Commit 924db0bf authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Don't display email addresses with errors as if they have been added (bug 3050)

parent 0dee6792
......@@ -203,9 +203,11 @@ function profileform_validate(Pieform $form, $values) {
foreach ($values['email']['unsent'] as $email) {
if (!PHPMailer::ValidateAddress($email)) {
$form->set_error('email', get_string('invalidemailaddress', 'artefact.internal') . ': ' . hsc($email));
break;
}
else if (record_exists('artefact_internal_profile_email', 'email', $email)) {
$form->set_error('email', get_string('unvalidatedemailalreadytaken', 'artefact.internal'));
break;
}
}
}
......
......@@ -93,12 +93,5 @@
<span>{{str tag=validationemailsent section=artefact.internal}}</span>
</div>
{{/foreach}}
{{foreach from=$unsent item=email}}
<div class="unsent">
<input type="hidden" name="{{$name}}_unsent[]" value="{{$email|escape}}">
{{$email|escape}}
<a href="" onclick="{{$name}}_remove(this); return false;">[x]</a>
</div>
{{/foreach}}
</div>
<a href="" onclick="{{$name}}_new(); return false;">{{str tag="addemail"}}</a>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment