Commit 600102f3 authored by Robert Lyon's avatar Robert Lyon

Bug 1847001: Change check_email_exist() to check_email_exists()

To make it consistent

behatnotneeded

Change-Id: I3008c66eeb55128f7aaf6efe419b38915fc715f5
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent d3af6bc0
...@@ -274,7 +274,7 @@ function adduser_validate(Pieform $form, $values) { ...@@ -274,7 +274,7 @@ function adduser_validate(Pieform $form, $values) {
$form->set_error('email', get_string('invalidemailaddress', 'artefact.internal')); $form->set_error('email', get_string('invalidemailaddress', 'artefact.internal'));
} }
if (check_email_exist($email)) { if (check_email_exists($email)) {
$form->set_error('email', get_string('emailalreadytaken', 'auth.internal')); $form->set_error('email', get_string('emailalreadytaken', 'auth.internal'));
} }
} }
......
...@@ -266,7 +266,7 @@ function profileform_validate(Pieform $form, $values) { ...@@ -266,7 +266,7 @@ function profileform_validate(Pieform $form, $values) {
$form->set_error('email', get_string('invalidemailaddress', 'artefact.internal') . ': ' . hsc($email)); $form->set_error('email', get_string('invalidemailaddress', 'artefact.internal') . ': ' . hsc($email));
break; break;
} }
else if (check_email_exist($email)) { else if (check_email_exists($email)) {
$form->set_error('email', get_string('unvalidatedemailalreadytaken', 'artefact.internal')); $form->set_error('email', get_string('unvalidatedemailalreadytaken', 'artefact.internal'));
break; break;
} }
......
...@@ -3019,7 +3019,7 @@ function auth_register_validate(Pieform $form, $values) { ...@@ -3019,7 +3019,7 @@ function auth_register_validate(Pieform $form, $values) {
$form->set_error('email', get_string('invalidemailaddress', 'artefact.internal')); $form->set_error('email', get_string('invalidemailaddress', 'artefact.internal'));
} }
if (check_email_exist($values['email'])) { if (check_email_exists($values['email'])) {
$form->set_error('email', get_string('emailalreadytaken', 'auth.internal')); $form->set_error('email', get_string('emailalreadytaken', 'auth.internal'));
} }
} }
......
...@@ -916,7 +916,7 @@ function generate_email_processing_address($userid, $userto, $type='B') { ...@@ -916,7 +916,7 @@ function generate_email_processing_address($userid, $userto, $type='B') {
* Case insensitive checking for emails to existing db * Case insensitive checking for emails to existing db
* @return bool if the emails exists or not * @return bool if the emails exists or not
*/ */
function check_email_exist($email, $ownerid = 0) { function check_email_exists($email, $ownerid = 0) {
// get existing users 'usr','email' // get existing users 'usr','email'
$resultarray = get_column_sql("SELECT email FROM {usr} WHERE id != ?", array($ownerid)); $resultarray = get_column_sql("SELECT email FROM {usr} WHERE id != ?", array($ownerid));
$resultarray = array_merge($resultarray, get_column_sql("SELECT email FROM {artefact_internal_profile_email} WHERE owner != ?", array($ownerid))); $resultarray = array_merge($resultarray, get_column_sql("SELECT email FROM {artefact_internal_profile_email} WHERE owner != ?", array($ownerid)));
......
Markdown is supported
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