Skip to content

Commit 0f08f0c

Browse files
committed
disable email field
- Practice of accepting user input for email accounts has accumulated a large number of non-ncsu emails that cannot be reliably verified - Email normalization to unity@ncsu emails, with field set to read-only / pre-populated to deal with undesired data in other applications - Fixes #51
1 parent 1520e2a commit 0f08f0c

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

application/modules/ot/controllers/AccountController.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,12 @@ public function editAction()
381381
$me = (Zend_Auth::getInstance()->getIdentity()->accountId == $this->_userData['accountId']);
382382

383383
$formData = $this->_userData;
384-
384+
385+
// override email, populate with unity
386+
if (isset($formData['username'])) {
387+
// @TODO: Move string portion to config
388+
$formData['emailAddress'] = $formData['username'] . "@ncsu.edu";
389+
}
385390

386391
if (isset($formData['accountAttributes'])) {
387392
foreach ($formData['accountAttributes'] as $key => $a) {

application/modules/ot/forms/Account.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ public function __construct($new = false, $me = false, $options = array())
5050

5151
// Email address field
5252
$email = $this->createElement('text', 'emailAddress', array('label' => 'model-account-emailAddress'));
53-
$email->setRequired(true)
54-
->addFilter('StringTrim')
55-
->addValidator('EmailAddress');
53+
$email->addFilter('StringTrim')
54+
->setAttrib('readonly', 'readonly');
5655

5756
$timezone = $this->createElement('select', 'timezone', array('label' => 'model-account-timezone'));
5857
$timezone->addMultiOptions(Ot_Model_Timezone::getTimezoneList());
@@ -101,14 +100,14 @@ public function __construct($new = false, $me = false, $options = array())
101100
if (is_null($thisHost)) {
102101
throw new Ot_Exception_Data('msg-error-objectNotSetup');
103102
}
104-
103+
105104
$customAttributes = $thisHost->getAttributes();
106-
105+
107106
foreach ($customAttributes as $a) {
108107
$elm = $a['var']->renderFormElement();
109108
$elm->clearDecorators();
110109
$elm->setBelongsTo('customAttributes');
111-
110+
112111
$this->addElement($elm);
113112
}
114113

0 commit comments

Comments
 (0)