} elseif (is_array($v)) {
// Serialize and BASE64-encode the array
$v = base64_encode(serialize($v));
+ } elseif ($this->name == 'config') {
+ // Configuration
+ $GLOBALS['cache_array']['config'][$data['config']][$k] = $v;
+ } elseif ($this->name == 'filter') {
+ // Filter
+ $GLOBALS['cache_array']['filter']['chains'][$data['filter_name']][$data['filter_function']] = $data['filter_active'];
+ $GLOBALS['cache_array']['filter']['counter'][$data['filter_name']][$data['filter_function']] = $data['filter_counter'];
+ $GLOBALS['cache_array']['filter']['loaded'][$data['filter_name']][$data['filter_function']] = true;
+ } elseif ($this->name == 'modules') {
+ // 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 {
+ $GLOBALS['cache_array']['admin'][$k][$data['login']] = $v;
+ }
+ } elseif ($this->name == 'refdepths') {
+ // Referal levels
+ $GLOBALS['cache_array']['refdepths'][$k][$data['id']] = $v;
+ } elseif ($this->name == 'revision') {
+ // Revision data
+ $GLOBALS['cache_array']['revision'][$k] = $v;
+ } elseif ($this->name == 'themes') {
+ // Themes
+ if ($k == 'theme_path') {
+ $GLOBALS['cache_array']['themes'][$k][$data['id']] = $v;
+ } else {
+ $GLOBALS['cache_array']['themes'][$k][$data['theme_path']] = $v;
+ }
+ } else {
+ // Finialize the cache and close it
+ $this->finialize();
+
+ // Remove cache
+ $this->removeCacheFile(true);
+
+ // Unsupported cache found!
+ debug_report_bug('Unsupported cache ' . $this->name . ' detected.');
}
// Write cache line to file
fwrite($this->pointer, $this->rewriteEntry($k, $v));
- }
+ } // END - foreach
} else {
// Cannot create file
addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".getMessage('CACHE_PROBLEMS_DETECTED'));
}
// Destroy an existing cache file
- function removeCacheFile ($removeArray = false, $force = false) {
+ function removeCacheFile ($force = false) {
// Reset read status
$this->resetCacheReadStatus();
// Reset read status
$this->resetCacheReadStatus();
- // Shall we remove the array from memory?
- if ($removeArray === true) {
- // Debug message if allowed
- if (isDebugModeEnabled()) {
- // Debug message
- logDebugMessage(__METHOD__, __LINE__, 'removing array!');
- } // END - if
-
- // Remove it from memory
- unset($GLOBALS['cache_array'][$this->name]);
- } // END - if
-
// Is the file there?
if (!$this->isCacheReadable()) {
// The cache does no longer exist so kill the content
logDebugMessage(__METHOD__, __LINE__, "Cache {$this->name} has missing version entry for extension {$ext_name}! Purging cache...");
// Remove the cache file
- $this->removeCacheFile(false, true);
+ $this->removeCacheFile(true);
}
} else {
// Not installed, does always match
break;
case '0.7.0': // SQL queries for v0.7.0
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` ADD `login_failtures` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` ADD `last_failture` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'");
+
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Veraltetes Update.");
break;
break;
case '0.6.5': // SQL queries for v0.6.5
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` ADD bonus_stats ENUM('Y','N') NOT NULL DEFAULT 'N'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` ADD `bonus_stats` ENUM('Y','N') NOT NULL DEFAULT 'N'");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Fehler mit bonus_stats beseitigt.");
break;
case '0.6.9': // SQL queries for v0.6.9
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD bonus_order_yn ENUM('Y','N') NOT NULL DEFAULT 'N'");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD bonus_ref_yn ENUM('Y','N') NOT NULL DEFAULT 'N'");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD bonus_stats_yn ENUM('Y','N') NOT NULL DEFAULT 'N'");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD bonus_login_yn ENUM('Y','N') NOT NULL DEFAULT 'N'");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD bonus_click_yn ENUM('Y','N') NOT NULL DEFAULT 'Y'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_order_yn` ENUM('Y','N') NOT NULL DEFAULT 'N'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_ref_yn` ENUM('Y','N') NOT NULL DEFAULT 'N'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_stats_yn` ENUM('Y','N') NOT NULL DEFAULT 'N'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_login_yn` ENUM('Y','N') NOT NULL DEFAULT 'N'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_click_yn` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Es können nun auch die folgenden Vergütungen bei der Auswertung der monatlichen Aktiv-Rallye mit berücksichtigt werden: Mailbestätigung (war vorher schon), Login-, Mailbuchung, Referal und Statistik-Bonus (100% Klickrate erreicht).");
break;
case '0.8.8': // SQL queries for v0.8.8
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` ADD bonus_stats_active ENUM('Y','N') NOT NULL DEFAULT 'N'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` ADD `bonus_stats_active` ENUM('Y','N') NOT NULL DEFAULT 'N'");
// Update notes
setExtensionUpdateNotes("Benachrichtigungsmails für z.B. Bettel- oder Aktiv-Rallye werden nun angezeigt.");
`subject` VARCHAR(200) NOT NULL DEFAULT '',
`url` TINYTEXT NOT NULL,
`max_rec` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+ `clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`timestamp_ordered` VARCHAR(10) NOT NULL DEFAULT '',
`pool_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`timestamp_sstart` VARCHAR(10) NOT NULL DEFAULT '',
// Init "generic filter system"
function initFilterSystem () {
// Is the filter already initialized?
- if (isset($GLOBALS['filters'])) {
+ if (isset($GLOBALS['filter_init'])) {
// Then abort here
- debug_report_bug(getMessage('FILTER_FAILED_ALREADY_INIT'));
+ debug_report_bug('Filter system already initialized.');
} // END - if
// Load all saved filers if sql_patches is updated
$filterArray['chains'][$filterName][$filterFunction] = $GLOBALS['cache_array']['filter']['filter_active'][$idx];
} // END - foreach
+ // Mark it as initialized
+ $GLOBALS['filter_init'] = true;
+
// Remove the cache
$GLOBALS['cache_array']['filter'] = $filterArray;
} elseif ((!isInstallationPhase()) && (isExtensionInstalledAndNewer('sql_patches', '0.5.9'))) {
if ((isset($GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction])) && ($force === false)) {
// Then abort here
if ($silentAbort === false) {
- addFatalMessage(__FUNCTION__, __LINE__, getMessage('FILTER_FAILED_ALREADY_ADDED'), array($filterFunction, $filterName));
+ // Add fatal message
+ addFatalMessage(__FUNCTION__, __LINE__, sprintf("Filter chain %s has already filter function %s registered!", $filterName, $filterFunction));
} // END - if
// Abort here
// Something has been added?
if ($inserted > 0) {
- // Finish SQL command
- $insertSQL = substr($insertSQL, 0, -1);
-
- // And run it
- addSql($insertSQL);
+ // Finish SQL command and add it
+ addSql(substr($insertSQL, 0, -1));
} // END - if
// Something has been removed?
if ($removed > 0) {
- // Finish SQL command
- $removeSQL = substr($removeSQL, 0, -2) . 'LIMIT '.$removed;
-
- // And run it
- addSql($removeSQL);
+ // Finish SQL command and add it
+ addSql(substr($removeSQL, 0, -2) . 'LIMIT ' . $removed);
} // END - if
// Shall we update usage counters (ONLY FOR DEBUGGING!)
SQL_FREERESULT($result);
}
-// Filter for checking admin ACL
-function FILTER_CHECK_ADMIN_ACL () {
- // Extension not installed so it's always allowed to access everywhere!
- $ret = true;
-
- // Ok, Cookie-Update done
- if ((isExtensionInstalledAndNewer('admins', '0.3.0')) && (isExtensionActive('admins'))) {
- // Check if action GET variable was set
- $action = getAction();
- if (isWhatSet()) {
- // Get action value by what-value
- $action = getModeAction('admin', getWhat());
- } // END - if
-
- // Check for access control line of current menu entry
- $ret = adminsCheckAdminAcl($action, getWhat());
- } // END - if
-
- // Return result
- return $ret;
-}
-
// Filter for initializing randomizer
function FILTER_INIT_RANDOMIZER () {
// Simply init the randomizer with seed and _ADD value
// Rebuild cache
if ($GLOBALS['cache_instance']->loadCacheFile($cache)) {
// Destroy it
- $GLOBALS['cache_instance']->removeCacheFile(false, $force);
+ $GLOBALS['cache_instance']->removeCacheFile($force);
} // END - if
// Include file given?
'ENTER_ADMIN_PASS' => "Passwort zum Admin-Account",
'ADMIN_LOGIN_SUBMIT' => "Einloggen zum Admin-Bereich",
'WRONG_PASS' => "Falsches Passwort!",
- 'ADMIN_404' => "Administrator-Account wurde nicht gefunden!",
+ 'ADMIN_404' => "Administrator-Account <strong>%s</strong> wurde nicht gefunden!",
'ADMIN_LOGIN_FAILED' => "Einloggen in den Administrator-Bereich fehlgeschlagen!",
'CANNOT_REGISTER_SESS' => "Konnte eine Sitzungsvariable nicht setzen! Vermutlich sind bei Ihnen Cookies deaktiviert.",
'SELECT_TIMEOUT' => "Gütigkeitsdauer des Auto-Logins",
'ENTER_ADMIN_PASS' => "Password",
'ADMIN_LOGIN_SUBMIT' => "Login to admin-area",
'WRONG_PASS' => "Wrong password.",
- 'ADMIN_404' => "Administrator account not found.",
+ 'ADMIN_404' => "Administrator account <strong>%s</strong> not found.",
'ADMIN_LOGIN_FAILED' => "Login into admin-area failed!",
'CANNOT_REGISTER_SESS' => "Cannot register session cookies. Maybe you have deactivated cookies?",
'SELECT_TIMEOUT' => "Expiration time for automated login",
if (!isCacheInstanceValid()) return $data;
// Remove cache
- foreach (array('config','extensions','modreg') as $cache) {
- if ($GLOBALS['cache_instance']->loadCacheFile($cache)) $GLOBALS['cache_instance']->removeCacheFile(false);
+ foreach (array('config','extensions','modules') as $cache) {
+ if ($GLOBALS['cache_instance']->loadCacheFile($cache)) $GLOBALS['cache_instance']->removeCacheFile();
} // END - foreach
// Return it
if (!isCacheInstanceValid()) return false;
// Remove cache
- if ($GLOBALS['cache_instance']->loadCacheFile('admins')) $GLOBALS['cache_instance']->removeCacheFile(false);
+ if ($GLOBALS['cache_instance']->loadCacheFile('admins')) $GLOBALS['cache_instance']->removeCacheFile();
// Return the data
return $data;
if (!isCacheInstanceValid()) return false;
// Remove cache files
- foreach (array('admins','admins_acls','config','extensions','modreg','refdepths','refsystem','themes','revision','filter','imprint') as $cache) {
+ foreach (array('admin','admin_acls','config','extensions','modules','refdepths','refsystem','themes','revision','filter','imprint') as $cache) {
/* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Trying to remove cache %s.", $cache));
- if ($GLOBALS['cache_instance']->loadCacheFile($cache)) $GLOBALS['cache_instance']->removeCacheFile(false);
+ if ($GLOBALS['cache_instance']->loadCacheFile($cache)) $GLOBALS['cache_instance']->removeCacheFile();
} // END - foreach
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
}
if ((!isCacheInstanceValid()) || (getConfig('update_filter_usage') != 'Y')) return false;
// Remove cache files
- if ($GLOBALS['cache_instance']->loadCacheFile('filter')) $GLOBALS['cache_instance']->removeCacheFile(false);
+ if ($GLOBALS['cache_instance']->loadCacheFile('filter')) $GLOBALS['cache_instance']->removeCacheFile();
}
// [EOF]
//* DEBUG: */ outputHtml("id={$id},userid={$userid},userid={$userid},old={$old},level={$GLOBALS['cache_array']['refsystem']['level'][$id]}<br />");
if (($userid == $userid) && ($GLOBALS['cache_array']['refsystem']['level'][$id] == 1)) {
//* DEBUG: */ outputHtml("userid matches!<br />");
- foreach ($GLOBALS['cache_array']['ref_depths']['level'] as $level) {
+ foreach ($GLOBALS['cache_array']['refdepths']['level'] as $level) {
if (($level == $GLOBALS['cache_array']['refsystem']['level'][$id]) && ($level == 1)) {
// Level does exist so abort here
$cnt = $GLOBALS['cache_array']['refsystem']['counter'][$id];
$GLOBALS['cache_array']['foo'] = $GLOBALS['cache_instance']->getArrayFromCache();
} elseif (getOutputMode() != '1') {
// Create cache file
- $GLOBALS['cache_instance']->init('FOO');
+ $GLOBALS['cache_instance']->init();
// Load every data from DB to cache file
$add = runFilterChain('sql_admin_extra_data');
// Close cache
$GLOBALS['cache_instance']->storeExtensionVersion('foo');
$GLOBALS['cache_instance']->finalize();
-
- // Include loader again
- loadInclude('inc/loader/'.basename(__FILE__));
}
// [EOF]
if (isInstallationPhase()) return;
// Let's start with the admins table...
-if (($GLOBALS['cache_instance']->loadCacheFile('admins')) && ($GLOBALS['cache_instance']->extensionVersionMatches('admins'))) {
+if (($GLOBALS['cache_instance']->loadCacheFile('admin')) && ($GLOBALS['cache_instance']->extensionVersionMatches('admins'))) {
// Load cache
- $GLOBALS['cache_array']['admins'] = $GLOBALS['cache_instance']->getArrayFromCache();
+ $GLOBALS['cache_array']['admin'] = $GLOBALS['cache_instance']->getArrayFromCache();
// Check if valid
- if ((isset($GLOBALS['cache_array']['admins']['login'])) && (is_array($GLOBALS['cache_array']['admins']['login'])) && (is_array($GLOBALS['cache_array']['admins']['admin_id']))) {
+ if ((isset($GLOBALS['cache_array']['admin']['login'])) && (is_array($GLOBALS['cache_array']['admin']['login'])) && (is_array($GLOBALS['cache_array']['admin']['admin_id']))) {
// Check count
- if (count($GLOBALS['cache_array']['admins']['login']) == count($GLOBALS['cache_array']['admins']['admin_id'])) {
- // Get "id map"
- $idMap = $GLOBALS['cache_array']['admins']['admin_id'];
-
- // Rewrite the cache array
- for ($idx = (count($idMap) - 1); $idx >= 0; $idx--) {
+ if (count($GLOBALS['cache_array']['admin']['login']) == count($GLOBALS['cache_array']['admin']['admin_id'])) {
+ // Rewrite the cache
+ $admins = array();
+ foreach ($GLOBALS['cache_array']['admin']['login'] as $idx=>$admin) {
// Rewrite all entries
- foreach ($GLOBALS['cache_array']['admins'] as $key=>$entryArray) {
- // Rewrite the entry
- if ($key == 'admin_id') {
- // Rewrite admin id (use login name as index)
- $GLOBALS['cache_array']['admins']['admin_id'][$GLOBALS['cache_array']['admins']['login'][$idx]] = $entryArray[$idx];
+ 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 {
- // Rewrite regular entry
- $GLOBALS['cache_array']['admins'][$key][$idMap[$idx]] = $entryArray[$idx];
+ // Regular entry so use login
+ $admins[$key][$GLOBALS['cache_array']['admin']['login'][$idx]] = $entry[$idx];
}
+ } // END - foreach
+ } // END - foreach
- // Is the last entry reached?
- if ($idx == 0) {
- // Remove it
- unset($GLOBALS['cache_array']['admins'][$key][0]);
- } // END - if
- } // END - if
- } // END - for
+ // Transfer back to cache array and remove dummy
+ $GLOBALS['cache_array']['admin'] = $admins;
+ unset($admins);
} else {
// Nope, cache file is corrupted!
$GLOBALS['cache_instance']->removeCacheFile();
- unset($GLOBALS['cache_array']['admins']);
+ unset($GLOBALS['cache_array']['admin']);
}
} else {
// Nope, cache file is corrupted!
$GLOBALS['cache_instance']->removeCacheFile();
- unset($GLOBALS['cache_array']['admins']);
+ unset($GLOBALS['cache_array']['admin']);
}
} elseif (getOutputMode() != '1') {
// Create cache file
- $GLOBALS['cache_instance']->init('ADMINS');
+ $GLOBALS['cache_instance']->init();
// Load every data from DB to cache file
$add = runFilterChain('sql_admin_extra_data');
// Close cache
$GLOBALS['cache_instance']->storeExtensionVersion('admins');
$GLOBALS['cache_instance']->finalize();
-
- // Include loader again
- loadInclude('inc/loader/'.basename(__FILE__));
}
// Next cached table are the admins_acls...
if (isExtensionInstalledAndNewer('admins', '0.3')) {
// Check for cache file
- if (($GLOBALS['cache_instance']->loadCacheFile('admins_acls')) && ($GLOBALS['cache_instance']->extensionVersionMatches('admins'))) {
+ if (($GLOBALS['cache_instance']->loadCacheFile('admin_acls')) && ($GLOBALS['cache_instance']->extensionVersionMatches('admins'))) {
// Load referal system from cache
$GLOBALS['cache_array']['admin_acls'] = $GLOBALS['cache_instance']->getArrayFromCache();
} elseif (getOutputMode() != '1') {
// Create cache file here
- $GLOBALS['cache_instance']->init('ADMINS_ACLS');
+ $GLOBALS['cache_instance']->init();
// Load all modules and their data (column 'id' is no longer required)
$result = SQL_QUERY('SELECT `admin_id`, `action_menu`, `what_menu`, `access_mode` FROM `{?_MYSQL_PREFIX?}_admins_acls` ORDER BY admin_id, action_menu, what_menu', __FILE__, __LINE__);
// Close cache
$GLOBALS['cache_instance']->storeExtensionVersion('admins');
$GLOBALS['cache_instance']->finalize();
-
- // Include loader again
- loadInclude('inc/loader/'.basename(__FILE__));
}
} // END - if
// Next cached table is the configuration (config)...
if (($GLOBALS['cache_instance']->loadCacheFile('config')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) {
// Load config from cache
- $GLOBALS['cache_array']['config'] = $GLOBALS['cache_instance']->getArrayFromCache();
+ $config = $GLOBALS['cache_instance']->getArrayFromCache();
// Swap cache
- $config = array();
- foreach ($GLOBALS['cache_array']['config'] as $entry => $array) {
+ foreach ($config as $entry => $array) {
// All config levels
foreach ($array as $key => $value) {
- $config[$key][$entry] = $value;
+ $GLOBALS['cache_array']['config'][$key][$entry] = $value;
} // END - foreach
} // END - foreach
- // Copy it back and remove dummy array
- $GLOBALS['cache_array']['config'] = $config;
+ // Remove dummy array
unset($config);
} elseif (getOutputMode() != '1') {
// Create cache file here
- $GLOBALS['cache_instance']->init('CONFIG');
+ $GLOBALS['cache_instance']->init();
// Load all modules and their data
$result = SQL_QUERY('SELECT * FROM `{?_MYSQL_PREFIX?}_config` ORDER BY `config` ASC', __FILE__, __LINE__);
// Close the cache
$GLOBALS['cache_instance']->storeExtensionVersion('sql_patches');
$GLOBALS['cache_instance']->finalize();
-
- // Include loader again
- loadInclude('inc/loader/'.basename(__FILE__));
}
// [EOF]
unset($EXT_POOL);
} elseif (getOutputMode() != '1') {
// Create cache file here
- $GLOBALS['cache_instance']->init('extension');
+ $GLOBALS['cache_instance']->init();
// Add more if sql_patches is recent enougth
$add = '';
// Close the cache
$GLOBALS['cache_instance']->storeExtensionVersion('sql_patches');
$GLOBALS['cache_instance']->finalize();
-
- // Include loader again
- loadInclude('inc/loader/'.basename(__FILE__));
}
// [EOF]
$GLOBALS['cache_array']['filter'] = $GLOBALS['cache_instance']->getArrayFromCache();
} elseif ((getOutputMode() != '1') && (isExtensionInstalled('sql_patches'))) {
// Create cache file here
- $GLOBALS['cache_instance']->init('FILTER');
+ $GLOBALS['cache_instance']->init();
// Load all modules and their data
$result = SQL_QUERY('SELECT * FROM `{?_MYSQL_PREFIX?}_filters` ORDER BY `filter_name` ASC, `filter_id` ASC', __FILE__, __LINE__);
// Close the cache
$GLOBALS['cache_instance']->storeExtensionVersion('sql_patches');
$GLOBALS['cache_instance']->finalize();
-
- // Include loader again
- loadInclude('inc/loader/'.basename(__FILE__));
}
// [EOF]
$GLOBALS['cache_array']['imprint'] = $GLOBALS['cache_instance']->getArrayFromCache();
} elseif (getOutputMode() != '1') {
// Create cache file
- $GLOBALS['cache_instance']->init('imprint');
+ $GLOBALS['cache_instance']->init();
// Load every data from DB to cache file
$add = runFilterChain('sql_admin_extra_data');
// Close cache
$GLOBALS['cache_instance']->storeExtensionVersion('imprint');
$GLOBALS['cache_instance']->finalize();
-
- // Include loader again
- loadInclude('inc/loader/'.basename(__FILE__));
}
// [EOF]
unset($modArray);
} elseif (getOutputMode() != '1') {
// Create cache file here
- $GLOBALS['cache_instance']->init('MODULES');
+ $GLOBALS['cache_instance']->init();
// Load all modules and their data
if (isExtensionInstalledAndNewer('sql_patches', '0.3.6')) {
// Close the cache
$GLOBALS['cache_instance']->storeExtensionVersion('sql_patches');
$GLOBALS['cache_instance']->finalize();
-
- // Include loader again
- loadInclude('inc/loader/'.basename(__FILE__));
}
// [EOF]
// Next cached table is the referal system (refdepths)...
if (($GLOBALS['cache_instance']->loadCacheFile('refdepths')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) {
// Load referal system from cache
- $GLOBALS['cache_array']['ref_depths'] = $GLOBALS['cache_instance']->getArrayFromCache();
+ $GLOBALS['cache_array']['refdepths'] = $GLOBALS['cache_instance']->getArrayFromCache();
} elseif (getOutputMode() != '1') {
// Create cache file here
- $GLOBALS['cache_instance']->init('REFDEPTHS');
+ $GLOBALS['cache_instance']->init();
// Load all modules and their data
$result = SQL_QUERY('SELECT id, level, percents FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY level', __FILE__, __LINE__);
// Close the cache
$GLOBALS['cache_instance']->storeExtensionVersion('sql_patches');
$GLOBALS['cache_instance']->finalize();
-
- // Include loader again
- loadInclude('inc/loader/'.basename(__FILE__));
}
// [EOF]
$GLOBALS['cache_array']['refsystem'] = $GLOBALS['cache_instance']->getArrayFromCache();
} elseif (getOutputMode() != '1') {
// Create cache file here
- $GLOBALS['cache_instance']->init('REFSYSTEM');
+ $GLOBALS['cache_instance']->init();
// Load all modules and their data
$result = SQL_QUERY('SELECT id, userid, level, counter FROM `{?_MYSQL_PREFIX?}_refsystem` ORDER BY userid, level', __FILE__, __LINE__);
// Close the cache
$GLOBALS['cache_instance']->storeExtensionVersion('sql_patches');
$GLOBALS['cache_instance']->finalize();
-
- // Include loader again
- loadInclude('inc/loader/'.basename(__FILE__));
}
// [EOF]
$GLOBALS['cache_array']['revision'] = $GLOBALS['cache_instance']->getArrayFromCache();
} elseif ((getOutputMode() != '1')) {
// Create cache file here
- $GLOBALS['cache_instance']->init('revision');
+ $GLOBALS['cache_instance']->init();
// add the new RevInfos in and saves it to the cache
$GLOBALS['cache_instance']->addRow(getArrayFromActualVersion());
$GLOBALS['cache_instance']->finalize();
// Generate FQFN for old revision file
- $FQFN = sprintf("%s%s/.revision", getConfig('PATH'), getConfig('CACHE_PATH'));
+ $FQFN = sprintf("%s/.revision", getConfig('CACHE_PATH'));
// Is it there?
if (isFileReadable($FQFN)) {
// Then remove it
removeFile($FQFN);
} // END - if
-
- // Include loader again
- loadInclude('inc/loader/'.basename(__FILE__));
}
// [EOF]
unset($cache);
} elseif (getOutputMode() != '1') {
// Create cache file here
- $GLOBALS['cache_instance']->init('THEMES');
+ $GLOBALS['cache_instance']->init();
// Load all themes and their data
if (getExtensionVersion('theme') >= '0.0.7') {
// Close the cache
$GLOBALS['cache_instance']->storeExtensionVersion('theme');
$GLOBALS['cache_instance']->finalize();
-
- // Include loader again
- loadInclude('inc/loader/'.basename(__FILE__));
}
// [EOF]
case '404': // Administrator login not found
setRequestPostElement('ok', $ret);
- $ret = getMessage('ADMIN_404');
+ $ret = sprintf(getMessage('ADMIN_404'), postRequestElement('login'));
destroyAdminSession();
break;
} else {
// Maybe an Admin want's to login?
$ret = ifAdminCookiesAreValid(getSession('admin_login'), getSession('admin_md5'));
- switch ($ret)
- {
+
+ // Check status
+ switch ($ret) {
case 'done':
// Check for access control line of current menu entry
- $GLOBALS['acl_allow'] = runFilterChain('check_admin_acl');
+ runFilterChain('check_admin_acl');
// When type of admin menu is not set fallback to old menu system
if (!isConfigEntrySet('admin_menu')) setConfigEntry('admin_menu', 'OLD');
loadIncludeOnce('inc/modules/admin/lasys-inc.php');
// Create new-style menu system will logical areas
- ADMIN_LOGICAL_AREA_SYSTEM($area, $action, getWhat());
+ doAdminLogicalArea($area, $action, getWhat());
} else {
// This little call constructs the whole default old and lacky menu system
// on left side. It also renders the content on right side
case '404': // Administrator login not found
setRequestPostElement('ok', $ret);
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('ADMIN_404'), getSession('admin_login')));
destroyAdminSession();
- addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_404'));
break;
case 'pass': // Wrong password
setRequestPostElement('ok', $ret);
- destroyAdminSession();
addFatalMessage(__FILE__, __LINE__, getMessage('WRONG_PASS'));
+ destroyAdminSession();
break;
default: // Others will be logged
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown return code %s from ifAdminCookiesAreValid()", $ret));
break;
- }
+ } // END - switch
}
// [EOF]
// Some security stuff...
if (!defined('__SECURITY')) {
die();
-}
+} // END - if
// Register an administrator account
function addAdminAccount ($user, $md5, $email) {
}
// Only be executed on login procedure!
-function ifAdminLoginDataIsValid ($admin_login, $password) {
+function ifAdminLoginDataIsValid ($admin, $password) {
// By default no admin is found
$ret = '404';
// Get admin id
- $adminId = getAdminId($admin_login);
+ $adminId = getAdminId($admin);
// Init array with admin id by default
$data = array('admin_id' => $adminId);
// Is the cache valid?
- if (isset($GLOBALS['cache_array']['admins']['password'][$adminId])) {
+ if (isAdminHashSet($admin)) {
// Get password from cache
- $data['password'] = $GLOBALS['cache_array']['admins']['password'][$adminId];
+ $data['password'] = getAdminHash($admin);
$ret = 'pass';
incrementStatsEntry('cache_hits');
// Include more admins data?
- if (isExtensionInstalledAndNewer('admins', '0.7.2')) {
+ if ((isExtensionInstalledAndNewer('admins', '0.7.2')) && (isset($GLOBALS['cache_array']['admin']['login_failures'][$adminId]))) {
// Load them here
- $data['login_failures'] = $GLOBALS['cache_array']['admins']['login_failures'][$adminId];
- $data['last_failure'] = $GLOBALS['cache_array']['admins']['last_failure'][$adminId];
+ $data['login_failures'] = $GLOBALS['cache_array']['admin']['login_failures'][$adminId];
+ $data['last_failure'] = $GLOBALS['cache_array']['admin']['last_failure'][$adminId];
} // END - if
} elseif (!isExtensionActive('cache')) {
// Add extra data via filter now
// Do we have 0.7.0 of admins or later?
// Remmeber login failures if available
- if (isExtensionInstalledAndNewer('admins', '0.7.2')) {
+ if ((isExtensionInstalledAndNewer('admins', '0.7.2')) && (isset($data['login_failures']))) {
// Store it in session
setSession('mxchange_admin_failures', $data['login_failures']);
setSession('mxchange_admin_last_fail', $data['last_failure']);
// Update password and reset login failures
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET password='%s',login_failures=0,last_failure='0000-00-00 00:00:00' WHERE `id`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `password`='%s',`login_failures`=0,`last_failure`='0000-00-00 00:00:00' WHERE `id`=%s LIMIT 1",
array($data['password'], $adminId), __FUNCTION__, __LINE__);
} else {
// Update password
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET password='%s' WHERE `id`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `password`='%s' WHERE `id`=%s LIMIT 1",
array($data['password'], $adminId), __FUNCTION__, __LINE__);
}
// Rebuild cache
- rebuildCacheFile('admins', 'admin');
+ rebuildCacheFile('admin', 'admin');
// Login has failed by default... ;-)
$ret = 'failed1';
// Password matches so login here
- if (doAdminLogin($admin_login, $data['password'])) {
+ if (doAdminLogin($admin, $data['password'])) {
// All done now
$ret = 'done';
} // END - if
$ret = 'failed_salt';
} elseif ($ret == 'done') {
// Try to login here if we have the old hashing way (sql_patches not installed?)
- if (!doAdminLogin($admin_login, $data['password'])) {
+ if (!doAdminLogin($admin, $data['password'])) {
// Something went wrong
$ret = 'failed2';
} // END - if
array($adminId), __FUNCTION__, __LINE__);
// Rebuild cache
- rebuildCacheFile('admins', 'admin');
+ rebuildCacheFile('admin', 'admin');
} // END - if
// Return the result
array($adminLogin), __FUNCTION__, __LINE__);
// Rebuild cache
- rebuildCacheFile('admins', 'admin');
+ rebuildCacheFile('admin', 'admin');
} // END - if
// Now set all session variables and return the result
}
// Only be executed on cookie checking
-function ifAdminCookiesAreValid ($admin_login, $password) {
+function ifAdminCookiesAreValid ($admin, $password) {
// By default no admin cookies are found
$ret = '404';
$pass = '';
// Get hash
- $pass = getAdminHash(getAdminId($admin_login));
+ $pass = getAdminHash($admin);
if ($pass != '-1') $ret = 'pass';
//* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")<br />");
$adminId = getCurrentAdminId();
// Check individual settings of current admin
- if (isset($GLOBALS['cache_array']['admins']['la_mode'][$adminId])) {
+ if (isset($GLOBALS['cache_array']['admin']['la_mode'][$adminId])) {
// Load from cache
- $ADMIN = $GLOBALS['cache_array']['admins']['la_mode'][$adminId];
+ $ADMIN = $GLOBALS['cache_array']['admin']['la_mode'][$adminId];
incrementStatsEntry('cache_hits');
} elseif (isExtensionInstalledAndNewer('admins', '0.6.7')) {
// Load from database when version of 'admins' is enough
return '{?URL?}/modules.php?module=admin&what=list_user';
}
+// -----------------------------------------------------------------------------
+// --- Filter functions ---
+// -----------------------------------------------------------------------------
+
+// Filter for checking admin ACL
+function FILTER_CHECK_ADMIN_ACL () {
+ // Extension not installed so it's always allowed to access everywhere!
+ $ret = true;
+
+ // Ok, Cookie-Update done
+ if ((isExtensionInstalledAndNewer('admins', '0.3.0')) && (isExtensionActive('admins'))) {
+ // Check if action GET variable was set
+ $action = getAction();
+ if (isWhatSet()) {
+ // Get action value by what-value
+ $action = getModeAction('admin', getWhat());
+ } // END - if
+
+ // Check for access control line of current menu entry
+ $ret = adminsCheckAdminAcl($action, getWhat());
+ } // END - if
+
+ // Set it here
+ $GLOBALS['acl_allow'] = $ret;
+}
+
// [EOF]
?>
$SEL = countPostSelection();
if ($SEL > 0) {
// Add option for events
- $GLOBALS['cache_array']['admins'] = generateOptionList('admins', 'id', 'login', '', 'email');
+ $adminsList = generateOptionList('admins', 'id', 'login', '', 'email');
$SW = 2; $rowNameS = '';
foreach (postRequestElement('sel') as $template => $sel) {
// First of all load data from DB
- $result = SQL_QUERY_ESC("SELECT admin_id, id FROM `{?_MYSQL_PREFIX?}_admins_mails` WHERE mail_template='%s' ORDER BY `id`",
- array($template), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `admin_id`, `id` FROM `{?_MYSQL_PREFIX?}_admins_mails` WHERE `mail_template`='%s' ORDER BY `id` ASC",
+ array($template), __FILE__, __LINE__);
$OUT = ''; $adminId2 = 0;
while ($content = SQL_FETCHARRAY($result)) {
// @TODO Can this be rewritten???
// Free memory
SQL_FREERESULT($result);
+ // Prepare content
$content = array(
'sw' => $SW,
'id' => $id,
'id2' => $id2,
'tpl' => $template,
- 'admins' => $GLOBALS['cache_array']['admins']
+ 'admins' => $adminsList
);
if ($adminId2 > 0) {
// Add form for an additional admin
$OUT .= loadTemplate('admin_admins_mails_edit_form', true, $content);
- }
+ } // END - if
// Save full rendered content
$content['content'] = $OUT;
}
} else {
// Load all assigned mails
- $result = SQL_QUERY("SELECT m.id, m.admin_id, a.login, m.mail_template
-FROM `{?_MYSQL_PREFIX?}_admins_mails` AS m
-LEFT JOIN `{?_MYSQL_PREFIX?}_admins` AS a
-ON m.admin_id=a.id
-WHERE (m.admin_id=a.id OR m.admin_id < 1) AND m.mail_template != ''
-ORDER BY m.admin_id, m.mail_template", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT
+ m.id, m.admin_id, a.login, m.mail_template
+FROM
+ `{?_MYSQL_PREFIX?}_admins_mails` AS m
+LEFT JOIN
+ `{?_MYSQL_PREFIX?}_admins` AS a
+ON
+ m.admin_id=a.id
+WHERE
+ (m.admin_id=a.id OR m.admin_id < 1) AND m.mail_template != ''
+ORDER BY
+ m.admin_id ASC,
+ m.mail_template ASC", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Shall I change entries?
// Update cache when installed
if (isExtensionActive('cache')) {
- if ($GLOBALS['cache_instance']->loadCacheFile('admins_acls')) $GLOBALS['cache_instance']->removeCacheFile();
+ if ($GLOBALS['cache_instance']->loadCacheFile('admin_acls')) $GLOBALS['cache_instance']->removeCacheFile();
} // END - if
// Entries changed
// Update cache when installed
if (isExtensionActive('cache')) {
- if ($GLOBALS['cache_instance']->loadCacheFile('admins_acls')) $GLOBALS['cache_instance']->removeCacheFile();
+ if ($GLOBALS['cache_instance']->loadCacheFile('admin_acls')) $GLOBALS['cache_instance']->removeCacheFile();
} // END - if
// Entries deleted
// Update cache when installed
if (isExtensionActive('cache')) {
- if ($GLOBALS['cache_instance']->loadCacheFile('admins_acls')) $GLOBALS['cache_instance']->removeCacheFile();
+ if ($GLOBALS['cache_instance']->loadCacheFile('admin_acls')) $GLOBALS['cache_instance']->removeCacheFile();
} // END - if
} else {
// ACL does already exist!
// Destroy cache here
// @TODO Rewrite this to a filter
- if (getOutputMode() == '0') rebuildCacheFile('modreg', 'modreg');
+ if (getOutputMode() == '0') rebuildCacheFile('modules', 'modules');
// And reload data
unset($GLOBALS['module_status'][$mod]);
}
} elseif (($ret == 'cache_miss') && (getOutputMode() == 0)) {
// Rebuild the cache files
- rebuildCacheFile('modreg', 'modreg');
+ rebuildCacheFile('modules', 'modules');
} elseif ($found === false) {
// Problem with module detected
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Problem in module %s detected. ret=%s, locked=%s, hidden=%s, mem=%s, admin=%s, output_mode=%s",
// Get admin login and password from session/cookies
$admin = getSession('admin_login');
$passCookie = getSession('admin_md5');
- }
+ } // END - if
//* DEBUG: */ outputHtml(__LINE__."ADMIN:".$admin.'/'.$passCookie."<br />");
// Search in array for entry
if (isset($GLOBALS['admin_hash'])) {
// Use cached string
$valPass = $GLOBALS['admin_hash'];
- } elseif ((!empty($passCookie)) && (isset($GLOBALS['cache_array']['admins']['password'][$admin])) && (!empty($admin))) {
+ } elseif ((!empty($passCookie)) && (isAdminHashSet($admin) === true) && (!empty($admin))) {
// Login data is valid or not?
- $valPass = generatePassString($GLOBALS['cache_array']['admins']['password'][$admin]);
+ $valPass = generatePassString(getAdminHash($admin));
// Cache it away
$GLOBALS['admin_hash'] = $valPass;
// Count cache hits
incrementStatsEntry('cache_hits');
- } elseif ((!empty($admin)) && ((!isExtensionActive('cache'))) || (!isset($GLOBALS['cache_array']['admins']['password'][$admin]))) {
+ } elseif ((!empty($admin)) && ((!isExtensionActive('cache'))) || (isAdminHashSet($admin) === false)) {
// Search for admin
$result = SQL_QUERY_ESC("SELECT HIGH_PRIORITY `password` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
array($admin), __FUNCTION__, __LINE__);
list($passDB) = SQL_FETCHROW($result);
// Temporary cache it
- $GLOBALS['cache_array']['admins']['password'][$admin] = $passDB;
+ setAdminHash($admin, $passDB);
// Generate password hash
$valPass = generatePassString($passDB);
if (!empty($valPass)) {
// Check if password is valid
- //* DEBUG: */ outputHtml(__FUNCTION__."*".$valPass.'/'.$passCookie."*<br />");
- $ret = (($valPass == $passCookie) || ((strlen($valPass) == 32) && ($valPass == md5($passCookie))) || (($valPass == "*FAILED*") && (!isExtensionActive('cache'))));
+ //* DEBUG: */ print(__FUNCTION__ . ':' . $valPass . '/' . $passCookie . '<br />');
+ $ret = (($valPass == $passCookie) || ((strlen($valPass) == 32) && ($valPass == md5($passCookie))) || (($valPass == '*FAILED*') && (!isExtensionActive('cache'))));
} // END - if
// Return result of comparision
$per = 0;
// Do we have cache?
- if ((isset($GLOBALS['cache_array']['ref_depths']['level'])) && (isExtensionActive('cache'))) {
+ if ((isset($GLOBALS['cache_array']['refdepths']['level'])) && (isExtensionActive('cache'))) {
// First look for level
- $key = array_search($level, $GLOBALS['cache_array']['ref_depths']['level']);
+ $key = array_search($level, $GLOBALS['cache_array']['refdepths']['level']);
if ($key !== false) {
// Entry found!
- $per = $GLOBALS['cache_array']['ref_depths']['percents'][$key];
+ $per = $GLOBALS['cache_array']['refdepths']['percents'][$key];
// Count cache hit
incrementStatsEntry('cache_hits');
- }
+ } // END - if
} elseif (!isExtensionActive('cache')) {
// Get referal data
- $result_level = SQL_QUERY_ESC("SELECT percents FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE level='%s' LIMIT 1",
+ $result_level = SQL_QUERY_ESC("SELECT `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `level`='%s' LIMIT 1",
array(bigintval($level)), __FUNCTION__, __LINE__);
// Entry found?
$ret = '-1';
// Check cache
- if (isset($GLOBALS['cache_array']['admins']['admin_id'][$login])) {
+ if (isset($GLOBALS['cache_array']['admin']['admin_id'][$login])) {
// Use it if found to save SQL queries
- $ret = $GLOBALS['cache_array']['admins']['admin_id'][$login];
+ $ret = $GLOBALS['cache_array']['admin']['admin_id'][$login];
// Update cache hits
incrementStatsEntry('cache_hits');
}
// Get password hash from administrator's login name
-function getAdminHash ($adminId) {
+function getAdminHash ($admin) {
// By default an invalid hash is returned
$ret = '-1';
- if (isset($GLOBALS['cache_array']['admins']['password'][$adminId])) {
+ if (isAdminHashSet($admin)) {
// Check cache
- $ret = $GLOBALS['cache_array']['admins']['password'][$adminId];
+ $ret = $GLOBALS['cache_array']['admin']['password'][$admin];
// Update cache hits
incrementStatsEntry('cache_hits');
} elseif (!isExtensionActive('cache')) {
// Load from database
$result = SQL_QUERY_ESC("SELECT password FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
- array($adminId), __FUNCTION__, __LINE__);
+ array($admin), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Fetch data
list($ret) = SQL_FETCHROW($result);
// Set cache
- $GLOBALS['cache_array']['admins']['password'][$adminId] = $ret;
+ setAdminHash($admin, $ret);
} // END - if
// Free result
// By default a non-existent login is returned (other functions react on this!)
$ret = '***';
- if (isset($GLOBALS['cache_array']['admins']['login'][$adminId])) {
+ if (isset($GLOBALS['cache_array']['admin']['login'][$adminId])) {
// Get cache
- $ret = $GLOBALS['cache_array']['admins']['login'][$adminId];
+ $ret = $GLOBALS['cache_array']['admin']['login'][$adminId];
// Update cache hits
incrementStatsEntry('cache_hits');
list($ret) = SQL_FETCHROW($result);
// Set cache
- $GLOBALS['cache_array']['admins']['login'][$adminId] = $ret;
+ $GLOBALS['cache_array']['admin']['login'][$adminId] = $ret;
} // END - if
// Free memory
// By default an invalid emails is returned
$ret = '***';
- if (isset($GLOBALS['cache_array']['admins']['email'][$adminId])) {
+ if (isset($GLOBALS['cache_array']['admin']['email'][$adminId])) {
// Get cache
- $ret = $GLOBALS['cache_array']['admins']['email'][$adminId];
+ $ret = $GLOBALS['cache_array']['admin']['email'][$adminId];
// Update cache hits
incrementStatsEntry('cache_hits');
list($ret) = SQL_FETCHROW($result_admin_id);
// Set cache
- $GLOBALS['cache_array']['admins']['email'][$adminId] = $ret;
+ $GLOBALS['cache_array']['admin']['email'][$adminId] = $ret;
} // END - if
// Free result
if (!isExtensionActive('sql_patches')) {
// Not found, which is bad, so we need to allow all
$ret = 'allow';
- } elseif (isset($GLOBALS['cache_array']['admins']['def_acl'][$adminId])) {
+ } elseif (isset($GLOBALS['cache_array']['admin']['def_acl'][$adminId])) {
// Use cache
- $ret = $GLOBALS['cache_array']['admins']['def_acl'][$adminId];
+ $ret = $GLOBALS['cache_array']['admin']['def_acl'][$adminId];
// Update cache hits
incrementStatsEntry('cache_hits');
list($ret) = SQL_FETCHROW($result_admin_id);
// Set cache
- $GLOBALS['cache_array']['admins']['def_acl'][$adminId] = $ret;
+ $GLOBALS['cache_array']['admin']['def_acl'][$adminId] = $ret;
}
// Free result
updateConfiguration('activate_xchange' ,0);
// Rebuild cache
- rebuildCacheFile('modreg', 'modreg');
+ rebuildCacheFile('modules', 'modules');
} // END - if
}
return $GLOBALS['php_caching'];
}
+// Checks wether the admin hash is set
+function isAdminHashSet ($admin) {
+ return isset($GLOBALS['cache_array']['admin']['password'][$admin]);
+}
+
+// Setter for admin hash
+function setAdminHash ($admin, $hash) {
+ $GLOBALS['cache_array']['admin']['password'][$admin] = $hash;
+}
+
// [EOF]
?>
'id' => $nextId,
'check' => SURFBAR_GENERATE_VALIDATION_CODE($nextId),
'salt' => SURFBAR_GET_SALT(),
- 'points' => translateComma(SURFBAR_GET_REWARD($nextId)),
+ 'reward' => translateComma(SURFBAR_GET_REWARD($nextId)),
'url' => SURFBAR_GET_URL($nextId),
'curr_reload' => SURFBAR_GET_USER_LOCKS(),
'max_urls' => SURFBAR_GET_TOTAL_URLS(),
function InitCounter() {
parent.surfbar_url.location.href = "$content[url]";
counter.innerHTML = '$content[reload]';
- points.innerHTML = '$content[points]';
+ points.innerHTML = '$content[reward]';
reload.innerHTML = '$content[curr_reload]';
max.innerHTML = '$content[max_urls]';
}