summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Phillips2008-04-21 19:45:11 (GMT)
committer Chad Phillips2008-04-21 19:45:11 (GMT)
commit2b2366b1fc6b0a5cd4c3930108eb3e0aa3d1e076 (patch)
tree6914b22784304f9617b482da85f2f1945bc8f2f3
parent54c4343b88a426464f689918f031aed27f8ba681 (diff)
#238660 by hunmonk: Allow user admins to re-send validation e-mail. thanks to manoloka for sponsoring the work on this patch.
-rwxr-xr-xlogintoboggan.module17
1 files changed, 12 insertions, 5 deletions
diff --git a/logintoboggan.module b/logintoboggan.module
index 99f96a4..3f33892 100755
--- a/logintoboggan.module
+++ b/logintoboggan.module
@@ -472,7 +472,7 @@ function logintoboggan_menu($may_cache) {
'title' => t('Re-send validation e-mail'),
'callback' => 'logintoboggan_resend_validation',
'callback arguments' => array(arg(2)),
- 'access' => $user->uid == arg(2),
+ 'access' => $user->uid == arg(2) || user_access('administer users'),
'type' => MENU_CALLBACK,
);
}
@@ -888,8 +888,9 @@ function logintoboggan_eml_rehash($password, $timestamp, $mail){
*/
function logintoboggan_user($op, &$edit, &$user_edit, $category = NULL) {
global $user;
- if ($op == 'form' && $category == 'account' && $user->uid == arg(1)) {
- // User is editing their own account settings
+ if ($op == 'form' && $category == 'account' && ($user->uid == $user_edit->uid || user_access('administer users'))) {
+ // User is editing their own account settings, or user admin
+ // is editing their account.
if (!variable_get('user_email_verification', TRUE) && array_key_exists(logintoboggan_validating_id(), $user_edit->roles) && variable_get('user_register', 1) == 1) {
// User is still in pre-authorized role; display link to re-send e-mail.
$form['revalidate'] = array(
@@ -944,8 +945,14 @@ function logintoboggan_resend_validation($uid) {
$body = _user_mail_text('welcome_body', $variables);
drupal_mail('logintoboggan-resend-validation', $account->mail, $subject, $body, $from);
- // Notify user that e-mail was sent and return to user edit form.
- drupal_set_message(t('A validation e-mail has been sent to your e-mail address. You will need to follow the instructions in that message in order to gain full access to the site.'));
+ // Notify admin or user that e-mail was sent and return to user edit form.
+ if (user_access('administer users')) {
+ drupal_set_message(t("A validation e-mail has been sent to the user's e-mail address."));
+ }
+ else {
+ drupal_set_message(t('A validation e-mail has been sent to your e-mail address. You will need to follow the instructions in that message in order to gain full access to the site.'));
+ }
+
drupal_goto('user/'. $account->uid .'/edit');
}