]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/user_functions.php
A lot CSS classes rewritten, please update all your themes.
[mailer.git] / inc / libs / user_functions.php
index b568c879ad36a0402d5a9e358d2b9fe9a6eab951..4a24b2d73bbd37c49e4334163e4f45e2362b7f29 100644 (file)
@@ -200,7 +200,7 @@ function addPageNavigation ($numPages, $offset, $showForm, $colspan, $return=fal
 }
 
 // Create email link to user's account
-function generateUserEmailLink($email, $mod = 'admin') {
+function generateUserEmailLink ($email, $mod = 'admin') {
        // Show contact link only if user is confirmed by default
        $locked = " AND `status`='CONFIRMED'";
 
@@ -467,7 +467,7 @@ function doNewUserPassword ($email, $userid) {
                }
        } else {
                // id or email is wrong
-               loadTemplate('admin_settings_saved', false, '<span class="guest_failed">{--GUEST_WRONG_ID_EMAIL--}</span>');
+               loadTemplate('admin_settings_saved', false, '<span class="notice">{--GUEST_WRONG_ID_EMAIL--}</span>');
        }
 
        // Return the error code
@@ -649,6 +649,40 @@ LIMIT 1",
        loadTemplate('admin_settings_saved', false, $content['message']);
 }
 
+// Does resend the user's confirmation link for given email address
+function doResendUserConfirmationLink ($email) {
+       // Confirmation link requested
+       if (fetchUserData($email, 'email')) {
+               // Email address found
+               $content = getUserDataArray();
+
+               // Detect status
+               switch ($content['status']) {
+                       case 'UNCONFIRMED': // Account not confirmed
+                               // Load email template
+                               $message = loadEmailTemplate('guest_request_confirm', array('hash' => $content['user_hash']), $content['userid']);
+
+                               // Send email
+                               sendEmail($email, '{--REQUEST_CONFIRM_LINK_SUBJECT--}', $message);
+
+                               // And set message
+                               $content['message'] = '{--CONFIRM_LINK_SENT--}';
+                               break;
+
+                       case 'CONFIRMED': // Account already confirmed
+                               $content['message'] = '{--LOGIN_ID_CONFIRMED--}';
+                               break;
+
+                       case 'LOCKED': // Account is locked
+                               $content['message'] = '{--LOGIN_ID_LOCKED--}';
+                               break;
+               } // END - switch
+       } else {
+               // Email address not registered
+               $content['message'] = '{--EMAIL_404--}';
+       }
+}
+
 // Expression call-back function for fetching user data
 function doExpressionUser ($data) {
        // Use current userid by default