./inc/modules/member/what-unconfirmed.php:206: // @TODO This 'userid' cannot be saved because of encapsulated EL code
./inc/modules/order.php:74: // @TODO Unused: 2,4
./inc/monthly/monthly_bonus.php:67: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1195: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1453: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1559: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1933: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1977:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/mysql-manager.php:1197: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1455: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:1561: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1935: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1979:// @TODO Fix inconsistency between last_module and getWhat()
./inc/mysql-manager.php:368: // @TODO Try to rewrite this to one or more functions
./inc/mysql-manager.php:44:// @TODO Can we cache this?
./inc/revision-functions.php:169:// @TODO This function does also set and get in 'cache_array'
// Checks wether the given config entry is set
function isConfigEntrySet ($configEntry) {
- //* DEBUG: */ debugOutput(__FUNCTION__.':'.$configEntry.'='.intval(isset($GLOBALS['config'][$configEntry])));
+ //* DEBUG: */ debugOutput(__FUNCTION__ . ':' . $configEntry . '=' . intval(isset($GLOBALS['config'][$configEntry])));
return (isset($GLOBALS['config'][$configEntry]));
}
// GLOBAL: DEBUG-TEMPLATE-CACHE
setConfigEntry('DEBUG_TEMPLATE_CACHE', 'N');
+// CFG: SALT-LENGTH
+setConfigEntry('salt_length', 10);
+
// Connect to the database...
loadIncludeOnce('inc/mysql-connect.php');
$callback = 'doTemplate' . $data['callback'];
// Init replacer
- $replacer = '<!-- ['.__FUNCTION__.':'.__LINE__.'] Call-back function ' . $callback . ' does not exist. //-->';
+ $replacer = '<!-- [' . __FUNCTION__ . ':' . __LINE__.'] Call-back function ' . $callback . ' does not exist. //-->';
// Is the function there?
if (function_exists($callback)) {
// Updates a given extension with current extension version to latest version
function updateExtension ($ext_name, $ext_ver, $dry_run = false) {
// Only admins are allowed to update extensions
- if ((!isAdmin()) || (empty($ext_name))) return false;
+ if ((!isAdmin()) || (empty($ext_name))) {
+ return false;
+ } // END - if
// Set current SQL name
setCurrentExtensionName($ext_name);
initExtensionSqls();
// Check if version is updated
- //* DEBUG: */ debugOutput(getCurrentExtensionName().'/'.$ext_name.':'.getThisExtensionVersion().'/'.$ext_ver.'/'.intval(is_array($history)));
+ //* DEBUG: */ debugOutput(getCurrentExtensionName() . '/' . $ext_name . ':' . getThisExtensionVersion() . '/' . $ext_ver . '/' . intval(is_array($history)));
if (((getThisExtensionVersion() != $ext_ver) || (isExtensionDryRun())) && (is_array($history))) {
// Search for starting point
$start = array_search($ext_ver, $history);
break;
case '0.3.6': // SQL queries for v0.3.6
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `salt_length` TINYINT(3) UNSIGNED NOT NULL DEFAULT 9");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `salt_length` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `pass_scramble` VARCHAR(255) NOT NULL DEFAULT ''");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` MODIFY `password` VARCHAR(255) NOT NULL DEFAULT ''");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `rand_no` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
// Look for file if no extension name is provided
$GLOBALS['lang_inc'][$ext_name] = isIncludeReadable($languageInclude);
- //* DEBUG: */ debugOutput(__FUNCTION__.':'.$ext_name.'='.$languageInclude.'='.intval(isIncludeReadable($languageInclude)));
+ //* DEBUG: */ debugOutput(__FUNCTION__ . ':' . $ext_name . '=' . $languageInclude . '=' . intval(isIncludeReadable($languageInclude)));
} // END - if
// Return it
// Generate hash code
$DATA['keys'][] = 'hash';
// @TODO Rewrite this to API function
- $DATA['values'][] = md5(session_id().':'.$postData['email'].':'.detectRemoteAddr().':'.detectUserAgent().':'.time());
+ $DATA['values'][] = md5(session_id() . getEncryptSeperator() . $postData['email'] . getEncryptSeperator() . detectRemoteAddr() . getEncryptSeperator() . detectUserAgent() . getEncryptSeperator() . time());
$DATA['keys'][] = 'remote_addr';
$DATA['values'][] = detectRemoteAddr();
}
// Generate hash code
// @TODO Rewrite this to API function
- $HASH = md5(session_id() . ':' . $postData['email'] . ':' . detectRemoteAddr() . ':' . detectUserAgent() . ':' . time());
+ $HASH = md5(session_id() . getEncryptSeperator() . $postData['email'] . getEncryptSeperator() . detectRemoteAddr() . getEncryptSeperator() . detectUserAgent() . getEncryptSeperator() . time());
$DATA[] = $HASH;
} // END - if
} // END - if
}
// ... and now the validation code
- $valCode = generateRandomCode($length, sha1(SURFBAR_GET_SALT().':'.$urlId), getMemberId());
+ $valCode = generateRandomCode($length, sha1(SURFBAR_GET_SALT() . getEncryptSeperator() . $urlId), getMemberId());
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'valCode='.valCode.'', false);
} // END - while
SQL_FREERESULT($result);
// Generate hash for reset link
- $content['hash'] = generateHash(getUrl() . ':' . $content['id'] . ':' . $content['login'] . ':' . $content['password'], substr($content['password'], 10));
+ $content['hash'] = generateHash(getUrl() . getEncryptSeperator() . $content['id'] . getEncryptSeperator() . $content['login'] . getEncryptSeperator() . $content['password'], substr($content['password'], getSaltLength()));
// Remove some data
unset($content['id']);
$content = SQL_FETCHARRAY($result);
// Generate hash again
- $hashFromData = generateHash(getUrl() . ':' . $content['id'] . ':' . $login . ':' . $content['password'], substr($content['password'], 10));
+ $hashFromData = generateHash(getUrl() . getEncryptSeperator() . $content['id'] . getEncryptSeperator() . $login . getEncryptSeperator() . $content['password'], substr($content['password'], getSaltLength()));
// Does both match?
$valid = ($hash == $hashFromData);
// No points repayed!
loadTemplate('admin_settings_saved', false, '{--ADMIN_NO_POINTS_REPAYED--}');
} elseif (getConfig('repay_deleted_mails') != 'SHRED') {
- //* DEBUG: */ debugOutput($stats_id.':'.$totalPoints.'/'.$links.'/'.$content['price']);
+ //* DEBUG: */ debugOutput($stats_id . ':' . $totalPoints . '/' . $links . '/' . $content['price']);
// Shall we payback to user or jackpot?
if (getConfig('repay_deleted_mails') == 'JACKPOT') {
// Set jackpot
`sort` ASC",
array($mode), __FUNCTION__, __LINE__);
- //* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.':'.getWhat().'*');
+ //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . ':' . getWhat() . '*');
if (!SQL_HASZERONUMS($result_main)) {
// There are menus available, so we simply display them... :)
$GLOBALS['rows'] = '';
if (isFileReadable($INC)) {
// Load include file
if ((!isExtensionActive($content['action'])) || ($content['action'] == 'online')) $GLOBALS['rows'] .= loadTemplate('menu_what_begin', true, $mode);
- //* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.getWhat().'*');
+ //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . '/' . $content['action'] . '/' . getWhat().'*');
loadInclude($INC);
- //* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.getWhat().'*');
+ //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . '/' . $content['action'] . '/' . getWhat() . '*');
if ((!isExtensionActive($content['action'])) || ($content['action'] == 'online')) $GLOBALS['rows'] .= loadTemplate('menu_what_end', true, $mode);
}
- //* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat().'*');
+ //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . '/' . $content['action'] . '/' . $content['sub_what'] . ':' . getWhat() . '*');
}
// Free result
// Count one up
$main_cnt++;
- //* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.':'.getWhat().'*');
+ //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . ':' . getWhat() . '*');
if (SQL_NUMROWS($result_main) > $main_cnt) {
// Add seperator
$GLOBALS['rows'] .= loadTemplate('menu_seperator', true, $mode);
);
// Load main template
- //* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat().'*');
+ //* DEBUG: */ debugOutput(__LINE__ . '/' . $main_cnt . '/' . $content['action'] . '/' . $content['sub_what'] . ':' . getWhat() . '*');
loadTemplate('menu_table', false, $content);
} // END - if
}
// Fix missing 'last_online' array, damn stupid code :(((
// @TODO Try to rewrite this to one or more functions
- if ((!isset($GLOBALS['last_online'])) || (!is_array($GLOBALS['last_online']))) $GLOBALS['last_online'] = array();
+ if ((!isset($GLOBALS['last_online'])) || (!is_array($GLOBALS['last_online']))) {
+ $GLOBALS['last_online'] = array();
+ } // END - if
// Is the cache entry there?
if (isset($GLOBALS[__FUNCTION__])) {
$add = '';
if ((!isAdmin()) && ($mode != 'admin')) $add = " AND `locked`='N'";
- //* DEBUG: */ debugOutput(__LINE__.':'.$mode.'/'.$action.'/'.$what.'*');
+ //* DEBUG: */ debugOutput(__LINE__ . ':' . $mode . '/' . $action . '/' . $what . '*');
if (($mode != 'admin') && ($updateEntry === true)) {
// Update guest or member menu
$sql = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET counter=counter+1 WHERE `action`='%s' AND `what`='%s'".$add." LIMIT 1",
// Checks wether the SQLs array is filled
function isSqlsValid () {
- //* DEBUG: */ debugOutput(__FUNCTION__.':'.intval(isSqlsInitialized()).'/'.countSqls().'/'.getCurrentExtensionName());
+ //* DEBUG: */ debugOutput(__FUNCTION__ . ':' . intval(isSqlsInitialized()) . '/' . countSqls() . '/' . getCurrentExtensionName());
return (
(
isSqlsInitialized()
}
// Return it
- //* DEBUG: */ debugOutput(__FUNCTION__.':'.$ext_name.'=>'.$version.':'.intval($GLOBALS[__FUNCTION__][$ext_name][$version]));
+ //* DEBUG: */ debugOutput(__FUNCTION__ . ':' . $ext_name . '=>' . $version . ':' . intval($GLOBALS[__FUNCTION__][$ext_name][$version]));
return $GLOBALS[__FUNCTION__][$ext_name][$version];
}
}
// Return it
- //* DEBUG: */ debugOutput(__FUNCTION__.':'.$ext_name.'<'.$version.':'.intval($GLOBALS[__FUNCTION__][$ext_name][$version]));
+ //* DEBUG: */ debugOutput(__FUNCTION__ . ':' . $ext_name . '<' . $version . ':' . intval($GLOBALS[__FUNCTION__][$ext_name][$version]));
return $GLOBALS[__FUNCTION__][$ext_name][$version];
}