Index: user/externallib.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- user/externallib.php (revision afbb53d70b6f53d529c568e87305bfb187601239) +++ user/externallib.php (revision ) @@ -189,7 +189,7 @@ // Make sure we validate current user info as handled by current GUI. See user/editadvanced_form.php func validation(). if (!validate_email($user['email'])) { throw new invalid_parameter_exception('Email address is invalid: '.$user['email']); - } else if ($DB->record_exists('user', array('email' => $user['email'], 'mnethostid' => $user['mnethostid']))) { + } else if (empty($CFG->allowaccountssameemail) && $DB->record_exists('user', array('email' => $user['email'], 'mnethostid' => $user['mnethostid']))) { throw new invalid_parameter_exception('Email address already exists: '.$user['email']); } // End of user info validation.