mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-14679
This commit is contained in:
parent
b3829d0a55
commit
ab122f4604
@ -52,8 +52,8 @@ class auth_plugin_none extends auth_plugin_base {
|
||||
*
|
||||
* called when the user password is updated.
|
||||
*
|
||||
* @param object $user User table object (with system magic quotes)
|
||||
* @param string $newpassword Plaintext password (with system magic quotes)
|
||||
* @param object $user User table object
|
||||
* @param string $newpassword Plaintext password
|
||||
* @return boolean result
|
||||
*
|
||||
*/
|
||||
|
@ -52,7 +52,7 @@ if ($match[1] == '127' or $match[1] == '10' or ($match[1] == '172' and $match[2]
|
||||
}
|
||||
|
||||
if ($user) {
|
||||
if ($user = get_record('user', 'id', $user, 'deleted', 0)) {
|
||||
if ($user = $DB->get_record('user', array('id'=>$user, 'deleted'=>0))) {
|
||||
$info[] = fullname($user);
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
if (!$course = get_record('course', 'id', $id)) {
|
||||
if (!$course = $DB->get_record('course', array('id'=>$id))) {
|
||||
print_error('No such course!');
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
if (is_mnet_remote_user($USER)) {
|
||||
$message = get_string('usercannotchangepassword', 'mnet');
|
||||
if ($idprovider = get_record('mnet_host', 'id', $USER->mnethostid)) {
|
||||
if ($idprovider = $DB->get_record('mnet_host', array('id'=>$USER->mnethostid))) {
|
||||
$message .= get_string('userchangepasswordlink', 'mnet', $idprovider);
|
||||
}
|
||||
print_error($message);
|
||||
@ -62,9 +62,9 @@
|
||||
|
||||
if ($mform->is_cancelled()) {
|
||||
redirect($CFG->wwwroot.'/user/view.php?id='.$USER->id.'&course='.$course->id);
|
||||
} else if ($data = $mform->get_data()) {
|
||||
} else if ($data = $mform->get_data(false)) {
|
||||
|
||||
if (!$userauth->user_update_password(addslashes_recursive($USER), $data->newpassword1)) {
|
||||
if (!$userauth->user_update_password($USER, $data->newpassword1)) {
|
||||
print_error('errorpasswordupdate', 'auth');
|
||||
}
|
||||
|
||||
|
@ -15,8 +15,8 @@ $navigation = build_navigation(array(array('name' => 'MNET ID Provider', 'link'
|
||||
print_header('MNET ID Provider', 'MNET ID Provider', $navigation, 'form.email' );
|
||||
|
||||
if ($form = data_submitted() and confirm_sesskey()) {
|
||||
if ($user = get_record('user', 'username', $username, 'email', $form->email)) {
|
||||
if (!empty($user->mnethostid) and $host = get_record('mnet_host', 'id', $user->mnethostid)) {
|
||||
if ($user = $DB->get_record('user', array('username'=>$username, 'email'=>$form->email))) {
|
||||
if (!empty($user->mnethostid) and $host = $DB->get_record('mnet_host', array('id'=>$user->mnethostid))) {
|
||||
notice("You should be able to login at your <a href=\"{$host->wwwroot}/login/\">{$host->name}</a> provider.");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user