./inc/modules/admin/what-adminedit.php:58: // @TODO Kill all constants in this file
./inc/modules/admin/what-admins_mails.php:61: // @TODO Can this be rewritten to an API function?
./inc/modules/admin/what-bonus.php:48:// @TODO Unused at the moment
-./inc/modules/admin/what-config_admins.php:126: // @TODO Rewrite this to filter 'run_sqls'
+./inc/modules/admin/what-config_admins.php:128: // @TODO Rewrite this to filter 'run_sqls'
./inc/modules/admin/what-config_mods.php:57: // @TODO This can be moved into mysql-function.php, see checkModulePermissions() function
./inc/modules/admin/what-config_points.php:113: // @TODO Rewrite this to a filter
./inc/modules/admin/what-config_rallye_prices.php:197: // @TODO Rewrite these two constants
./inc/modules/admin/what-mem_add.php:126: // @TODO This can be somehow rewritten to a function
./inc/modules/admin/what-mem_add.php:65: // @TODO Cant this be rewritten?
./inc/modules/admin/what-mem_add.php:81: // @TODO This can be somehow rewritten to a function
-./inc/modules/admin/what-unlock_emails.php:89: // @TODO Rewrite these if-blocks to a filter
+./inc/modules/admin/what-unlock_emails.php:86: // @TODO Rewrite these if-blocks to a filter
./inc/modules/admin/what-usage.php:88: // @TODO This code is double, see loadTemplate() and loadEmailTemplate() in functions.php
./inc/modules/admin/what-usr_online.php:51: // @TODO Add a filter for sponsor
./inc/modules/guest/what-beg.php:53:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
) TYPE={?_TABLE_TYPE?}");
addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_packages`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_packages` (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-title VARCHAR(255) NOT NULL DEFAULT '',
-description TINYTEXT,
-account_fee FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
-free_transfers INT(7) UNSIGNED NOT NULL DEFAULT 0,
-transfer_fee FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
-available TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-output_system_mode ENUM('LOGIN','EMAIL','DISABLED'),
-package_active ENUM('Y','N') NOT NULL DEFAULT 'N',
-free_months_no_fee TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
-interest_plus FLOAT(7,5) UNSIGNED NOT NULL DEFAULT 0.00000,
-interest_minus FLOAT(7,5) UNSIGNED NOT NULL DEFAULT 0.00000,
-first_payment FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
-free_account_income FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
-free_account_stuff TINYTEXT null,
-tan_lock TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
-PRIMARY KEY (id)
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`title` VARCHAR(255) NOT NULL DEFAULT '',
+`description` TINYTEXT,
+`account_fee` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
+`free_transfers` INT(7) UNSIGNED NOT NULL DEFAULT 0,
+`transfer_fee` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
+`available` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`output_system_mode` ENUM('LOGIN','EMAIL','DISABLED'),
+`package_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
+`free_months_no_fee` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
+`interest_plus` FLOAT(7,5) UNSIGNED NOT NULL DEFAULT 0.00000,
+`interest_minus` FLOAT(7,5) UNSIGNED NOT NULL DEFAULT 0.00000,
+`first_payment` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
+`free_account_income` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
+`free_account_stuff` TINYTEXT null,
+`tan_lock` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
+PRIMARY KEY (`id`)
) TYPE={?_TABLE_TYPE?}");
// free_account_stuff will be a list of columns of the table _bank_packages
// what the member shall get for the specified income. output_system_mode
// should be fine. More than one entry and not DISABLED ;) are not supported.
addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_tanlist`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_tanlist` (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-idx TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
-account_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-tan VARCHAR(50) NOT NULL DEFAULT '',
-used ENUM('Y','N') NOT NULL DEFAULT 'N',
-PRIMARY KEY (id),
-UNIQUE (account_id, tan)
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`idx` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
+`account_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`tan` VARCHAR(50) NOT NULL DEFAULT '',
+`used` ENUM('Y','N') NOT NULL DEFAULT 'N',
+PRIMARY KEY (`id`),
+UNIQUE (`account_id`, `tan`)
) TYPE={?_TABLE_TYPE?}");
// Admin menu queries
// Update notes (these will be set as task text!)
setExtensionUpdateNotes('');
break;
- }
+ } // END - switch
break;
case 'modify': // When the extension got modified
default: // Unknown extension mode
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
break;
-}
+} // END - switch
// [EOF]
?>
}
// Scramble a string
-function scrambleString($str) {
+function scrambleString ($str) {
// Init
$scrambled = '';
}
// De-scramble a string scrambled by scrambleString()
-function descrambleString($str) {
+function descrambleString ($str) {
// Scramble only 40 chars long strings
if (strlen($str) != 40) return $str;
}
// Generates an error code from given account status
-function generateErrorCodeFromUserStatus ($status='') {
+function generateErrorCodeFromUserStatus ($status = '') {
// If no status is provided, use the default, cached
if ((empty($status)) && (isMember())) {
// Get user status
// Finally contruct the message
// @TODO Rewrite this old lost code to a template
- $message = "{--MEMBER_URL_TIME_LOCK--}<br />{--CONFIG_URL_TLOCK--} ".$STD."
- {--_HOURS--}, ".$MIN." {--_MINUTES--} {--_AND--} ".$SEC." {--_SECONDS--}<br />
- {--MEMBER_LAST_TLOCK--}: ".$timestamp;
+ $message = '{--MEMBER_URL_TIME_LOCK--}<br />{--CONFIG_URL_TLOCK--} ' . $STD . '
+ {--_HOURS--}, ' . $MIN . ' {--_MINUTES--} {--_AND--} ' . $SEC . ' {--_SECONDS--}<br />
+ {--MEMBER_LAST_TLOCK--}: ' . $timestamp;
break;
default:
// Debug regex?
if (isDebugRegularExpressionEnabled()) {
// @TODO Are these convertions still required?
- $pat = str_replace('.', "\.", $pat);
- $pat = str_replace('@', "\@", $pat);
- //* DEBUG: */ debugOutput($key."= " . $pat);
+ $pat = str_replace('.', '\.', $pat);
+ $pat = str_replace('@', '\@', $pat);
+ //* DEBUG: */ debugOutput($key . '= ' . $pat);
} // END - if
// Check if expression matches
// Ignore zero values
if (getSession('mailer_' . $accessLevel . '_failures') > 0) {
// Non-guest has login failures found, get both data and prepare it for template
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "accessLevel={$accessLevel}<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'accessLevel=' . $accessLevel . '<br />');
$content = array(
'login_failures' => 'mailer_' . $accessLevel . '_failures',
'last_failure' => generateDateTime(getSession('mailer_' . $accessLevel . '_last_failure'), 2)
$excludeArray[] = '.svn';
$excludeArray[] = '.htaccess';
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "baseDir={$baseDir},prefix={$prefix} - Entered!");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'baseDir=' . $baseDir . ',prefix=' . $prefix . ' - Entered!');
// Init includes
$files = array();
continue;
} elseif (substr($baseFile, 0, strlen($prefix)) != $prefix) {
// Skip this file
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "Invalid prefix in file " . $baseFile . ", prefix=" . $prefix);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Invalid prefix in file ' . $baseFile . ', prefix=' . $prefix);
continue;
} elseif ((!empty($suffix)) && (substr($baseFile, -(strlen($suffix . $extension)), (strlen($suffix . $extension))) != $suffix . $extension)) {
// Skip wrong suffix as well
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "Invalid suffix in file " . $baseFile . ", suffix=" . $suffix);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Invalid suffix in file ' . $baseFile . ', suffix=' . $suffix);
continue;
} elseif (!isFileReadable($FQFN)) {
// Not readable so skip it
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "File " . $FQFN . " is not readable!");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'File ' . $FQFN . ' is not readable!');
continue;
}
// Is the file a PHP script or other?
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "baseDir={$baseDir},prefix={$prefix},baseFile={$baseFile}");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'baseDir=' . $baseDir . ',prefix=' . $prefix . ',baseFile=' . $baseFile);
if ((substr($baseFile, -4, 4) == '.php') || (($fileIncludeDirs === true) && (isDirectory($FQFN)))) {
// Is this a valid include file?
if ($extension == '.php') {
incrementStatsEntry('cache_hits');
} elseif (isExtensionInstalledAndNewer('admins', '0.6.7')) {
// Load from database when version of 'admins' is enough
- $result = SQL_QUERY_ESC("SELECT la_mode FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `la_mode` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
array($adminId), __FUNCTION__, __LINE__);
// Do we have an entry?
if (SQL_HASZERONUMS($result)) {
// Ok, start and end time did not overlap
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_rallye_data` (admin_id, title, descr, template, start_time, end_time, auto_add_new_user, is_active, send_notify)
-VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_rallye_data` (`admin_id`, `title`, `descr`, template, `start_time`, `end_time`, `auto_add_new_user`, `is_active`, `send_notify`)
+VALUES (%s,'%s','%s','%s',%s,%s,'%s','%s','%s')",
array(
getCurrentAdminId(),
postRequestParameter('title'),
), __FILE__, __LINE__);
// Load id
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_rallye_data` WHERE start_time='%s' AND end_time='%s' AND `title`='%s' LIMIT 1",
- array($START, $END, postRequestParameter('title')), __FILE__, __LINE__);
- list($id) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
+ $id = SQL_INSERTID();
if (!empty($id)) {
// Reload to prices...
$OUT = '';
foreach (postRequestParameter('sel') as $id => $selected) {
// Load data for the id
- $result = SQL_QUERY_ESC("SELECT admin_id, action_menu, what_menu, access_mode FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id`, `admin_id`, `action_menu, `what_menu`, `access_mode` FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
- list($adminId, $action, $what, $mode) = SQL_FETCHROW($result);
+ $content = SQL_FETCHARRAY($result);
+
+ // Free result
SQL_FREERESULT($result);
// Prepare data for the row template
$content = array(
- 'id' => $id,
- 'admins_selection' => generateOptionList('admins', 'id', 'login', $adminId, 'default_acl'),
- 'action_selection' => adminMenuSelectionBox_DEPRECATED('action', $action, $id),
- 'what_selection' => adminMenuSelectionBox_DEPRECATED('what', $what, $id),
+ 'id' => $content['id'],
+ 'admins_selection' => generateOptionList('admins', 'id', 'login', $content['admin_id'], 'default_acl'),
+ 'action_selection' => adminMenuSelectionBox_DEPRECATED('action', $content['action_menu'], $content['id']),
+ 'what_selection' => adminMenuSelectionBox_DEPRECATED('what', $content['what_menu'], $content['id']),
'mode_options' => generateOptionList(
'/ARRAY/',
array('allow', 'deny'),
'{--ADMINS_ALLOW_MODE--}',
'{--ADMINS_DENY_MODE--}'
),
- $mode
+ $content['access_mode']
),
);
'/ARRAY/',
array('allow', 'deny'),
array(
- 'ADMINS_ALLOW_MODE--}',
- 'ADMINS_DENY_MODE--}'
+ '{--ADMINS_ALLOW_MODE--}',
+ '{--ADMINS_DENY_MODE--}'
)
);
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_cats` SET `cat`='%s', `visible`='%s', `sort`=%s WHERE `id`=%s LIMIT 1",
array(
$cat,
- postRequestParameter('vis', $id),
+ postRequestParameter('visible', $id),
postRequestParameter('sort', $id),
$id
), __FILE__, __LINE__);
// Delete categories
$OUT = '';
foreach (postRequestParameter('sel') as $id => $value) {
- // Load data of category
- $result = SQL_QUERY_ESC("SELECT `cat` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
- list($cat) = SQL_FETCHROW($result);
-
- // Free result
- SQL_FREERESULT($result);
-
- // Prepare data for the row template
- $content = array(
- 'id' => $id,
- 'cat' => $cat,
- );
-
// Load row template and switch colors
- $OUT .= loadTemplate('admin_del_cats_row', true, $content);
+ $OUT .= loadTemplate('admin_del_cats_row', true, $id);
} // END - foreach
// Load main template
$OUT = '';
foreach (postRequestParameter('sel') as $id => $value) {
// Load data from the category
- $result = SQL_QUERY_ESC("SELECT cat, visible, sort FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
- list($cat, $vis, $sort) = SQL_FETCHROW($result);
+ $result = SQL_QUERY_ESC("SELECT `id`, `visible`, `sort` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
+ array(bigintval($id)), __FILE__, __LINE__);
+ $content = SQL_FETCHARRAY($result);
+
+ // Free result
SQL_FREERESULT($result);
// Prepare data for the row template
- $content = array(
- 'id' => $id,
- 'cat' => $cat,
- 'vis' => addSelectionBox('yn', $vis, 'vis', $id),
- 'sort' => $sort,
- );
+ $content['visible_selection'] = addSelectionBox('yn', $content['visible'], 'visible', $content['id'])
// Load row template and switch colors
$OUT .= loadTemplate('admin_edit_cats_row', true, $content);
// List already existing categories for editing
while ($content = SQL_FETCHARRAY($result)) {
- // Prepare data for the row template
- $content['vis'] = translateYesNo($content['visible']);
-
// Put cat descriptions into variable for the selection box
$cat = $content['cat'];
if (strlen($cat) > 40) $cat = substr($cat, 0, 37) . '...';
LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load data and free memory
- list($userid, $start, $end) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
+ $content = SQL_FETCHARRAY($result);
// Update user's account
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data`
`holiday_activated`=0
WHERE
`userid`=%s
-LIMIT 1", array(bigintval($userid)), __FILE__, __LINE__);
+LIMIT 1", array(bigintval($content['userid'])), __FILE__, __LINE__);
// Remove holiday
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM
LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
// Prepare loaded data for the
- $content = array(
- 'start' => generateDateTime($start, 3),
- 'end' => generateDateTime($end , 3)
- );
+ $content['holiday_start'] = generateDateTime($content['holiday_start'], 3);
+ $content['holiday_end'] = generateDateTime($content['holiday_end'] , 3);
// Send email to user
- $message = loadEmailTemplate('member_holiday_removed', $content, $userid);
- sendEmail($userid, '{--ADMIN_HOLIDAY_REMOVED_SUBJECT--}', $message);
+ $message = loadEmailTemplate('member_holiday_removed', $content, $content['userid']);
+ sendEmail($content['userid'], '{--ADMIN_HOLIDAY_REMOVED_SUBJECT--}', $message);
$cnt++;
- }
- }
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+ } // END - foreach
loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_HOLIDAY_MULTI_DEL', $cnt));
} elseif (isGetRequestParameterSet('userid')) {
// Set default message
// Fetch data
$result_load = SQL_QUERY_ESC("SELECT
- `holiday_start` AS start, `holiday_end` AS end
+ `holiday_start` AS start, `holiday_end` AS `end`
FROM
`{?_MYSQL_PREFIX?}_user_holidays`
WHERE
$OUT = '';
foreach (postRequestParameter('id') as $id => $status) {
// Load data from DB
- $result = SQL_QUERY_ESC("SELECT code, descr FROM `{?_MYSQL_PREFIX?}_countries` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id`, `code`, `descr` FROM `{?_MYSQL_PREFIX?}_countries` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load data
- list($code, $descr) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
-
- // Prepare data, load row template and switch colors
- $content = array(
- 'id' => $id,
- 'code' => $code,
- 'descr' => $descr,
- );
+ $content = SQL_FETCHARRAY($result);
if ($post == 'modify') {
// Generate default selection in edit-mode
// Insert row template and switch color
$OUT .= loadTemplate($row, true, $content);
} // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
} // END - foreach
// Prepare content for template
// 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__);
- list($task) = SQL_FETCHROW($result);
+ list($taskId) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- if (empty($task)) $task = '0';
+ if (empty($taskId)) $taskId = '0';
} elseif ((empty($userid)) || ($userid == '0')) {
// Cannot obtain member id!
loadTemplate('admin_settings_saved', false, '{--ADMIN_PAYOUT_FAILED_OBTAIN_USERID--}');
} else {
// Get task id from URL
- $task = getRequestParameter('task');
+ $taskId = getRequestParameter('task');
}
- if ((!empty($task)) && (!empty($userid)) && ($userid > 0)) {
+ if ((!empty($taskId)) && (!empty($userid)) && ($userid > 0)) {
// Load user's data
if (!fetchUserData($userid)) {
// Abort here because it is not valid!
$data['from_pass'] = base64_encode($data['from_pass']);
$tpass = base64_encode($tpass);
break;
- }
+ } // END - switch
// Transfer variables...
$reason = encodeString(getMessage('ADMIN_PAYOUT_REASON'), false);
if ($ret[0] == $data['engine_ret_ok']) {
// Clear task
- if ($task > 0) {
- runFilterChain('solve_task', $task);
+ if ($taskId > 0) {
+ runFilterChain('solve_task', $taskId);
}
// Clear payout request
} else {
// Prepare content
$content = array(
- 'task' => $task,
+ 'task' => $taskId,
'pid' => bigintval(getRequestParameter('pid')),
'user' => '<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">' . translateGender(getUserData('gender')) . ' ' . getUserData('surname') . ' ' . getUserData('family') . '</a>',
);
} elseif ((getRequestParameter('do') == 'reject') && (getUserData('email') != '')) {
// Ok, now we can output the form or execute rejecting
if (isFormSent()) {
- if ($task > 0) {
+ if ($taskId > 0) {
// Clear task
- runFilterChain('solve_task', $task);
+ runFilterChain('solve_task', $taskId);
} // END - if
// Clear payout request
} else {
// Prepare content
$content = array(
- 'task' => $task,
+ 'task' => $taskId,
'pid' => bigintval(getRequestParameter('pid')),
'user' => '<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">' . translateGender(getUserData('gender')) . ' ' . getUserData('surname') . ' ' . getUserData('family') . '</a>',
);
// Cannot load user data
loadTemplate('admin_settings_saved', false, '{--ADMIN_PAYOUT_FAILED_OBTAIN_USERDATA--}');
}
- } elseif ((empty($task)) || ($task == '0')) {
+ } elseif ((empty($taskId)) || ($taskId == '0')) {
// Failed loading task id
loadTemplate('admin_settings_saved', false, '{--ADMIN_PAYOUT_FAILED_OBTAIN_TASK_ID--}');
}
loadTemplate('admin_list_unconfirmed', false, $content);
} elseif (getRequestParameter('mid') > 0) {
// Data in pool or in user_stats not found, so let's find out where data is missing
- $result1 = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
- array(bigintval($ID)), __FILE__, __LINE__);
- $result2 = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1",
- array(bigintval($ID)), __FILE__, __LINE__);
-
- if (SQL_NUMROWS($result1) == 1) {
+ if (countSumTotalData(bigintval($ID), 'pool', 'id', 'id', true) == 1) {
// pool table
loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_UNCONFIRMED_POOL_MISSING', $ID));
- } elseif (SQL_NUMROWS($result2) == 1) {
+ } elseif (countSumTotalData(bigintval($ID), 'user_stats', 'id', 'pool_id', true) == 1) {
// user_stats table
loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_UNCONFIRMED_STATS_MISSING', $ID));
} else {
// both or link is invalid
loadTemplate('admin_settings_saved', false, '{--ADMIN_UNCONFIRMED_INVALID_LINK--}');
}
-
- // Free memory
- SQL_FREERESULT($result1);
- SQL_FREERESULT($result2);
} elseif (isGetRequestParameterSet('bid')) {
// Data in bonus table not found
loadTemplate('admin_settings_saved', false, '{--ADMIN_UNCONFIRMED_INVALID_LINK--}');
switch (getRequestParameter('do')) {
case 'add':
addSql("INSERT INTO `{?_MYSQL_PREFIX?}_payments` (`time`, `payment`, `mail_title`, `price`) VALUES ('".postRequestParameter('t_wait')."','".postRequestParameter('payment')."','".postRequestParameter('title')."','".postRequestParameter('price')."')");
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_payments` WHERE `time`='%s' LIMIT 1",
- array(postRequestParameter('t_wait')), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1) {
+ if (countSumTotalData(postRequestParameter('t_wait'), 'payments', 'id', 'time', true) == 1) {
// Re-init the array here
initSqls();
-
- // Free memory
- SQL_FREERESULT($result);
- }
+ } // END - if
break;
case 'edit':
foreach (postRequestParameter('time') as $id => $value) {
- addSql("UPDATE `{?_MYSQL_PREFIX?}_payments` SET `time`='" . $value . "', `payment`='".postRequestParameter('pay', $id)."', price='".postRequestParameter('price', $id)."', mail_title='".postRequestParameter('title', $id)."' WHERE `id`='".$id."' LIMIT 1");
- }
+ addSql("UPDATE `{?_MYSQL_PREFIX?}_payments` SET `time`='" . $value . "', `payment`='".postRequestParameter('payment', $id)."', price='".postRequestParameter('price', $id)."', mail_title='".postRequestParameter('mail_title', $id)."' WHERE `id`='".$id."' LIMIT 1");
+ } // END - foreach
break;
case 'del':
foreach (postRequestParameter('id') as $id => $value) {
addSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`=" . bigintval($id) . " LIMIT 1");
- }
+ } // END - foreach
break;
} // END - switch
// Delete entries here
$OUT = '';
foreach (postRequestParameter('sel') as $id => $value) {
- $result = SQL_QUERY_ESC("SELECT time, mail_title FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`=%s LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
- list($time, $title) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
+ $result = SQL_QUERY_ESC("SELECT `id`, `time`, `mail_title` FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`=%s LIMIT 1",
+ array(bigintval($id)), __FILE__, __LINE__);
+ $content = SQL_FETCHARRAY($result);
- // Prepare array for the row template
- $content = array(
- 'id' => $id,
- 'time' => $time,
- 'title' => $title,
- );
+ // Free result
+ SQL_FREERESULT($result);
// Load row template and switch colors
$OUT .= loadTemplate('admin_del_payments_row', true, $content);
// Edit entries
$OUT = '';
foreach (postRequestParameter('sel') as $id => $value) {
- $result = SQL_QUERY_ESC("SELECT time, payment, mail_title, price FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`=%s LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
- list($time, $pay, $title, $price) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
+ $result = SQL_QUERY_ESC("SELECT `id`, `time`, `payment`, `mail_title`, `price` FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`=%s LIMIT 1",
+ array(bigintval($id)), __FILE__, __LINE__);
+ $content = SQL_FETCHARRAY($result);
- // Prepare array for the row template
- $content = array(
- 'id' => $id,
- 'time' => $time,
- 'title' => $title,
- 'pay' => $pay,
- 'price' => $price,
- );
+ // Free result
+ SQL_FREERESULT($result);
// Load row template and switch colors
$OUT .= loadTemplate('admin_edit_payments_row', true, $content);
// Load data
$content = SQL_FETCHARRAY($result);
- // Free result
- SQL_FREERESULT($result);
-
// Is the surfbar installed?
// @TODO Rewrite these if-blocks to a filter
if ((isExtensionActive('surfbar')) && (getConfig('surfbar_migrate_order') == 'Y')) {
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `data_type`='NEW' WHERE `id`=%s AND `data_type`='ADMIN' LIMIT 1",
array($id), __FILE__, __LINE__);
} // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
} // END - foreach
// Set message
// Nothing selected
loadTemplate('admin_settings_saved', false, '{--ADMIN_MAILS_NOTHING_CHECKED--}');
}
- } elseif ((isFormSent('lock')) && (ifPostContainsSelections()) && (getConfig('url_blacklist') == 'Y')) {
+ } elseif ((isFormSent('lock')) && (ifPostContainsSelections()) && (isUrlBlaskEnabled())) {
// Lock URLs
foreach (postRequestParameter('sel') as $id => $url) {
// Secure id number
// Load main template
loadTemplate('admin_unlock_emails', false, $content);
- } elseif ((isFormSent('lock')) && (getConfig('url_blacklist') != 'Y')) {
+ } elseif ((isFormSent('lock')) && (!isUrlBlaskEnabled())) {
// URL blacklist not activated
loadTemplate('admin_settings_saved', false, '{--ADMIN_URL_BLACKLIST_DISABLED--}');
} else {
} // END - if
// And shall I check that his URL is not in the black list?
- if (getConfig('url_blacklist') == 'Y') {
+ if (isUrlBlaskEnabled()) {
// Ok, I do that for you know...
$result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`timestamp`) AS tstamp FROM `{?_MYSQL_PREFIX?}_url_blacklist` WHERE `url`='%s' LIMIT 1",
array(postRequestParameter('url')), __FILE__, __LINE__);
return $GLOBALS['total_points'][$userid];
}
+// Wrapper to check if url_blacklist is enabled
+function isUrlBlacklistEnabled () {
+ // Do we have cache?
+ if (!isset($GLOBALS['is_url_blacklist_enabled'])) {
+ // Determine it
+ $GLOBALS['is_url_blacklist_enabled'] = (getConfig('url_blacklist') == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['is_url_blacklist_enabled'];
+}
+
// [EOF]
?>
------------------------------
Vor-, Nachname: {%user,gender,translateGender=$userid%} {%user,surname=$userid%} {%user,family=$userid%}
------------------------------
-Anfang Ihres Urlaubes: $content[start]
+Anfang Ihres Urlaubes: $content[holiday_start]
------------------------------
-Ende Ihres Urlaubes: $content[end]
+Ende Ihres Urlaubes: $content[holiday_end]
------------------------------
Ihre Urlaubsschaltung ist hiermit wieder aufgehoben. Sie können wieder Mails buchen.
<input type="checkbox" class="admin_normal" title="{--ID_SELECT--} $content[id]" name="sel[$content[id]]" value="1" />
</td>
<td class="bottom right {%template,ColorSwitch%}">
- $content[cat]
+ {%pipe,getCategory=$content[id]%}
</td>
<td align="center" class="bottom right {%template,ColorSwitch%}">
- $content[vis]
+ {%pipe,translateComma=$content[visible]%}
</td>
<td align="center" class="bottom {%template,ColorSwitch%}">
$content[sort]
<tr>
<td align="center" class="{%template,ColorSwitch%}">
- <strong>{--ADMIN_CATEGORY_ID--} $content[id]:</strong>
+ <strong>{--ADMIN_CATEGORY_ID--} $content:</strong>
</td>
</tr>
<tr>
<td align="center" class="{%template,ColorSwitch%} bottom">
- $content[cat] <input type="hidden" name="id[$content[id]]" value="1" />
+ {%pipe,getCategory=$content[id]%}
+ <input type="hidden" name="id[$content]" value="1" />
</td>
</tr>
<tr>
<td class="admin_title bottom" height="20" align="center">
- <strong>{--PAYMENT_ID--} $content[id]:</strong>
+ <strong>{--ADMIN_PAYMENT_ID--} $content[id]:</strong>
</td>
</tr>
<tr>
<td align="center" class="{%template,ColorSwitch%} bottom">
- $content[time] {--_SECONDS--} ($content[title])
+ $content[time] {--_SECONDS--} ($content[mail_title])
<input type="hidden" name="id[$content[id]]" value="1" />
</td>
</tr>
<tr>
<td align="right" class="{%template,ColorSwitch%}">{--ADMIN_CATEGORY_DESCRIPTION--}: </td>
<td class="{%template,ColorSwitch%}">
- <input type="text" name="id[$content[id]]" class="admin_normal" value="$content[cat]" size="32" maxlength="255" />
+ <input type="text" name="id[$content[id]]" class="admin_normal" value="{%pipe,getCategory=$content[id]%}" size="32" maxlength="255" />
</td>
</tr>
<tr>
<td class="{%template,ColorSwitch%}" align="right">{--CAT_IS_VISIBLE--} </td>
- <td class="{%template,ColorSwitch%}">$content[vis]</td>
+ <td class="{%template,ColorSwitch%}">$content[visible_selection]</td>
</tr>
<tr>
<td class="{%template,ColorSwitch%} bottom" align="right">{--SORT_KEY--}: </td>
<tr>
<td class="admin_title bottom" colspan="2" align="center">
- <strong>{--PAYMENT_ID--} $content[id]:</strong>
+ <strong>{--ADMIN_PAYMENT_ID--} $content[id]:</strong>
</td>
</tr>
<tr>
- <td class="{%template,ColorSwitch%}" align="right">{--PAY_TIME--}:</td>
+ <td class="{%template,ColorSwitch%}" align="right">{--ADMIN_PAYMENT_TIME--}:</td>
<td class="{%template,ColorSwitch%}">
<input type="text" name="time[$content[id]]" class="admin_normal" value="$content[time]" size="3" maxlength="5" />{--_SECONDS--}
</td>
</tr>
<tr>
- <td class="{%template,ColorSwitch%}" align="right">{--PAY_PAYMENT--}:</td>
+ <td class="{%template,ColorSwitch%}" align="right">{--ADMIN_PAYMENT_PAYMENT--}:</td>
<td class="{%template,ColorSwitch%}">
- <input type="text" name="pay[$content[id]]" class="admin_normal" value="$content[pay]" size="5" maxlength="8" />{?POINTS?}
+ <input type="text" name="payment[$content[id]]" class="admin_normal" value="$content[payment]" size="5" maxlength="8" />{?POINTS?}
</td>
</tr>
<tr>
- <td class="{%template,ColorSwitch%}" align="right">{--PAY_PRICE--}:</td>
+ <td class="{%template,ColorSwitch%}" align="right">{--ADMIN_PAYMENT_PRICE--}:</td>
<td class="{%template,ColorSwitch%}">
<input type="text" name="price[$content[id]]" class="admin_normal" value="$content[price]" size="5" maxlength="8" />
<span class="tiny">({?POINTS?})</span>
</td>
</tr>
<tr>
- <td class="{%template,ColorSwitch%} bottom" align="right">{--PAY_TITLE--}:</td>
+ <td class="{%template,ColorSwitch%} bottom" align="right">{--ADMIN_PAYMENT_TITLE--}:</td>
<td class="{%template,ColorSwitch%} bottom">
- <input type="text" name="title[$content[id]]" class="admin_normal" value="$content[title]" size="25" maxlength="255" />
+ <input type="text" name="mail_title[$content[id]]" class="admin_normal" value="$content[mail_title]" size="25" maxlength="255" />
</td>
</tr>