Default refid is always fallback now, or 0 if sql_patches is absend
[mailer.git] / inc / functions.php
index b5d3d1ea39a1d0ffbd13efd3776a65df58fdfeb4..5f9e1229ade302b33056d1ada5faeb8d7d17c4b0 100644 (file)
@@ -3228,12 +3228,12 @@ function DETERMINE_REFID () {
        } elseif ((isSessionVariableSet('refid')) && (getSession('refid') != 0)) {
                // Set session refid als global
                $GLOBALS['refid'] = bigintval(getSession('refid'));
-       } elseif ((GET_EXT_VERSION('sql_patches') != '') && (getConfig('def_refid') > 0)) {
-               // Set default refid as refid in URL
-               $GLOBALS['refid'] = getConfig('def_refid');
        } elseif ((GET_EXT_VERSION('user') >= '0.3.4') && (getConfig('select_user_zero_refid')) == 'Y') {
                // Select a random user which has confirmed enougth mails
                $GLOBALS['refid'] = determineRandomReferalId();
+       } elseif ((GET_EXT_VERSION('sql_patches') != '') && (getConfig('def_refid') > 0)) {
+               // Set default refid as refid in URL
+               $GLOBALS['refid'] = getConfig('def_refid');
        } else {
                // No default ID when sql_patches is not installed or none set
                $GLOBALS['refid'] = 0;