Checks if the types of the passed arguments in a function/method call are compatible.
1 | <?php |
||
2 | /** |
||
3 | * Action to reset a password, send success email, and log the user in. |
||
4 | */ |
||
5 | |||
6 | $password = get_input('password1'); |
||
7 | $password_repeat = get_input('password2'); |
||
8 | $user_guid = (int) get_input('u'); |
||
9 | $code = get_input('c'); |
||
10 | |||
11 | try { |
||
12 | validate_password($password); |
||
13 | } catch (RegistrationException $e) { |
||
14 | return elgg_error_response($e->getMessage()); |
||
15 | } |
||
16 | |||
17 | if ($password != $password_repeat) { |
||
18 | return elgg_error_response(elgg_echo('RegistrationException:PasswordMismatch')); |
||
19 | } |
||
20 | |||
21 | if (!execute_new_password_request($user_guid, $code, $password)) { |
||
22 | return elgg_error_response(elgg_echo('user:password:fail')); |
||
23 | } |
||
24 | |||
25 | try { |
||
26 | login(get_user($user_guid)); |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
27 | } catch (LoginException $e) { |
||
28 | return elgg_error_response($e->getMessage()); |
||
29 | } |
||
30 | |||
31 | return elgg_ok_response('', elgg_echo('user:password:success')); |
||
32 |