More rewrites from double- to single-quote
[mailer.git] / inc / libs / user_functions.php
index 0f4afe124c34f7038c065b1f8d4c0a4c64b69d91..32be05f4b6aed24ae2c5d0a3234322fae09e436e 100644 (file)
@@ -211,7 +211,7 @@ WHERE `email`='%s'".$locked." LIMIT 1",
                list($uid) = SQL_FETCHROW($result);
 
                // Rewrite email address to contact link
-               $email = "{!URL!}/modules.php?module=".$mod."&what=user_contct&uid=".bigintval($uid);
+               $email = '{!URL!}/modules.php?module=' . $mod . '&what=user_contct&uid=' . bigintval($uid);
        } // END - if
 
        // Free memory
@@ -227,7 +227,7 @@ function SELECT_RANDOM_REFID () {
        $refid = 0;
 
        // Is the extension version fine?
-       if (GET_EXT_VERSION('user') >= "0.3.4") {
+       if (GET_EXT_VERSION('user') >= '0.3.4') {
                // Get all user ids
                $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", 'userid', "status", true, " AND `rand_confirmed` >= ".getConfig('user_min_confirmed')."");
 
@@ -267,16 +267,16 @@ function USER_DO_LOGIN ($uid, $passwd) {
        // 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
        $content = array(
-               'password'    => "",
-               'userid'      => "",
+               'password'    => '',
+               'userid'      => '',
                'last_online' => 0,
                'last_login'  => 0,
-               'hash'        => ""
+               'hash'        => ''
        );
 
        // Check login data
@@ -351,18 +351,18 @@ function USER_DO_LOGIN ($uid, $passwd) {
                                        // 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";
+                                               $URL = 'modules.php?module=chk_login&mode=bonus';
                                        } else {
                                                // Bonus not added
-                                               $URL = "modules.php?module=chk_login&mode=login";
+                                               $URL = 'modules.php?module=chk_login&mode=login';
                                        }
                                } else {
                                        // Cannot update counter!
-                                       $URL = "modules.php?module=index&what=login&login=".getCode('CNTR_FAILED');
+                                       $URL = 'modules.php?module=index&what=login&login='.getCode('CNTR_FAILED');
                                }
                        } else {
                                // Cookies not setable!
-                               $URL = "modules.php?module=index&what=login&login=".getCode('NO_COOKIES');
+                               $URL = 'modules.php?module=index&what=login&login='.getCode('NO_COOKIES');
                        }
                } elseif (GET_EXT_VERSION('sql_patches') >= '0.6.1') {
                        // Update failture counter
@@ -370,7 +370,7 @@ function USER_DO_LOGIN ($uid, $passwd) {
                                array($uid), __FUNCTION__, __LINE__);
 
                        // Wrong password!
-                       $URL = "modules.php?module=index&what=login&login=".getCode('WRONG_PASS');
+                       $URL = 'modules.php?module=index&what=login&login='.getCode('WRONG_PASS');
                }
        } elseif ((($probe_nickname) && (!empty($content['userid']))) || ($content['userid'] == $uid)) {
                // Other account status?
@@ -391,10 +391,10 @@ function USER_DO_LOGIN ($uid, $passwd) {
                }
 
                // Construct URL
-               $URL = "modules.php?module=index&what=login&login=".$errorCode;
+               $URL = 'modules.php?module=index&what=login&login='.$errorCode;
        } else {
                // ID not found!
-               $URL = "modules.php?module=index&what=login&login=".getCode('WRONG_ID');
+               $URL = 'modules.php?module=index&what=login&login='.getCode('WRONG_ID');
        }
 
        // Return URL
@@ -404,7 +404,7 @@ function USER_DO_LOGIN ($uid, $passwd) {
 // Try to send a new password for the given user account
 function USER_DO_NEW_PASSWORD ($email, $uid) {
        // Compile email when found in address (only secure chars!)
-       if (!empty($email)) $email = str_replace("{DOT}", '.', $email);
+       if (!empty($email)) $email = str_replace('{DOT}', '.', $email);
 
        // Init result and error
        $errorCode = '';
@@ -425,7 +425,7 @@ function USER_DO_NEW_PASSWORD ($email, $uid) {
                        array($email), __FUNCTION__, __LINE__);
        } else {
                // Userid not set!
-               DEBUG_LOG(__FUNCTION__, __LINE__, "Userid is not set! BUG!");
+               DEBUG_LOG(__FUNCTION__, __LINE__, 'Userid is not set! BUG!');
                $errorCode = getCode('WRONG_ID');
        }
 
@@ -434,14 +434,14 @@ function USER_DO_NEW_PASSWORD ($email, $uid) {
                // This data is valid, so we create a new pass... :-)
                list($uid, $status) = SQL_FETCHROW($result);
 
-               if ($status == "CONFIRMED") {
+               if ($status == 'CONFIRMED') {
                        // Ooppps, this was missing! ;-) We should update the database...
                        $NEW_PASS = GEN_PASS();
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET password='%s' WHERE userid=%s LIMIT 1",
                                array(generateHash($NEW_PASS), $uid), __FUNCTION__, __LINE__);
 
                        // Prepare data and message for email
-                       $msg = LOAD_EMAIL_TEMPLATE("new-pass", array('new_pass' => $NEW_PASS), $uid);
+                       $msg = LOAD_EMAIL_TEMPLATE('new-pass', array('new_pass' => $NEW_PASS), $uid);
 
                        // ... and send it away
                        SEND_EMAIL($uid, getMessage('GUEST_NEW_PASSWORD'), $msg);
@@ -453,11 +453,11 @@ function USER_DO_NEW_PASSWORD ($email, $uid) {
                        $errorCode = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status);
 
                        // Load URL
-                       LOAD_URL("modules.php?module=index&what=login&login=".$errorCode);
+                       LOAD_URL('modules.php?module=index&what=login&login='.$errorCode);
                }
        } else {
                // ID or email is wrong
-               LOAD_TEMPLATE('admin_settings_saved', false, "<span class=\"guest_failed\">{--GUEST_WRONG_ID_EMAIL--}</span>");
+               LOAD_TEMPLATE('admin_settings_saved', false, '<span class="guest_failed">{--GUEST_WRONG_ID_EMAIL--}</span>');
        }
 
        // Return the error code