More complete rewrite to use wrapper function isExtensionInstalledAndNewer(), some...
[mailer.git] / inc / libs / user_functions.php
index 61ae0ea3cc8ddeb615cfd35589eba711c7a2ac83..af1e552320412fe79659b800254069069e156db7 100644 (file)
@@ -228,7 +228,7 @@ function determineRandomReferalId () {
        $refid = '0';
 
        // Is the extension version fine?
-       if (getExtensionVersion('user') >= '0.3.4') {
+       if (isExtensionInstalledAndNewer('user', '0.3.4')) {
                // Get all user ids
                $totalUsers = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true, " AND `rand_confirmed` >= ".getConfig('user_min_confirmed')."");
 
@@ -331,7 +331,7 @@ function doUserLogin ($userid, $passwd, $successUrl = '', $errorUrl = 'modules.p
                                $GLOBALS['bonus_payed'] = true;
 
                                // Subtract login bonus from userid's account or jackpot
-                               if ((getExtensionVersion('bonus') >= '0.3.5') && (getConfig('bonus_mode') != 'ADD')) handleBonusPoints('login_bonus');
+                               if ((isExtensionInstalledAndNewer('bonus', '0.3.5')) && (getConfig('bonus_mode') != 'ADD')) handleBonusPoints('login_bonus');
                        } // END - if
 
                        // @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
@@ -368,7 +368,7 @@ function doUserLogin ($userid, $passwd, $successUrl = '', $errorUrl = 'modules.p
                                // Cookies not setable!
                                $errorCode = getCode('COOKIES_DISABLED');
                        }
-               } elseif (getExtensionVersion('sql_patches') >= '0.6.1') {
+               } elseif (isExtensionInstalledAndNewer('sql_patches', '0.6.1')) {
                        // Update failture counter
                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `login_failures`=`login_failures`+1,`last_failure`=NOW() WHERE `userid`=%s LIMIT 1",
                                array($userid), __FUNCTION__, __LINE__);