ext was missing, fixed error message
[mailer.git] / inc / libs / user_functions.php
index e967ca4cf21580c678c1255b0ce80d6e33875a53..6fc8006e05938e2d0e3498c5d5aefdfccf38a9b5 100644 (file)
@@ -264,6 +264,7 @@ function doUserLogin ($userid, $passwd, $successUrl = '', $errorUrl = 'modules.p
        $dmy = '';
        $add = '';
        $errorCode = '0';
        $dmy = '';
        $add = '';
        $errorCode = '0';
+       $ext = '';
 
        // Add last_login if available
        $lastOnline = '';
 
        // Add last_login if available
        $lastOnline = '';
@@ -287,6 +288,7 @@ function doUserLogin ($userid, $passwd, $successUrl = '', $errorUrl = 'modules.p
        } elseif (isNicknameUsed($userid)) {
                // No nickname installed
                $errorCode = getCode('EXTENSION_PROBLEM');
        } elseif (isNicknameUsed($userid)) {
                // No nickname installed
                $errorCode = getCode('EXTENSION_PROBLEM');
+               $ext = 'nickname';
        } else {
                // Direct userid entered
                fetchUserData($userid);
        } else {
                // Direct userid entered
                fetchUserData($userid);
@@ -384,7 +386,7 @@ function doUserLogin ($userid, $passwd, $successUrl = '', $errorUrl = 'modules.p
                        // id not found!
                        $errorCode = getCode('WRONG_ID');
                }
                        // id not found!
                        $errorCode = getCode('WRONG_ID');
                }
-       } else {
+       } elseif ($errorCode == '0') {
                // id not found!
                $errorCode = getCode('WRONG_ID');
        }
                // id not found!
                $errorCode = getCode('WRONG_ID');
        }
@@ -393,6 +395,9 @@ function doUserLogin ($userid, $passwd, $successUrl = '', $errorUrl = 'modules.p
        if ($errorCode > 0) {
                // Then reconstruct the URL
                $URL = $errorUrl . $errorCode;
        if ($errorCode > 0) {
                // Then reconstruct the URL
                $URL = $errorUrl . $errorCode;
+
+               // Extension set? Then add it as well.
+               if (!empty($ext)) $URL .= '&ext=' . $ext;
        } // END - if
 
        // Return URL
        } // END - if
 
        // Return URL