Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b771b31
)
MDL-48691 webservices: Check if the user must be changing password
author
Juan Leyva
<juanleyvadelgado@gmail.com>
Thu, 29 Jan 2015 15:56:20 +0000
(16:56 +0100)
committer
Dan Poltawski
<dan@moodle.com>
Mon, 2 Mar 2015 14:39:52 +0000
(14:39 +0000)
login/token.php
patch
|
blob
|
blame
|
history
diff --git
a/login/token.php
b/login/token.php
index
19a9eae
..
ee4d6ca
100644
(file)
--- a/
login/token.php
+++ b/
login/token.php
@@
-64,6
+64,15
@@
if (!empty($user)) {
}
}
+ // Check whether the user should be changing password.
+ if (get_user_preferences('auth_forcepasswordchange', false, $user)) {
+ if ($userauth->can_change_password()) {
+ throw new moodle_exception('forcepasswordchangenotice');
+ } else {
+ throw new moodle_exception('nopasswordchangeforced', 'auth');
+ }
+ }
+
// let enrol plugins deal with new enrolments if necessary
enrol_check_plugins($user);