]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/what-login.php
More rewrites/templates swapped out:
[mailer.git] / inc / modules / guest / what-login.php
index 62cca5a2383fdcd99fbab3ccefe91e742cddc05e..e888b2cbbb076e89571c46c7ea2043a801b36b43 100644 (file)
@@ -55,7 +55,7 @@ if ((!isExtensionActive('user')) && (!isAdmin())) {
 $errorCode = '0';
 $userid = false;
 $hash = '';
-$URL = '';
+$url = '';
 $add = '';
 
 // Already logged in?
@@ -82,13 +82,13 @@ if ((isMemberIdSet()) && (isSessionVariableSet('u_hash'))) {
 
 if (isMember()) {
        // Login immidiately...
-       $URL = 'modules.php?module=login';
+       $url = 'modules.php?module=login';
 } elseif ((isFormSent()) && ('' . $userid . '' != '' . postRequestParameter('id') . '')) {
        // Invalid input (no nickname extension installed but nickname entered)
        $errorCode = getCode('EXTENSION_PROBLEM');
 } elseif (isFormSent()) {
        // Try the login (see inc/libs/user_functions.php)
-       $URL = doUserLogin(postRequestParameter('id'), postRequestParameter('password'));
+       $url = doUserLogin(postRequestParameter('id'), postRequestParameter('password'));
 } elseif ((isPostRequestParameterSet('new_pass')) && (isset($userid))) {
        // Try the userid/email lookup (see inc/libs/user_functions.php)
        $errorCode = doNewUserPassword(postRequestParameter('email'), $userid);
@@ -105,25 +105,18 @@ $content['message'] = '';
 
 // Login problems?
 if (!empty($errorCode)) {
-       // @TODO Move this HTML code into a template
-       $message = "<tr>
-  <td colspan=\"4\" align=\"center\">
-    <span class=\"guest_failed\">";
-
        // Do we have a userid set?
        if (isSessionVariableSet('current_userid')) {
                // Then prefetch data for this account
                fetchUserData(getSession('current_userid'));
        } // END - if
 
-       // Convert the code to message
-       $message .= getMessageFromErrorCode($errorCode);
-
-       // Continue with HTML
-       $message .= "</span>
+       // @TODO Move this HTML code into a template
+       $content['message'] = '<tr>
+  <td colspan="4" align="center">
+    <span class="guest_failed">' . getMessageFromErrorCode($errorCode) . '</span>
   </td>
-</tr>\n";
-       $content['message'] = $message;
+</tr>';
 } // END - if
 
 // Display login form with resend-password form
@@ -134,14 +127,14 @@ if (isExtensionActive('nickname')) {
 }
 
 // Was an URL constructed?
-if (!empty($URL)) {
+if (!empty($url)) {
        // URL was constructed
-       if (getTotalFatalErrors() > 0) {
+       if (ifFatalErrorsDetected()) {
                // Handle fatal errors
                runFilterChain('handle_fatal_errors');
        } else {
                // Load URL
-               redirectToUrl($URL);
+               redirectToUrl($url);
        }
 } // END - if