]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/user_functions.php
Login form for guests in surfbar added, some trigger_error() added, misc rewrites
[mailer.git] / inc / libs / user_functions.php
index 45198007823541cd841a0add808b69f6fd34733a..cfb52655e3b86af0cf88deed1d4f0d97c194aa3d 100644 (file)
@@ -258,14 +258,14 @@ function determineRandomReferalId () {
 }
 
 // Do the user login
-function USER_DO_LOGIN ($uid, $passwd) {
+function USER_DO_LOGIN ($uid, $passwd, $successUrl = '') {
        // Init variables
-       $dmy = '';
+       $dmy = ''; $add = '';
 
        // Add last_login if available
        $lastOnline = '';
        if (GET_EXT_VERSION('sql_patches') >= '0.2.8') {
-               $lastOnline = ', last_login';
+               $lastOnline = ', `last_login`';
        } // END - if
 
        // Init array
@@ -346,13 +346,19 @@ function USER_DO_LOGIN ($uid, $passwd) {
                                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `total_logins`=`total_logins`+1" . $add . " WHERE `userid`=%s LIMIT 1",
                                                array($uid), __FUNCTION__, __LINE__);
                                        if (SQL_AFFECTEDROWS() == 1) {
-                                               // Procedure to checking for login data
-                                               if (($GLOBALS['bonus_payed']) && (EXT_IS_ACTIVE('bonus'))) {
-                                                       // Bonus added (just displaying!)
-                                                       $URL = 'modules.php?module=chk_login&mode=bonus';
+                                               // Is a success URL set?
+                                               if (empty($successUrl)) {
+                                                       // Procedure to checking for login data
+                                                       if (($GLOBALS['bonus_payed']) && (EXT_IS_ACTIVE('bonus'))) {
+                                                               // Bonus added (just displaying!)
+                                                               $URL = 'modules.php?module=chk_login&mode=bonus';
+                                                       } else {
+                                                               // Bonus not added
+                                                               $URL = 'modules.php?module=chk_login&mode=login';
+                                                       }
                                                } else {
-                                                       // Bonus not added
-                                                       $URL = 'modules.php?module=chk_login&mode=login';
+                                                       // Use this URL
+                                                       $URL = $successUrl;
                                                }
                                        } else {
                                                // Cannot update counter!