]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/what-login.php
Floater added, admin_header.tpl added, EL code improved:
[mailer.git] / inc / modules / guest / what-login.php
index b3e272c6c57a42851b016cc1ce1bcca3f5351138..15863bb1f96a6cef28bd294766a9fba2cfcc65a0 100644 (file)
@@ -15,8 +15,6 @@
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
@@ -41,7 +39,7 @@
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-}
+} // END - if
 
 // Add description as navigation point
 addMenuDescription('guest', __FILE__);
@@ -64,7 +62,7 @@ if ((isMemberIdSet()) && (isSessionVariableSet('u_hash'))) {
        $userid = getMemberId();
 } elseif ((isPostRequestParameterSet('id')) && (isPostRequestParameterSet('password')) && (isFormSent())) {
        // Set userid and crypt password when login data was submitted
-       if ((isExtensionActive('nickname')) && (isNicknameUsed(postRequestParameter('id')))) {
+       if (isExtensionActive('nickname')) {
                // Nickname entered
                $userid = SQL_ESCAPE(postRequestParameter('id'));
        } else {
@@ -74,7 +72,16 @@ if ((isMemberIdSet()) && (isSessionVariableSet('u_hash'))) {
 } elseif (isPostRequestParameterSet('new_pass')) {
        // New password requested
        $userid = '0';
-       if ((isPostRequestParameterSet('id')) && (postRequestParameter('id') > 0)) $userid = bigintval(postRequestParameter('id'));
+       if (isPostRequestParameterSet('id')) {
+               // Do we have nickname or userid?
+               if ((isExtensionActive('nickname')) && (isNicknameUsed(postRequestParameter('id')))) {
+                       // Nickname entered
+                       $userid = SQL_ESCAPE(postRequestParameter('id'));
+               } else {
+                       // Direct userid entered
+                       $userid  = bigintval(postRequestParameter('id'));
+               }
+       } // END - if
 } else {
        // Not logged in
        $userid = '0'; $hash = '';
@@ -105,25 +112,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="notice">' . getMessageFromErrorCode($errorCode) . '</span>
   </td>
-</tr>\n";
-       $content['message'] = $message;
+</tr>';
 } // END - if
 
 // Display login form with resend-password form