Skip to content
Snippets Groups Projects
Commit f4a75f4e authored by Jared Hancock's avatar Jared Hancock
Browse files

Email cannot be changed on client registration

Otherwise, it might be possible for a forwarded email to accidentally
contain a ticket link, with which a sinister individual might be able to use
to register for account on behalf of the original client, and, at the same
time, be able to change the user's email address to his/her own.
parent 8e1910e6
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@ elseif ($thisclient) {
foreach ($thisclient->getForms() as $f)
if ($f->get('type') == 'U')
$user_form = $f;
$user_form->getField('email')->configure('disabled', true);
}
// Existing client (with an account) updating profile
else {
......
......@@ -73,9 +73,9 @@ class DynamicForm extends VerySimpleModel {
}
function getField($name) {
foreach ($this->getDynamicFields() as $f)
foreach ($this->getFields() as $f)
if (!strcasecmp($f->get('name'), $name))
return $f->getImpl();
return $f;
}
function hasField($name) {
......
......@@ -478,6 +478,11 @@ class FormField {
return $this->_cform;
}
function configure($prop, $value) {
$this->getConfiguration();
$this->_config[$prop] = $value;
}
function getWidget() {
if (!static::$widget)
throw new Exception('Widget not defined for this field');
......@@ -960,12 +965,14 @@ class TextboxWidget extends Widget {
$classes = 'class="'.$config['classes'].'"';
if (isset($config['autocomplete']))
$autocomplete = 'autocomplete="'.($config['autocomplete']?'on':'off').'"';
if (isset($config['disabled']))
$disabled = 'disabled="disabled"';
?>
<span style="display:inline-block">
<input type="<?php echo static::$input_type; ?>"
id="<?php echo $this->name; ?>"
<?php echo $size . " " . $maxlength; ?>
<?php echo $classes.' '.$autocomplete
<?php echo implode(' ', array_filter(array(
$size, $maxlength, $classes, $autocomplete, $disabled)))
.' placeholder="'.$config['placeholder'].'"'; ?>
name="<?php echo $this->name; ?>"
value="<?php echo Format::htmlchars($this->value); ?>"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment