Possible fix for missing user_data array element
[mailer.git] / inc / libs / user_functions.php
index 709369f4adcd1804a89d3ac407deb61f78c1516e..ef8c29fa9672373c42f9825beeecfbc2be4abb1e 100644 (file)
@@ -290,9 +290,12 @@ function doUserLogin ($userid, $passwd, $successUrl = '', $errorUrl = 'modules.p
                fetchUserData($userid);
        }
 
-       // Get user data array and set userid (e.g. important if we login with nickname)
-       $content = getUserDataArray();
-       if (!empty($content['userid'])) $userid = bigintval($content['userid']);
+       // No error found?
+       if ($errorCode == '0') {
+               // Get user data array and set userid (e.g. important if we login with nickname)
+               $content = getUserDataArray();
+               if (!empty($content['userid'])) $userid = bigintval($content['userid']);
+       } // END - if
 
        // Is there an entry?
        if ((isUserDataValid()) && (getUserData('status') == 'CONFIRMED') && (!empty($content['userid']))) {