]> git.mxchange.org Git - mailer.git/commitdiff
Moved resending of user confirmation link to ext-user
authorRoland Häder <roland@mxchange.org>
Sun, 22 Aug 2010 13:54:30 +0000 (13:54 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 22 Aug 2010 13:54:30 +0000 (13:54 +0000)
DOCS/TODOs.txt
inc/libs/user_functions.php
inc/modules/guest/what-confirm.php

index e460fa7985026a3a73bf7cae6135a0ad54e76cdd..21a0837eb8eaa661e862955221888e5182537ea5 100644 (file)
@@ -86,7 +86,7 @@
 ./inc/libs/user_functions.php:327:                     // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
 ./inc/libs/user_functions.php:347:                     // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
 ./inc/libs/user_functions.php:423:     // @TODO We should try to rewrite this to fetchUserData() somehow
-./inc/libs/user_functions.php:609:                                     // @TODO Try to rewrite the following unset()
+./inc/libs/user_functions.php:611:                                     // @TODO Try to rewrite the following unset()
 ./inc/libs/yoomedia_functions.php:116: $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script
 ./inc/load_config.php:77:      // @TODO Rewrite them to avoid this else block
 ./inc/loader/load_cache-extension.php:13: * @TODO Rewrite this whole file to load_cache-extensions.php           *
index b568c879ad36a0402d5a9e358d2b9fe9a6eab951..62daf7d8b29527d1d3650b31bc68bda80bf72158 100644 (file)
@@ -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
index a3f4e8617530828194aea5ab89aafab4253d2806..1280dd3088e0ddadef339aeccb5a27a214fa38e3 100644 (file)
@@ -54,39 +54,8 @@ if (isGetRequestParameterSet('hash')) {
        // Do user account confirmation
        doConfirmUserAccount(getRequestParameter('hash'));
 } elseif ((isFormSent()) && (isPostRequestParameterSet('email'))) {
-       // Confirmation link requested      0         1          2
-       if (fetchUserData(postRequestParameter('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(postRequestParameter('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--}';
-       }
-
-       // Load template
-       loadTemplate('admin_settings_saved', false, $content['message']);
+       // Resend confirmation link
+       doResendUserConfirmationLink(postRequestParameter('email'));
 } else {
        // No hash found, the guest may want to enter his email address to re-get his confirmation link?
        loadTemplate('guest_confirm_link');