- All admin getter functions like getAdminEmail() (except getAdminId()) does now
take the admin id
- Naming convention on some template names applied
- Some deprecated footer/header templates merged and marked as deprecated
- TODOs.txt updated
inc/modules/admin/what-stats_mods.php -text
inc/modules/admin/what-sub_points.php -text
inc/modules/admin/what-surfbar_stats.php -text
-inc/modules/admin/what-theme_check.php -text
inc/modules/admin/what-theme_edit.php -text
inc/modules/admin/what-theme_import.php -text
inc/modules/admin/what-unlock_emails.php -text
templates/de/html/admin/admin_list_surfbar_actions_row.tpl -text
templates/de/html/admin/admin_list_surfbar_urls.tpl -text
templates/de/html/admin/admin_list_surfbar_urls_row.tpl -text
+templates/de/html/admin/admin_list_task.tpl -text
+templates/de/html/admin/admin_list_task_delete.tpl -text
templates/de/html/admin/admin_list_task_ext_rows.tpl -text
templates/de/html/admin/admin_list_task_rows.tpl -text
templates/de/html/admin/admin_list_theme.tpl -text
./inc/libs/yoomedia_functions.php:116: $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script
./inc/load_config.php:77: // @TODO Rewrite them to avoid this else block
./inc/loader/load_cache-extension.php:13: * @TODO Rewrite this whole file to load_cache-extensions.php *
-./inc/modules/admin/admin-inc.php:254: // @TODO Rewrite this to $content = SQL_FETCHARRAY()
-./inc/modules/admin/admin-inc.php:259: // @TODO ACL is 'allow'... hmmm
-./inc/modules/admin/admin-inc.php:325: // @TODO Rewrite this to $content = SQL_FETCHARRAY()
-./inc/modules/admin/admin-inc.php:331: // @TODO ACL is 'allow'... hmmm
-./inc/modules/admin/admin-inc.php:431:// @TODO Try to rewrite this to adminAddMenuSelectionBox()
+./inc/modules/admin/admin-inc.php:261: // @TODO Rewrite this to $content = SQL_FETCHARRAY()
+./inc/modules/admin/admin-inc.php:266: // @TODO ACL is 'allow'... hmmm
+./inc/modules/admin/admin-inc.php:332: // @TODO Rewrite this to $content = SQL_FETCHARRAY()
+./inc/modules/admin/admin-inc.php:338: // @TODO ACL is 'allow'... hmmm
+./inc/modules/admin/admin-inc.php:438:// @TODO Try to rewrite this to adminAddMenuSelectionBox()
./inc/modules/admin/overview-inc.php:164: // @TODO Rewrite this to a filter
./inc/modules/admin/overview-inc.php:278: // @TODO Rewrite this to something with include files and/or filter
./inc/modules/admin/overview-inc.php:316: // @TODO This may also be rewritten to include files
./inc/modules/admin/overview-inc.php:318: default: // @TODO Unknown support mode
-./inc/modules/admin/overview-inc.php:439: // @TODO Try to move this in includes
+./inc/modules/admin/overview-inc.php:436: // @TODO Try to move this in includes
./inc/modules/admin/overview-inc.php:45:// @TODO This function does also check for uncompleted tasks
./inc/modules/admin/what-add_guestnl_cat.php:49: // @TODO Check if category does already exist
./inc/modules/admin/what-add_surfbar_url.php:57: // @TODO Find all convertSelectionsToTimestamp() calls and rewrite postRequestParameter() calls to $postData
./inc/modules/admin/what-list_links.php:89: // @TODO Find a way to rewrite this. See some lines above for different queries
./inc/modules/admin/what-list_links.php:98: // @TODO Rewrite this to includes/filter
./inc/modules/admin/what-list_refs.php:110: // @TODO Try to rewrite some to EL
-./inc/modules/admin/what-list_task.php:146: // @TODO Rewrite these templates to one and add $OUT
-./inc/modules/admin/what-list_task.php:180: // @TODO Rewritings: admin->assigned_admin,type->task_type_msg in template
-./inc/modules/admin/what-list_task.php:192: // @TODO Rewrite this to $OUT .= ..., true, ...
-./inc/modules/admin/what-list_task.php:196: // @TODO Rewrite this to $OUT .= ..., true, ...
./inc/modules/admin/what-list_unconfirmed.php:100: // @TODO Rewrite this to $content = SQL_FETCHARRAY(), look some lines above for two differrent queries
./inc/modules/admin/what-list_unconfirmed.php:77: // @TODO This constant might be unused? define('__LIST_UNCON_TITLE', '{--LIST_UNCONFIRMED_BONUS_LINKS--}');
./inc/modules/admin/what-list_unconfirmed.php:88: // @TODO "Please do not call me directly." Should be rewritten to a nice selection depending on ext-bonus
./inc/modules/member/what-unconfirmed.php:143: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
./inc/modules/order.php:76: // @TODO Unused: 2,4
./inc/monthly/monthly_bonus.php:69: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1627: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1727: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:2107: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:2151:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/mysql-manager.php:1630: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:1730: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2110: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2154:// @TODO Fix inconsistency between last_module and getWhat()
./inc/mysql-manager.php:229: // @TODO Nothing helped???
./inc/mysql-manager.php:264: // @TODO Rewrite this to a filter
./inc/mysql-manager.php:589: // @TODO Try to rewrite this to one or more functions
./inc/wrapper-functions.php:127:// @TODO Implement $compress
./inc/wrapper-functions.php:134:// @TODO Implement $decompress
./inc/wrapper-functions.php:455:// @TODO Do some more sanity check here
-./inc/wrapper-functions.php:793: * @TODO Do we really need this check? If yes, try to fix this:
./mailid.php:138: // @TODO Rewrite this to a filter
./mailid.php:95: // @TODO Rewrite this to a filter
./mailid_top.php:132: // @TODO Rewrite this to a filter
./templates/de/html/surfbar/surfbar_frame_textlinks.tpl:5: <!-- @TODO These are static lines and should be replaced by a filter (see ext-sponsor) //-->
./templates/de/html/surfbar/surfbar_frame_top.tpl:32:// @TODO Try to rewrite this JavaScript to js.php?js=surfbar_frame_top (wouldn't be easy)
### ### DEPRECATION FOLLOWS: ### ###
-./inc/modules/admin/admin-inc.php:432:// @DEPRECATED
-./inc/modules/admin/what-theme_check.php:2:// @DEPRECATED
+./inc/modules/admin/admin-inc.php:439:// @DEPRECATED
./templates/de/html/admin/admin_list_theme_row.tpl:1:<!-- @DEPRECATED //-->
./templates/de/html/admin/admin_list_theme.tpl:1:<!-- @DEPRECATED //-->
+./templates/de/html/admin/admin_overview_footer_task.tpl:1:<!-- @DEPRECATED //-->
+./templates/de/html/admin/admin_overview_footer.tpl:1:<!-- @DEPRECATED //-->
+./templates/de/html/admin/admin_overview_header_task.tpl:1:<!-- @DEPRECATED //-->
### ### template-warnings.log follows: ### ###
Warning: Not parsing JavaScript templates/de/html/js/js_order_send.tpl.
Warning: Not parsing JavaScript templates/de/html/js/js_cookies_disabled.tpl.
PHP Warning: DOMDocument::loadHTMLFile(): Attribute class redefined in templates/de/html/admin/admin_list_beg.tpl, line: 23 in
PHP Warning: DOMDocument::loadHTMLFile(): Attribute align redefined in templates/de/html/admin/admin_list_beg.tpl, line: 23 in
PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/admin/admin_logout_sql_patches_remove.tpl, line: 10 in
-PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/admin/admin_overview_footer_task.tpl, line: 10 in
-PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : form in templates/de/html/admin/admin_overview_footer_task.tpl, line: 11 in
-PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/admin/admin_overview_footer.tpl, line: 10 in
-PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : form in templates/de/html/admin/admin_overview_footer.tpl, line: 11 in
-PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/admin/admin_overview_footer.tpl, line: 12 in
PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/admin/admin_main_footer.tpl, line: 1 in
PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/admin/admin_main_footer.tpl, line: 2 in
PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/admin/admin_main_footer.tpl, line: 12 in
// Modules
$GLOBALS['cache_array']['modules'][$k][$data['module']] = $v;
} elseif ($this->name == 'admin') {
- // Modules
- if ($k == 'login') {
- $GLOBALS['cache_array']['admin'][$k][$data['admin_id']] = $v;
- } else {
+ // Admin logins
+ if ($k == 'admin_id') {
$GLOBALS['cache_array']['admin'][$k][$data['login']] = $v;
+ } else {
+ $GLOBALS['cache_array']['admin'][$k][$data['admin_id']] = $v;
}
} elseif ($this->name == 'refdepths') {
// Referal levels
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` ADD default_acl ENUM('deny','allow') NOT NULL DEFAULT 'deny'");
// But allow current admin everything (THIS SHALL BE YOU!)
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `default_acl`='allow' WHERE `login`='".getSession('admin_login')."' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `default_acl`='allow' WHERE `id`=".bigintval(getSession('admin_id'))." LIMIT 1");
addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_acls`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admins_acls` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
$GLOBALS['admin_login_success'] = ((
setSession('admin_md5', encodeHashForCookie($data['pass_hash']))
) && (
- setSession('admin_login', $data['login'])
+ setSession('admin_id', $data['id'])
) && (
setSession('admin_last', time())
));
// Generate a hash for extra-security for all passwords
function generateHash ($plainText, $salt = '', $hash = true) {
// Debug output
- //* DEBUG: */ debugOutput('plainText=' . $plainText . ',salt=' . $salt . ',hash='.intval($hash));
+ //* DEBUG: */ debugOutput('plainText('.strlen($plainText).')=' . $plainText . ',salt('.strlen($salt).')=' . $salt . ',hash=' . intval($hash));
// Is the required extension 'sql_patches' there and a salt is not given?
- // 0123 4 43 3 4 432 2 3 32 2 3 3210
- if ((((isExtensionInstalledAndOlder('sql_patches', '0.3.6')) && (empty($salt))) || (!isExtensionActive('sql_patches')) || (!isExtensionInstalledAndNewer('other', '0.2.5')))) {
+ // 123 4 43 3 4 432 2 3 32 2 3 32 2 3 3 21
+ if (((isExtensionInstalledAndOlder('sql_patches', '0.3.6')) && (empty($salt))) || (!isExtensionActive('sql_patches')) || (!isExtensionInstalledAndNewer('other', '0.2.5')) || (strlen($salt) == 32)) {
// Extension sql_patches is missing/outdated so we hash the plain text with MD5
if ($hash === true) {
// Is plain password
$finalHash = $salt . sha1($salt . $plainText);
// Debug output
- //* DEBUG: */ debugOutput('finalHash=' . $finalHash);
+ //* DEBUG: */ debugOutput('finalHash('.strlen($finalHash).')=' . $finalHash);
// Return hash
return $finalHash;
'ADMINS_ADD_MORE_ADMINS' => "Weiteren Admin hinzufügen",
'ADMIN_ACCOUNT_SAVED' => "Admin-Account gespeichert.",
'ADMINS_ERROR_PASS_MISMATCH' => "Die beiden Passwörter stimmen nicht überein.",
- 'ADMIN_ACCOUNT_404' => "Admin-Account nicht gefunden.",
// Logical area constants
'ADMINS_GLOBAL_LA_SETTING' => "Globale Einst.",
// Set timeout cookie
setSession('admin_last', time());
- if ($login != getSession('admin_login')) {
+ if ($adminId != getSession('admin_id')) {
// Update login cookie
- setSession('admin_login', $login);
+ setSession('admin_id', $adminId);
// Update password cookie as well?
if (!empty($add)) setSession('admin_md5', $hash);
// Rewrite all entries
foreach ($GLOBALS['cache_array']['admin'] as $key => $entry) {
// Do we have login or regular entries?
- if ($key == 'login') {
- // Login, so use id
- $admins[$key][$GLOBALS['cache_array']['admin']['admin_id'][$idx]] = $entry[$idx];
- } else {
- // Regular entry so use login
+ if ($key == 'admin_id') {
+ // Admin id, so use login
$admins[$key][$GLOBALS['cache_array']['admin']['login'][$idx]] = $entry[$idx];
+ } else {
+ // Regular entry so use id
+ $admins[$key][$GLOBALS['cache_array']['admin']['admin_id'][$idx]] = $entry[$idx];
}
} // END - foreach
} // END - foreach
loadIncludeOnce('inc/modules/admin/admin-inc.php');
// Fix "deleted" cookies in PHP4 (PHP5 does remove them, PHP4 sets them to deleted!)
-fixDeletedCookies(array('admin_login', 'admin_md5', 'admin_last'));
+fixDeletedCookies(array('admin_id', 'admin_md5', 'admin_last'));
// Init return value
$ret = 'init';
// Output reset password form
loadTemplate('admin_send_reset_link');
}
-} elseif ((!isSessionVariableSet('admin_login')) || (!isSessionVariableSet('admin_md5')) || (!isSessionVariableSet('admin_last'))) {
+} elseif ((!isSessionVariableSet('admin_id')) || (!isSessionVariableSet('admin_md5')) || (!isSessionVariableSet('admin_last'))) {
// At leat one administrator account was created
- if ((isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5')) && (isSessionVariableSet('admin_last'))) {
+ if ((isSessionVariableSet('admin_id')) && (isSessionVariableSet('admin_md5')) && (isSessionVariableSet('admin_last'))) {
// Timeout for last login, we have to logout first!
redirectToUrl('modules.php?module=admin&logout=1');
} // END - if
}
} else {
// Maybe an Admin want's to login?
- $ret = ifAdminCookiesAreValid(getSession('admin_login'), getSession('admin_md5'));
+ $ret = ifAdminCookiesAreValid(getSession('admin_id'), getSession('admin_md5'));
// Check status
switch ($ret) {
case '404': // Administrator login not found
setPostRequestParameter('ok', $ret);
- loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_ACCOUNT_404', getSession('admin_login')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_ACCOUNT_404', getSession('admin_id')));
destroyAdminSession();
break;
// First of all, no admin login is found
$ret = '404';
- // Then we need to lookup the login name by getting the admin hash
- $adminHash = getAdminHash($adminLogin);
-
- // If this is fine, we can continue
- if ($adminHash != '-1') {
- // Get admin id and set it as current
- setCurrentAdminId(getAdminId($adminLogin));
-
- // Now, we need to encode the password in the same way the one is encoded in database
- $testHash = generateHash($adminPassword, $adminHash);
-
- // If they both match, the login data is valid
- if ($testHash == $adminHash) {
- // All fine
- $ret = 'done';
- } else {
- // Set status
- $ret = 'pass';
- }
+ // Get admin id from login
+ $adminId = getAdminId($adminLogin);
+
+ // Continue only with found admin ids
+ if ($adminId > 0) {
+ // Then we need to lookup the login name by getting the admin hash
+ $adminHash = getAdminHash($adminId);
+
+ // If this is fine, we can continue
+ if ($adminHash != '-1') {
+ // Get admin id and set it as current
+ setCurrentAdminId($adminId);
+
+ // Now, we need to encode the password in the same way the one is encoded in database
+ $testHash = generateHash($adminPassword, $adminHash);
+
+ // If they both match, the login data is valid
+ if ($testHash == $adminHash) {
+ // All fine
+ $ret = 'done';
+ } else {
+ // Set status
+ $ret = 'pass';
+ }
+ } // END - if
} // END - if
// Prepare data array
$data = array(
+ 'id' => $adminId,
'login' => $adminLogin,
'plain_pass' => $adminPassword,
'pass_hash' => $adminHash
$action = getActionFromModuleWhat(getModule(), $what);
// Define admin login name and id number
- $content['login'] = getSession('admin_login');
+ $content['login'] = getAdminLogin(getSession('admin_id'));
$content['id'] = getCurrentAdminId();
// Preload templates
// Prepare array for the template
$content = array(
- 'sw' => $SW,
- 'subject' => $taskData['subject'],
- 'add' => $add,
- 'text' => $taskData['text'],
- 'created' => generateDateTime($taskData['task_created'], 1),
- 'extension' => $ext_name
+ 'sw' => $SW,
+ 'subject' => $taskData['subject'],
+ 'add' => $add,
+ 'text' => $taskData['text'],
+ 'task_created' => generateDateTime($taskData['task_created'], 1),
+ 'extension' => $ext_name
);
// Load template
// Init infos
$content['infos'] = '';
- // Generate assign link
- $content['assigned_admin'] = generateAdminLink($content['assigned_admin']);
-
// Generate infos
// @TODO Try to move this in includes
switch ($content['task_type']) {
$content['userid'] = '<em>{--ADMIN_IS_SYSTEM_TASK--}</em>';
}
- // Prepare content
- $content = merge_array($content, array(
- 'sw' => $SW,
- 'assigned_admin' => $content['assigned_admin'],
- 'userid' => $content['userid'],
- 'task_type_msg' => $content['task_type_msg'],
- 'created' => generateDateTime($content['task_created'], 2)
- ));
+ // Add/translate some content
+ $content['sw'] = $SW;
+ $content['task_created'] = generateDateTime($content['task_created'], 2);
// Do we have extension task?
if (($content['task_type'] == 'EXTENSION') && (isExtensionNameValid($content['infos'])) && (!isExtensionInstalled($content['infos']))) {
while ($content = SQL_FETCHARRAY($result)) {
// Prepare content
$content['sw'] = $SW;
- $content['alnk'] = generateAdminLink($content['admin_id']);
// Load row template
$OUT .= loadTemplate('admin_admins_mails_list_row', true, $content);
'id' => $content['id'],
'title' => $content['title'],
'admin_id' => $content['admin_id'],
- 'admin_link' => generateAdminLink($content['admin_id']),
'login' => $content['login'],
'start' => generateDateTime($content['start_time'], 3),
'end' => generateDateTime($content['end_time'], 3),
// Contact data
$content['email_link'] = generateEmailLink($content['email'], 'sponsor_data');
// Timestamps
- $content['created'] = generateDateTime($content['sponsor_created'], 2);
- $content['last_online'] = generateDateTime($content['last_online'], 2);
- $content['last_change'] = generateDateTime($content['last_change'], 2);
+ $content['sponsor_created'] = generateDateTime($content['sponsor_created'], 2);
+ $content['last_online'] = generateDateTime($content['last_online'], 2);
+ $content['last_change'] = generateDateTime($content['last_change'], 2);
// Orders total
$content['orders'] = countSumTotalData(bigintval(getRequestParameter('id')), 'sponsor_orders', 'id', 'sponsorid', true);
while ($content = SQL_FETCHARRAY($result_main)) {
// Transfer data to array
$content = array(
- 'id' => $content['id'],
- 'sw' => $SW,
- 'gender' => $content['gender'],
- 'surname' => $content['surname'],
- 'family' => $content['family'],
- 'email' => generateEmailLink($content['email'], 'sponsor_data'),
- 'status' => $content['status'],
- 'created' => generateDateTime($content['sponsor_created'], 2),
- 'last_online' => generateDateTime($content['last_online'], 2),
- 'points' => translateComma($content['points_amount'] - $content['points_used']),
- 'remote_addr' => $content['remote_addr'],
+ 'id' => $content['id'],
+ 'sw' => $SW,
+ 'gender' => $content['gender'],
+ 'surname' => $content['surname'],
+ 'family' => $content['family'],
+ 'email' => generateEmailLink($content['email'], 'sponsor_data'),
+ 'status' => $content['status'],
+ 'sponsor_created' => generateDateTime($content['sponsor_created'], 2),
+ 'last_online' => generateDateTime($content['last_online'], 2),
+ 'points' => translateComma($content['points_amount'] - $content['points_used']),
+ 'remote_addr' => $content['remote_addr'],
);
// Load row template
}
// There are uncompleted jobs!
- $type = '{--ADMIN_OVERVIEW_TASK_' . strtoupper(getRequestParameter('type')) . '_TYPE--}';
- // @TODO Rewrite these templates to one and add $OUT
- loadTemplate('admin_overview_header_task', false, array(
- 'message' => $type,
- 'type' => getRequestParameter('type')
- ));
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result_tasks)) {
// Init infos
$content['infos'] = '';
- // Generate link
- $content['assigned_admin'] = generateAdminLink($content['assigned_admin']);
-
// Get admin task
$content['task_type_msg'] = '{--ADMIN_TASK_IS_' . strtoupper($content['task_type']) . '--}';
}
// Prepare content
- // @TODO Rewritings: admin->assigned_admin,type->task_type_msg in template
$content = merge_array($content, array(
- 'sw' => $SW,
- 'admin' => $content['assigned_admin'],
- 'userid' => $content['userid'],
- 'type' => $content['task_type_msg'],
- 'created' => generateDateTime($content['task_created'], 2)
+ 'sw' => $SW,
+ 'assign_admin' => $content['assigned_admin'],
+ 'userid' => $content['userid'],
+ 'task_type_msg' => $content['task_type_msg'],
+ 'task_created' => generateDateTime($content['task_created'], 2)
));
// Do we have an extension task?
if (($content['task_type'] == 'EXTENSION') && (isExtensionNameValid($content['infos'])) && (!isExtensionInstalled($content['infos']))) {
// Load extension row template
- // @TODO Rewrite this to $OUT .= ..., true, ...
- loadTemplate('admin_list_task_ext_rows', false, $content);
+ $OUT .= loadTemplate('admin_list_task_ext_rows', true, $content);
} else {
// Load default row template
- // @TODO Rewrite this to $OUT .= ..., true, ...
- loadTemplate('admin_list_task_rows', false, $content);
+ $OUT .= loadTemplate('admin_list_task_rows', true, $content);
}
// Switch colors
// Free memory
SQL_FREERESULT($result_tasks);
+ // Prepare content
+ $content = array(
+ 'message' => '{--ADMIN_OVERVIEW_TASK_' . strtoupper(getRequestParameter('type')) . '_TYPE--}',
+ 'type' => getRequestParameter('type'),
+ 'rows' => $OUT
+ );
+
// Load footer template
if (getRequestParameter('type') == 'deleted') {
// Delete now button
- loadTemplate('admin_overview_footer_task');
+ loadTemplate('admin_list_task_delete', false, $content);
} else {
// Normal footer
- loadTemplate('admin_overview_footer');
+ loadTemplate('admin_list_task', false, $content);
}
}
} // END - if
+++ /dev/null
-<?php
-// @DEPRECATED
-?>
}
// This patched function will reduce many SELECT queries for the specified or current admin login
-function isAdmin ($adminLogin = '') {
+function isAdmin () {
// No admin in installation phase!
if ((isInstallationPhase()) || (!isAdminRegistered())) {
return false;
// Init variables
$ret = false;
+ $adminId = '0';
$passCookie = '';
$valPass = '';
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $adminLogin);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $adminId);
// If admin login is not given take current from cookies...
- if ((empty($adminLogin)) && (isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5'))) {
+ if ((isSessionVariableSet('admin_id')) && (isSessionVariableSet('admin_md5'))) {
// Get admin login and password from session/cookies
- $adminLogin = getSession('admin_login');
+ $adminId = getSession('admin_id');
$passCookie = getSession('admin_md5');
} // END - if
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $adminLogin.'/'.$passCookie);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $adminId.'/'.$passCookie);
+
+ // Abort if admin id is zero
+ if ($adminId == '0') {
+ return false;
+ } // END - if
// Do we have cache?
- if (!isset($GLOBALS['is_admin'][$adminLogin])) {
+ if (!isset($GLOBALS['is_admin'][$adminId])) {
// Init it with failed
- $GLOBALS['is_admin'][$adminLogin] = false;
+ $GLOBALS['is_admin'][$adminId] = false;
// Search in array for entry
if (isset($GLOBALS['admin_hash'])) {
// Use cached string
$valPass = $GLOBALS['admin_hash'];
- } elseif ((!empty($passCookie)) && (isAdminHashSet($adminLogin) === true) && (!empty($adminLogin))) {
+ } elseif ((!empty($passCookie)) && (isAdminHashSet($adminId) === true) && (!empty($adminId))) {
// Login data is valid or not?
- $valPass = encodeHashForCookie(getAdminHash($adminLogin));
+ $valPass = encodeHashForCookie(getAdminHash($adminId));
// Cache it away
$GLOBALS['admin_hash'] = $valPass;
// Count cache hits
incrementStatsEntry('cache_hits');
- } elseif ((!empty($adminLogin)) && ((!isExtensionActive('cache')) || (isAdminHashSet($adminLogin) === false))) {
+ } elseif ((!empty($adminId)) && ((!isExtensionActive('cache')) || (isAdminHashSet($adminId) === false))) {
// Get admin hash and hash it
- $valPass = encodeHashForCookie(getAdminHash($adminLogin));
+ $valPass = encodeHashForCookie(getAdminHash($adminId));
// Cache it away
$GLOBALS['admin_hash'] = $valPass;
if (!empty($valPass)) {
// Check if password is valid
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '(' . $valPass . '==' . $passCookie . ')='.intval($valPass == $passCookie));
- $GLOBALS['is_admin'][$adminLogin] = (($valPass == $passCookie) || ((strlen($valPass) == 32) && ($valPass == md5($passCookie))) || (($valPass == '*FAILED*') && (!isExtensionActive('cache'))));
+ $GLOBALS['is_admin'][$adminId] = (($GLOBALS['admin_hash'] == $passCookie) || ((strlen($GLOBALS['admin_hash']) == 32) && ($GLOBALS['admin_hash'] == md5($passCookie))) || (($GLOBALS['admin_hash'] == '*FAILED*') && (!isExtensionActive('cache'))));
} // END - if
} // END - if
// Return result of comparision
- return $GLOBALS['is_admin'][$adminLogin];
+ return $GLOBALS['is_admin'][$adminId];
}
// Generates a list of "max receiveable emails per day"
// Do we have cache?
if (!isset($GLOBALS['current_admin_id'])) {
// Get the admin login from session
- $adminLogin = getSession('admin_login');
-
- // "Solve" it into an id
- $adminId = getAdminId($adminLogin);
+ $adminId = getSession('admin_id');
// Remember in cache securely
setCurrentAdminId(bigintval($adminId));
}
// Get password hash from administrator's login name
-function getAdminHash ($adminLogin) {
+function getAdminHash ($adminId) {
// By default an invalid hash is returned
$data['password'] = '-1';
- if (isAdminHashSet($adminLogin)) {
+ if (isAdminHashSet($adminId)) {
// Check cache
- $data['password'] = $GLOBALS['cache_array']['admin']['password'][$adminLogin];
+ $data['password'] = $GLOBALS['cache_array']['admin']['password'][$adminId];
// Update cache hits
incrementStatsEntry('cache_hits');
} elseif (!isExtensionActive('cache')) {
// Load from database
- $result = SQL_QUERY_ESC("SELECT `password` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
- array($adminLogin), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `password` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+ array(bigintval($adminId)), __FUNCTION__, __LINE__);
// Do we have an entry?
if (SQL_NUMROWS($result) == 1) {
$data = SQL_FETCHARRAY($result);
// Set cache
- setAdminHash($adminLogin, $data['password']);
+ setAdminHash($adminId, $data['password']);
} // END - if
// Free result
// Destroys the admin session
function destroyAdminSession ($destroy = true) {
// Kill maybe existing session variables including array elements
- setSession('admin_login', '');
- setSession('admin_md5' , '');
- setSession('admin_last' , '');
+ setSession('admin_id' , '');
+ setSession('admin_md5' , '');
+ setSession('admin_last', '');
// Destroy session and return status
if ($destroy) {
// Is cache set?
if (!isset($GLOBALS['demo_mode_active'])) {
// Simply check it
- $GLOBALS['demo_mode_active'] = ((isExtensionActive('demo')) && (getSession('admin_login') == 'demo'));
+ $GLOBALS['demo_mode_active'] = ((isExtensionActive('demo')) && (getAdminLogin(getSession('admin_id')) == 'demo'));
} // END - if
// Return it
}
// Checks wether the admin hash is set
-function isAdminHashSet ($admin) {
- /**
- * @TODO Do we really need this check? If yes, try to fix this:
- * 1.:functions.php:2504, debug_get_mailable_backtrace(0)
- * 2.:wrapper-functions.php:744, debug_report_bug(1)
- * 3.:mysql-manager.php:728, isAdminHashSet(1)
- * 4.:filters.php:384, isAdmin(0)
- * 5.:debug_get_mailable_backtrace:2457, FILTER_DETERMINE_USERNAME(1)
- * 6.:filter-functions.php:280, call_user_func_array(2)
- * 7.:load_cache.php:74, runFilterChain(1)
- * 8.:inc-functions.php:131, include(1)
- * 9.:inc-functions.php:145, loadInclude(1)
- * 10.:mysql-connect.php:104, loadIncludeOnce(1)
- * 11.:inc-functions.php:131, include(1)
- * 12.:inc-functions.php:145, loadInclude(1)
- * 13.:config-global.php:106, loadIncludeOnce(1)
- * 14.:js.php:57, require(1)
- */
+function isAdminHashSet ($adminId) {
+ // Is the array there?
if (!isset($GLOBALS['cache_array']['admin'])) {
+ // Missing array should be reported
debug_report_bug(__FUNCTION__, __LINE__, 'Cache not set.');
} // END - if
// Check for admin hash
- return isset($GLOBALS['cache_array']['admin']['password'][$admin]);
+ return isset($GLOBALS['cache_array']['admin']['password'][$adminId]);
}
// Setter for admin hash
-function setAdminHash ($admin, $hash) {
- $GLOBALS['cache_array']['admin']['password'][$admin] = $hash;
+function setAdminHash ($adminId, $hash) {
+ $GLOBALS['cache_array']['admin']['password'][$adminId] = $hash;
}
// Init user data array
$content[mail_template]
</td>
<td class="switch_sw$content[sw] bottom" align="center">
- $content[alnk]
+ {%pipe,generateAdminLink=$content[admin_id]%}
</td>
</tr>
<tr>
<td align="center" class="switch_sw$content[sw] bottom right"><a href="{%url=modules.php?module=admin&what=config_rallye_prices&rallye=$content[id]%}">$content[title]</a></td>
- <td align="center" class="switch_sw$content[sw] bottom right">$content[admin_link]</td>
+ <td align="center" class="switch_sw$content[sw] bottom right">{%pipe,generateAdminLink=$content[admin_id]%}</td>
<td align="center" class="switch_sw$content[sw] bottom right">$content[start]</td>
<td align="center" class="switch_sw$content[sw] bottom">$content[end]</td>
</tr>
</tr>
<tr>
<td align="right" class="bottom right">{--SPONSOR_CREATED--}:</td>
- <td align="center" class="bottom">$content[created]</td>
+ <td align="center" class="bottom">$content[sponsor_created]</td>
</tr>
<tr>
<td align="right" class="bottom right">{--ADMIN_LAST_ONLINE--}:</td>
[<strong><a href="{%url=modules.php?module=admin&what=lock_sponsor&id=$content[id]%}">{%pipe,sponsorTranslateUserStatus=$content[status]%}</a></strong>]
</td>
<td align="center" class="switch_sw$content[sw] bottom right" width="120">
- $content[created]
+ $content[sponsor_created]
</td>
<td align="center" class="switch_sw$content[sw] bottom right" width="120">
$content[last_online]
--- /dev/null
+<div align="center">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_task&type=$content[type]%}" method="post">
+<table border="0" cellspacing="0" cellpadding="0" class="admin_tasktable dashed">
+<tr>
+ <td colspan="7" align="center" class="admin_task_header bottom">
+ <strong>$content[message]</strong>
+ </td>
+</tr>
+<tr>
+ <td align="center" class="header_column bottom right"><strong>{--ID_SELECT--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_ASSIGNED_ADMIN--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_REGISTER_EXTENSION--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_TASK_INFOS--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_MEMBER_UID--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_TASK_TYPE--}</strong></td>
+ <td align="center" class="header_column bottom"><strong>{--ADMIN_TASK_CREATED--}</strong></td>
+</tr>
+$content[rows]
+<tr>
+ <td colspan="7" align="center" class="admin_footer">
+ <input type="reset" value="{--ADMIN_UNSELECT_ALL--}" class="admin_reset" />
+ <input type="submit" name="assign" value="{--ADMIN_ASSIGN_TASKS--}" class="admin_submit" />
+ <input type="submit" name="unassign" value="{--ADMIN_UNASSIGN_TASKS--}" class="admin_submit" />
+ <input type="submit" name="redir" value="{--ADMIN_REDIRECT_TASKS--}" class="admin_submit" />
+ <input type="submit" name="del" value="{--ADMIN_DELETE_ENTRIES--}" class="admin_delete" />
+ </td>
+</tr>
+</table>
+</form>
+</div>
--- /dev/null
+<div align="center">
+<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_task&type=$content[type]%}" method="post">
+<table border="0" cellspacing="0" cellpadding="0" class="admin_tasktable dashed">
+<tr>
+ <td colspan="7" align="center" class="admin_task_header bottom">
+ <strong>$content[message]</strong>
+ </td>
+</tr>
+<tr>
+ <td align="center" class="header_column bottom right"><strong>{--ID_SELECT--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_ASSIGNED_ADMIN--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_REGISTER_EXTENSION--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_TASK_INFOS--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_MEMBER_UID--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_TASK_TYPE--}</strong></td>
+ <td align="center" class="header_column bottom"><strong>{--ADMIN_TASK_CREATED--}</strong></td>
+</tr>
+$content[rows]
+<tr>
+ <td colspan="7" align="center" class="admin_footer">
+ <input type="reset" value="{--ADMIN_UNSELECT_ALL--}" class="admin_reset" />
+ <input type="submit" name="assign" value="{--ADMIN_ASSIGN_TASKS--}" class="admin_submit" />
+ <input type="submit" name="unassign" value="{--ADMIN_UNASSIGN_TASKS--}" class="admin_submit" />
+ <input type="submit" name="redir" value="{--ADMIN_REDIRECT_TASKS--}" class="admin_submit" />
+ <input type="submit" name="del" value="{--ADMIN_TASK_DELETE_ENTRIES--}" class="admin_delete" />
+ </td>
+</tr>
+</table>
+</form>
+</div>
+
+<div class="admin_note">
+ <strong>{--TASK_DELETE_MODE_NOTE--}</strong>
+</div>
<input type="checkbox" class="admin_normal" title="{--ID_SELECT--} $content[id]" name="sel[$content[id]]" value="1" />
</td>
<td class="switch_sw$content[sw] bottom right" align="center">
- $content[admin]
+ {%pipe,generateAdminLink=$content[assigned_admin]%}
</td>
<td class="switch_sw$content[sw] bottom right" align="center">
<a title="{--ADMIN_REGISTER_EXTENSION_TITLE--}" href="{%url=modules.php?module=admin&what=extensions&reg_ext=$content[id]%}">{--ADMIN_REGISTER_EXTENSION--}</a>
$content[userid]
</td>
<td class="switch_sw$content[sw] bottom right" align="center">
- $content[type]
+ $content[task_type_msg]
</td>
<td class="switch_sw$content[sw] bottom" align="center">
- $content[created]]
+ $content[task_created]
</td>
</tr>
<input type="checkbox" class="admin_normal" title="{--ID_SELECT--} $content[id]" name="sel[$content[id]]" value="1" />
</td>
<td class="switch_sw$content[sw] bottom right" align="center">
- $content[admin]
+ {%pipe,generateAdminLink=$content[assigned_admin]%}
</td>
<td class="switch_sw$content[sw] bottom right" align="center">
---
$content[userid]
</td>
<td class="switch_sw$content[sw] bottom right" align="center">
- $content[type]
+ $content[task_type_msg]
</td>
<td class="switch_sw$content[sw] bottom" align="center">
- $content[created]]
+ $content[task_created]
</td>
</tr>
-<tr>
- <td colspan="7" align="center" class="admin_footer">
- <input type="reset" value="{--ADMIN_UNSELECT_ALL--}" class="admin_reset" />
- <input type="submit" name="assign" value="{--ADMIN_ASSIGN_TASKS--}" class="admin_submit" />
- <input type="submit" name="unassign" value="{--ADMIN_UNASSIGN_TASKS--}" class="admin_submit" />
- <input type="submit" name="redir" value="{--ADMIN_REDIRECT_TASKS--}" class="admin_submit" />
- <input type="submit" name="del" value="{--ADMIN_DELETE_ENTRIES--}" class="admin_delete" />
- </td>
-</tr>
-</table>
-</form>
-</div>
+<!-- @DEPRECATED //-->
-<tr>
- <td colspan="7" align="center" class="admin_footer">
- <input type="reset" value="{--ADMIN_UNSELECT_ALL--}" class="admin_reset" />
- <input type="submit" name="assign" value="{--ADMIN_ASSIGN_TASKS--}" class="admin_submit" />
- <input type="submit" name="unassign" value="{--ADMIN_UNASSIGN_TASKS--}" class="admin_submit" />
- <input type="submit" name="redir" value="{--ADMIN_REDIRECT_TASKS--}" class="admin_submit" />
- <input type="submit" name="del" value="{--ADMIN_TASK_DELETE_ENTRIES--}" class="admin_delete" />
- </td>
-</tr>
-</table>
-</form>
-
-<div class="admin_note">
- <strong>{--TASK_DELETE_MODE_NOTE--}</strong>
-</div>
+<!-- @DEPRECATED //-->
-<div align="center">
-<form accept-charset="utf-8" action="{%url=modules.php?module=admin&what=list_task&type=$content[type]%}" method="post">
-<table border="0" cellspacing="0" cellpadding="0" class="admin_tasktable dashed">
-<tr>
- <td colspan="7" align="center" class="admin_task_header bottom">
- <strong>$content[message]</strong>
- </td>
-</tr>
-<tr>
- <td align="center" class="header_column bottom right"><strong>{--ID_SELECT--}</strong></td>
- <td align="center" class="header_column bottom right"><strong>{--ADMIN_ASSIGNED_ADMIN--}</strong></td>
- <td align="center" class="header_column bottom right"><strong>{--ADMIN_REGISTER_EXTENSION--}</strong></td>
- <td align="center" class="header_column bottom right"><strong>{--ADMIN_TASK_INFOS--}</strong></td>
- <td align="center" class="header_column bottom right"><strong>{--ADMIN_MEMBER_UID--}</strong></td>
- <td align="center" class="header_column bottom right"><strong>{--ADMIN_TASK_TYPE--}</strong></td>
- <td align="center" class="header_column bottom"><strong>{--ADMIN_TASK_CREATED--}</strong></td>
-</tr>
+<!-- @DEPRECATED //-->
<input type="checkbox" class="admin_normal" title="{--ID_SELECT--} $content[id]" name="sel[$content[id]]" value="1" />
</td>
<td class="switch_sw$content[sw] bottom right" align="center">
- $content[assigned_admin]
+ {%pipe,generateAdminLink=$content[assigned_admin]%}
</td>
<td class="switch_sw$content[sw] bottom right" align="center">
<a title="{--ADMIN_REGISTER_EXTENSION_TITLE--}" href="{%url=modules.php?module=admin&what=extensions&reg_ext=$content[id]%}">{--ADMIN_REGISTER_EXTENSION--}</a>
$content[task_type_msg]
</td>
<td class="switch_sw$content[sw] bottom right" align="center">
- $content[created]]
+ $content[task_created]
</td>
</tr>
<input type="checkbox" class="admin_normal" title="{--ID_SELECT--} $content[id]" name="sel[$content[id]]" value="1" />
</td>
<td class="switch_sw$content[sw] bottom right" align="center">
- $content[assigned_admin]
+ {%pipe,generateAdminLink=$content[assigned_admin]%}
</td>
<td class="switch_sw$content[sw] bottom right" align="center">
---
$content[task_type_msg]
</td>
<td class="switch_sw$content[sw] bottom right" align="center">
- $content[created]]
+ $content[task_created]
</td>
</tr>
$content[add]
<li style="white-space: normal">{--ADMIN_TASK_TEXT--}: $content[text]</li>
<li style="white-space: normal"><div style="text-align: right"><a href="#ext_$content[extension]">{--TOP--}</a></div></li>
- <li style="white-space: normal">{--ADMIN_TASK_CREATED--}: <strong>$content[created]</strong></li>
+ <li style="white-space: normal">{--ADMIN_TASK_CREATED--}: <strong>$content[task_created]</strong></li>
</ul>
</td>
<td width="20%" class="switch_sw$content[sw] bottom" align="right" valign="top" style="padding-top: 40px">
-<!-- Kleiner 88x31 Banner ... -->
+<!-- Kleiner 88x31 Banner ... //-->
-<!-- Kleiner 88x31 Banner ... -->
+<!-- Kleiner 88x31 Banner ... //-->
</td>
<td valign="top"><div class="skyscraper">
- <!-- 120x600 may fit here -->
+ <!-- 120x600 may fit here //-->
</div></td>
</tr>
<tr>
<td align="center" valign="top" class="guest_advert">
-<!-- Don't add your code here! -->
+<!-- Don't add your code here! //-->
<tr>
<td class="guest_advert" colspan="3" align="center">
- <!-- Horizontal footer banner -->
+ <!-- Horizontal footer banner //-->
</td>
</tr>
</table>
-<!-- Gast-Tabelle - Anfang -->
+<!-- Gast-Tabelle - Anfang //-->
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="guest">
<tr>
<td colspan="3" align="center" valign="top" class="guest_title">
<a name="TOP"></a>
- <!-- Ab hier Kopf! -->
+ <!-- Ab hier Kopf! //-->
<strong><big>- - -<a title="{?MAIN_TITLE?}"
style="cursor: default; background: none; text-decoration: none"
class="guest_header">{?MAIN_TITLE?}</a> - - -</big></strong>
<td width="200" align="right"><div class="guest_header">$content[date_time]</div></td>
</tr>
</table>
- <!-- Bis hier Kopf! --></td>
+ <!-- Bis hier Kopf! //--></td>
</tr>
-<!-- This HTML code goes between the left menu and the content on right side -->
+<!-- This HTML code goes between the left menu and the content on right side //-->
</td>
-<td valign="top" rowspan="3" class="guest_content">
\ No newline at end of file
+<td valign="top" rowspan="3" class="guest_content">
-<!-- This code goes between header and left menu -->
+<!-- This code goes between header and left menu //-->
<tr>
- <td class="guest_menu">
\ No newline at end of file
+ <td class="guest_menu">
-<!-- Kleiner 88x31 Banner ... -->
\ No newline at end of file
+<!-- Kleiner 88x31 Banner ... //-->
<tr>
<td class="guest_advert" colspan="3" align="center">
- <!-- Horizontal footer banner -->
+ <!-- Horizontal footer banner //-->
</td>
</tr>
</table>
-<!-- Fuss unterhalb des Mitgliederbereiches -->
+<!-- Fuss unterhalb des Mitgliederbereiches //-->
</table>
</form>
-<!-- Hinweise zur "Auszahlung" in Bannerviews, Textlinkklicks, etc. -->
+<!-- Hinweise zur "Auszahlung" in Bannerviews, Textlinkklicks, etc. //-->
<div class="member_note">(*): {--PAYOUT_BANNER_NOTE--}</div>
-<!-- Hinweise zur "Auszahlung" in Bannerviews, Textlinkklicks, etc. -->
+<!-- Hinweise zur "Auszahlung" in Bannerviews, Textlinkklicks, etc. //-->
</div>
-<!-- Werbebanner oder was auch immer? -->
-
+<!-- Werbebanner oder was auch immer? //-->
-<!-- Einbauanleitung: http://www.uberwach.de/code-snippet.html -->
-<!-- start uberwach code :: do not change :: v2.2.2 -->
+<!-- Einbauanleitung: http://www.uberwach.de/code-snippet.html //-->
+<!-- start uberwach code :: do not change :: v2.2.2 //-->
<script type="text/javascript">/* <![CDATA[ */
au_ip='{%server,remote_addr%}';
/* ]]> */</script>
<script src="{%url=js.php?js=uberwach%}{%ext,version=uberwach%}" type="text/javascript"></script>
<noscript><a href="http://www.uberwach.de/" rel="external" target="_blank" title="Aktion: Überwach!">?mg src="http://www.uberwach.de/wanze.gif" alt="Aktion UBERWACH!" width="80" height="15" border="0" /></a></noscript>
-<!-- ende uberwach code -->
+<!-- ende uberwach code //-->