*
* 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
*
*/
}
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);
}
}
$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!');
}
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);
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');
}
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.");
}
}