inc/reset/reset_profile.php -text
inc/reset/reset_surfbar.php -text
inc/reset/reset_yoomedia.php -text
+inc/revision-functions.php -text
inc/session-functions.php -text
inc/session.php -text
inc/sql-functions.php -text
-### WARNING: THIS FILE IS AUTO-GENERATED BY ./DOCS/todo-builder.sh (uid=1000/user=quix0r) ###
+### WARNING: THIS FILE IS AUTO-GENERATED BY ./DOCS/todo-builder.sh (uid=/user=quix0r) ###
### DO NOT EDIT THIS FILE. ###
./beg.php:172: // @TODO Opps, what is missing here???
./birthday_confirm.php:93: // @TODO Try to rewrite the following unset()
./inc/extensions-functions.php:492: // @TODO Extension is loaded, what next?
./inc/functions.php:1010:// @TODO $simple is deprecated
./inc/functions.php:1045: // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
-./inc/functions.php:2521:// @TODO Please describe this function
-./inc/functions.php:2539: searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time);
+./inc/functions.php:2475: // @TODO Add a little more infos here
+./inc/functions.php:2557: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
./inc/functions.php:255: // @TODO Remove this sanity-check if all is fine
+./inc/functions.php:2580: // @TODO Rewrite this old lost code to a template
./inc/functions.php:258: // @TODO Try to rewrite all $DATA to $content
-./inc/functions.php:2662: // @TODO Add a little more infos here
-./inc/functions.php:2744: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
-./inc/functions.php:2767: // @TODO Rewrite this old lost code to a template
-./inc/functions.php:2856: // @TODO Are these convertions still required?
-./inc/functions.php:2874:// @TODO Rewrite this function to use readFromFile() and writeToFile()
-./inc/functions.php:3753:// @TODO Lame description for this function
-./inc/functions.php:3775: // @TODO Move this in a filter
-./inc/functions.php:3893: // @TODO This is still very static, rewrite it somehow
+./inc/functions.php:2669: // @TODO Are these convertions still required?
+./inc/functions.php:2687:// @TODO Rewrite this function to use readFromFile() and writeToFile()
+./inc/functions.php:3566:// @TODO Lame description for this function
+./inc/functions.php:3588: // @TODO Move this in a filter
+./inc/functions.php:3706: // @TODO This is still very static, rewrite it somehow
./inc/functions.php:473: // @TODO Do only use $content, not $DATA or raw variables
./inc/functions.php:543: // @TODO Extension 'msg' does not exist
./inc/functions.php:612:// @TODO Rewrite this to an extension 'smtp'
./inc/language/rallye_de.php:13: * @TODO Naming convention not applied for language strings *
./inc/language/refback_de.php:45:// @TODO Rewrite these constants to one
./inc/language/sponsor_de.php:118:// @TODO Rewrite these four constants to one and use sprintf()
-./inc/libs/admins_functions.php:426: // @TODO This can be, somehow, rewritten
+./inc/libs/admins_functions.php:439: // @TODO This can be, somehow, rewritten
./inc/libs/beg_functions.php:57: // @TODO Try to rewrite the following unset()
./inc/libs/bonus_functions.php:215: // @TODO Try to find a way for rewriting this constant
./inc/libs/bonus_functions.php:303: // @TODO This query isn't right, it will only update if the user was for a longer time away!
./inc/libs/rallye_functions.php:718: $EXPIRE = 3; // @TODO The hard-coded value...
./inc/libs/rallye_functions.php:782: // @TODO Rewrite this to our API function
./inc/libs/refback_functions.php:60: // @TODO Try to rewrite the following unset()
+./inc/libs/register_functions.php:286: // @TODO Rewrite these all to a single filter
+./inc/libs/register_functions.php:362: // @TODO Rewrite this to a filter
+./inc/libs/register_functions.php:369: // @TODO Rewrite this whole if() block to addPointsThroughReferalSystem(). This will also make following if() block obsolete
+./inc/libs/register_functions.php:370: // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
./inc/libs/surfbar_functions.php:1496: // @TODO This can be somehow rewritten
./inc/libs/surfbar_functions.php:949: // @TODO Invalid salt should be refused
./inc/libs/task_functions.php:244: // @TODO These can be rewritten to filter
./inc/libs/user_functions.php:137: // @TODO These two constants are no longer used, maybe we reactivate this code?
./inc/libs/user_functions.php:224:// @TODO Double-check configuration entry here
./inc/libs/user_functions.php:319: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
-./inc/libs/user_functions.php:343: // @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
-./inc/libs/user_functions.php:416: // @TODO We should try to rewrite this to fetchUserData() somehow
+./inc/libs/user_functions.php:342: // @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
+./inc/libs/user_functions.php:417: // @TODO We should try to rewrite this to fetchUserData() somehow
./inc/libs/yoomedia_functions.php:115: $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script
./inc/load_config.php:76: // @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:352: // @TODO Rewrite this to $content = SQL_FETCHARRAY()
-./inc/modules/admin/admin-inc.php:357: // @TODO ACL is 'allow'... hmmm
-./inc/modules/admin/admin-inc.php:423: // @TODO Rewrite this to $content = SQL_FETCHARRAY()
-./inc/modules/admin/admin-inc.php:429: // @TODO ACL is 'allow'... hmmm
-./inc/modules/admin/admin-inc.php:531:// @TODO Try to rewrite this to adminAddMenuSelectionBox()
-./inc/modules/admin/admin-inc.php:545: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY(). Please look some lines above for the dynamic query
+./inc/modules/admin/admin-inc.php:251: // @TODO Rewrite this to $content = SQL_FETCHARRAY()
+./inc/modules/admin/admin-inc.php:256: // @TODO ACL is 'allow'... hmmm
+./inc/modules/admin/admin-inc.php:322: // @TODO Rewrite this to $content = SQL_FETCHARRAY()
+./inc/modules/admin/admin-inc.php:328: // @TODO ACL is 'allow'... hmmm
+./inc/modules/admin/admin-inc.php:428:// @TODO Try to rewrite this to adminAddMenuSelectionBox()
+./inc/modules/admin/admin-inc.php:442: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY(). Please look some lines above for the dynamic query
./inc/modules/admin/overview-inc.php:163: // @TODO Rewrite this to a filter
./inc/modules/admin/overview-inc.php:277: // @TODO Rewrite this to something with include files and/or filter
./inc/modules/admin/overview-inc.php:315: // @TODO This may also be rewritten to include files
./inc/modules/admin/what-config_mods.php:56: // @TODO This can be moved into mysql-function.php, see checkModulePermissions() function
./inc/modules/admin/what-config_rallye_prices.php:208: // @TODO Rewritings: level->price_level, infos->info in template
./inc/modules/admin/what-config_rallye_prices.php:225: // @TODO Rewrite these two constants
-./inc/modules/admin/what-config_register.php:67: // @TODO Move this HTML code into a template
+./inc/modules/admin/what-config_register.php:77: // @TODO Move this HTML code into a template
./inc/modules/admin/what-edit_user.php:20: * @TODO Add support for ext-country *
./inc/modules/admin/what-email_stats.php:47:// @TODO Unused at the moment
./inc/modules/admin/what-extensions.php:347: // @TODO Rewrite this to a filter
./inc/modules/admin/what-mem_add.php:64: // @TODO Cant this be rewritten?
./inc/modules/admin/what-mem_add.php:80: // @TODO This can be somehow rewritten to a function
./inc/modules/admin/what-payments.php:151: // @TODO Rewritings: title->mail_title, pay->payment in template
-./inc/modules/admin/what-refbanner.php:139: // @TODO Rewritings: alt->alternate,cnt->counter,clx->clicks in template
-./inc/modules/admin/what-unlock_emails.php:91: // @TODO Rewrite these if-blocks to a filter
+./inc/modules/admin/what-refbanner.php:144: // @TODO Rewritings: alt->alternate,cnt->counter,clx->clicks in template
+./inc/modules/admin/what-unlock_emails.php:88: // @TODO Rewrite these if-blocks to a filter
./inc/modules/admin/what-unlock_sponsor.php:191: // @TODO Rewritings: remote->remote_addr, created->sponsor_created in template
./inc/modules/admin/what-usage.php:87: // @TODO This code is double, see LOAD_TEMPLATE and loadEmailTemplate in functions.php
./inc/modules/admin/what-usr_online.php:50: // @TODO Add a filter for sponsor
./inc/modules/guest/what-mediadata.php:182:// @TODO Rewrite all these if-blocks to filters
./inc/modules/guest/what-mediadata.php:69: // @TODO Find a better formular than this one
./inc/modules/guest/what-rallyes.php:90: // @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&what=impressum&admin=' . $adminId . '%}">' . $login . '</a>';
-./inc/modules/guest/what-register.php:192: // @TODO Rewrite these all to a single filter
-./inc/modules/guest/what-register.php:270: // @TODO Rewrite this to a filter
-./inc/modules/guest/what-register.php:286: // @TODO Rewrite this to addPointsDirectly()
./inc/modules/guest/what-sponsor_infos.php:69: // @TODO Rewritings: conv->conv_rate,name->conv_name in template
./inc/modules/guest/what-sponsor_infos.php:89: // @TODO Rewritings: name->pay_name,min->pay_min_count,min->pay_min_count,curr->pay_currency
./inc/modules/guest/what-sponsor_reg.php:286: // @TODO Swap this HTML code to templates
./inc/modules/member/what-unconfirmed.php:142: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
./inc/modules/order.php:75: // @TODO Unused: 2,4
./inc/monthly/monthly_bonus.php:68: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1565: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1663: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:2107: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:2148:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/mysql-manager.php:1571: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:1669: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2113: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2154:// @TODO Fix inconsistency between last_module and getWhat()
./inc/mysql-manager.php:228: // @TODO Nothing helped???
./inc/mysql-manager.php:263: // @TODO Rewrite this to a filter
./inc/mysql-manager.php:556: // @TODO Try to rewrite this to one or more functions
./inc/mysql-manager.php:93:// @TODO Can we cache this?
./inc/reset/reset_beg.php:50:// @TODO This should be converted in a daily beg rallye
./inc/reset/reset_birthday.php:91: // @TODO 4 is hard-coded here, should we move it out in config?
-./inc/wrapper-functions.php:127:// @TODO Implement $compress
-./inc/wrapper-functions.php:134:// @TODO Implement $decompress
-./inc/wrapper-functions.php:409:// @TODO Do some more sanity check here
+./inc/revision-functions.php:152:// @TODO Please describe this function
+./inc/wrapper-functions.php:126:// @TODO Implement $compress
+./inc/wrapper-functions.php:133:// @TODO Implement $decompress
+./inc/wrapper-functions.php:420:// @TODO Do some more sanity check here
./mailid.php:134: // @TODO Rewrite this to a filter
./mailid.php:214: // @TODO Rewrite this to a dynamic include or so
./mailid.php:94: // @TODO Rewrite this to a filter
./mailid_top.php:99: // @TODO Rewrite this to a filter
./view.php:69: // @TODO No banner found, output some default banner
./templates/de/html/admin/admin_add_country.tpl:23: <!-- @TODO Rewrite this selection box to our generic functions //-->
-./templates/de/html/admin/admin_admins_contct_form.tpl:3: <!-- @TODO Shouldn't we add a title here? //-->
+./templates/de/html/admin/admin_admins_contct_form.tpl:4: <!-- @TODO Shouldn't we add a title here? //-->
./templates/de/html/admin/admin_amenu_edit.tpl:4:<!-- @TODO Shouldn't we add a title here? //-->
-./templates/de/html/admin/admin_config_other.tpl:66: <!-- @TODO Rewrite this selection to one of our functions //-->
+./templates/de/html/admin/admin_config_other.tpl:67: <!-- @TODO Rewrite this selection to one of our functions //-->
./templates/de/html/admin/admin_list_autopurge.tpl:2: <!-- @TODO Shouldn't we add a title here? //-->
-./templates/de/html/admin/admin_list_beg.tpl:2: <!-- @TODO No title here? //-->
-./templates/de/html/admin/admin_list_bonus.tpl:2: <!-- @TODO No title here? //-->
+./templates/de/html/admin/admin_list_beg.tpl:3: <!-- @TODO No title here? //-->
+./templates/de/html/admin/admin_list_bonus.tpl:3: <!-- @TODO No title here? //-->
./templates/de/html/admin/admin_list_mods.tpl:4: <!-- @TODO Shouldn't we add a title here? //-->
+./templates/de/html/admin/admin_list_primera_main.tpl:3:<!-- @TODO No title here? //-->
./templates/de/html/admin/admin_list_unconfirmed_list.tpl:3:<!-- @TODO Shouldn't we add a title here? //-->
./templates/de/html/admin/admin_list_wernis_main.tpl:2:<!-- @TODO No title here? //-->
./templates/de/html/admin/admin_login_form.tpl:35: @TODO Doesn't work with sessions
./templates/de/html/admin/admin_login_form.tpl:38: @TODO Try to move the select box to our generic functions
./templates/de/html/admin/admin_mods_edit.tpl:3: <!-- @TODO Shouldn't we add a title here? //-->
./templates/de/html/admin/admin_optimize.tpl:3: <!-- @TODO Shouldn't we add a title here? //-->
+./templates/de/html/admin/admin_send_bonus_form.tpl:4: <!-- @TODO Maybe add some title? //-->
./templates/de/html/guest/guest_login.tpl:21: @TODO Deactivated feature, try to implement it or remove it.
./templates/de/html/guest/guest_nickname_login.tpl:21: @TODO Deactivated feature, try to find a solution for this or remove it.
-./templates/de/html/guest/guest_stats_member.tpl:23: @TODO We have to fix these counters.
+./templates/de/html/guest/guest_stats_member.tpl:21: @TODO We have to fix these counters.
./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:23:// @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:532:// @DEPRECATED
+./inc/modules/admin/admin-inc.php:429:// @DEPRECATED
+./templates/de/html/admin/admin_menu_unknown_okay.tpl:1:<!-- @DEPRECATED //-->
### ### template-warnings.log follows: ### ###
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/menu/menu_what_end.tpl, line: 1 in
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/menu/menu_what_end.tpl, line: 2 in
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/member/member_content_right.tpl, line: 1 in
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/member/member_content_right.tpl, line: 5 in
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/member/member_welcome_footer.tpl, line: 1 in
+Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/member/member_order_points.tpl, line: 14 in
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/member/member_footer.tpl, line: 6 in
Warning: DOMDocument::loadHTMLFile(): Document is empty in templates/de/html/header.tpl, line: 1 in /home
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/page_footer.tpl, line: 1 in /home
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/admin/admin_overview_footer.tpl, line: 10 in
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : form in templates/de/html/admin/admin_overview_footer.tpl, line: 11 in
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/admin/admin_overview_footer.tpl, line: 12 in
+Warning: DOMDocument::loadHTMLFile(): Attribute class redefined in templates/de/html/admin/admin_list_beg.tpl, line: 23 in
+Warning: DOMDocument::loadHTMLFile(): Attribute align redefined in templates/de/html/admin/admin_list_beg.tpl, line: 23 in
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/admin/admin_overview_footer_task.tpl, line: 10 in
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : form in templates/de/html/admin/admin_overview_footer_task.tpl, line: 11 in
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/admin/admin_main_footer.tpl, line: 1 in
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/admin/admin_main_footer.tpl, line: 2 in
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/admin/admin_main_footer.tpl, line: 12 in
+Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/admin/admin_logout_sql_patches_remove.tpl, line: 10 in
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/guest/guest_rallye_expired_footer.tpl, line: 6 in
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/guest/guest_rallye_expired_footer.tpl, line: 7 in
Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/guest/guest_footer.tpl, line: 6 in
if (($k == 'ext_keep') && ($v == 'Y')) {
$GLOBALS['cache_array']['always_active'][$data['ext_name']] = $v;
} // END - if
- } 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;
$GLOBALS['cache_array']['refsystem'][$k][$data['id']] = $v;
} elseif ($this->name == 'revision') {
// Revision data
- $GLOBALS['cache_array']['revision'][$k] = $v;
+ $GLOBALS['cache_array']['revision'][$k][0] = $v;
} elseif ($this->name == 'themes') {
// Themes
if ($k == 'theme_path') {
} elseif ($this->name == 'imprint') {
// Imprint
$GLOBALS['cache_array']['imprint'][$k][$data['imprint_id']] = $v;
+ } elseif (is_array($v)) {
+ // Serialize and BASE64-encode the array
+ $v = base64_encode(serialize($v));
} else {
// Finialize the cache and close it
$this->finalize();
// False
$line = '$this->' . $prefix . "['".$this->name."']['" . $key . "']" . $extender . " = false;\n";
}
+ } elseif (isset($value[0])) {
+ // These lines needs fixing
+ debug_report_bug('Invalid entry with [0] found. key=' . $key);
} else {
// Non-string
$line = '$this->' . $prefix . "['".$this->name."']['" . $key . "']" . $extender . " = " . $value . ";\n";
// Some security stuff...
if (!defined('__SECURITY')) {
die();
-}
+} // END - if
// Adds a code key/value pair to $GLOBALS
function addCode ($key, $value) {
// Update entry
$all .= sprintf("`%s`=`%s`%s%s,", $entry, $entry, $updateMode, (float)$values[$idx]);
} else {
- // Check if string or number
- if (($values[$idx] + 0) === $values[$idx]) {
+ // Check if string or number but no array
+ if (is_array($values[$idx])) {
+ // Arrays must be fixed...
+ debug_report_bug('values[' . $idx . '] should not be an array! Content=<pre>'.print_r($values[$idx], true).'</pre>');
+ } elseif (($values[$idx] + 0) === $values[$idx]) {
// Number detected
$all .= sprintf("`%s`=%s,", $entry, (float)$values[$idx]);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "entries={$entries}");
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_config` SET ".$entries." WHERE `config`=%s LIMIT 1",
array(bigintval($config)), __FUNCTION__, __LINE__);
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):entries={$entries},affectedRows={$affectedRows}<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "entries={$entries},affectedRows={$affectedRows}<br />");
// Rebuild cache
rebuildCacheFile('config', 'config');
include($PATH . 'inc/' . $inc . '-functions.php');
} // END - foreach
+// Own functions
+include($PATH.'inc/functions.php');
+
// Auto-detection... (patched by "Stelzi" aka. profi-concept, thanks again!)
-$URL = 'http://' . getenv('SERVER_NAME') . str_replace("\\", '/', dirname($_SERVER['PHP_SELF']));
+$URL = 'http://' . detectServerName() . str_replace("\\", '/', dirname($_SERVER['PHP_SELF']));
while (substr($URL, -1, 1) == '/') { $URL = substr($URL, 0, -1); }
// Initialize the configuration
addCode('MODULE_MEM_ONLY' , 0x023);
addCode('UNKNOWN_ERROR' , 0x024);
+// Full version
+setConfigEntry('FULL_VERSION', '0.2.1-FINAL');
+
// Server-URL (DO NOT CHANGE THIS OR YOU CANNOT CHECK FOR UPDATES/EXTENSIONS!)
setConfigEntry('SERVER_URL', 'http://www.mxchange.org');
return $GLOBALS['ext_current_version'];
}
-// Remove the extension from global cache array
+// Remove the extension from cache array
function removeExtensionFromArray () {
// "Cache" this name
$ext_name = getCurrentExtensionName();
} // END - if
// Version of this extension
-setThisExtensionVersion('0.7.3');
+setThisExtensionVersion('0.7.4');
// Version history array (add more with , '0.1.0' and so on)
-setExtensionVersionHistory(array('0.0', '0.1.0', '0.2.0', '0.3.0', '0.3.1', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3'));
+setExtensionVersionHistory(array('0.0', '0.1.0', '0.2.0', '0.3.0', '0.3.1', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4'));
// Keep this extension always active!
setExtensionAlwaysActive('Y');
// Remove filters
unregisterFilter('sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', true, getExtensionDryRun());
+ unregisterFilter('do_admin_login_done', 'RESET_ADMINS_LOGIN_FAILURES', true, getExtensionDryRun());
+ unregisterFilter('do_admin_login_pass', 'COUNT_ADMINS_LOGIN_FAILURE', true, getExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
setExtensionUpdateNotes("Schreibweise korregiert.");
break;
- case '0.7.3': // SQL queries for v0.7.2
+ case '0.7.3': // SQL queries for v0.7.3
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` ADD `expert_settings` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` ADD `expert_warning` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Experten-Einstellungen sind nun hinzugekommen.");
break;
+
+ case '0.7.4': // SQL queries for v0.7.4
+ // Add filter
+ registerFilter('do_admin_login_done', 'RESET_ADMINS_LOGIN_FAILURES', false, true, getExtensionDryRun());
+ registerFilter('do_admin_login_pass', 'COUNT_ADMINS_LOGIN_FAILURE', false, true, getExtensionDryRun());
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Filter hinzugefuegt.");
+ break;
} // END - switch
break;
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='booking'");
// Remove the filters
- unregisterFilter('add_points', 'ADD_BOOKING_RECORD', false, true, getExtensionDryRun());
- unregisterFilter('sub_points', 'ADD_BOOKING_RECORD', false, true, getExtensionDryRun());
+ unregisterFilter('add_points', 'ADD_BOOKING_RECORD', true, getExtensionDryRun());
+ unregisterFilter('sub_points', 'ADD_BOOKING_RECORD', true, getExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='mediadata'");
// Remove the filters
- unregisterFilter('add_points', 'UPDATE_MEDIADATA_ENTRY', false, true, getExtensionDryRun());
- unregisterFilter('sub_points', 'UPDATE_MEDIADATA_ENTRY', false, true, getExtensionDryRun());
+ unregisterFilter('add_points', 'UPDATE_MEDIADATA_ENTRY', true, getExtensionDryRun());
+ unregisterFilter('sub_points', 'UPDATE_MEDIADATA_ENTRY', true, getExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD repay_deleted_mails ENUM('REPAY','JACKPOT','SHRED') NOT NULL DEFAULT 'REPAY'");
// Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Bei Löschung von Mailbuchungen kann nun global entschieden werden (Einstellungen also), ob die verbliebenen {?POINTS?} wieder gutgeschrieben werden sollen oder in den Jackpot landen.");
+ setExtensionUpdateNotes("Bei Löschung von Mailbuchungen kann nun scripteweit entschieden werden (Einstellungen also), ob die verbliebenen {?POINTS?} wieder gutgeschrieben werden sollen oder in den Jackpot landen.");
break;
case '0.5.0': // SQL queries for v0.5.0
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_other'");
// Unregister filter
- unregisterFilter('page_footer', 'DISPLAY_DEBUG_SQL', false, true, getExtensionDryRun());
+ unregisterFilter('page_footer', 'DISPLAY_DEBUG_SQL', true, getExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
case 'remove': // Do stuff when removing extension
// Unregister filter
- unregisterFilter('page_footer', 'DISPLAY_POLITICIAN_STOP_SNIPPET', false, true, getExtensionDryRun());
+ unregisterFilter('page_footer', 'DISPLAY_POLITICIAN_STOP_SNIPPET', true, getExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`");
// Unregister a filter
- unregisterFilter('register_must_fillout', 'REGISTER_MUST_FILLOUT', false, true, getExtensionDryRun());
+ unregisterFilter('register_must_fillout', 'REGISTER_MUST_FILLOUT', true, getExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_uberwach' LIMIT 1");
// Unregister filter
- unregisterFilter('page_footer', 'DISPLAY_UBERWACH_SNIPPET', false, true, getExtensionDryRun());
+ unregisterFilter('page_footer', 'DISPLAY_UBERWACH_SNIPPET', true, getExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
} // END - if
// Load all saved filers if sql_patches is updated
- if (isset($GLOBALS['cache_array']['filter']['filter_name'])) {
- // Init dummy array
- $filterArray = array(
- 'chains' => array(),
- 'loaded' => array(),
- 'counter' => array()
- );
-
- // Found in cache so rewrite the array
- foreach ($GLOBALS['cache_array']['filter']['filter_name'] as $idx => $filterName) {
- // Get filter function
- $filterFunction = $GLOBALS['cache_array']['filter']['filter_function'][$idx];
-
- // Add the element with mapped index
- $filterArray['counter'][$filterName][$filterFunction] = $GLOBALS['cache_array']['filter']['filter_counter'][$idx];
- $filterArray['loaded'][$filterName][$filterFunction] = true;
- $filterArray['chains'][$filterName][$filterFunction] = $GLOBALS['cache_array']['filter']['filter_active'][$idx];
- } // END - foreach
+ if ((isset($GLOBALS['cache_array']['filter']['filter_name'])) && (!isset($GLOBALS['cache_array']['filter']['chains']))) {
+ // Prepare filter array
+ prepareFilterArray();
// Mark it as initialized
$GLOBALS['filter_init'] = true;
-
- // Remove the cache
- $GLOBALS['cache_array']['filter'] = $filterArray;
} elseif ((!isInstallationPhase()) && (isExtensionInstalledAndNewer('sql_patches', '0.5.9'))) {
// Init add
$add = '';
// Member login check. Always keep FETCH_USER_DATA as first entry!
registerFilter('member_login_check', 'FETCH_USER_DATA');
+
+ // Admin login
+ registerFilter('do_admin_login_done', 'DO_LOGIN_ADMIN');
}
// "Registers" a new filter function
function registerFilter ($filterName, $filterFunction, $silentAbort = true, $force = false, $dry_run = false) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: filterName=' . $filterName . ',filterFunction=' . $filterFunction);
+
// Extend the filter function name
$filterFunction = sprintf("FILTER_%s", strtoupper($filterFunction));
} // END - if
// Simply add it to the array
- //* DEBUG: */ print __FUNCTION__.': filterName='.$filterName.',filterFunction='.$filterFunction.'<br />';
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'REGISTER: filterName=' . $filterName . ',filterFunction=' . $filterFunction);
$GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = 'A';
$GLOBALS['cache_array']['filter']['counter'][$filterName][$filterFunction] = '0';
} // END - if
// "Unregisters" a filter from the given chain
function unregisterFilter ($filterName, $filterFunction, $force = false, $dry_run = false) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',dry=' . intval($dry_run));
+
// Extend the filter function name only if not loaded from database
if (!isset($GLOBALS['cache_array']['filter']['loaded'][$filterName][$filterFunction])) {
$filterFunction = sprintf("FILTER_%s", strtoupper($filterFunction));
// Shall we remove? (default, not while just showing an extension removal)
if ($dry_run === false) {
// Mark for filter removal
- //* DEBUG: */ print __FUNCTION__.': filterName='.$filterName.',filterFunction='.$filterFunction.'<br />';
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'REMOVE: filterName=' . $filterName . ',filterFunction=' . $filterFunction);
$GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = 'R';
} // END - if
}
// Log it away...
logDebugMessage(__FUNCTION__, __LINE__, 'Filter chain ' . $filterName . ' not found!');
} // END - if
+ if ($filterName == 'sql_admin_extra_data') debug_report_bug(print_r($GLOBALS['cache_array']['filter'] , true));
// Abort here and return content
return $data;
} // END - if
// Call the filter chain
- //* DEBUG: */ print $filterName.'/'.$filterFunction.',[]='.gettype($returnValue).'<br />';
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $filterName.'/'.$filterFunction.',[]='.gettype($returnValue));
$returnValue = call_user_func_array($filterFunction, array($returnValue));
// Update usage counter
}
}
+// Prepares the filter array for usage
+function prepareFilterArray () {
+ // Init dummy array
+ $filterArray = array(
+ 'chains' => array(),
+ 'loaded' => array(),
+ 'counter' => array()
+ );
+
+ // Found in cache so rewrite the array
+ foreach ($GLOBALS['cache_array']['filter']['filter_name'] as $idx => $filterName) {
+ // Get filter function
+ $filterFunction = $GLOBALS['cache_array']['filter']['filter_function'][$idx];
+
+ // Add the element with mapped index
+ $filterArray['counter'][$filterName][$filterFunction] = $GLOBALS['cache_array']['filter']['filter_counter'][$idx];
+ $filterArray['loaded'][$filterName][$filterFunction] = true;
+ $filterArray['chains'][$filterName][$filterFunction] = $GLOBALS['cache_array']['filter']['filter_active'][$idx];
+ } // END - foreach
+
+ // Remove the cache
+ $GLOBALS['cache_array']['filter'] = $filterArray;
+}
+
// [EOF]
?>
$content = $data;
// Handle failed logins here if not in guest
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):type={$data['type']},action={getAction()},what={getWhat()},level={$data['access_level']}<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "type=".$data['type'].",action=".getAction().",what=".getWhat().",level=".$data['access_level']."<br />");
if ((($data['type'] == 'what') || ($data['type'] == 'action') && ((!isWhatSet()) || (getWhat() == 'overview') || (getWhat() == getConfig('index_home')))) && ($data['access_level'] != 'guest') && ((isExtensionInstalledAndNewer('sql_patches', '0.4.7')) || (isExtensionInstalledAndNewer('admins', '0.7.0')))) {
// Handle failure
- $content['content'] .= handleLoginFailtures($data['access_level']);
+ $content['content'] .= handleLoginFailures($data['access_level']);
} // END - if
// Return the content
// Is this extension always activated?
if (getExtensionAlwaysActive() == 'Y') {
// Then activate the extension
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>): ext_name={$data['ext_name']}<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "ext_name={$data['ext_name']}<br />");
doActivateExtension($data['ext_name']);
} // END - if
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1",
array(getCurrentExtensionName()), __FUNCTION__, __LINE__);
- // Remove the extension from global cache array as well
+ // Remove the extension from cache array as well
removeExtensionFromArray();
// Remove the cache
// Store it in session
setSession('mxchange_member_failures' , getUserData('login_failures'));
- setSession('mxchange_member_last_fail', getUserData('last_failure'));
+ setSession('mxchange_member_last_failure', getUserData('last_failure'));
} // END - if
}
+// Try to login the admin by setting some session/cookie variables
+function FILTER_DO_LOGIN_ADMIN ($data) {
+ // Now set all session variables and store the result for later processing
+ $GLOBALS['admin_login_success'] = ((
+ setSession('admin_md5', encodeHashForCookie(generateHash($data['pass_hash'], '', false)))
+ ) && (
+ setSession('admin_login', $data['login'])
+ ) && (
+ setSession('admin_last', time())
+ ));
+
+ // Return the data for further processing
+ return $data;
+}
+
// [EOF]
?>
} // END - if
// Load user's data
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):UID={$userid},template={$template},content[]=".gettype($content).'<br />');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "UID={$userid},template={$template},content[]=".gettype($content).'<br />');
if (($userid > 0) && (is_array($content))) {
// If nickname extension is installed, fetch nickname as well
if ((isExtensionActive('nickname')) && (isNicknameUsed($userid))) {
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):NICKNAME!<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "NICKNAME!<br />");
// Load by nickname
fetchUserData($userid, 'nickname');
} else {
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):NO-NICK!<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "NO-NICK!<br />");
/// Load by userid
fetchUserData($userid);
}
// Merge data if valid
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):content()=".count($content)." - PRE<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - PRE<br />");
if (isUserDataValid()) {
$content = merge_array($content, getUserDataArray());
} // END - if
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):content()=".count($content)." - AFTER<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - AFTER<br />");
} // END - if
// Translate M to male or F to female if present
// Overwrite email from data if present
if (isset($content['email'])) $email = $content['email'];
- // Store email for some functions in global data array
+ // Store email for some functions in global $DATA array
// @TODO Do only use $content, not $DATA or raw variables
$DATA['email'] = $email;
// Send mail out to an email address
function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '') {
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):TO={$toEmail},SUBJECT={$subject}<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "TO={$toEmail},SUBJECT={$subject}<br />");
// Compile subject line (for POINTS constant etc.)
eval("\$subject = decodeEntities(\"".compileRawCode(escapeQuotes($subject))."\");");
// Is the webmaster!
$toEmail = getConfig('WEBMASTER');
}
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):TO={$toEmail}<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "TO={$toEmail}<br />");
// Check for PHPMailer or debug-mode
if (!checkPhpMailerUsage()) {
$test = substr($found, 0, strlen($match));
// Does this entry exist?
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):found={$found},match={$match},set={$set}<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "found={$found},match={$match},set={$set}<br />");
if ($test == $match) {
// Match found!
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):fuzzyFound!<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "fuzzyFound!<br />");
$fuzzyFound = true;
break;
} // END - if
// Take all string elements
if ((is_string($matches[4][$key])) && (!isset($matchesFound[$match])) && (!isset($matchesFound[$key."_" . $matches[4][$key]]))) {
// Replace it in the code
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):key={$key},match={$match}<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "key={$key},match={$match}<br />");
$newMatch = str_replace('[', "['", str_replace(']', "']", $match));
$code = str_replace($match, '".' . $newMatch . '."', $code);
$matchesFound[$key . '_' . $matches[4][$key]] = 1;
$matchesFound[$match] = 1;
} elseif (!isset($matchesFound[$match])) {
// Not yet replaced!
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):match={$match}<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "match={$match}<br />");
$code = str_replace($match, '".' . $match . '."', $code);
$matchesFound[$match] = 1;
}
//
function generateRandomCode ($length, $code, $userid, $DATA = '') {
// Build server string
- $server = $_SERVER['PHP_SELF'] . getConfig('ENCRYPT_SEPERATOR') . detectUserAgent() . getConfig('ENCRYPT_SEPERATOR') . getenv('SERVER_SOFTWARE') . getConfig('ENCRYPT_SEPERATOR') . detectRemoteAddr().":'.':".filemtime(getConfig('PATH').'inc/databases.php');
+ $server = $_SERVER['PHP_SELF'] . getConfig('ENCRYPT_SEPERATOR') . detectUserAgent() . getConfig('ENCRYPT_SEPERATOR') . getenv('SERVER_SOFTWARE') . getConfig('ENCRYPT_SEPERATOR') . detectRemoteAddr();
// Build key string
$keys = getConfig('SITE_KEY') . getConfig('ENCRYPT_SEPERATOR') . getConfig('DATE_KEY');
}
// Does only allow numbers
-function bigintval ($num, $castValue = true) {
+function bigintval ($num, $castValue = true, $abortOnMismatch = true) {
// Filter all numbers out
$ret = preg_replace('/[^0123456789]/', '', $num);
if ($castValue === true) $ret = (double)$ret;
// Has the whole value changed?
- if ('' . $ret . '' != '' . $num . '') {
+ if (('' . $ret . '' != '' . $num . '') && ($abortOnMismatch === true)) {
// Log the values
debug_report_bug('Problem with number found. ret=' . $ret . ', num='. $num);
} // END - if
// Generate a hash for extra-security for all passwords
function generateHash ($plainText, $salt = '', $hash = true) {
// Is the required extension 'sql_patches' there and a salt is not given?
- if (((isExtensionInstalledAndOlder('sql_patches', '0.3.6')) || (!isExtensionActive('sql_patches')) || (!isExtensionInstalledAndNewer('other', '0.2.5'))) && (empty($salt))) {
+ // 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')))) {
// Extension sql_patches is missing/outdated so we hash the plain text with MD5
if ($hash === true) {
// Is plain password
// When the salt is empty build a new one, else use the first x configured characters as the salt
if (empty($salt)) {
- // Build server string (inc/databases.php is no longer updated with every commit)
+ // Build server string for more entropy
$server = $_SERVER['PHP_SELF'] . getConfig('ENCRYPT_SEPERATOR') . detectUserAgent() . getConfig('ENCRYPT_SEPERATOR') . getenv('SERVER_SOFTWARE') . getConfig('ENCRYPT_SEPERATOR') . detectRemoteAddr();
// Build key string
}
// Generate an PGP-like encrypted hash of given hash for e.g. cookies
-function generatePassString ($passHash) {
+function encodeHashForCookie ($passHash) {
// Return vanilla password hash
$ret = $passHash;
return $errorCode;
}
-// Function to search for the last modifified file
-function searchDirsRecursive ($dir, &$last_changed) {
- // Get dir as array
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):dir=" . $dir.'<br />');
- // Does it match what we are looking for? (We skip a lot files already!)
- // RegexPattern to exclude ., .., .revision, .svn, debug.log or .cache in the filenames
- $excludePattern = '@(\.revision|debug\.log|\.cache|config\.php)$@';
- $ds = getArrayFromDirectory($dir, '', true, false, array(), '.php', $excludePattern);
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):ds[]=".count($ds).'<br />');
-
- // Walk through all entries
- foreach ($ds as $d) {
- // Generate proper FQFN
- $FQFN = str_replace('//', '/', getConfig('PATH') . $dir. '/'. $d);
-
- // Is it a file and readable?
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):FQFN={$FQFN}<br />");
- if (isDirectory($FQFN)) {
- // $FQFN is a directory so also crawl into this directory
- $newDir = $d;
- if (!empty($dir)) $newDir = $dir . '/'. $d;
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):DESCENT: " . $newDir.'<br />');
- searchDirsRecursive($newDir, $last_changed);
- } elseif (isFileReadable($FQFN)) {
- // $FQFN is a filename and no directory
- $time = filemtime($FQFN);
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):File: " . $d." found. (".($last_changed['time'] - $time).")<br />");
- if ($last_changed['time'] < $time) {
- // This file is newer as the file before
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>) - NEWER!<br />");
- $last_changed['path_name'] = $FQFN;
- $last_changed['time'] = $time;
- } // END - if
- }
- } // END - foreach
-}
-
-// "Getter" for revision/version data
-function getActualVersion ($type = 'Revision') {
- // By default nothing is new... ;-)
- $new = false;
-
- // Is the cache entry there?
- if (isset($GLOBALS['cache_array']['revision'][$type])) {
- // Found so increase cache hit
- incrementStatsEntry('cache_hits');
-
- // Return it
- return $GLOBALS['cache_array']['revision'][$type][0];
- } else {
- // FQFN of revision file
- $FQFN = sprintf("%s/.revision", getConfig('CACHE_PATH'));
-
- // Check if 'check_revision_data' is setted (switch for manually rewrite the .revision-File)
- if ((isGetRequestParameterSet('check_revision_data')) && (getRequestParameter('check_revision_data') == 'yes')) {
- // Forced rebuild of .revision file
- $new = true;
- } else {
- // Check for revision file
- if (!isFileReadable($FQFN)) {
- // Not found, so we need to create it
- $new = true;
- } else {
- // Revision file found
- $ins_vers = explode("\n", readFromFile($FQFN));
-
- // Get array for mapping information
- $mapper = array_flip(getSearchFor());
- //* DEBUG: */ print('<pre>mapper='.print_r($mapper, true).'</pre>ins_vers=<pre>'.print_r($ins_vers, true).'</pre>');
-
- // Is the content valid?
- if ((!is_array($ins_vers)) || (count($ins_vers) <= 0) || (!isset($ins_vers[$mapper[$type]])) || (trim($ins_vers[$mapper[$type]]) == '') || ($ins_vers[0]) == 'new') {
- // File needs update!
- $new = true;
- } else {
- // Generate fake cache entry
- foreach ($mapper as $map => $idx) {
- $GLOBALS['cache_array']['revision'][$map][0] = $ins_vers[$idx];
- } // END - foreach
-
- // Return found value
- return getActualVersion($type);
- }
- }
- }
-
- // Has it been updated?
- if ($new === true) {
- // Write it
- writeToFile($FQFN, implode("\n", getArrayFromActualVersion()));
-
- // ... and call recursive
- return getActualVersion($type);
- } // END - if
- }
-}
-
-// Repares an array we are looking for
-// The returned Array is needed twice (in getArrayFromActualVersion() and in getActualVersion() in the old .revision-fallback) so I puted it in an extra function to not polute the global namespace
-function getSearchFor () {
- // Add Revision, Date, Tag and Author
- $searchFor = array('File', 'Revision', 'Date', 'Tag', 'Author');
-
- // Return the created array
- return $searchFor;
-}
-
-// @TODO Please describe this function
-function getArrayFromActualVersion () {
- // Init variables
- $next_dir = '';
-
- // Directory to start with search
- $last_changed = array(
- 'path_name' => '',
- 'time' => 0
- );
-
- // Init return array
- $akt_vers = array();
-
- // Init value for counting the founded keywords
- $res = '0';
-
- // Searches all Files and there date of the last modifikation and puts the newest File in $last_changed.
- searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time);
-
- // Get file
- $last_file = readFromFile($last_changed['path_name']);
-
- // Get all the keywords to search for
- $searchFor = getSearchFor();
-
- // Save the last-changed filename for debugging
- $GLOBALS['cache_array']['revision']['File'] = $last_changed['path_name'];
-
- // This foreach loops the $searchFor-Tags (array('Revision', 'Date', 'Tag', 'Author') --> could easaly extended in the future)
- foreach ($searchFor as $search) {
- // Searches for "$search-tag:VALUE$" or "$search-tag::VALUE$"(the stylish keywordversion ;-)) in the lates modified file
- $res += preg_match('@\$' . $search.'(:|::) (.*) \$@U', $last_file, $t);
-
- // This trimms the search-result and puts it in the $GLOBALS['cache_array']['revision']-return array
- if (isset($t[2])) {
- $GLOBALS['cache_array']['revision'][$search] = trim($t[2]);
- } // END - if
- } // END - foreach
-
- // at least 3 keyword-Tags are needed for propper values
- if ($res && $res >= 3
- && isset($GLOBALS['cache_array']['revision']['Revision']) && $GLOBALS['cache_array']['revision']['Revision'] != ''
- && isset($GLOBALS['cache_array']['revision']['Date']) && $GLOBALS['cache_array']['revision']['Date'] != ''
- && isset($GLOBALS['cache_array']['revision']['Tag']) && $GLOBALS['cache_array']['revision']['Tag'] != '') {
- // Prepare content witch need special treadment
-
- // Prepare timestamp for date
- preg_match('@(....)-(..)-(..) (..):(..):(..)@', $GLOBALS['cache_array']['revision']['Date'], $match_d);
- $GLOBALS['cache_array']['revision']['Date'] = mktime($match_d[4], $match_d[5], $match_d[6], $match_d[2], $match_d[3], $match_d[1]);
-
- // Add author to the Tag if the author is set and is not quix0r (lead coder)
- if ((isset($GLOBALS['cache_array']['revision']['Author'])) && ($GLOBALS['cache_array']['revision']['Author'] != 'quix0r')) {
- $GLOBALS['cache_array']['revision']['Tag'] .= '-'.strtoupper($GLOBALS['cache_array']['revision']['Author']);
- } // END - if
-
- } else {
- // No valid Data from the last modificated file so read the Revision from the Server. Fallback-solution!! Should not be removed I think.
- $version = sendGetRequest('check-updates3.php');
-
- // Invalid request reply?
- if (!isset($version[11])) {
- // Cannot continue here
- debug_report_bug('Invalid response from check-updates3.php, count should be 10, is ' . count($version));
- } // END - if
-
- // Prepare content
- // Only sets not setted or not proper values to the Online-Server-Fallback-Solution
- if (!isset($GLOBALS['cache_array']['revision']['File']) || $GLOBALS['cache_array']['revision']['File'] == '') $GLOBALS['cache_array']['revision']['File'] = trim($version[11]);
- if (!isset($GLOBALS['cache_array']['revision']['Revision']) || $GLOBALS['cache_array']['revision']['Revision'] == '') $GLOBALS['cache_array']['revision']['Revision'] = trim($version[10]);
- if (!isset($GLOBALS['cache_array']['revision']['Date']) || $GLOBALS['cache_array']['revision']['Date'] == '') $GLOBALS['cache_array']['revision']['Date'] = trim($version[9]);
- if (!isset($GLOBALS['cache_array']['revision']['Tag']) || $GLOBALS['cache_array']['revision']['Tag'] == '') $GLOBALS['cache_array']['revision']['Tag'] = trim($version[8]);
- if (!isset($GLOBALS['cache_array']['revision']['Author']) || $GLOBALS['cache_array']['revision']['Author'] == '') $GLOBALS['cache_array']['revision']['Author'] = 'quix0r';
- }
-
- // Return prepared array
- return $GLOBALS['cache_array']['revision'];
-}
-
// Back-ported from the new ship-simu engine. :-)
function debug_get_printable_backtrace () {
// Init variable
}
// Handle menu-depending failed logins and return the rendered content
-function handleLoginFailtures ($accessLevel) {
+function handleLoginFailures ($accessLevel) {
// Default output is empty ;-)
$OUT = '';
// Is the session data set?
- if ((isSessionVariableSet('mxchange_' . $accessLevel.'_failures')) && (isSessionVariableSet('mxchange_' . $accessLevel.'_last_fail'))) {
+ if ((isSessionVariableSet('mxchange_' . $accessLevel . '_failures')) && (isSessionVariableSet('mxchange_' . $accessLevel . '_last_failure'))) {
// Ignore zero values
- if (getSession('mxchange_' . $accessLevel.'_failures') > 0) {
+ if (getSession('mxchange_' . $accessLevel . '_failures') > 0) {
// Non-guest has login failures found, get both data and prepare it for template
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):accessLevel={$accessLevel}<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "accessLevel={$accessLevel}<br />");
$content = array(
- 'login_failures' => getSession('mxchange_' . $accessLevel.'_failures'),
- 'last_failure' => generateDateTime(getSession('mxchange_' . $accessLevel.'_last_fail'), 2)
+ 'login_failures' => getSession('mxchange_' . $accessLevel . '_failures'),
+ 'last_failure' => generateDateTime(getSession('mxchange_' . $accessLevel . '_last_failure'), 2)
);
// Load template
} // END - if
// Reset session data
- setSession('mxchange_' . $accessLevel.'_failures', '');
- setSession('mxchange_' . $accessLevel.'_last_fail', '');
+ setSession('mxchange_' . $accessLevel . '_failures', '');
+ setSession('mxchange_' . $accessLevel . '_last_failure', '');
} // END - if
// Return rendered content
// Is the include there?
if (isIncludeReadable($inc)) {
// And rebuild it from scratch
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>): inc={$inc} - LOADED!<br />");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "inc={$inc} - LOADED!<br />");
loadInclude($inc);
} else {
// Include not found!
$salt = substr(getSession('u_hash'), 0, -40);
// Now let's compare passwords
- $hash = generatePassString(getUserData('password'));
+ $hash = encodeHashForCookie(getUserData('password'));
// Does the hash match or should we change it?
if (($hash == getSession('u_hash')) || (postRequestParameter('pass1') == postRequestParameter('pass2'))) {
return $GLOBALS['template_cache_fqfn'][$template];
}
+// Function to search for the last modified file
+function searchDirsRecursive ($dir, &$last_changed, $lookFor = 'Date') {
+ // Get dir as array
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'dir=' . $dir);
+ // Does it match what we are looking for? (We skip a lot files already!)
+ // RegexPattern to exclude ., .., .revision, .svn, debug.log or .cache in the filenames
+ $excludePattern = '@(\.revision|\.svn|debug\.log|\.cache|config\.php)$@';
+
+ $ds = getArrayFromDirectory($dir, '', false, true, array(), '.php', $excludePattern);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'count(ds)='.count($ds));
+
+ // Walk through all entries
+ foreach ($ds as $d) {
+ // Generate proper FQFN
+ $FQFN = str_replace('//', '/', getConfig('PATH') . $dir . '/' . $d);
+
+ // Is it a file and readable?
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'dir=' . $dir . ',d=' . $d);
+ if (isFileReadable($FQFN)) {
+ // $FQFN is a readable file so extract the requested data from it
+ $check = extractRevisionInfoFromFile($FQFN, $lookFor);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'File: ' . $d . ' found. check=' . $check);
+
+ // Is the file more recent?
+ if ((!isset($last_changed[$lookFor])) || ($last_changed[$lookFor] < $check)) {
+ // This file is newer as the file before
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'NEWER!');
+ $last_changed['path_name'] = $FQFN;
+ $last_changed[$lookFor] = $check;
+ } // END - if
+ } else {
+ // Not readable
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'File: ' . $d . ' not readable or directory.');
+ }
+ } // END - foreach
+}
+
//////////////////////////////////////////////////
// AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
//////////////////////////////////////////////////
} // END - if
}
+// Read a given SQL dump
+function readSqlDump ($FQFN) {
+ // Sanity-check if file is there (should be there, but just to make it sure)
+ if (!isFileReadable($FQFN)) {
+ // This should not happen
+ debug_report_bug(__FUNCTION__.': File ' . basename($FQFN) . ' is not readable!');
+ } // END - if
+
+ // Load the file
+ $content = readFromFile($FQFN);
+
+ // Remove some unwanted chars
+ $content = str_replace("\r", '', $content);
+ $content = str_replace("\n\n", "\n", $content);
+
+ // Return the content
+ return $content;
+}
+
// [EOF]
?>
// Is the file readable?
if (isFileReadable($FQFN)) {
// Read the file
- $fileContent = readFromFile($FQFN, true);
+ $fileContent = readSqlDump($FQFN);
// Split it up against ";\n" and merge it into existing SQLs
mergeSqls(explode(";\n", $fileContent), 'install');
'PATCH_DESCRIPTION' => "Beschreibung zum Patch",
'DOWNLOAD_SVN' => "SVN-Version herunterladen",
'SVN_REPOSITORY' => "SVN-Repository",
- 'SVN_CHECKOUT_COMMAND' => "SVN auschecken mit:",
'DOWNLOAD_NOW' => "Jetzt downloaden.",
'ADMIN_MEMBER_STATS_TITLE' => "Einstellungen an der Mitglieder-Statistik",
'ADMIN_MEMBER_STATS_LIMIT' => "Anzahl Mailbuchungen pro Seite (<strong>Nicht verwendet!</strong>)",
'ADMIN_CSS_PHP_DIRECT' => "Per <link>-Tag ausgeben (Debug!)",
'ADMIN_CSS_PHP_FILE' => "Per css.php ausgeben (<strong>empfohlen</strong>)",
'ADMIN_CSS_PHP_INLINE' => "In <style>-Tag eingeschlossen ausgeben (Debug!)",
- 'ADMIN_OPTION_GUEST_MENU' => "Gastmenü global ein-/ausblenden",
- 'ADMIN_OPTION_MEMBER_MENU' => "Mitgliedsmenü global ein-/ausblenden",
+ 'ADMIN_OPTION_GUEST_MENU' => "Gastmenü ein-/ausblenden",
+ 'ADMIN_OPTION_MEMBER_MENU' => "Mitgliedsmenü ein-/ausblenden",
'ADMIN_OPTION_YOURE_HERE' => "Navigation "Sie sind hier" ein-/ausblenden",
'ADMIN_GUEST_MENU_ACTIVE' => "Einblenden",
'ADMIN_GUEST_MENU_INACTIVE' => "Ausblenden",
// Admin account saved
$message = getMessage('ADMIN_ACCOUNT_SAVED');
- } elseif ($postData['pass1'][$id] == $postData['pass2'][$id]) {
- // Save only when both passwords are the same (also when they are empty)
- $add = ''; $cache_update = 1;
-
- // Generate hash
- $hash = generateHash($postData['pass1'][$id]);
-
- // Save password when set
- if (!empty($postData['pass1'][$id])) $add = sprintf(", `password`='%s'", SQL_ESCAPE($hash));
-
- // Get admin's id
- $adminId = getCurrentAdminId();
- $salt = substr(getAdminHash(getAdminLogin($adminId)), 0, -40);
-
- // Rewrite cookie when it's own account
- if ($adminId == $id) {
- // Set timeout cookie
- setSession('admin_last', time());
-
- if ($login != getSession('admin_login')) {
- // Update login cookie
- setSession('admin_login', $login);
-
- // Update password cookie as well?
- if (!empty($add)) setSession('admin_md5', $hash);
- } elseif (generateHash($postData['pass1'][$id], $salt) != getSession('admin_md5')) {
- // Update password cookie
- setSession('admin_md5', $hash);
- }
- } // END - if
-
- // Get default ACL from admin to check if we can allow him to change the default ACL
- $default = getAdminDefaultAcl(getCurrentAdminId());
-
- // Update admin account
- if ($default == 'allow') {
- // Allow changing default ACL
- SQL_QUERY_ESC("UPDATE
+ } elseif ((isset($postData['pass1'])) && (isset($postData['pass2']))) {
+ // Update only if both passwords match
+ if (($postData['pass1'][$id] == $postData['pass2'][$id])) {
+ // Save only when both passwords are the same (also when they are empty)
+ $add = ''; $cache_update = 1;
+
+ // Generate hash
+ $hash = generateHash($postData['pass1'][$id]);
+
+ // Save password when set
+ if (!empty($postData['pass1'][$id])) $add = sprintf(", `password`='%s'", SQL_ESCAPE($hash));
+
+ // Get admin's id
+ $adminId = getCurrentAdminId();
+ $salt = substr(getAdminHash(getAdminLogin($adminId)), 0, -40);
+
+ // Rewrite cookie when it's own account
+ if ($adminId == $id) {
+ // Set timeout cookie
+ setSession('admin_last', time());
+
+ if ($login != getSession('admin_login')) {
+ // Update login cookie
+ setSession('admin_login', $login);
+
+ // Update password cookie as well?
+ if (!empty($add)) setSession('admin_md5', $hash);
+ } elseif (generateHash($postData['pass1'][$id], $salt) != getSession('admin_md5')) {
+ // Update password cookie
+ setSession('admin_md5', $hash);
+ }
+ } // END - if
+
+ // Get default ACL from admin to check if we can allow him to change the default ACL
+ $default = getAdminDefaultAcl(getCurrentAdminId());
+
+ // Update admin account
+ if ($default == 'allow') {
+ // Allow changing default ACL
+ SQL_QUERY_ESC("UPDATE
`{?_MYSQL_PREFIX?}_admins`
SET
`login`='%s'".$add.",
WHERE
`id`=%s
LIMIT 1",
- array(
- $login,
- $postData['email'][$id],
- $postData['mode'][$id],
- $postData['la_mode'][$id],
- $id
- ), __FUNCTION__, __LINE__);
- } else {
- // Do not allow it here
- SQL_QUERY_ESC("UPDATE
+ array(
+ $login,
+ $postData['email'][$id],
+ $postData['mode'][$id],
+ $postData['la_mode'][$id],
+ $id
+ ), __FUNCTION__, __LINE__);
+ } else {
+ // Do not allow it here
+ SQL_QUERY_ESC("UPDATE
`{?_MYSQL_PREFIX?}_admins`
SET
`login`='%s'".$add.",
WHERE
`id`=%s
LIMIT 1",
- array(
- $login,
- $postData['email'][$id],
- $postData['la_mode'][$id],
- $id
- ), __FUNCTION__, __LINE__);
- }
+ array(
+ $login,
+ $postData['email'][$id],
+ $postData['la_mode'][$id],
+ $id
+ ), __FUNCTION__, __LINE__);
+ }
- // Admin account saved
- $message = getMessage('ADMIN_ACCOUNT_SAVED');
+ // Admin account saved
+ $message = getMessage('ADMIN_ACCOUNT_SAVED');
+ } else {
+ // Passwords did not match
+ $message = getMessage('ADMINS_ERROR_PASS_MISMATCH');
+ }
} else {
- // Passwords did not match
- $message = getMessage('ADMINS_ERROR_PASS_MISMATCH');
+ // Update whole array
+ $SQL = 'UPDATE `{?_MYSQL_PREFIX?}_admins` SET ';
+ foreach ($postData as $entry => $value) {
+ // Skip login/id entry
+ if (in_array($entry, array('login', 'id'))) continue;
+
+ // Do we have a non-string (e.g. number, NOW() or back-tick at the beginning?
+ if ((bigintval($value[$id], true, false) === $value[$id]) || ($value[$id] == 'NOW()') || (substr($value[$id], 0, 1) == '`')) {
+ // No need for ticks (')
+ $SQL .= '`' . $entry . '`=' . $value[$id] . ',';
+ } else {
+ // Strings need ticks (') around them
+ $SQL .= '`' . $entry . "`='" . SQL_ESCAPE($value[$id]) . "',";
+ }
+ } // END - foreach
+
+ // Remove last tick and finish query
+ $SQL = substr($SQL, 0, -1) . ' WHERE `id`=%s LIMIT 1';
+
+ // Run it
+ SQL_QUERY_ESC($SQL, array(bigintval($id)), __FUNCTION__, __LINE__);
}
} // END - foreach
loadTemplate('admin_list_admins', false, $OUT);
}
-// Filter for adding extra data to the query
-function FILTER_ADD_EXTRA_SQL_DATA ($add = '') {
- // Is the admins extension updated? (should be!)
- if (getExtensionVersion('admins') >= '0.3.0') $add .= ', `default_acl` AS def_acl';
- if (getExtensionVersion('admins') >= '0.6.7') $add .= ', `la_mode`';
- if (getExtensionVersion('admins') >= '0.7.2') $add .= ', `login_failures`, UNIX_TIMESTAMP(`last_failure`) AS last_failure';
- if (getExtensionVersion('admins') >= '0.7.3') $add .= ', `expert_settings`, `expert_warning`';
-
- // Return it
- return $add;
-}
-
// Sends out mail to all administrators
// IMPORTANT: Please use SEND_ADMIN_NOTIFCATION() for now!
function sendAdminsEmails ($subj, $template, $content, $userid) {
return $data['expert_warning'];
}
+// Get login_failures number from administrator's login name
+function getAdminLoginFailures ($adminLogin) {
+ // Admin login should not be empty
+ if (empty($adminLogin)) {
+ debug_report_bug('adminLogin is empty.');
+ } // END - if
+
+ // By default no admin is found
+ $data['login_failures'] = '-1';
+
+ // Check cache
+ if (isset($GLOBALS['cache_array']['admin']['login_failures'][$adminLogin])) {
+ // Use it if found to save SQL queries
+ $data['login_failures'] = $GLOBALS['cache_array']['admin']['login_failures'][$adminLogin];
+
+ // Update cache hits
+ incrementStatsEntry('cache_hits');
+ } elseif (!isExtensionActive('cache')) {
+ // Load from database
+ $result = SQL_QUERY_ESC("SELECT `login_failures` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
+ array($adminLogin), __FUNCTION__, __LINE__);
+
+ // Do we have an entry?
+ if (SQL_NUMROWS($result) == 1) {
+ // Get it
+ $data = SQL_FETCHARRAY($result);
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+ }
+
+ // Return the login_failures
+ return $data['login_failures'];
+}
+
+// Get last_failure number from administrator's login name
+function getAdminLastFailure ($adminLogin) {
+ // Admin login should not be empty
+ if (empty($adminLogin)) {
+ debug_report_bug('adminLogin is empty.');
+ } // END - if
+
+ // By default no admin is found
+ $data['last_failure'] = '-1';
+
+ // Check cache
+ if (isset($GLOBALS['cache_array']['admin']['last_failure'][$adminLogin])) {
+ // Use it if found to save SQL queries
+ $data['last_failure'] = $GLOBALS['cache_array']['admin']['last_failure'][$adminLogin];
+
+ // Update cache hits
+ incrementStatsEntry('cache_hits');
+ } elseif (!isExtensionActive('cache')) {
+ // Load from database
+ $result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`last_failure`) AS `last_failure` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
+ array($adminLogin), __FUNCTION__, __LINE__);
+
+ // Do we have an entry?
+ if (SQL_NUMROWS($result) == 1) {
+ // Get it
+ $data = SQL_FETCHARRAY($result);
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+ }
+
+ // Return the last_failure
+ return $data['last_failure'];
+}
+
+//*****************************************************************************
+// Below only filter functions
+//*****************************************************************************
+
+// Filter for adding extra data to the query
+function FILTER_ADD_EXTRA_SQL_DATA ($add = '') {
+ // Is the admins extension updated? (should be!)
+ if (getExtensionVersion('admins') >= '0.3.0') $add .= ', `default_acl` AS def_acl';
+ if (getExtensionVersion('admins') >= '0.6.7') $add .= ', `la_mode`';
+ if (getExtensionVersion('admins') >= '0.7.2') $add .= ', `login_failures`, UNIX_TIMESTAMP(`last_failure`) AS last_failure';
+ if (getExtensionVersion('admins') >= '0.7.3') $add .= ', `expert_settings`, `expert_warning`';
+
+ // Return it
+ return $add;
+}
+
+// Reset the login failures
+function FILTER_RESET_ADMINS_LOGIN_FAILURES ($data) {
+ // Store it in session
+ setSession('mxchange_admin_failures' , getAdminLoginFailures($data['login']));
+ setSession('mxchange_admin_last_failure', getAdminLastFailure($data['login']));
+
+ // Prepare update data
+ $postData['login'][getCurrentAdminId()] = $data['login'];
+ $postData['login_failures'][getCurrentAdminId()] = '0';
+ $postData['last_failure'][getCurrentAdminId()] = '0000-00-00 00:00:00';
+
+ // Change it in the admin
+ adminsChangeAdminAccount($postData);
+
+ // Return the data for further processing
+ return $data;
+}
+
+// Count the login failure
+function FILTER_COUNT_ADMINS_LOGIN_FAILURE ($data) {
+ // Prepare update data
+ $postData['login'][getCurrentAdminId()] = $data['login'];
+ $postData['login_failures'][getCurrentAdminId()] = '`login_failures`+1';
+ $postData['last_failure'][getCurrentAdminId()] = 'NOW()';
+
+ // Change it in the admin
+ adminsChangeAdminAccount($postData);
+
+ // Return the data for further processing
+ return $data;
+}
+
// [EOF]
?>
if (!isCacheInstanceValid()) return false;
// Remove cache files
- foreach (array('admin','admin_acls','config','extension','modules','refdepths','refsystem','themes','revision','filter','imprint') as $cache) {
+ foreach (array('admin','admin_acls','config','extension','modules','refdepths','refsystem','themes','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();
} // END - foreach
SQL_FREERESULT($result);
if ($notify == 'Y') {
- // Transfer all neccessary data to the global $content array
+ // Transfer all neccessary data to $content array
$content['start'] = generateDateTime($start, 2);
$content['end'] = generateDateTime($end , 2);
$content['now_t'] = generateDateTime(time(), 2);
return $content;
}
-//
+// Checks wether the registration data is complete
+function isRegistrationDataComplete () {
+ // Init elements
+ $GLOBALS['registration_ip_timeout'] = false;
+ $GLOBALS['registration_short_password'] = false;
+ $GLOBALS['register_selected_cats'] = '0';
+
+ // Default is okay
+ $isOkay = true;
+
+ // First we only check the submitted data then we continue... :)
+ //
+ // Did he agree to our Terms Of Usage?
+ if (postRequestParameter('agree') != 'Y') {
+ setPostRequestParameter('agree', '!');
+ $isOkay = false;
+ } // END - if
+
+ // Did he enter a valid email address? (we really don't care about
+ // that, he has to click on a confirmation link :P )
+ if ((!isPostRequestParameterSet('email')) || (!isEmailValid(postRequestParameter('email')))) {
+ setPostRequestParameter('email', '!');
+ $isOkay = false;
+ } // END - if
+
+ // And what about surname and family's name?
+ if (!isPostRequestParameterSet('surname')) {
+ setPostRequestParameter('surname', '!');
+ $isOkay = false;
+ } // END - if
+ if (!isPostRequestParameterSet('family')) {
+ setPostRequestParameter('family', '!');
+ $isOkay = false;
+ } // END - if
+
+ // Get temporary array for modification
+ $postArray = postRequestArray();
+
+ // Check for required fields
+ $isOkay = ($isOkay && ifRequiredRegisterFieldsAreSet($postArray));
+
+ // Set it back in request
+ setPostRequestArray($postArray);
+
+ // Did he enter his password twice?
+ if (((!isPostRequestParameterSet('pass1')) || (!isPostRequestParameterSet('pass2'))) || ((postRequestParameter('pass1') != postRequestParameter('pass2')) && (isPostRequestParameterSet('pass1')) && (isPostRequestParameterSet('pass2')))) {
+ if ((postRequestParameter('pass1') != postRequestParameter('pass2')) && (isPostRequestParameterSet('pass1')) && (isPostRequestParameterSet('pass2'))) {
+ setPostRequestParameter('pass1', '!');
+ setPostRequestParameter('pass2', '!');
+ } else {
+ if (!isPostRequestParameterSet('pass1')) { setPostRequestParameter('pass1', '!'); } else { setPostRequestParameter('pass1', ''); }
+ if (!isPostRequestParameterSet('pass2')) { setPostRequestParameter('pass2', '!'); } else { setPostRequestParameter('pass2', ''); }
+ }
+ $isOkay = false;
+ } // END - if
+
+ // Is the password long enouth?
+ if ((strlen(postRequestParameter('pass1')) < getConfig('pass_len')) && ($isOkay === true)) {
+ $GLOBALS['registration_short_password'] = true;
+ $isOkay = false;
+ } // END - if
+
+ // Do this check only when no admin is logged in
+ foreach (postRequestParameter('cat') as $id => $answer) {
+ if ($answer == 'Y') $GLOBALS['register_selected_cats']++;
+ } // END - foreach
+
+ // Enougth categories selected?
+ $isOkay = (($isOkay) && ($GLOBALS['register_selected_cats'] < getConfig('least_cats')));
+
+ if ((postRequestParameter('email') != '!') && (getConfig('check_double_email') == 'Y')) {
+ // Does the email address already exists in our database?
+ if ((!isAdmin()) && (isEmailTaken(postRequestParameter('email')))) {
+ setPostRequestParameter('email', '?');
+ $isOkay = false;
+ } // END - if
+ } // END - if
+
+ // Check for IP timeout?
+ if ((!isAdmin()) && (getConfig('ip_timeout') > 0)) {
+ // Check his IP number
+ $GLOBALS['registration_ip_timeout'] = (countSumTotalData(detectRemoteAddr() , 'user_data', 'userid', 'REMOTE_ADDR', true, " AND (`joined` > (UNIX_TIMESTAMP() - {?ip_timeout?}) OR `last_update` > (UNIX_TIMESTAMP() - {?ip_timeout?}))") == 1);
+ $isOkay = false;
+ } // END - if
+
+ // Return result
+ return $isOkay;
+}
+
+// Do the registration
+function doRegistration () {
+ // Prepapre month and day of birth
+ if (strlen(postRequestParameter('day')) == 1) setPostRequestParameter('day' , '0' . postRequestParameter('day'));
+ if (strlen(postRequestParameter('month')) == 1) setPostRequestParameter('month', '0' . postRequestParameter('month'));
+
+ // Get total ...
+ // ... confirmed, ...
+ $confirmedUsers = countSumTotalData('CONFIRMED' , 'user_data', 'userid', 'status', true);
+ // ... unconfirmed ...
+ $unconfirmedUsers = countSumTotalData('UNCONFIRMED', 'user_data', 'userid', 'status', true);
+ // ... and locked users!
+ $lockedUsers = countSumTotalData('LOCKED' , 'user_data', 'userid', 'status', true);
+
+ // Generate hash which will be inserted into confirmation mail
+ $hash = generateHash(sha1(
+ $confirmedUsers . getConfig('ENCRYPT_SEPERATOR') .
+ $unconfirmedUsers . getConfig('ENCRYPT_SEPERATOR') .
+ $lockedUsers . getConfig('ENCRYPT_SEPERATOR') .
+ postRequestParameter('month') . '-' .
+ postRequestParameter('day') . '-' .
+ postRequestParameter('year') . getConfig('ENCRYPT_SEPERATOR') .
+ detectServerName() . getConfig('ENCRYPT_SEPERATOR') .
+ detectRemoteAddr() . getConfig('ENCRYPT_SEPERATOR') .
+ detectUserAgent() . '/' .
+ getConfig('SITE_KEY') . '/' .
+ getConfig('DATE_KEY') . '/' .
+ getConfig('CACHE_BUSTER')
+ ));
+
+ // Old way with enterable two-char-code
+ $countryRow = '`country`';
+ $countryData = substr(postRequestParameter('cntry'), 0, 2);
+
+ // Add design when extension sql_patches is v0.2.7 or greater
+ // @TODO Rewrite these all to a single filter
+ $GLOBALS['register_sql_columns'] = '';
+ $GLOBALS['register_sql_data'] = '';
+ if (isExtensionInstalledAndNewer('theme', '0.0.8')) {
+ // Okay, add design here
+ $GLOBALS['register_sql_columns'] = ', `curr_theme`';
+ $GLOBALS['register_sql_data'] = ", '" . getCurrentTheme() . "'";
+ } // END - if
+
+ // Check if I shall disable sending mail to newly registered members out about active/begging rallye
+ //
+ // First comes first: begging rallye
+ if (isExtensionInstalledAndNewer('beg', '0.1.7')) {
+ // Okay, shall I disable now?
+ if (getConfig('beg_new_mem_notify') != 'Y') {
+ $GLOBALS['register_sql_columns'] .= ', `beg_ral_notify`, `beg_ral_en_notify`';
+ $GLOBALS['register_sql_data'] .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()';
+ } // END - if
+ } // END - if
+
+ // Second: active rallye
+ if (isExtensionInstalledAndNewer('bonus', '0.7.7')) {
+ // Okay, shall I disable now?
+ if (getConfig('bonus_new_mem_notify') != 'Y') {
+ $GLOBALS['register_sql_columns'] .= ', `bonus_ral_notify`, `bonus_ral_en_notify`';
+ $GLOBALS['register_sql_data'] .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()';
+ } // END - if
+ } // END - if
+
+ // Write user data to table
+ if (isExtensionActive('country')) {
+ // Save with new selectable country code
+ $countryRow = '`country_code`';
+ $countryData = bigintval(postRequestParameter('country_code'));
+ } // END - if
+
+ //////////////////////////////
+ // Create user's account... //
+ //////////////////////////////
+ //
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_data` (gender, surname, family, street_nr,%s, zip, city, email, birth_day, birth_month, birth_year, password, max_mails, receive_mails, refid, status, user_hash, REMOTE_ADDR, joined, last_update".$GLOBALS['register_sql_columns'].")
+VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONFIRMED','%s','%s', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()".$GLOBALS['register_sql_data'].")",
+ array(
+ $countryRow,
+ substr(postRequestParameter('gender'), 0, 1),
+ postRequestParameter('surname'),
+ postRequestParameter('family'),
+ postRequestParameter('street_nr'),
+ $countryData,
+ bigintval(postRequestParameter('zip')),
+ postRequestParameter('city'),
+ postRequestParameter('email'),
+ bigintval(postRequestParameter('day')),
+ bigintval(postRequestParameter('month')),
+ bigintval(postRequestParameter('year')),
+ generateHash(postRequestParameter('pass1')),
+ bigintval(postRequestParameter('max_mails')),
+ bigintval(postRequestParameter('max_mails')),
+ bigintval(postRequestParameter('refid')),
+ $hash,
+ detectRemoteAddr(),
+ ), __FILE__, __LINE__);
+
+ // Get his userid
+ $userid = bigintval(SQL_INSERTID());
+
+ // Did this work?
+ if ($userid == '0') {
+ // Something bad happened!
+ loadTemplate('admin_settings_saved', false, getMessage('USER_NOT_REGISTERED'));
+
+ // Stop here
+ return;
+ } // END - if
+
+ // Is the refback extension there?
+ // @TODO Rewrite this to a filter
+ if (isExtensionActive('refback')) {
+ // Update refback table
+ updateRefbackTable($userid);
+ } // END - if
+
+ // Write his welcome-points
+ // @TODO Rewrite this whole if() block to addPointsThroughReferalSystem(). This will also make following if() block obsolete
+ // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s AND `ref_depth`=0 LIMIT 1",
+ array($userid), __FILE__, __LINE__);
+ if (SQL_NUMROWS($result) == '0') {
+ // Add only when the line was not found (maybe some more secure?)
+ $locked = 'points';
+
+ // Pay him later. First he has to confirm some mails!
+ if (getConfig('ref_payout') > 0) $locked = 'locked_points';
+
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_points` (`userid`, `ref_depth`, `%s`) VALUES (%s,0,'{?points_register?}')",
+ array($locked, $userid), __FILE__, __LINE__);
+
+ // Update mediadata as well
+ if ((isExtensionInstalledAndNewer('mediadata', '0.0.4')) && ($locked == 'points')) {
+ // Update database
+ updateMediadataEntry(array('total_points'), 'add', getConfig('points_register'));
+ } // END - if
+ } // END - if
+
+ // Write catgories
+ if ((is_array(postRequestParameter('cat'))) && (count(postRequestParameter('cat')))) {
+ foreach (postRequestParameter('cat') as $cat => $joined) {
+ if ($joined == 'Y') {
+ // Insert category entry
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_cats` (`userid`, `cat_id`) VALUES (%s, %s)",
+ array($userid, bigintval($cat)), __FILE__, __LINE__);
+ } // END - if
+ } // END - foreach
+ } // END - if
+
+ // ... rewrite a zero referal id to the main title
+ if (postRequestParameter('refid') == '0') setPostRequestParameter('refid', getConfig('MAIN_TITLE'));
+
+ // Is ZIP code set?
+ if (isPostRequestParameterSet('zip')) {
+ // Prepare data array for the email template
+ // Start with the gender...
+ $content = array(
+ 'hash' => $hash,
+ 'userid' => $userid,
+ 'gender' => translateGender(postRequestParameter('gender')),
+ 'surname' => SQL_ESCAPE(postRequestParameter('surname')),
+ 'family' => SQL_ESCAPE(postRequestParameter('family')),
+ 'email' => SQL_ESCAPE(postRequestParameter('email')),
+ 'street' => SQL_ESCAPE(postRequestParameter('street_nr')),
+ 'city' => SQL_ESCAPE(postRequestParameter('city')),
+ 'zip' => bigintval(postRequestParameter('zip')),
+ 'country' => $countryData,
+ 'refid' => SQL_ESCAPE(postRequestParameter('refid')),
+ 'pass' => SQL_ESCAPE(postRequestParameter('pass1')),
+ );
+ } else {
+ // No ZIP code entered
+ $content = array(
+ 'hash' => $hash,
+ 'userid' => $userid,
+ 'gender' => translateGender(postRequestParameter('gender')),
+ 'surname' => SQL_ESCAPE(postRequestParameter('surname')),
+ 'family' => SQL_ESCAPE(postRequestParameter('family')),
+ 'email' => SQL_ESCAPE(postRequestParameter('email')),
+ 'street' => SQL_ESCAPE(postRequestParameter('street_nr')),
+ 'city' => SQL_ESCAPE(postRequestParameter('city')),
+ 'zip' => '',
+ 'country' => $countryData,
+ 'refid' => SQL_ESCAPE(postRequestParameter('refid')),
+ 'pass' => SQL_ESCAPE(postRequestParameter('pass1')),
+ );
+ }
+
+ // Continue with birthday...
+ switch (getLanguage()) {
+ case 'de':
+ $content['birthday'] = bigintval(postRequestParameter('day')) . '.' . bigintval(postRequestParameter('month')) . '.' . bigintval(postRequestParameter('year'));
+ break;
+
+ default:
+ $content['birthday'] = bigintval(postRequestParameter('month')) . '/' . bigintval(postRequestParameter('day')) . '/' . bigintval(postRequestParameter('year'));
+ break;
+ } // END - switch
+
+ // Display information to the user that he got mail and send it away
+ $messageGuest = loadEmailTemplate('register-member', $content, $userid);
+
+ // Send mail to user (confirmation link!)
+ $email = $content['email'];
+ sendEmail($content['email'], getMessage('GUEST_SUBJECT_CONFIRM_LINK'), $messageGuest);
+ $content['email'] = $email;
+
+ // Send mail to admin
+ sendAdminNotification(getMessage('ADMIN_SUBJECT_NEW_ACCOUNT'), 'register-admin', $content, $userid);
+}
+
+// [EOF]
?>
$hashedCode = generateHash(md5($valCode), SURFBAR_GET_SALT());
// Finally encrypt it PGP-like and return it
- $valHashedCode = generatePassString($hashedCode);
+ $valHashedCode = encodeHashForCookie($hashedCode);
// Return hashed value
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'finalValCode='.$valHashedCode.'', false);
} // END - if
// Calculate new hash with the secret key and master salt together
- $content['hash'] = generatePassString($content['hash']);
+ $content['hash'] = encodeHashForCookie($content['hash']);
- // Update global array
// @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
+
+ // Set member id
setMemberId($userid);
// Try to set session data (which shall normally always work!)
// Pre-load extensions cacher
loadIncludeOnce('inc/loader/load_cache-extension.php');
+// Load all includes
+loadIncludePool('cache');
+
// Init filter system
initFilterSystem();
// Init system here
runFilterChain('init');
-// Load all includes
-loadIncludePool('cache');
-
// [EOF]
?>
if (($GLOBALS['cache_instance']->loadCacheFile('filter')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) {
// Load filter from cache
$GLOBALS['cache_array']['filter'] = $GLOBALS['cache_instance']->getArrayFromCache();
+
+ // Prepare the array here
+ prepareFilterArray();
} elseif ((getOutputMode() != 1) && (isExtensionInstalled('sql_patches'))) {
// Create cache file here
$GLOBALS['cache_instance']->init();
$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__);
+ $result = SQL_QUERY('SELECT `id`, `userid`, `level`, `counter` FROM `{?_MYSQL_PREFIX?}_refsystem` ORDER BY `userid` ASC, `level` ASC', __FILE__, __LINE__);
while ($content = SQL_FETCHARRAY($result)) {
// Add row to cache file
$GLOBALS['cache_instance']->addRow($content);
} // END - if
// Register an administrator account
-function addAdminAccount ($user, $md5, $email) {
+function addAdminAccount ($adminLogin, $passHash, $adminEmail) {
// Login does already exist
$ret = 'already';
// Lookup the admin
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
- array($user), __FUNCTION__, __LINE__);
+ array($adminLogin), __FUNCTION__, __LINE__);
// Is the entry there?
if (SQL_NUMROWS($result) == '0') {
// Ok, let's create the admin login
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admins` (`login`, `password`, `email`) VALUES ('%s', '%s', '%s')",
array(
- $user,
- $md5,
- $email
+ $adminLogin,
+ $passHash,
+ $adminEmail
), __FUNCTION__, __LINE__);
// All done
return $ret;
}
-// Only be executed on login procedure!
-function ifAdminLoginDataIsValid ($admin, $password) {
- // By default no admin is found
+// This function will be executed when the admin is not logged in and has submitted his login data
+function ifAdminLoginDataIsValid ($adminLogin, $adminPassword) {
+ // First of all, no admin login is found
$ret = '404';
- // Get admin id
- $adminId = getAdminId($admin);
-
- // Init array with admin id by default
- $data = array('admin_id' => $adminId);
-
- // Is the cache valid?
- if (isAdminHashSet($admin)) {
- // Get password from cache
- $data['password'] = getAdminHash($admin);
- $ret = 'pass';
- incrementStatsEntry('cache_hits');
-
- // Include more admins data?
- if ((isExtensionInstalledAndNewer('admins', '0.7.2')) && (isset($GLOBALS['cache_array']['admin']['login_failures'][$adminId]))) {
- // Load them here
- $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
- $add = runFilterChain('sql_admin_extra_data');
-
- // Get password from DB
- $result = SQL_QUERY_ESC("SELECT `password`" . $add . " FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
- array($adminId), __FUNCTION__, __LINE__);
-
- // Entry found?
- if (SQL_NUMROWS($result) == 1) {
- // Login password found
- $ret = 'pass';
-
- // Fetch data
- $data = SQL_FETCHARRAY($result);
- } // END - if
+ // Then we need to lookup the login name by getting the admin hash
+ $adminHash = getAdminHash($adminLogin);
- // Free result
- SQL_FREERESULT($result);
- }
+ // If this is fine, we can continue
+ if ($adminHash != '-1') {
+ // Get admin id and set it as current
+ setCurrentAdminId(getAdminId($adminLogin));
- //* DEBUG: */ outputHtml('*' . $data['password'] . '/' . md5($password) .'/' . $ret . '*<br />');
- if ((isset($data['password'])) && (strlen($data['password']) == 32) && ($data['password'] == md5($password))) {
- // Generate new hash
- $data['password'] = generateHash($password);
-
- // Is the sql_patches not installed, than we cannot have a valid hashed password here!
- //* DEBUG: */ outputHtml($ret . ',' . intval(isExtensionInstalledAndOlder('sql_patches', '0.3.6')) . '/' . intval(!isExtensionInstalled('sql_patches')).'<br />');
- if (($ret == 'pass') && ((isExtensionInstalledAndOlder('sql_patches', '0.3.6')) || (!isExtensionInstalled('sql_patches')))) $ret = 'done';
- } elseif ((isExtensionInstalledAndOlder('sql_patches', '0.3.6')) || (!isExtensionInstalled('sql_patches'))) {
- // Old hashing way
- return $ret;
- } elseif (!isset($data['password'])) {
- // Password not found, so no valid login!
- return $ret;
- }
+ // Now, we need to encode the password in the same way the one is encoded in database
+ $testHash = generateHash($adminPassword, $adminHash);
- // Generate salt of password
- $salt = substr($data['password'], 0, -40);
-
- // Check if password is same
- //* DEBUG: */ outputHtml('*' . $ret . ',' . $data['password'] . ',' . $password . ',' . $salt . '*<br />');
- if (($ret == 'pass') && ($data['password'] == generateHash($password, $salt)) && ((!empty($salt))) || ($data['password'] == md5($password))) {
- // Re-hash the plain passord with new random salt
- $data['password'] = generateHash($password);
-
- // Do we have 0.7.0 of admins or later?
- // Remmeber login failures if available
- 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",
- array($data['password'], $adminId), __FUNCTION__, __LINE__);
+ // If they both match, the login data is valid
+ if ($testHash == $adminHash) {
+ // All fine
+ $ret = 'done';
} else {
- // Update password
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `password`='%s' WHERE `id`=%s LIMIT 1",
- array($data['password'], $adminId), __FUNCTION__, __LINE__);
+ // Set status
+ $ret = 'pass';
}
-
- // Rebuild cache
- rebuildCacheFile('admin', 'admin');
-
- // Login has failed by default... ;-)
- $ret = 'failed1';
-
- // Password matches so login here
- if (doAdminLogin($admin, $data['password'])) {
- // All done now
- $ret = 'done';
- } // END - if
- } elseif ((empty($salt)) && ($ret == 'pass')) {
- // Something bad went wrong
- $ret = 'failed_salt';
- } elseif ($ret == 'done') {
- // Try to login here if we have the old hashing way (sql_patches not installed?)
- if (!doAdminLogin($admin, $data['password'])) {
- // Something went wrong
- $ret = 'failed2';
- } // END - if
- }
-
- // Count login failure if admins extension version is 0.7.0+
- if (($ret == 'pass') && (getExtensionVersion('admins') >= '0.7.0')) {
- // Update counter
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET login_failures`=`login_failures`+1,`last_failure`=NOW() WHERE `id`=%s LIMIT 1",
- array($adminId), __FUNCTION__, __LINE__);
-
- // Rebuild cache
- rebuildCacheFile('admin', 'admin');
} // END - if
- // Return the result
- //* DEBUG: */ die('RETURN=' . $ret);
- return $ret;
-}
-
-// Try to login the admin by setting some session/cookie variables
-function doAdminLogin ($adminLogin, $passHash) {
- // Reset failure counter on matching admins version
- if ((isExtensionInstalledAndNewer('admins', '0.7.0')) && ((isExtensionInstalledAndOlder('sql_patches', '0.3.6')) || (!isExtensionInstalled('sql_patches')))) {
- // Reset counter on out-dated sql_patches version
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `login_failures`=0, `last_failure`='0000-00-00 00:00:00' WHERE `login`='%s' LIMIT 1",
- array($adminLogin), __FUNCTION__, __LINE__);
+ // Prepare data array
+ $data = array(
+ 'login' => $adminLogin,
+ 'pass_hash' => $adminHash
+ );
- // Rebuild cache
- rebuildCacheFile('admin', 'admin');
- } // END - if
+ // Run a special filter
+ runFilterChain('do_admin_login_' . $ret, $data);
- // Now set all session variables and return the result
- return ((
- setSession('admin_md5', generatePassString(generateHash($passHash, '', false)))
- ) && (
- setSession('admin_login', $adminLogin)
- ) && (
- setSession('admin_last', time())
- ));
+ // Return status
+ return $ret;
}
// Only be executed on cookie checking
-function ifAdminCookiesAreValid ($admin, $password) {
- // By default no admin cookies are found
- $ret = '404';
- $pass = '';
+function ifAdminCookiesAreValid ($adminLogin, $passHash) {
+ // First of all, no admin login is found
+ $ret = '404';
- // Get hash
- $pass = getAdminHash($admin);
- if ($pass != '-1') $ret = 'pass';
+ // Then we need to lookup the login name by getting the admin hash
+ $adminHash = getAdminHash($adminLogin);
- //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")<br />");
+ // If this is fine, we can continue
+ if ($adminHash != '-1') {
+ // Now, we need to encode the password in the same way the one is encoded in database
+ $testHash = encodeHashForCookie($adminHash);
- // Check if password matches
- if (($ret == 'pass') && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass))) && (isAdmin())) {
- // Passwords matches!
- $ret = 'done';
+ // If they both match, the login data is valid
+ if ($testHash == $passHash) {
+ // All fine
+ $ret = 'done';
+ } else {
+
+ // Set status
+ $ret = 'pass';
+ }
} // END - if
- // Return result
+ // Return status
return $ret;
}
// Check "logical-area-mode"
function adminGetMenuMode () {
- // Set the global mode as the mode for all admins
+ // Set the default menu mode as the mode for all admins
$mode = getConfig('admin_menu');
$adminMode = $mode;
SQL_FREERESULT($result);
}
- // Check what the admin wants and set it when it's not the global mode
+ // Check what the admin wants and set it when it's not the default mode
if ($adminMode != 'global') $mode = $adminMode;
// Return admin-menu's mode
// Reset the password for the login. Do NOT call this function without calling above function first!
function doResetAdminPassword ($login, $password) {
- // Init hash
- $passHash = '';
-
- // Now check if we have sql_patches installed
- if (isExtensionInstalledAndNewer('sql_patches', '0.3.6')) {
- // Use new way of hashing
- $passHash = generateHash($password);
- } else {
- // Old MD5 method
- $passHash = md5($password);
- }
+ // Generate hash (we already check for sql_patches in generateHash())
+ $passHash = generateHash($password);
// Update database
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `password`='%s' WHERE `login`='%s' LIMIT 1",
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-// Define some variables
-global $DATA;
-
// Check for mails
$result_main = SQL_QUERY("SELECT
`id`,`sender`,`subject`,`payment_id` AS `payment`,`timestamp`,`url`,`target_send`,`cat_id` AS category
return;
}
-// Initialize variables
-$isOkay = true;
-$shortPass = false;
-$cats = '0';
-$ipTimedOut = false;
-
-// Default refid is zero
-setPostRequestParameter('refid', 0);
-if (determineReferalId() > 0) {
- // Test if the refid is valid
- if (!fetchUserData(determineReferalId())) {
- // Not found so we set your refid!
- setPostRequestParameter('refid', getConfig('def_refid'));
- setSession('refid', getConfig('def_refid'));
- } else {
- // Use the refid here
- setPostRequestParameter('refid', determineReferalId());
- }
-} // END - if
-
-if (isFormSent()) {
- // First we only check the submitted data then we continue... :)
- //
- // Did he agree to our Terms Of Usage?
- if (postRequestParameter('agree') != 'Y') {
- setPostRequestParameter('agree', '!');
- $isOkay = false;
- } // END - if
-
- // Did he enter a valid email address? (we really don't care about
- // that, he has to click on a confirmation link :P )
- if ((!isPostRequestParameterSet('email')) || (!isEmailValid(postRequestParameter('email')))) {
- setPostRequestParameter('email', '!');
- $isOkay = false;
- } // END - if
-
- // And what about surname and family's name?
- if (!isPostRequestParameterSet('surname')) {
- setPostRequestParameter('surname', '!');
- $isOkay = false;
- } // END - if
- if (!isPostRequestParameterSet('family')) {
- setPostRequestParameter('family', '!');
- $isOkay = false;
- } // END - if
-
- // Get temporary array for modification
- $postArray = postRequestArray();
-
- // Check for required fields
- if ($isOkay === true) $isOkay = ifRequiredRegisterFieldsAreSet($postArray);
-
- // Set it back in request
- setPostRequestArray($postArray);
-
- // Did he enter his password twice?
- if (((!isPostRequestParameterSet('pass1')) || (!isPostRequestParameterSet('pass2'))) || ((postRequestParameter('pass1') != postRequestParameter('pass2')) && (isPostRequestParameterSet('pass1')) && (isPostRequestParameterSet('pass2')))) {
- if ((postRequestParameter('pass1') != postRequestParameter('pass2')) && (isPostRequestParameterSet('pass1')) && (isPostRequestParameterSet('pass2'))) {
- setPostRequestParameter('pass1', '!');
- setPostRequestParameter('pass2', '!');
- } else {
- if (!isPostRequestParameterSet('pass1')) { setPostRequestParameter('pass1', '!'); } else { setPostRequestParameter('pass1', ''); }
- if (!isPostRequestParameterSet('pass2')) { setPostRequestParameter('pass2', '!'); } else { setPostRequestParameter('pass2', ''); }
- }
- $isOkay = false;
- } // END - if
-
- // Is the password long enouth?
- if ((strlen(postRequestParameter('pass1')) < getConfig('pass_len')) && ($isOkay === true)) {
- $shortPass = true;
- $isOkay = false;
- } // END - if
-
- // No admin? Admins can always register!
- if (!isAdmin()) {
- // Do this check only when no admin is logged in
- foreach (postRequestParameter('cat') as $id => $answer) {
- if ($answer == 'Y') $cats++;
- } // END - foreach
-
- if ($cats < getConfig('least_cats')) {
- // ... nope!
- $isOkay = false;
- } // END - if
- } // END - if
-
- if ((postRequestParameter('email') != '!') && (getConfig('check_double_email') == 'Y')) {
- // Does the email address already exists in our database?
- if ((!isAdmin()) && (isEmailTaken(postRequestParameter('email')))) {
- setPostRequestParameter('email', '?');
- $isOkay = false;
- } // END - if
- } // END - if
-
- // Check for IP timeout?
- if (getConfig('ip_timeout') > 0) {
- // Check his IP number
- $result = SQL_QUERY_ESC("SELECT
- `userid`
-FROM
- `{?_MYSQL_PREFIX?}_user_data`
-WHERE
- `REMOTE_ADDR`='%s' AND
- (`joined` > (UNIX_TIMESTAMP() - {?ip_timeout?}) OR `last_update` > (UNIX_TIMESTAMP() - {?ip_timeout?}))
-LIMIT 1",
- array(detectRemoteAddr()), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1) {
- // Same IP in timeout range and different email address entered... Eat this, faker! ;-)
- // But admins are allowed to fake their own exchange service.
- $ipTimedOut = true;
- $isOkay = false;
- } // END - if
-
- // Free memory
- SQL_FREERESULT($result);
- } // END - if
-} // END - if
-
-// Is the form sent and all went fine or admin logged in?
-//* DEBUG: */ print intval(isFormSent()).'/'.intval($isOkay).'/'.intval(isAdmin()).'<br />';
-if ((isFormSent()) && (($isOkay === true) || (isAdmin()))) {
- // Prepapre month and day of birth
- if (strlen(postRequestParameter('day')) == 1) setPostRequestParameter('day' , 0 . postRequestParameter('day'));
- if (strlen(postRequestParameter('month')) == 1) setPostRequestParameter('month', 0 . postRequestParameter('month'));
-
- // Get total ...
- // ... confirmed, ...
- $confirmedUsers = countSumTotalData('CONFIRMED' , 'user_data', 'userid', 'status', true);
- // ... unconfirmed ...
- $unconfirmedUsers = countSumTotalData('UNCONFIRMED', 'user_data', 'userid', 'status', true);
- // ... and locked users!
- $lockedUsers = countSumTotalData('LOCKED' , 'user_data', 'userid', 'status', true);
-
- // Generate hash which will be inserted into confirmation mail
- $hash = generateHash(sha1($confirmedUsers.getConfig('ENCRYPT_SEPERATOR').$unconfirmedUsers.getConfig('ENCRYPT_SEPERATOR').$lockedUsers.getConfig('ENCRYPT_SEPERATOR').postRequestParameter('month') . '-'.postRequestParameter('day') . '-'.postRequestParameter('year').getConfig('ENCRYPT_SEPERATOR').getenv('SERVER_NAME').getConfig('ENCRYPT_SEPERATOR').detectRemoteAddr().getConfig('ENCRYPT_SEPERATOR').detectUserAgent() . '/' . getConfig('SITE_KEY') . '/' . getConfig('DATE_KEY') . '/'. getConfig('CACHE_BUSTER')));
-
- // Add design when extension sql_patches is v0.2.7 or greater
- // @TODO Rewrite these all to a single filter
- $ADD1 = '';
- $ADD2 = '';
- if (isExtensionInstalledAndNewer('theme', '0.0.8')) {
- // Okay, add design here
- $ADD1 = ', `curr_theme`';
- $ADD2 = ", '".getCurrentTheme()."'";
- } // END - if
-
- // Check if I shall disable sending mail to newly registered members out about active/begging rallye
- //
- // First comes first: begging rallye
- if (isExtensionInstalledAndNewer('beg', '0.1.7')) {
- // Okay, shall I disable now?
- if (getConfig('beg_new_mem_notify') != 'Y') {
- $ADD1 .= ', `beg_ral_notify`, `beg_ral_en_notify`';
- $ADD2 .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()';
- } // END - if
- } // END - if
-
- // Second: active rallye
- if (isExtensionInstalledAndNewer('bonus', '0.7.7')) {
- // Okay, shall I disable now?
- if (getConfig('bonus_new_mem_notify') != 'Y') {
- $ADD1 .= ', `bonus_ral_notify`, `bonus_ral_en_notify`';
- $ADD2 .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()';
- } // END - if
- } // END - if
-
- // Write user data to table
- if (isExtensionActive('country')) {
- // Save with new selectable country code
- $countryRow = '`country_code`';
- $countryData = bigintval(postRequestParameter('country_code'));
- } else {
- // Old way with enterable two-char-code
- $countryRow = '`country`';
- $countryData = substr(postRequestParameter('cntry'), 0, 2);
- }
-
- //////////////////////////////
- // Create user's account... //
- //////////////////////////////
- //
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_data` (gender, surname, family, street_nr,%s, zip, city, email, birth_day, birth_month, birth_year, password, max_mails, receive_mails, refid, status, user_hash, REMOTE_ADDR, joined, last_update".$ADD1.")
-VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONFIRMED','%s','%s', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()".$ADD2.")",
- array(
- $countryRow,
- substr(postRequestParameter('gender'), 0, 1),
- postRequestParameter('surname'),
- postRequestParameter('family'),
- postRequestParameter('street_nr'),
- $countryData,
- bigintval(postRequestParameter('zip')),
- postRequestParameter('city'),
- postRequestParameter('email'),
- bigintval(postRequestParameter('day')),
- bigintval(postRequestParameter('month')),
- bigintval(postRequestParameter('year')),
- generateHash(postRequestParameter('pass1')),
- bigintval(postRequestParameter('max_mails')),
- bigintval(postRequestParameter('max_mails')),
- bigintval(postRequestParameter('refid')),
- $hash,
- detectRemoteAddr(),
- ), __FILE__, __LINE__);
-
- // Get his userid
- $userid = SQL_INSERTID();
-
- // Did this work?
- if ($userid == '0') {
- // Something bad happened!
- loadTemplate('admin_settings_saved', false, getMessage('USER_NOT_REGISTERED'));
- return;
- } // END - if
-
- // Is the refback extension there?
- // @TODO Rewrite this to a filter
- if (isExtensionActive('refback')) {
- // Update refback table
- updateRefbackTable($userid);
- } // END - if
-
- // Write his welcome-points
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s AND `ref_depth`=0 LIMIT 1",
- array(bigintval($userid)), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == '0') {
- // Add only when the line was not found (maybe some more secure?)
- $locked = 'points';
-
- // Pay him later. First he has to confirm some mails!
- if (getConfig('ref_payout') > 0) $locked = 'locked_points';
-
- // @TODO Rewrite this to addPointsDirectly()
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_points` (`userid`, `ref_depth`, `".$locked."`) VALUES (%s,0,'{?points_register?}')",
- array(bigintval($userid)), __FILE__, __LINE__);
-
- // Update mediadata as well
- if ((isExtensionInstalledAndNewer('mediadata', '0.0.4')) && ($locked == 'points')) {
- // Update database
- updateMediadataEntry(array('total_points'), 'add', getConfig('points_register'));
- } // END - if
- } // END - if
-
- // Write catgories
- if ((is_array(postRequestParameter('cat'))) && (count(postRequestParameter('cat')))) {
- foreach (postRequestParameter('cat') as $cat => $joined) {
- if ($joined == 'Y') {
- // Insert category entry
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_cats` (userid, cat_id) VALUES (%s, %s)",
- array(bigintval($userid), bigintval($cat)), __FILE__, __LINE__);
- } // END - if
- } // END - foreach
- } // END - if
-
- // Rewrite gender
- $gender = translateGender(postRequestParameter('gender'));
-
- // ... rewrite a zero referal id to the main title
- if (postRequestParameter('refid') == '0') setPostRequestParameter('refid', getConfig('MAIN_TITLE'));
-
- // Is ZIP code set?
- if (isPostRequestParameterSet('zip')) {
- // Prepare data array for the email template
- // Start with the gender...
- $content = array(
- 'hash' => $hash,
- 'userid' => $userid,
- 'gender' => $gender,
- 'surname' => SQL_ESCAPE(postRequestParameter('surname')),
- 'family' => SQL_ESCAPE(postRequestParameter('family')),
- 'email' => SQL_ESCAPE(postRequestParameter('email')),
- 'street' => SQL_ESCAPE(postRequestParameter('street_nr')),
- 'city' => SQL_ESCAPE(postRequestParameter('city')),
- 'zip' => bigintval(postRequestParameter('zip')),
- 'country' => $countryData,
- 'refid' => SQL_ESCAPE(postRequestParameter('refid')),
- 'pass' => SQL_ESCAPE(postRequestParameter('pass1')),
- );
- } else {
- // No ZIP code entered
- $content = array(
- 'hash' => $hash,
- 'userid' => $userid,
- 'gender' => $gender,
- 'surname' => SQL_ESCAPE(postRequestParameter('surname')),
- 'family' => SQL_ESCAPE(postRequestParameter('family')),
- 'email' => SQL_ESCAPE(postRequestParameter('email')),
- 'street' => SQL_ESCAPE(postRequestParameter('street_nr')),
- 'city' => SQL_ESCAPE(postRequestParameter('city')),
- 'zip' => '',
- 'country' => $countryData,
- 'refid' => SQL_ESCAPE(postRequestParameter('refid')),
- 'pass' => SQL_ESCAPE(postRequestParameter('pass1')),
- );
- }
-
- // Continue with birthday...
- switch (getLanguage()) {
- case 'de':
- $content['birthday'] = bigintval(postRequestParameter('day')) . '.' . bigintval(postRequestParameter('month')) . '.' . bigintval(postRequestParameter('year'));
- break;
-
- default:
- $content['birthday'] = bigintval(postRequestParameter('month')) . '/' . bigintval(postRequestParameter('day')) . '/' . bigintval(postRequestParameter('year'));
- break;
- } // END - switch
-
- // Display information to the user that he got mail and send it away
- $messageGuest = loadEmailTemplate('register-member', $content, $userid);
-
- // Send mail to user (confirmation link!)
- $email = $content['email'];
- sendEmail($content['email'], getMessage('GUEST_SUBJECT_CONFIRM_LINK'), $messageGuest);
- $content['email'] = $email;
-
- // Send mail to admin
- sendAdminNotification(getMessage('ADMIN_SUBJECT_NEW_ACCOUNT'), 'register-admin', $content, $userid);
+// Is the form sent and all went fine?
+//* DEBUG: */ print intval(isFormSent()) . '/' . intval(isRegistrationDataComplete()) . '/' . intval(isAdmin()) . '<br />';
+if ((isFormSent()) && (isRegistrationDataComplete())) {
+ // Do the registration here
+ doRegistration();
// Output success registration
loadTemplate('admin_settings_saved', false, getMessage('REGISTRATION_DONE'));
registerOutputFailedMessage('ENTER_PASS2');
}
- if ($shortPass === true) {
+ if ($GLOBALS['registration_short_password'] === true) {
registerOutputFailedMessage('SHORT_PASS', ': ' . getConfig('pass_len'));
} // END - if
- if ($ipTimedOut === true) {
+ if ($GLOBALS['registration_ip_timeout'] === true) {
registerOutputFailedMessage('REMOTE_ADDR_TIMEOUT');
} // END - if
- if ((!empty($cats)) && ($cats < getConfig('least_cats'))) {
+ if ((!empty($GLOBALS['register_selected_cats'])) && ($GLOBALS['register_selected_cats'] < getConfig('least_cats'))) {
registerOutputFailedMessage('', getMessage('CATS_LEAST'));
} // END - if
} // END - if
// Load more function libraries or includes
-foreach (array('functions', 'request-functions', 'session-functions', 'code-functions', 'language-functions', 'sql-functions', 'expression-functions', 'filter-functions', 'filters', 'mysql-manager', 'extensions-functions', 'handler') as $lib) {
+foreach (array('request-functions', 'session-functions', 'code-functions', 'language-functions', 'sql-functions', 'expression-functions', 'filter-functions','revision-functions', 'filters', 'mysql-manager', 'extensions-functions', 'handler') as $lib) {
// Load special functions
loadIncludeOnce('inc/' . $lib . '.php');
} // END - foreach
setConfigEntry('_DB_TYPE', 'mysql3');
// Include more
- foreach (array('inc/databases.php','inc/versions.php','inc/db/lib.php','inc/session.php','inc/install-functions.php','inc/load_config.php') as $inc) {
+ foreach (array('inc/db/lib.php','inc/databases.php','inc/session.php','inc/versions.php','inc/install-functions.php','inc/load_config.php') as $inc) {
// Load the include
loadIncludeOnce($inc);
} // END - foreach
- // Load config
- loadIncludeOnce('inc/load_config.php');
-
// Init filter system here
initFilterSystem();
setCurrentUserid(getMemberId());
}
- // Init global user data array
+ // Init user data array
initUserData();
// Fix "deleted" cookies first
// Cookies are set with values, but are they valid?
if (fetchUserData(getMemberId()) === true) {
// Validate password by created the difference of it and the secret key
- $valPass = generatePassString(getUserData('password'));
+ $valPass = encodeHashForCookie(getUserData('password'));
// Transfer last module and online time
$GLOBALS['last_online']['module'] = getUserData('last_module');
}
// This patched function will reduce many SELECT queries for the specified or current admin login
-function isAdmin ($admin = '') {
+function isAdmin ($adminLogin = '') {
// Init variables
$ret = false;
$passCookie = '';
$valPass = '';
- //* DEBUG: */ print(__FUNCTION__.':'.$admin.'<br />');
+ //* DEBUG: */ print(__FUNCTION__.':'.$adminLogin.'<br />');
// If admin login is not given take current from cookies...
- if ((empty($admin)) && (isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5'))) {
+ if ((empty($adminLogin)) && (isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5'))) {
// Get admin login and password from session/cookies
- $admin = getSession('admin_login');
+ $adminLogin = getSession('admin_login');
$passCookie = getSession('admin_md5');
} // END - if
- //* DEBUG: */ print(__FUNCTION__.':'.$admin.'/'.$passCookie.'<br />');
+ //* DEBUG: */ print(__FUNCTION__.':'.$adminLogin.'/'.$passCookie.'<br />');
// Do we have cache?
- if (!isset($GLOBALS['is_admin'][$admin])) {
+ if (!isset($GLOBALS['is_admin'][$adminLogin])) {
// Init it with failed
- $GLOBALS['is_admin'][$admin] = false;
+ $GLOBALS['is_admin'][$adminLogin] = false;
// Search in array for entry
if (isset($GLOBALS['admin_hash'])) {
// Use cached string
$valPass = $GLOBALS['admin_hash'];
- } elseif ((!empty($passCookie)) && (isAdminHashSet($admin) === true) && (!empty($admin))) {
+ } elseif ((!empty($passCookie)) && (isAdminHashSet($adminLogin) === true) && (!empty($adminLogin))) {
// Login data is valid or not?
- $valPass = generatePassString(getAdminHash($admin));
+ $valPass = encodeHashForCookie(getAdminHash($adminLogin));
// Cache it away
$GLOBALS['admin_hash'] = $valPass;
// Count cache hits
incrementStatsEntry('cache_hits');
- } elseif ((!empty($admin)) && ((!isExtensionActive('cache')) || (isAdminHashSet($admin) === false))) {
+ } elseif ((!empty($adminLogin)) && ((!isExtensionActive('cache')) || (isAdminHashSet($adminLogin) === false))) {
// Get admin hash and hash it
- $valPass = generatePassString(getAdminHash($admin));
+ $valPass = encodeHashForCookie(getAdminHash($adminLogin));
// Cache it away
$GLOBALS['admin_hash'] = $valPass;
if (!empty($valPass)) {
// Check if password is valid
//* DEBUG: */ print(__FUNCTION__ . ':(' . $valPass . '==' . $passCookie . ')='.intval($valPass == $passCookie).'<br />');
- $GLOBALS['is_admin'][$admin] = (($valPass == $passCookie) || ((strlen($valPass) == 32) && ($valPass == md5($passCookie))) || (($valPass == '*FAILED*') && (!isExtensionActive('cache'))));
+ $GLOBALS['is_admin'][$adminLogin] = (($valPass == $passCookie) || ((strlen($valPass) == 32) && ($valPass == md5($passCookie))) || (($valPass == '*FAILED*') && (!isExtensionActive('cache'))));
} // END - if
} // END - if
// Return result of comparision
- return $GLOBALS['is_admin'][$admin];
+ return $GLOBALS['is_admin'][$adminLogin];
}
// Generates a list of "max receiveable emails per day"
// Send email
sendEmail($userid, getMessage('THANX_REFERAL_ONE_SUBJECT'), $message);
- } elseif (($sendNotify) && (getUserData('refid') == '0') && ($locked === false) && ($add_mode == 'direct')) {
+ } elseif (($sendNotify === true) && (getUserData('refid') == '0') && ($locked === false) && ($add_mode == 'direct')) {
// Prepare content
$content = array(
'text' => getMessage('REASON_DIRECT_PAYMENT'),
}
// Get id number from administrator's login name
-function getAdminId ($login) {
+function getAdminId ($adminLogin) {
// By default no admin is found
$data['id'] = '-1';
// Check cache
- if (isset($GLOBALS['cache_array']['admin']['admin_id'][$login])) {
+ if (isset($GLOBALS['cache_array']['admin']['admin_id'][$adminLogin])) {
// Use it if found to save SQL queries
- $data['id'] = $GLOBALS['cache_array']['admin']['admin_id'][$login];
+ $data['id'] = $GLOBALS['cache_array']['admin']['admin_id'][$adminLogin];
// Update cache hits
incrementStatsEntry('cache_hits');
} elseif (!isExtensionActive('cache')) {
// Load from database
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
- array($login), __FUNCTION__, __LINE__);
+ array($adminLogin), __FUNCTION__, __LINE__);
// Do we have an entry?
if (SQL_NUMROWS($result) == 1) {
$adminId = getAdminId($adminLogin);
// Remember in cache securely
- $GLOBALS['current_admin_id'] = bigintval($adminId);
+ setCurrentAdminId(bigintval($adminId));
} // END - if
// Return it
return $GLOBALS['current_admin_id'];
}
+// Setter for current admin id
+function setCurrentAdminId ($currentAdminId) {
+ // Set it secured
+ $GLOBALS['current_admin_id'] = bigintval($currentAdminId);
+}
+
// Get password hash from administrator's login name
-function getAdminHash ($admin) {
+function getAdminHash ($adminLogin) {
// By default an invalid hash is returned
$data['password'] = '-1';
- if (isAdminHashSet($admin)) {
+ if (isAdminHashSet($adminLogin)) {
// Check cache
- $data['password'] = $GLOBALS['cache_array']['admin']['password'][$admin];
+ $data['password'] = $GLOBALS['cache_array']['admin']['password'][$adminLogin];
// 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($admin), __FUNCTION__, __LINE__);
+ array($adminLogin), __FUNCTION__, __LINE__);
// Do we have an entry?
if (SQL_NUMROWS($result) == 1) {
$data = SQL_FETCHARRAY($result);
// Set cache
- setAdminHash($admin, $data['password']);
+ setAdminHash($adminLogin, $data['password']);
} // END - if
// Free result
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 12/15/2009 *
+ * =================== Last change: 12/15/2009 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : revision-functions.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Revison-info related functions *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Revsions-Info relevante Funktionen *
+ * -------------------------------------------------------------------- *
+ * $Revision:: 1645 $ *
+ * $Date:: 2009-12-06 15:30:15 +0100 (Sun, 06 Dec 2009) $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: quix0r $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ die();
+} // END - if
+
+// "Getter" for revision/version data
+function getActualVersion ($type = 'Revision') {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ret[' . $type . '] - ENTRY!');
+ // Default is an invalid value to find bugs... :-)
+ $ret = 'INVALID';
+
+ // By default nothing is new... ;-)
+ $new = false;
+
+ // Is the cache entry there?
+ if (isset($GLOBALS['cache_array']['revision'][$type][0])) {
+ // Found so increase cache hit
+ incrementStatsEntry('cache_hits');
+
+ // Return it
+ $ret = $GLOBALS['cache_array']['revision'][$type][0];
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ret[' . $type . ']=' . $ret);
+ } else {
+ // FQFN of revision file
+ $FQFN = sprintf("%s/.revision", getConfig('CACHE_PATH'));
+
+ // Check if 'check_revision_data' is setted (switch for manually rewrite the .revision-File)
+ if ((isGetRequestParameterSet('check_revision_data')) && (getRequestParameter('check_revision_data') == 'yes')) {
+ // Forced rebuild of .revision file
+ $new = true;
+ } else {
+ // Check for revision file
+ if (!isFileReadable($FQFN)) {
+ // Not found, so we need to create it
+ $new = true;
+ } else {
+ // Revision file found
+ $ins_vers = explode("\n", readFromFile($FQFN));
+
+ // Get array for mapping information
+ $mapper = array_flip(getSearchFor());
+ //* DEBUG: */ print('<pre>mapper='.print_r($mapper, true).'</pre>ins_vers=<pre>'.print_r($ins_vers, true).'</pre>');
+
+ // Is the content valid?
+ if ((!is_array($ins_vers)) || (count($ins_vers) <= 0) || (!isset($ins_vers[$mapper[$type]])) || (trim($ins_vers[$mapper[$type]]) == '') || ($ins_vers[0]) == 'new') {
+ // File needs update!
+ $new = true;
+ } else {
+ // Generate fake cache entry
+ foreach ($mapper as $map => $idx) {
+ $GLOBALS['cache_array']['revision'][$map][0] = $ins_vers[$idx];
+ } // END - foreach
+
+ // Return found value
+ $ret = getActualVersion($type);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ret[' . $type . ']=' . $ret);
+ }
+ }
+ }
+
+ // Has it been updated?
+ if ($new === true) {
+ // Write it
+ writeToFile($FQFN, implode("\n", getArrayFromActualVersion()));
+
+ // ... and call recursive
+ $ret = getActualVersion($type);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ret[' . $type . ']=' . $ret);
+ } // END - if
+ }
+
+ // Return the value
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ret[' . $type . ']=' . $ret);
+ return $ret;
+}
+
+// Repares an array we are looking for
+// The returned Array is needed twice (in getArrayFromActualVersion() and in getActualVersion() in the old .revision-fallback) so I puted it in an extra function to not polute the global namespace
+function getSearchFor () {
+ // Add Revision, Date, Tag and Author
+ $searchFor = array('File', 'Revision', 'Date', 'Tag', 'Author');
+
+ // Return the created array
+ return $searchFor;
+}
+
+// Extracts requested revision info from given file data
+function extractRevisionInfoFromData ($fileData, $search) {
+ // Default is to return empty string
+ $ret = '';
+
+ // Searches for "$search-tag:VALUE$" or "$search-tag::VALUE$"(the stylish keywordversion ;-)) in the lates modified file
+ $GLOBALS['revision_res'] += preg_match('@\$' . $search . '(:|::) (.*) \$@U', $fileData, $t);
+
+ // Make sure only valid and trimmed entries are used
+ if (isset($t[2])) {
+ $ret = trim($t[2]);
+ } // END - if
+
+ // Return the result
+ return $ret;
+}
+
+// Extracts requested revison info for given file name by reading it's content
+// and parsing it with extractRevisionInfoFromData().
+function extractRevisionInfoFromFile ($FQFN, $search) {
+ // Read the file
+ $fileData = readFromFile($FQFN);
+
+ // Call the extract function and return the result
+ return extractRevisionInfoFromData($fileData, $search);
+}
+
+// @TODO Please describe this function
+function getArrayFromActualVersion () {
+ // Init array
+ $GLOBALS['cache_array']['revision'] = array();
+
+ // Init variables
+ $next_dir = '';
+
+ // Directory to start with search
+ $last_changed = array(
+ 'path_name' => '',
+ 'time' => 0
+ );
+
+ // Init return array
+ $akt_vers = array();
+
+ // Init value for counting the founded keywords
+ $GLOBALS['revision_res'] = '0';
+
+ // Searches all Files and there date of the last modifikation and puts the newest File in $last_changed.
+ searchDirsRecursive($next_dir, $last_changed, 'Revision');
+
+ // Get file
+ $last_file = readFromFile($last_changed['path_name']);
+
+ // Save the last-changed filename for debugging
+ $GLOBALS['cache_array']['revision']['File'][0] = $last_changed['path_name'];
+
+ // This foreach loops the $searchFor-Tags (array('Revision', 'Date', 'Tag', 'Author') --> could easaly extended in the future)
+ foreach (getSearchFor() as $search) {
+ // This extracts the requested data $search from file data $last_file
+ if ($search != 'File') {
+ // Skip 'File' because we have set it some lines above
+ $GLOBALS['cache_array']['revision'][$search][0] = extractRevisionInfoFromData($last_file, $search);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',data=' . $GLOBALS['cache_array']['revision'][$search][0]);
+ } // END - if
+ } // END - foreach
+
+ // at least 3 keyword-Tags are needed for propper values
+ if ($GLOBALS['revision_res'] && $GLOBALS['revision_res'] >= 3
+ && isset($GLOBALS['cache_array']['revision']['Revision'][0]) && $GLOBALS['cache_array']['revision']['Revision'][0] != ''
+ && isset($GLOBALS['cache_array']['revision']['Date'][0]) && $GLOBALS['cache_array']['revision']['Date'][0] != ''
+ && isset($GLOBALS['cache_array']['revision']['Tag'][0]) && $GLOBALS['cache_array']['revision']['Tag'][0] != '') {
+ // Prepare content witch need special treadment
+
+ // Prepare timestamp for date
+ preg_match('@(....)-(..)-(..) (..):(..):(..)@', $GLOBALS['cache_array']['revision']['Date'][0], $match_d);
+ $GLOBALS['cache_array']['revision']['Date'][0] = mktime($match_d[4], $match_d[5], $match_d[6], $match_d[2], $match_d[3], $match_d[1]);
+
+ // Add author to the Tag if the author is set and is not quix0r (lead coder)
+ if ((isset($GLOBALS['cache_array']['revision']['Author'][0])) && ($GLOBALS['cache_array']['revision']['Author'][0] != 'quix0r')) {
+ $GLOBALS['cache_array']['revision']['Tag'][0] .= '-'.strtoupper($GLOBALS['cache_array']['revision']['Author'][0]);
+ } // END - if
+
+ } else {
+ // No valid Data from the last modificated file so read the Revision from the Server. Fallback-solution!! Should not be removed I think.
+ $version = sendGetRequest('check-updates3.php');
+
+ // Invalid request reply?
+ if (!isset($version[11])) {
+ // Cannot continue here
+ debug_report_bug('Invalid response from check-updates3.php, count should be 10+, is ' . count($version));
+ } // END - if
+
+ // Prepare content
+ // Only sets not setted or not proper values to the Online-Server-Fallback-Solution
+ if (!isset($GLOBALS['cache_array']['revision']['File'][0]) || $GLOBALS['cache_array']['revision']['File'][0] == '') $GLOBALS['cache_array']['revision']['File'][0] = trim($version[11]);
+ if (!isset($GLOBALS['cache_array']['revision']['Revision'][0]) || $GLOBALS['cache_array']['revision']['Revision'][0] == '') $GLOBALS['cache_array']['revision']['Revision'][0] = trim($version[10]);
+ if (!isset($GLOBALS['cache_array']['revision']['Date'][0]) || $GLOBALS['cache_array']['revision']['Date'][0] == '') $GLOBALS['cache_array']['revision']['Date'][0] = trim($version[9]);
+ if (!isset($GLOBALS['cache_array']['revision']['Tag'][0]) || $GLOBALS['cache_array']['revision']['Tag'][0] == '') $GLOBALS['cache_array']['revision']['Tag'][0] = trim($version[8]);
+ if (!isset($GLOBALS['cache_array']['revision']['Author'][0]) || $GLOBALS['cache_array']['revision']['Author'][0] == '') $GLOBALS['cache_array']['revision']['Author'][0] = 'quix0r';
+ }
+
+ // Temporary remove [0] from array
+ $array = $GLOBALS['cache_array']['revision'];
+ foreach ($array as $key => $value) {
+ if ((is_array($value)) && (isset($value[0]))) {
+ unset($array[$key][0]);
+ $array[$key] = $value[0];
+ } // END - if
+ } // END - if
+
+ // Return prepared array
+ return $array;
+}
+
+// [EOF]
+?>
// Is the session variable set?
if (('' . $value . '' == '') && (isSessionVariableSet($var))) {
// Remove the session
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'UNSET:' . $var . '=' . getSession($var));
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'UNSET:' . $var . '=' . getSession($var));
unset($GLOBALS['_SESSION'][$var]);
return session_unregister($var);
} elseif (('' . $value . '' != '') && (!isSessionVariableSet($var))) {
// Set session
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SET:' . $var . '=' . $value);
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SET:' . $var . '=' . $value);
$GLOBALS['_SESSION'][$var] = $value;
return session_register($var);
} elseif (!empty($value)) {
// Update session
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'UPDATE:' . $var . '=' . $value);
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'UPDATE:' . $var . '=' . $value);
$GLOBALS['_SESSION'][$var] = $value;
return true;
}
}
// Close tag
- $GLOBALS['page_header'] .= $OUT . '%}" />';
+ $GLOBALS['page_header'] .= $OUT . '%}{%ext,version=sql_patches%}" />';
}
// [EOF]
} // END - if
// Read a given file
-function readFromFile ($FQFN, $sqlPrepare = false) {
+function readFromFile ($FQFN) {
// Sanity-check if file is there (should be there, but just to make it sure)
if (!isFileReadable($FQFN)) {
// This should not happen
debug_report_bug(__FUNCTION__.': File ' . basename($FQFN) . ' is not readable!');
} // END - if
- // Load the file
- if (function_exists('file_get_contents')) {
- // Use new function
- $content = file_get_contents($FQFN);
- } else {
- // Fall-back to implode-file chain
- $content = implode('', file($FQFN));
- }
-
- // Prepare SQL queries?
- if ($sqlPrepare === true) {
- // Remove some unwanted chars
- $content = str_replace("\r", '', $content);
- $content = str_replace("\n\n", "\n", $content);
+ // Is it cached?
+ if (!isset($GLOBALS['file_content'][$FQFN])) {
+ // Load the file
+ if (function_exists('file_get_contents')) {
+ // Use new function
+ $GLOBALS['file_content'][$FQFN] = file_get_contents($FQFN);
+ } else {
+ // Fall-back to implode-file chain
+ $GLOBALS['file_content'][$FQFN] = implode('', file($FQFN));
+ }
} // END - if
// Return the content
- return $content;
+ return $GLOBALS['file_content'][$FQFN];
}
// Writes content to a file
// Mark it as readable
$GLOBALS['file_readable'][$FQFN] = true;
+ // Remember content in cache
+ $GLOBALS['file_content'][$FQFN] = $content;
+
// Return status
return changeMode($FQFN, 0644);
}
if (!isset($GLOBALS['file_readable'][$FQFN])) {
// Check all...
$GLOBALS['file_readable'][$FQFN] = ((file_exists($FQFN)) && (is_file($FQFN)) && (is_readable($FQFN)));
- } // END - if
+
+ // Debug message
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'file=' . basename($FQFN) . ' - CHECK! (' . intval($GLOBALS['file_readable'][$FQFN]) . ')');
+ } else {
+ // Cache used
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'file=' . basename($FQFN) . ' - CACHE! (' . intval($GLOBALS['file_readable'][$FQFN]) . ')');
+ }
// Return result
return $GLOBALS['file_readable'][$FQFN];
return str_replace('&', '&', (getenv('QUERY_STRING')));
}
+// "Getter" for SERVER_NAME
+function detectServerName () {
+ // Return it
+ return (getenv('SERVER_NAME'));
+}
+
// Check wether we are installing
function isInstalling () {
// Determine wether we are installing
// Checks wether the admin hash is set
function isAdminHashSet ($admin) {
+ if (!isset($GLOBALS['cache_array']['admin'])) debug_report_bug('Cache not set.');
return isset($GLOBALS['cache_array']['admin']['password'][$admin]);
}
Content-Transfer-Encoding: 8bit
X-Mailer: {?TITLE?} {?FULL_VERSION?}
Errors-To: {?WEBMASTER?}
+Bounces-To: {?WEBMASTER?}
X-Loop: {?WEBMASTER?}
From: "{?MAIN_TITLE?}" <{?WEBMASTER?}>
+<div align="center">
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<!-- @TODO No title here? //-->
<tr>
<div class="admin_note">
<strong>{--ADMIN_BEG_WINNER_HIGLIGHTED--}</strong>
- <div class="admin_note">
+ <div>
{--ADMIN_BEG_TIMEOUT_1--} <strong>$content[autopurge_timeout]</strong> {--ADMIN_BEG_TIMEOUT_2--}
</div>
</div>
+</div>
{--ADMIN_BONUS_TIMEOUT_1--}<strong>$content[autopurge_timeout]</strong>{--ADMIN_BONUS_TIMEOUT_2--}
</div>
</div>
-</div
+</div>
<tr>
<td align="center" class="top bottom right" width="23%">
<div>{--EMAIL_POINTS--}:</div>
- <div><div><strong class="admin_misc">$content[points] {?POINTS?}</strong></div>
+ <div><strong class="admin_misc">$content[points] {?POINTS?}</strong></div>
</td>
<td align="center" class="top bottom right" width="23%">
<div>{--EMAIL_SECONDS--}:</div>
<div style="clear:both">
<div style="float:left;padding:5px">{--ONLINE_VERSION_IS--}:</div>
- <div style="float:right;padding:5px"><strong>v$content[version] $content[revision]</strong></div>
+ <div style="float:right;padding:5px"><strong>v$content[version] R$content[revision]</strong></div>
</div>
<div style="clear:both">
<div style="padding:5px">
<div style="float:left">{--DOWNLOAD_SVN--}:</div>
<div style="float:right">
- <strong><a href="{?SERVER_URL?}/cms/index/wht/svn" target="_blank">{--DOWNLOAD_NOW--}</a></strong>
+ <strong><a href="{?SERVER_URL?}/cms/index/wht/svn" title="{--SVN_REPOSITORY--}" target="_blank">{--DOWNLOAD_NOW--}</a></strong>
</div>
</div>
</div>
<div class="para">
-Schalten Sie Ihren {?mt_word?} in den Wartungsmodus, wenn dieser mal nicht
-funktionieren sollte und Sie in Ruhe dran debuggen müssen. Bitte
-aktualisieren dann zuerst Ihre SVN-Version (SVN-Update) und falls Sie den
-Fehler nicht selber finden können, melden Sie sich bitte im
-<a href="http://forum.mxchange.org/" rel="external" target="_blank"
- title="Direkt-Link zum Support-Forum">Forum</a> und/oder <a rel="external"
- href="http://bugs.mxchange.org/" target="_blank"
- title="Direkt-Link zum Bug-Tracker">Bug-Tracker</a>.
+ Schalten Sie Ihren {?mt_word?} in den Wartungsmodus, wenn dieser mal nicht
+ funktionieren sollte und Sie in Ruhe dran debuggen müssen. Bitte
+ aktualisieren dann zuerst Ihre SVN-Version (SVN-Update) und falls Sie den
+ Fehler nicht selber finden können, melden Sie sich bitte im
+ <a href="http://forum.mxchange.org/" rel="external" target="_blank"
+ title="Direkt-Link zum Support-Forum">Forum</a> und/oder <a rel="external"
+ href="http://bugs.mxchange.org/" target="_blank"
+ title="Direkt-Link zum Bug-Tracker">Bug-Tracker</a>.
</div>
<div class="para">
-Danke für Ihre Mithilfe bei der Suche nach Bugs! :-)
+ Danke für Ihre Mithilfe bei der Suche nach Bugs! :-)
</div>
Diese Erweiterung prüft im regelmäßigen Abstand nach Updates auf
dem Projekt-Server und wird Sie wahlweise per Mail oder per PopUp-Fenster im
-Adminbereich (oder beides zusammen) benachrichtigen, sobald eine neuere Revision
+Adminbereich (oder beides zusammen) benachrichtigen, sobald eine neuere Version
verfügbar ist.
</td>
</tr>
<tr>
- <td align="right" width="60%" class="register_left">
+ <td align="right" class="register_left">
{--PASS_1--}, {--PASS_2--}:
</td>
- <td width="40%" class="register_right">
+ <td class="register_right">
<input type="password" name="pass1" class="guest_normal" size="10" maxlength="100" />
<input type="password" name="pass2" class="guest_normal" size="10" maxlength="100" />
</td>
$content[refid_content]
<tr>
<td colspan="2" class="guest_title bottom top">
- {--TERMS_OF_USAGE--}:<br />
- <span class="guest_failed">{--YOU_FINALIZE--}</span>
+ <div>{--TERMS_OF_USAGE--}:</div>
+ <div class="guest_failed">{--YOU_FINALIZE--}</div>
</td>
</tr>
<tr>
- <td class="bottom" align="right" width="60%" class="register_left">
+ <td class="bottom register_left" align="right">
{--AGREE_TO_THIS--}:
</td>
- <td class="bottom" width="40%" class="register_right">
+ <td class="bottom register_right">
{--YES--}: <input type="radio" name="agree" class="guest_normal" value="Y" />
{--NO--}: <input type="radio" name="agree" class="guest_normal" value="N" checked="checked" />
</td>
</td>
</tr>
<tr>
- <td class="sponsor_menu" class="top" align="center" valign="top">
+ <td class="sponsor_menu top" align="center" valign="top">
$content[menu]
</td>
<td align="left" valign="top" style="padding-left: 5px; padding-right: 5px">
background-color: #eeeeff;
color: #000000;
width: 230px;
+ height: 25px;
}
.admin_logout {
vertical-align: top;
}
-.list_categories, .admin_action_header, .admin_main, .admin_menu_main, .admin_menu_sub
- {
+.list_categories, .admin_action_header, .admin_main, .admin_menu_main, .admin_menu_sub {
text-align: left;
width: 100%;
}
background-color: #ddeedd;
color: #000077;
width: 220px;
+ height: 25px;
}
.admin_logout {
vertical-align: top;
}
-.list_categories, .admin_action_header, .admin_main, .admin_menu_main, .admin_menu_sub
- {
+.list_categories, .admin_action_header, .admin_main, .admin_menu_main, .admin_menu_sub {
text-align: left;
width: 100%;
}
background-color: #ddddaa;
color: #880000;
width: 230px;
+ height: 25px;
}
.admin_logout {
vertical-align: top;
}
-.list_categories, .admin_action_header, .admin_main, .admin_menu_main, .admin_menu_sub
- {
+.list_categories, .admin_action_header, .admin_main, .admin_menu_main, .admin_menu_sub {
text-align: left;
width: 100%;
}