// Check all together
if ((isUserDataValid()) && (getUserData('password') == generateHash(postRequestParameter('pass'), substr(getUserData('password'), 0, -40))) && (getUserData('status') == 'CONFIRMED') && ($probe_points)) {
// Nickname resolved to a unique userid or direct userid entered by the member
- $GLOBALS['doubler_userid'] = getUserData('userid');
+ $GLOBALS['local_doubler_userid'] = getUserData('userid');
// Calulcate points
$points = getTotalPoints(getUserData('userid'));
// Handle failed logins here if not in guest
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "type=".$data['type'].",action=".getAction().",what=".getWhat().",level=".$data['access_level']."<br />");
- if ((($data['type'] == 'what') || ($data['type'] == 'action') && ((!isWhatSet()) || (getWhat() == 'overview') || (getWhat() == getConfig('index_home')))) && ($data['access_level'] != 'guest') && ((isExtensionInstalledAndNewer('sql_patches', '0.4.7')) || (isExtensionInstalledAndNewer('admins', '0.7.0')))) {
+ if ((($data['type'] == 'what') || ($data['type'] == 'action') && ((!isWhatSet()) || (getWhat() == 'overview') || (getWhat() == getIndexHome()))) && ($data['access_level'] != 'guest') && ((isExtensionInstalledAndNewer('sql_patches', '0.4.7')) || (isExtensionInstalledAndNewer('admins', '0.7.0')))) {
// Handle failure
$content['content'] .= handleLoginFailures($data['access_level']);
} // END - if
if (!isWhatSet()) {
// Fix it to default
setWhat('welcome');
- if (getConfig('index_home') != '') setWhatFromConfig('index_home');
+ if (getIndexHome() != '') setWhatFromConfig('index_home');
} // END - if
// Update last module / online time
return $points;
}
+// "Getter" for doubler_userid
+function getDoublerUserid () {
+ // Is it cached?
+ if (!isset($GLOBALS['doubler_userid'])) {
+ // Get it
+ $GLOBALS['doubler_userid'] = getConfig('doubler_userid');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['doubler_userid'];
+}
+
// [EOF]
?>
unsetGetRequestParameter('DOUBLER_UID');
unsetPostRequestParameter('DOUBLER_UID');
setSession('DOUBLER_UID', '');
-if (empty($GLOBALS['doubler_userid'])) $GLOBALS['doubler_userid'] = '0';
+if (empty($GLOBALS['local_doubler_userid'])) $GLOBALS['local_doubler_userid'] = '0';
// Check for doubles which we can pay out
$result_total = SQL_QUERY_ESC("SELECT
// Zero refid when empty (might be helpful!)
if (empty($ref)) $ref = '0';
- if (($ref > 0) && ($GLOBALS['doubler_userid'] == $content['userid']) && (!empty($ref))) {
+ if (($ref > 0) && ($GLOBALS['local_doubler_userid'] == $content['userid']) && (!empty($ref))) {
// Referal points found so add them and set line(s) to completed='Y'
$content['points'] += $ref;
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_doubler` SET `completed`='Y' WHERE `refid`=%s AND `completed`='N' AND `is_ref`='Y'",
if (isPostRequestParameterSet('no')) {
// Do not logout now
redirectToUrl('admin.php');
-} elseif ((isPostRequestParameterSet(('yes'))) && (getAction() == 'logout')) {
+} elseif ((isPostRequestParameterSet('yes')) && (getAction() == 'logout')) {
// Redirect to logout link
redirectToUrl('modules.php?module=admin&logout=1');
}
break;
}
} else {
- if ((isGetRequestParameterSet(('act'))) && (isGetRequestParameterSet(('tid'))) && (isGetRequestParameterSet(('fid')))) {
+ if ((isGetRequestParameterSet('act')) && (isGetRequestParameterSet('tid')) && (isGetRequestParameterSet('fid'))) {
// Get ids
- if (isGetRequestParameterSet(('w'))) {
+ if (isGetRequestParameterSet('w')) {
// Sub menus selected
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
array(getRequestParameter('act'), bigintval(getRequestParameter('tid'))), __FILE__, __LINE__);
array(bigintval(getRequestParameter('tid')), bigintval($fid)), __FILE__, __LINE__);
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('fid')), bigintval($tid)), __FILE__, __LINE__);
- }
- }
+ } // END - if
+ } // END - if
// By default list menus
if (!empty($SUB)) {
addMenuDescription('admin', __FILE__);
// Remove empty array index
-if (!isPostRequestParameterSet(('max'))) unsetPostRequestParameter(('add_max'));
+if (!isPostRequestParameterSet('max')) unsetPostRequestParameter('add_max');
-if (isPostRequestParameterSet(('add_max'))) {
+if (isPostRequestParameterSet('add_max')) {
// Save all settings
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE value='%s' LIMIT 1",
array(bigintval(postRequestParameter('max'))), __FILE__, __LINE__);
if (SQL_HASZERONUMS($result)) {
// Add this value (including comment)
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_max_receive` (value, comment) VALUES ('%s','%s')",
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_max_receive` (`value`, `comment`) VALUES ('%s','%s')",
array(bigintval(postRequestParameter('max')), postRequestParameter('comment')),__FILE__, __LINE__);
$content = '{--ADMIN_MAX_VALUE_SAVED--}';
} else {
// Save configuration
adminSaveSettingsFromPostData();
} else {
- // Prepare data
- switch (getConfig('verbose_sql')) {
- case 'Y':
- $content['verbose_y'] = ' checked="checked"';
- $content['verbose_n'] = '';
- break;
+ // Prepare content
+ $content['verbose_y'] = '';
+ $content['verbose_n'] = '';
- case 'N':
- $content['verbose_y'] = '';
- $content['verbose_n'] = ' checked="checked"';
- break;
- } // END - switch
+ // Prepare data
+ if (isVerboseSqlEnabled()) {
+ // Is enabled
+ $content['verbose_y'] = ' checked="checked"';
+ } else {
+ // Is disabled
+ $content['verbose_n'] = ' checked="checked"';
+ }
// Load template
loadTemplate('admin_config_extensions', false, $content);
-
}
// [EOF]
break;
case 'target': // Set which what-file will be placed in home-page (only modules.php?module=index)
- if (isGetRequestParameterSet(('home'))) {
+ if (isGetRequestParameterSet('home')) {
// Set new home
- updateConfiguration('index_home', getRequestParameter(('home')));
+ updateConfiguration('index_home', getRequestParameter('home'));
} // END - if
// Load all what menu points
$newHomeLink = '<a href="{%url=modules.php?module=admin&what=config_home&sub=target&home=' . $content['what'] . '%}">{--_IS_NEW_HOME--}</a>';
// Is this current home?
- if ($content['what'] == getConfig('index_home')) {
+ if ($content['what'] == getIndexHome()) {
// Is current home
$newHomeLink = '<div class="admin_mark">{--_IS_CURRENT_HOME--}</div>';
$content['title'] = '<div class="admin_mark">' . $content['title'] . '</div>';
mergeConfig(postRequestArray());
// Is the password set?
- if (isPostRequestParameterSet(('pass'))) {
+ if (isPostRequestParameterSet('pass')) {
// Then hash and remove it
setPostRequestParameter('primera_api_md5', md5(postRequestParameter('pass')));
unsetPostRequestParameter('pass');
if (isGetRequestParameterSet('rallye')) {
// Price submitted?
if (isFormSent('add')) {
- if ((isPostRequestParameterSet(('level'))) && ((isPostRequestParameterSet('points')) || (isPostRequestParameterSet(('info'))))) {
+ if ((isPostRequestParameterSet('level')) && ((isPostRequestParameterSet('points')) || (isPostRequestParameterSet('info')))) {
// Submitted data is valid, but maybe we already have this price level?
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s AND `price_level`='%s' LIMIT 1",
array(bigintval(getRequestParameter('rallye')), bigintval(postRequestParameter('level'))), __FILE__, __LINE__);
if (isFormSent()) {
// If salt length is empty or null then we shall generate new passwords
- if (!isPostRequestParameterSet(('salt_length')) || (postRequestParameter('salt_length') == '0')) {
+ if (!isPostRequestParameterSet('salt_length') || (postRequestParameter('salt_length') == '0')) {
// Generate new passwords for all!
loadInclude('inc/gen_sql_patches.php');
if (isFormSent()) {
// Test Path
- if ((!isPostRequestParameterSet(('session_save_path'))) || ((isDirectory(postRequestParameter('session_save_path'))) && (is_writeable(postRequestParameter('session_save_path'))))) {
+ if ((!isPostRequestParameterSet('session_save_path')) || ((isDirectory(postRequestParameter('session_save_path'))) && (is_writeable(postRequestParameter('session_save_path'))))) {
// Save configuration
adminSaveSettingsFromPostData();
} else {
addMenuDescription('admin', __FILE__);
// User exists..
-if ((isFormSent()) || ((isFormSent('del')) && (isPostRequestParameterSet(('reason'))))) {
+if ((isFormSent()) || ((isFormSent('del')) && (isPostRequestParameterSet('reason')))) {
// Is the account there?
if (fetchUserData(getRequestParameter('userid'))) {
// Delete user account
$WHO = '';
$SQL2 = '';
-if (isGetRequestParameterSet(('mid'))) {
+if (isGetRequestParameterSet('mid')) {
// Only a specific mail shall be displayed
$sql = sprintf("SELECT
`id`, `sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `target_send`, `cat_id`
} // END - if
// Add limitation to SQL string
-if (!isGetRequestParameterSet(('mid'))) {
+if (!isGetRequestParameterSet('mid')) {
// Create limitation line
$add = ' LIMIT ' . (bigintval(getRequestParameter('offset')) * bigintval(getRequestParameter('page')) - bigintval(getRequestParameter('offset'))) . ', ' . bigintval(getRequestParameter('offset'));
// Shall we display active/inactive extensions?
$where = '';
-if (isGetRequestParameterSet(('active'))) {
+if (isGetRequestParameterSet('active')) {
$where = sprintf("WHERE `ext_active`='%s'", SQL_ESCAPE(secureString(getRequestParameter('active'))));
} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-if (isGetRequestParameterSet(('pid'))) {
+if (isGetRequestParameterSet('pid')) {
// First let's get the member's id
$result = SQL_QUERY_ESC("SELECT userid, target_account, payout_total, payout_timestamp, password FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `id`=%s LIMIT 1",
array(getRequestParameter('pid')), __FILE__, __LINE__);
SQL_FREERESULT($result);
// Obtain some data
- if (!isGetRequestParameterSet(('task')) && (!empty($userid)) && ($userid > 0)) {
+ if (!isGetRequestParameterSet('task') && (!empty($userid)) && ($userid > 0)) {
// Get task id from database
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `userid`=%s AND `task_type`='PAYOUT_REQUEST' AND `task_created`=%s LIMIT 1",
array(bigintval($userid), bigintval($tstamp)), __FILE__, __LINE__);
} // END - if
// Parse the status or mode parameter
- if (isGetRequestParameterSet(('status'))) {
+ if (isGetRequestParameterSet('status')) {
// Is a WHERE statement already there?
if (!empty($whereStatement)) {
// Then append the status column
// Init title with "all accounts"
$content['title'] = '{--ADMIN_ALL_ACCOUNTS--}';
- if (isGetRequestParameterSet(('status'))) {
+ if (isGetRequestParameterSet('status')) {
// Set title according to the 'status'
- $content['title'] = sprintf("{--ADMIN_LIST_STATUS_%s_ACCOUNTS--}", strtoupper(getRequestParameter(('status'))));
+ $content['title'] = sprintf("{--ADMIN_LIST_STATUS_%s_ACCOUNTS--}", strtoupper(getRequestParameter('status')));
} elseif (isGetRequestParameterSet('mode')) {
// Set title according to the "mode"
$content['title'] = sprintf("{--ADMIN_LIST_MODE_%s_ACCOUNTS--}", strtoupper(getRequestParameter('mode')));
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-if (((!isPostRequestParameterSet(('t_wait'))) || (!isPostRequestParameterSet(('payment')))) && (isGetRequestParameterSet('do')) && (getRequestParameter('do') == 'add')) {
+if (((!isPostRequestParameterSet('t_wait')) || (!isPostRequestParameterSet('payment'))) && (isGetRequestParameterSet('do')) && (getRequestParameter('do') == 'add')) {
unsetPostRequestParameter('ok');
} // END - if
addMenuDescription('admin', __FILE__);
// Some sanity-check
-if ((!isPostRequestParameterSet('url')) || (!isPostRequestParameterSet(('alternate')))) {
+if ((!isPostRequestParameterSet('url')) || (!isPostRequestParameterSet('alternate'))) {
unsetPostRequestParameter('ok');
-}
+} // END - if
if (isFormSent()) {
// Fix older calls from add-new-banner-form
), __FILE__, __LINE__);
}
break;
- }
+ } // END - switch
// Check if we have saved (updated)
if (SQL_AFFECTEDROWS() == 1) {
addMenuDescription('admin', __FILE__);
// Is the 'url_id' set?
-if (isGetRequestParameterSet(('url_id'))) {
+if (isGetRequestParameterSet('url_id')) {
// Generate general statistics
$result = SQL_QUERY_ESC("SELECT
`stats_userid`,
foreach (postRequestParameter('sel') as $id => $sel) {
$sql = '';
// Shall I de-/activate or delete themes?
- if (isPostRequestParameterSet(('status'))) {
+ if (isPostRequestParameterSet('status')) {
// Change status
if (postRequestParameter('active', $id) == 'Y') {
$sql = "UPDATE `{?_MYSQL_PREFIX?}_themes` SET `theme_active`='N' WHERE `id`=%s LIMIT 1";
// Mails unlocked for mail delivery
loadTemplate('admin_settings_saved', false, $message);
- } elseif (isPostRequestParameterSet(('reject'))) {
+ } elseif (isPostRequestParameterSet('reject')) {
if (ifPostContainsSelections()) {
// Reject mail orders
$OUT = '';
// Unlock failed!
loadTemplate('admin_settings_saved', false, '{--ADMIN_SURFBAR_UNLOCK_FAILED--}');
}
-} elseif ((isPostRequestParameterSet(('reject'))) && (is_array(postRequestParameter('url_id'))) && (count(postRequestParameter('url_id')) > 0)) {
+} elseif ((isPostRequestParameterSet('reject')) && (is_array(postRequestParameter('url_id'))) && (count(postRequestParameter('url_id')) > 0)) {
// Reject selected URLs
if (SURFBAR_ADMIN_REJECT_URL_IDS(postRequestParameter('url_id'))) {
// Unlock done! :-)
$content['jy'] = '';
// When we found an entry don't read it, just change the jx elements
- if (isPostRequestParameterSet(('cat'))) {
+ if (isPostRequestParameterSet('cat')) {
// Form sent?
if (postRequestParameter('cat', $content['id']) =='Y') {
$content['jy'] = ' checked="checked"';
$content['jn'] = '';
- }
+ } // END - if
} else {
// Check if he has an entry
if (countSumTotalData(getMemberId(), 'user_cats', 'id', 'userid', true, sprintf(" AND `cat_id`=%s", bigintval($content['id']))) == 1) {
// Is the mode set (payout only)
if (!isGetRequestParameterSet('mode')) {
- // Get referal id
- $content['refid'] = getConfig(('primera_refid'));
-
// Is there an id?
if ((!empty($content['primera_nickname'])) && (!isGetRequestParameterSet('mode'))) {
// Then use an other "mode"
switch (getRequestParameter('mode')) {
case 'pay': // Payout this exchange -> Primus
// Is the user id and password set?
- if (!isPostRequestParameterSet(('primera_nickname'))) {
+ if (!isPostRequestParameterSet('primera_nickname')) {
// Nothing entered in Primus nickname
loadTemplate('admin_settings_saved', false, '{--MEMBER_PRIMERA_EMPTY_USERNAME--}');
- } elseif (!isPostRequestParameterSet(('primera_password'))) {
+ } elseif (!isPostRequestParameterSet('primera_password')) {
// Nothing entered in Primera password
loadTemplate('admin_settings_saved', false, '{--MEMBER_PRIMERA_EMPTY_PASSWORD--}');
- } elseif (!isPostRequestParameterSet(('amount'))) {
+ } elseif (!isPostRequestParameterSet('amount')) {
// Nothing entered in amount
loadTemplate('admin_settings_saved', false, '{--MEMBER_PRIMERA_EMPTY_AMOUNT--}');
} elseif (postRequestParameter('amount') != bigintval(postRequestParameter('amount'))) {
return;
} // END - if
-if ((!isFormSent()) || (!isPostRequestParameterSet(('qsummary')))) {
+if ((!isFormSent()) || (!isPostRequestParameterSet('qsummary'))) {
// Output form
loadTemplate('member_support_form', false, getUserDataArray());
} else {
if (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
// No more URLs allowed to book!
loadTemplate('admin_settings_saved', false, '{--MEMBER_SURFBAR_NO_MORE_ALLOWED--}');
-} elseif ((isFormSent()) && (isPostRequestParameterSet(('limited')))) {
+} elseif ((isFormSent()) && (isPostRequestParameterSet('limited'))) {
// Is limitation "no" and "limit" is > 0?
- if ((postRequestParameter('limited') != 'Y') && ((isPostRequestParameterSet(('limit'))) && (postRequestParameter('limit') > 0)) || (!isPostRequestParameterSet(('limit')))) {
+ if ((postRequestParameter('limited') != 'Y') && ((isPostRequestParameterSet('limit')) && (postRequestParameter('limit') > 0)) || (!isPostRequestParameterSet('limit'))) {
// Set it to unlimited
setPostRequestParameter('limit', 0);
} // END - if
$urlArray = SURFBAR_GET_USER_URLS();
// Are there entries or form is submitted?
-if ((isFormSent()) && (isPostRequestParameterSet(('action'))) && (isPostRequestParameterSet('id'))) {
+if ((isFormSent()) && (isPostRequestParameterSet('action')) && (isPostRequestParameterSet('id'))) {
// Process the form
if (SURFBAR_MEMBER_DO_FORM(postRequestArray(), $urlArray)) {
// Action performed but shall we display it?
// @TODO Try to rewrite his to $content = SQL_FETCHARRAY(), see some lines above for two different queries
while (list($userid, $nick) = SQL_FETCHROW($result)) {
$OUT .= " <option value=\"".$userid."\"";
- if ((isPostRequestParameterSet(('to_userid'))) && (postRequestParameter('to_userid') == $userid)) $OUT .= ' selected="selected"';
- $OUT .= ">";
+ if ((isPostRequestParameterSet('to_userid')) && (postRequestParameter('to_userid') == $userid)) $OUT .= ' selected="selected"';
+ $OUT .= '>';
if (($nick != $userid) && (!empty($nick))) {
// Output nickname
$OUT .= $nick;
// Output userid
$OUT .= $userid;
}
- $OUT .= "</option>\n";
+ $OUT .= '</option>';
}
- $OUT .= "</select>\n";
+ $OUT .= '</select>';
$content['to_disabled'] = '';
// Free memory
// Free result
SQL_FREERESULT($result_data);
-} elseif (isGetRequestParameterSet(('mailid'))) {
+} elseif (isGetRequestParameterSet('mailid')) {
// Display regular member mail by loading its full data
$result_data = SQL_QUERY_ESC("SELECT
s.id, s.subject, p.text, s.timestamp_ordered AS `timestamp`, s.cat_id, pay.price AS points, p.sender, pay.time, p.data_type
// Is the mode set (withdraw or payout)
if ((!isGetRequestParameterSet('mode')) || (getRequestParameter('mode') == 'choose')) {
// Let the user choose what he wants to do
- $content['refid'] = getConfig(('wernis_refid'));
$content['wernis_userid'] = '0';
// Is there an id?
function getTitleFromMenu ($mode, $what, $column = 'what', $ADD='') {
// Fix empty 'what'
if (empty($what)) {
- $what = getConfig('index_home');
+ $what = getIndexHome();
} // END - if
// Default is not found
}
} elseif ((empty($what)) && ($module != 'admin')) {
// Use configured 'home'
- $what = getConfig('index_home');
+ $what = getIndexHome();
} // END - if
if ($module == 'admin') {
// Is ext-sql_patches installed and newer than 0.0.5?
if (isExtensionInstalledAndNewer('sql_patches', '0.0.5')) {
// Use it from config
- $what = getConfig('index_home');
+ $what = getIndexHome();
} else {
// Use default 'welcome'
$what = 'welcome';
return $GLOBALS['online_timeout'];
}
+// "Getter" for index_home
+function getIndexHome () {
+ // Do we have cache?
+ if (!isset($GLOBALS['index_home'])) {
+ // Determine it
+ $GLOBALS['index_home'] = getConfig('index_home');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['index_home'];
+}
+
// Checks wether proxy configuration is used
function isProxyUsed () {
// Do we have cache?
</tr>
</table>
-<a href="http://www.wds66.com/ref.php?refid=$content[refid]" target="_blank" rel="external">{--MEMBER_WERNIS_NO_ACCOUNT--}</a>
+<a href="http://www.wds66.com/ref.php?refid={?wernis_refid?}" target="_blank" rel="external">{--MEMBER_WERNIS_NO_ACCOUNT--}</a>
</div>