Elgg /
Elgg
Checks if the types of the passed arguments in a function/method call are compatible.
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Resends validation emails to a user or users by guid |
||
| 4 | */ |
||
| 5 | |||
| 6 | $user_guids = get_input('user_guids'); |
||
| 7 | $error = false; |
||
| 8 | |||
| 9 | if (!$user_guids) { |
||
| 10 | return elgg_error_response(elgg_echo('uservalidationbyemail:errors:unknown_users')); |
||
| 11 | } |
||
| 12 | |||
| 13 | $access = access_show_hidden_entities(true); |
||
| 14 | |||
| 15 | foreach ($user_guids as $guid) { |
||
| 16 | $user = get_entity($guid); |
||
| 17 | if (!$user instanceof ElggUser) { |
||
| 18 | $error = true; |
||
| 19 | continue; |
||
| 20 | } |
||
| 21 | |||
| 22 | // don't resend emails to validated users |
||
| 23 | if ($user->isValidated() !== false || !uservalidationbyemail_request_validation($guid)) { |
||
| 24 | $error = true; |
||
| 25 | continue; |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | access_show_hidden_entities($access); |
||
| 30 | |||
| 31 | if (count($user_guids) == 1) { |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 32 | $message_txt = elgg_echo('uservalidationbyemail:messages:resent_validation'); |
||
| 33 | $error_txt = elgg_echo('uservalidationbyemail:errors:could_not_resend_validation'); |
||
| 34 | } else { |
||
| 35 | $message_txt = elgg_echo('uservalidationbyemail:messages:resent_validations'); |
||
| 36 | $error_txt = elgg_echo('uservalidationbyemail:errors:could_not_resend_validations'); |
||
| 37 | } |
||
| 38 | |||
| 39 | if ($error) { |
||
| 40 | return elgg_error_response($error_txt); |
||
| 41 | } |
||
| 42 | |||
| 43 | return elgg_ok_response('', $message_txt); |
||
| 44 |