From ab122f4604ebad0e1980809ff4d0df1be4b01b90 Mon Sep 17 00:00:00 2001 From: skodak Date: Sat, 31 May 2008 17:48:51 +0000 Subject: [PATCH] MDL-14679 --- auth/none/auth.php | 4 ++-- iplookup/index.php | 2 +- login/change_password.php | 8 ++++---- login/mnet_email.php | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/auth/none/auth.php b/auth/none/auth.php index 8914bba3d8..740d4dd1f5 100644 --- a/auth/none/auth.php +++ b/auth/none/auth.php @@ -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 * */ diff --git a/iplookup/index.php b/iplookup/index.php index 6fd6d86c64..78f3ec0167 100644 --- a/iplookup/index.php +++ b/iplookup/index.php @@ -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); } } diff --git a/login/change_password.php b/login/change_password.php index 81ca8dc9be..cc9a35b856 100644 --- a/login/change_password.php +++ b/login/change_password.php @@ -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'); } diff --git a/login/mnet_email.php b/login/mnet_email.php index 3181b4e1f4..53c71657f2 100644 --- a/login/mnet_email.php +++ b/login/mnet_email.php @@ -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 wwwroot}/login/\">{$host->name} provider."); } } -- 2.39.5