templates/de/html/admin/admin_email_archiv.tpl -text
templates/de/html/admin/admin_email_archiv_row.tpl -text
templates/de/html/admin/admin_email_nav_row.tpl -text
+templates/de/html/admin/admin_expert_settings_form.tpl -text
templates/de/html/admin/admin_ext_notes.tpl -text
templates/de/html/admin/admin_ext_reg_form.tpl -text
templates/de/html/admin/admin_ext_sql_row.tpl -text
templates/de/html/member/member_menu_whats.tpl -text
templates/de/html/member/member_mydata_button.tpl -text
templates/de/html/member/member_mydata_edit.tpl -text
-templates/de/html/member/member_mydata_locked.tpl -text
templates/de/html/member/member_mydata_overview.tpl -text
templates/de/html/member/member_newsletter.tpl -text
templates/de/html/member/member_nickname_form.tpl -text
./inc/filters.php:538: case 'config': // @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again
./inc/functions.php:1002:// @TODO $simple is deprecated
./inc/functions.php:1037: // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
-./inc/functions.php:2435:// @TODO Please describe this function
-./inc/functions.php:2453: searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time);
+./inc/functions.php:2437:// @TODO Please describe this function
+./inc/functions.php:2455: searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time);
./inc/functions.php:253: // @TODO Remove this sanity-check if all is fine
-./inc/functions.php:2567: // @TODO Add a little more infos here
+./inc/functions.php:2569: // @TODO Add a little more infos here
./inc/functions.php:256: // @TODO Try to rewrite all $DATA to $content
-./inc/functions.php:2668: // @TODO Rewrite this old lost code to a template
-./inc/functions.php:2757: // @TODO Are these convertions still required?
-./inc/functions.php:2775:// @TODO Rewrite this function to use readFromFile() and writeToFile()
-./inc/functions.php:3653:// @TODO Lame description for this function
-./inc/functions.php:3675: // @TODO Move this in a filter
-./inc/functions.php:3793: // @TODO This is still very static, rewrite it somehow
+./inc/functions.php:2651: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
+./inc/functions.php:2674: // @TODO Rewrite this old lost code to a template
+./inc/functions.php:2763: // @TODO Are these convertions still required?
+./inc/functions.php:2781:// @TODO Rewrite this function to use readFromFile() and writeToFile()
+./inc/functions.php:3659:// @TODO Lame description for this function
+./inc/functions.php:3681: // @TODO Move this in a filter
+./inc/functions.php:3799: // @TODO This is still very static, rewrite it somehow
./inc/functions.php:468: // @TODO Do only use $content, not $DATA or raw variables
./inc/functions.php:538: // @TODO Extension 'msg' does not exist
./inc/functions.php:607:// @TODO Rewrite this to an extension 'smtp'
./inc/install-functions.php:62: // @TODO DEACTIVATED: changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestElement('omode'), 0);
-./inc/language/de.php:1150:// @TODO Rewrite these two constants
-./inc/language/de.php:1166:// @TODO Rewrite these five constants
-./inc/language/de.php:848:// @TODO Are these constants longer used?
-./inc/language-functions.php:228: // @TODO These are all valid languages, again hard-coded
+./inc/language/de.php:1154:// @TODO Rewrite these two constants
+./inc/language/de.php:1170:// @TODO Rewrite these five constants
+./inc/language/de.php:850:// @TODO Are these constants longer used?
+./inc/language-functions.php:233: // @TODO These are all valid languages, again hard-coded
./inc/language-functions.php:45:// @TODO Rewrite all language constants to this function.
./inc/language/holiday_de.php:49:// @TODO Rewrite these two constants to one
./inc/language/rallye_de.php:113:// @TODO Rewrite following two lines to one
./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:418: // @TODO This can be, somehow, rewritten
+./inc/libs/admins_functions.php:426: // @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/surfbar_functions.php:1491: // @TODO This can be somehow rewritten
-./inc/libs/surfbar_functions.php:944: // @TODO Invalid salt should be refused
+./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/task_functions.php:52:// @TODO Move all extension-dependent queries into filters
./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:342: // @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
-./inc/libs/user_functions.php:415: // @TODO We should try to rewrite this to fetchUserData() somehow
+./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/yoomedia_functions.php:64: $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: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:544: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY(). Please look some lines above for the dynamic query
-./inc/modules/admin/overview-inc.php:160: // @TODO Rewrite this to a filter
-./inc/modules/admin/overview-inc.php:274: // @TODO Rewrite this to something with include files and/or filter
-./inc/modules/admin/overview-inc.php:312: // @TODO This may also be rewritten to include files
-./inc/modules/admin/overview-inc.php:314: default: // @TODO Unknown support mode
-./inc/modules/admin/overview-inc.php:435: // @TODO Try to move this in includes
+./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/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/overview-inc.php:317: default: // @TODO Unknown support mode
+./inc/modules/admin/overview-inc.php:438: // @TODO Try to move this in includes
./inc/modules/admin/overview-inc.php:44:// @TODO This function does also check for uncompleted tasks
./inc/modules/admin/what-add_guestnl_cat.php:48: // @TODO Check if category does already exist
./inc/modules/admin/what-add_surfbar_url.php:56: // @TODO Find all convertSelectionsToTimestamp() calls and rewrite postRequestElement() calls to $postData
./inc/modules/admin/what-admins_mails.php:60: // @TODO Can this be rewritten???
./inc/modules/admin/what-bonus.php:47:// @TODO Unused at the moment
./inc/modules/admin/what-config_admins.php:145: // @TODO Rewrite this to filter 'run_sqls'
-./inc/modules/admin/what-config_mods.php:135: // @TODO Rewritings: mod->module in template
+./inc/modules/admin/what-config_mods.php:140: // @TODO Rewritings: mod->module in template
+./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-holiday_list.php:47:// @TODO Unused at the moment
./inc/modules/admin/what-list_autopurge.php:54:// @TODO Rewrite those lines to filter
./inc/modules/admin/what-list_autopurge.php:84: // @TODO Rewritings: surname->surname,family->family in templates
-./inc/modules/admin/what-list_cats.php:55: // @TODO No longer needed? define('__CATS_BASE' , "<a href=\"{%url=modules.php?module=admin&userid=");
+./inc/modules/admin/what-list_cats.php:55: // @TODO No longer needed? define('__CATS_BASE' , '<a href="{%url=modules.php?module=admin&userid=');
./inc/modules/admin/what-list_links.php:56: // @TODO Try to rewrite this to a filter
./inc/modules/admin/what-list_links.php:88: // @TODO Find a way to rewrite this. See some lines above for different queries
./inc/modules/admin/what-list_links.php:97: // @TODO Rewrite this to includes/filter
./inc/modules/guest/what-login.php:107: // @TODO Move this HTML code into a template
./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-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/member/what-bonus.php:56: // @TODO Rewrite this to a filter
./inc/modules/member/what-categories.php:128: // @TODO Rewrite this to use $OUT .= ...
./inc/modules/member/what-doubler.php:55:// @TODO The '*100' is in the way to get moved into the template
-./inc/modules/member/what-order.php:443: // @TODO Rewrite this to a filter
-./inc/modules/member/what-payout.php:240: // @TODO Rewrite this to a filter
+./inc/modules/member/what-order.php:449: // @TODO Rewrite this to a filter
+./inc/modules/member/what-order.php:64:// @TODO Rewrite this to a filter
+./inc/modules/member/what-payout.php:220: // @TODO Rewrite this to a filter
./inc/modules/member/what-points.php:54:// @TODO Should we rewrite this to a filter?
-./inc/modules/member/what-rallyes.php:90: // @TODO Reactivate this: $content['admin'] = "<a href=\"{%url=modules.php?module=index&what=impressum&admin=" . $content['admin_id'] . "%}\">" . $content['login'] . "</a>";
+./inc/modules/member/what-rallyes.php:90: // @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&what=impressum&admin=' . $content['admin_id'] . '%}">' . $content['login'] . '</a>';
./inc/modules/member/what-reflinks.php:53:// @TODO Move this into a filter
./inc/modules/member/what-stats.php:118: // @TODO Rewrite in template: clix->clicks
./inc/modules/member/what-transfer.php:135: // @TODO Rewrite this to a filter
./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:1546: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1770: // @TODO Rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:2098: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:2128:// @TODO Fix inconsistency between last_module and getWhat()
-./inc/mysql-manager.php:224: // @TODO Nothing helped???
-./inc/mysql-manager.php:259: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:552: // @TODO Try to rewrite this to one or more functions
+./inc/mysql-manager.php:1554: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:1646: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2105: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2146:// @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:401:// @TODO Do some more sanity check here
+./inc/wrapper-functions.php:406:// @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
./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
-./templates/de/html/member/member_mydata_locked.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
$content['message'] = loadTemplate('birthday_msg', true, $data);
} else {
// Unconfirmed / locked accounts cannot get points
- $content['message'] = sprintf(getMessage('BIRTHDAY_CANNOT_STATUS'), translateUserStatus($data['status']));
+ $content['message'] = getMaskedMessage('BIRTHDAY_CANNOT_STATUS', translateUserStatus($data['status']));
}
} else {
// Cannot load data!
// Is the cache file there?
if ($this->isCacheReadable()) {
// Load cache file
- require($this->fqfn);
+ include($this->fqfn);
// Is there an array?
if (isset($this->data[$this->name])) {
} else {
// Cache file not found or not readable
debug_report_bug($this->name);
- addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".sprintf(getMessage('CACHE_CANNOT_LOAD'), $this->fqfn));
+ addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".getMaskedMessage('CACHE_CANNOT_LOAD', $this->fqfn));
// Try to remove it
$this->removeCacheFile();
$this->rebuilt[$this->name] = true;
} else {
// Not removed!
- addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".sprintf(getMessage('CACHE_CANNOT_UNLINK'), $this->fqfn));
+ addFatalMessage(__METHOD__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".getMaskedMessage('CACHE_CANNOT_UNLINK', $this->fqfn));
}
} // END - if
}
}
$this->_output .= "<a href=\"".$this->_citem['link']."\" ";
if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
- $this->_output .= ">".$this->_cut_string($this->_citem['link'])."</a>";
+ $this->_output .= ">".$this->_cut_string($this->_citem['link']) . '</a>';
$this->_output .= "</td></tr>\n";
$this->_output .= "<tr><td><hr noshade width=\"100%\" size=\"1\"></td></tr>\n";
$this->_output .= "</table></td></tr>";
// Some very important function includes
foreach (array('config','wrapper','inc','stats') as $inc) {
- require($PATH . 'inc/' . $inc . '-functions.php');
+ include($PATH . 'inc/' . $inc . '-functions.php');
} // END - foreach
// Auto-detection... (patched by "Stelzi" aka. profi-concept, thanks again!)
} // END - if
// System-wide return codes
-addCode('WRONG_PASS' , 0x001);
-addCode('WRONG_ID' , 0x002);
-addCode('STATUS_LOCKED' , 0x003);
-addCode('STATUS_UNCONFIRMED', 0x004);
-addCode('UNKNOWN_STATUS' , 0x005);
-addCode('CNTR_FAILED' , 0x008);
-addCode('LOGOUT_DONE' , 0x008);
-addCode('LOGOUT_FAILED' , 0x009);
-addCode('URL_TLOCK' , 0x00a);
-addCode('URL_FOUND' , 0x00b);
-addCode('OVERLENGTH' , 0x00c);
-addCode('SUBJ_URL' , 0x00d);
-addCode('BLIST_URL' , 0x00e);
-addCode('NO_RECS_LEFT' , 0x00f);
-addCode('INVALID_TAGS' , 0x010);
-addCode('MORE_POINTS' , 0x011);
-addCode('COOKIES_DISABLED' , 0x012);
-addCode('DATA_INVALID' , 0x013);
-addCode('POSSIBLE_INVALID' , 0x014);
-addCode('ACCOUNT_LOCKED' , 0x015);
-addCode('USER_404' , 0x016);
-addCode('STATS_404' , 0x017);
-addCode('ALREADY_CONFIRMED' , 0x018);
-addCode('ERROR_MAILID' , 0x019);
-addCode('EXTENSION_PROBLEM' , 0x01a);
-addCode('MORE_RECEIVERS1' , 0x01b);
-addCode('MORE_RECEIVERS2' , 0x01c);
-addCode('MORE_RECEIVERS3' , 0x01d);
-addCode('INVALID_URL' , 0x01e);
-addCode('MENU_NOT_VALID' , 0x01f);
-addCode('LOGIN_FAILED' , 0x020);
-addCode('BEG_SAME_AS_OWN' , 0x021);
-addCode('UNHANDLED_STATUS' , 0x022);
-addCode('MODULE_MEM_ONLY' , 0x023);
+addCode('WRONG_PASS' , 0x001);
+addCode('WRONG_ID' , 0x002);
+addCode('ACCOUNT_LOCKED' , 0x003);
+addCode('ACCOUNT_UNCONFIRMED', 0x004);
+addCode('UNKNOWN_STATUS' , 0x005);
+addCode('CNTR_FAILED' , 0x008);
+addCode('LOGOUT_DONE' , 0x008);
+addCode('LOGOUT_FAILED' , 0x009);
+addCode('URL_TLOCK' , 0x00a);
+addCode('URL_FOUND' , 0x00b);
+addCode('OVERLENGTH' , 0x00c);
+addCode('SUBJ_URL' , 0x00d);
+addCode('BLIST_URL' , 0x00e);
+addCode('NO_RECS_LEFT' , 0x00f);
+addCode('INVALID_TAGS' , 0x010);
+addCode('MORE_POINTS' , 0x011);
+addCode('COOKIES_DISABLED' , 0x012);
+addCode('DATA_INVALID' , 0x013);
+addCode('POSSIBLE_INVALID' , 0x014);
+addCode('USER_404' , 0x016);
+addCode('STATS_404' , 0x017);
+addCode('ALREADY_CONFIRMED' , 0x018);
+addCode('ERROR_MAILID' , 0x019);
+addCode('EXTENSION_PROBLEM' , 0x01a);
+addCode('MORE_RECEIVERS1' , 0x01b);
+addCode('MORE_RECEIVERS2' , 0x01c);
+addCode('MORE_RECEIVERS3' , 0x01d);
+addCode('INVALID_URL' , 0x01e);
+addCode('MENU_NOT_VALID' , 0x01f);
+addCode('LOGIN_FAILED' , 0x020);
+addCode('BEG_SAME_AS_OWN' , 0x021);
+addCode('UNHANDLED_STATUS' , 0x022);
+addCode('MODULE_MEM_ONLY' , 0x023);
+addCode('UNKNOWN_ERROR' , 0x024);
// Server-URL (DO NOT CHANGE THIS OR YOU CANNOT CHECK FOR UPDATES/EXTENSIONS!)
setConfigEntry('SERVER_URL', 'http://www.mxchange.org');
// Debugging
//
//* DEBUG: */ $fp = fopen(getConfig('CACHE_PATH') . 'escape_debug.log', 'a') or app_die(__FILE__, __LINE__, "Cannot write debug.log!");
- //* DEBUG: */ fwrite($fp, $F.'('.$L."): ".str_replace("\r", '', str_replace("\n", " ", $eval))."\n");
+ //* DEBUG: */ fwrite($fp, $F.'('.$L."): ".str_replace("\r", '', str_replace("\n", ' ', $eval))."\n");
//* DEBUG: */ fclose($fp);
if ($run === true) {
if ((isInstallationPhase()) || (empty($ext_name))) return false;
// Not active is the default
- $active = 'N';
+ $data['ext_active'] = 'N';
// Check cache
if (isset($GLOBALS['cache_array']['extension']['ext_active'][$ext_name])) {
// Load from cache
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "CACHE! ext_name={$ext_name}");
- $active = $GLOBALS['cache_array']['extension']['ext_active'][$ext_name];
+ $data['ext_active'] = $GLOBALS['cache_array']['extension']['ext_active'][$ext_name];
// Count cache hits
incrementStatsEntry('cache_hits');
} elseif (isset($GLOBALS['ext_loaded'][$ext_name])) {
// @TODO Extension is loaded, what next?
- app_die(__FUNCTION__, __LINE__, "LOADED:$ext_name");
+ app_die(__FUNCTION__, __LINE__, 'LOADED:' . $ext_name);
} elseif (($ext_name == 'cache') || (!isExtensionInstalled('cache'))) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "DB! ext_name={$ext_name}");
// Load from database
// Entry found?
if (SQL_NUMROWS($result) == 1) {
// Load entry
- list($active) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
} // END - if
// Free result
SQL_FREERESULT($result);
// Write cache array
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "ext_name=".$ext_name."[DB]: {$active}");
- $GLOBALS['cache_array']['extension']['ext_active'][$ext_name] = $active;
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "ext_name=".$ext_name."[DB]: ".$data['ext_active']."");
+ $GLOBALS['cache_array']['extension']['ext_active'][$ext_name] = $data['ext_active'];
} else {
// Extension not active!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "ext_name=".$ext_name.": Not active!");
}
// Debug message
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "ext_name={$ext_name},active={$active}");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "ext_name=".$ext_name.",active=".$data['ext_active']."");
// Is this extension activated? (For admins we always have active extensions...)
- return ($active == 'Y');
+ return ($data['ext_active'] == 'Y');
}
// Get version from extensions
function getExtensionVersion ($ext_name, $force = false) {
// By default no extension is found
- $ext_ver = 'false';
+ $data['ext_version'] = 'false';
// Empty extension name should be fixed!
if (empty($ext_name)) {
// Extensions are all inactive during installation
if (isInstallationPhase()) return '';
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": ext_name={$ext_name}");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": ext_name=".$ext_name."");
// Is the cache written?
if (isset($GLOBALS['cache_array']['extension']['ext_version'][$ext_name])) {
// Load data from cache
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": CACHE!");
- $ext_ver = $GLOBALS['cache_array']['extension']['ext_version'][$ext_name];
+ $data['ext_version'] = $GLOBALS['cache_array']['extension']['ext_version'][$ext_name];
// Count cache hits
incrementStatsEntry('cache_hits');
// Is the extension there?
if (SQL_NUMROWS($result) == 1) {
// Load entry
- list($ext_ver) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
} elseif (isDebugModeEnabled()) {
// Not found!
logDebugMessage(__FUNCTION__, __LINE__, sprintf(": Cannot find extension %s in database!", $ext_name));
SQL_FREERESULT($result);
// Set cache
- $GLOBALS['cache_array']['extension']['ext_version'][$ext_name] = $ext_ver;
+ $GLOBALS['cache_array']['extension']['ext_version'][$ext_name] = $data['ext_version'];
}
// Extension version should not be invalid
- if (($ext_ver == 'false') && ($force === false)) {
+ if (($data['ext_version'] == 'false') && ($force === false)) {
// Please report this trouble
debug_report_bug(sprintf("Extension <strong>%s</strong> has empty version!", $ext_name));
} // END - if
// Return result
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": ret={$ext_ver}");
- return $ext_ver;
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": ret={$data['ext_version']}");
+ return $data['ext_version'];
}
// Updates a given extension with current extension version to latest version
// Get extension name from id
function getExtensionName ($ext_id) {
// Init extension name
- $ret = '';
+ $data['ext_name'] = '';
// Is cache there?
if (isset($GLOBALS['cache_array']['extension']['ext_name'][$ext_id])) {
// Load from cache
- $ret = $GLOBALS['cache_array']['extension']['ext_name'][$ext_id];
+ $data['ext_name'] = $GLOBALS['cache_array']['extension']['ext_name'][$ext_id];
// Count cache hits
incrementStatsEntry('cache_hits');
// Is the entry there?
if (SQL_NUMROWS($result) == 1) {
// Get the extension's name from database
- list($ret) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
} // END - if
// Free result
}
// Did we find some extension?
- if (empty($ret)) {
+ if (empty($data['ext_name'])) {
// We should fix these all!
debug_report_bug(__FUNCTION__ . ': ext_name is empty. ext_id=' . $ext_id);
} // END - if
// Return the extension name
- return $ret;
+ return $data['ext_name'];
}
// Get extension id from name
function getExtensionId ($ext_name) {
// Init id number
- $ret = '0';
+ $data['ext_id'] = '0';
// Do we have cache?
if (isset($GLOBALS['cache_array']['extension']['ext_id'][$ext_name])) {
// Load from cache
- $ret = $GLOBALS['cache_array']['extension']['ext_id'][$ext_name];
+ $data['ext_id'] = $GLOBALS['cache_array']['extension']['ext_id'][$ext_name];
// Count cache hits
incrementStatsEntry('cache_hits');
} else {
// Load from database
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id` AS ext_id FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1",
array($ext_name), __FUNCTION__, __LINE__);
// Is the entry there?
if (SQL_NUMROWS($result) == 1) {
// Get the extension's id from database
- list($ret) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
} // END - if
// Free result
SQL_FREERESULT($result);
// Cache it
- $GLOBALS['cache_array']['extension']['ext_id'][$ext_name] = $ret;
+ $GLOBALS['cache_array']['extension']['ext_id'][$ext_name] = $data['ext_id'];
}
// Return value
- return $ret;
+ return $data['ext_id'];
}
// Determines wether the given extension name is valid
// Not installed and do we have created a task for the admin?
if ((determineTaskIdBySubject($subject) == '0') && (!isExtensionInstalled($ext))) {
// Set default message if ext-foo is missing
- $message = sprintf(getMessage('ADMIN_EXT_TEXT_FILE_MISSING'), $ext);
+ $message = getMaskedMessage('ADMIN_EXT_TEXT_FILE_MISSING', $ext);
// Template file
$tpl = sprintf("%stemplates/%s/html/ext/ext_%s.tpl",
// Entry found?
if (SQL_NUMROWS($result) == 1) {
// Load "has_menu" column
- list($has_menu) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
// Fake cache... ;-)
- $GLOBALS['cache_array']['extension']['ext_menu'][$mod] = $has_menu;
+ $GLOBALS['cache_array']['extension']['ext_menu'][$mod] = $data['has_menu'];
// Does it have a menu?
- $ret = ($has_menu == 'Y');
+ $ret = ($data['has_menu'] == 'Y');
} // END - if
// Free memory
// Determines the task id for given extension
function determineExtensionTaskId ($ext_name) {
// Default is not found
- $task_id = '0';
+ $data['task_id'] = '0';
// Search for extension task's id
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `task_type`='EXTENSION' AND `subject`='[%s:]' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id` AS task_id FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `task_type`='EXTENSION' AND `subject`='[%s:]' LIMIT 1",
array($ext_name), __FUNCTION__, __LINE__);
// Entry found?
if (SQL_NUMROWS($result) == 1) {
// Task found so load task's id and register extension...
- list($task_id) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
} // END - if
// Free result
SQL_FREERESULT($result);
// Return it
- return $task_id;
+ return $data['task_id'];
}
// Determines the task id for given subject
function determineTaskIdBySubject ($subject) {
// Default is not found
- $task_id = '0';
+ $data['task_id'] = '0';
// Search for task id
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `subject` LIKE '%s%%' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id` AS task_id FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `subject` LIKE '%s%%' LIMIT 1",
array($subject), __FUNCTION__, __LINE__);
// Entry found?
if (SQL_NUMROWS($result) == 1) {
// Task found so load task's id and register extension...
- list($task_id) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
} // END - if
// Free result
SQL_FREERESULT($result);
// Return it
- return $task_id;
+ return $data['task_id'];
}
// Add updates notes for given version
} // END - if
// Version of this extension
-setThisExtensionVersion('0.7.2');
+setThisExtensionVersion('0.7.3');
// 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'));
+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'));
// Keep this extension always active!
setExtensionAlwaysActive('Y');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='admins'");
addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_acls`");
addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_mails`");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` DROP default_acl");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` DROP `default_acl`");
// Remove filters
unregisterFilter('sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', true, getExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Schreibweise korregiert.");
break;
+
+ case '0.7.3': // SQL queries for v0.7.2
+ 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;
} // END - switch
break;
case '0.2.4': // SQL queries for v0.2.4
// SQL commands to run
- addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_cache')");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_cache' LIMIT 1");
// Remove config entries
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` DROP `cache_themes`");
// User data found
$functionName = "getFetchedUserData('userid', " . $matches[4][$key] . ", " . $callback . "')";
} // END - if
- } elseif ((!empty($callback)) && (isMember())) {
+ } elseif ((!empty($callback)) && (isUserDataValid())) {
// "Call-back" alias column for current logged in user's data
$functionName = "getUserData('" . $callback . "')";
}
// Translates the "pool type" into human-readable
function translatePoolType ($type) {
// Default?type is unknown
- $translated = sprintf(getMessage('POOL_TYPE_UNKNOWN'), $type);
+ $translated = getMaskedMessage('POOL_TYPE_UNKNOWN', $type);
// Generate constant
$constName = sprintf("POOL_TYPE_%s", $type);
default:
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown status %s detected.", $status));
- $ret = sprintf(getMessage('UNKNOWN_STATUS'), $status);
+ $ret = getMaskedMessage('UNKNOWN_STATUS', $status);
break;
} // END - switch
if (ereg('Y', $display) || (empty($display))) {
// Generate year selection
- $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix."_ye\" size=\"1\">\n";
+ $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_ye\" size=\"1\">\n";
for ($idx = '0'; $idx <= 10; $idx++) {
$OUT .= " <option class=\"mini_select\" value=\"" . $idx."\"";
if ($idx == $Y) $OUT .= ' selected="selected"';
}
$OUT .= " </select></td>\n";
} else {
- $OUT .= "<input type=\"hidden\" name=\"" . $prefix."_ye\" value=\"0\" />\n";
+ $OUT .= '<input type="hidden" name="' . $prefix . '_ye" value="0" />';
}
if (ereg('M', $display) || (empty($display))) {
// Generate month selection
- $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix."_mo\" size=\"1\">\n";
+ $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_mo\" size=\"1\">\n";
for ($idx = '0'; $idx <= 11; $idx++)
{
$OUT .= " <option class=\"mini_select\" value=\"" . $idx."\"";
}
$OUT .= " </select></td>\n";
} else {
- $OUT .= "<input type=\"hidden\" name=\"" . $prefix."_mo\" value=\"0\" />\n";
+ $OUT .= '<input type="hidden" name="' . $prefix . '_mo" value="0" />';
}
if (ereg('W', $display) || (empty($display))) {
// Generate week selection
- $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix."_we\" size=\"1\">\n";
+ $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_we\" size=\"1\">\n";
for ($idx = '0'; $idx <= 4; $idx++) {
$OUT .= " <option class=\"mini_select\" value=\"" . $idx."\"";
if ($idx == $W) $OUT .= ' selected="selected"';
}
$OUT .= " </select></td>\n";
} else {
- $OUT .= "<input type=\"hidden\" name=\"" . $prefix."_we\" value=\"0\" />\n";
+ $OUT .= '<input type="hidden" name="' . $prefix . '_we" value="0" />';
}
if (ereg('D', $display) || (empty($display))) {
// Generate day selection
- $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix."_da\" size=\"1\">\n";
+ $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_da\" size=\"1\">\n";
for ($idx = '0'; $idx <= 31; $idx++) {
$OUT .= " <option class=\"mini_select\" value=\"" . $idx."\"";
if ($idx == $D) $OUT .= ' selected="selected"';
}
$OUT .= " </select></td>\n";
} else {
- $OUT .= "<input type=\"hidden\" name=\"" . $prefix."_da\" value=\"0\" />\n";
+ $OUT .= '<input type="hidden" name="' . $prefix . '_da" value="0" />';
}
if (ereg('h', $display) || (empty($display))) {
// Generate hour selection
- $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix."_ho\" size=\"1\">\n";
+ $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_ho\" size=\"1\">\n";
for ($idx = '0'; $idx <= 23; $idx++) {
$OUT .= " <option class=\"mini_select\" value=\"" . $idx."\"";
if ($idx == $h) $OUT .= ' selected="selected"';
}
$OUT .= " </select></td>\n";
} else {
- $OUT .= "<input type=\"hidden\" name=\"" . $prefix."_ho\" value=\"0\" />\n";
+ $OUT .= '<input type="hidden" name="' . $prefix . '_ho" value="0" />';
}
if (ereg('m', $display) || (empty($display))) {
// Generate minute selection
- $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix."_mi\" size=\"1\">\n";
+ $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_mi\" size=\"1\">\n";
for ($idx = '0'; $idx <= 59; $idx++) {
$OUT .= " <option class=\"mini_select\" value=\"" . $idx."\"";
if ($idx == $m) $OUT .= ' selected="selected"';
}
$OUT .= " </select></td>\n";
} else {
- $OUT .= "<input type=\"hidden\" name=\"" . $prefix."_mi\" value=\"0\" />\n";
+ $OUT .= '<input type="hidden" name="' . $prefix . '_mi" value="0" />';
}
if (ereg('s', $display) || (empty($display))) {
// Generate second selection
- $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix."_se\" size=\"1\">\n";
+ $OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_se\" size=\"1\">\n";
for ($idx = '0'; $idx <= 59; $idx++) {
$OUT .= " <option class=\"mini_select\" value=\"" . $idx."\"";
if ($idx == $s) $OUT .= ' selected="selected"';
}
$OUT .= " </select></td>\n";
} else {
- $OUT .= "<input type=\"hidden\" name=\"" . $prefix."_se\" value=\"0\" />\n";
+ $OUT .= '<input type="hidden" name="' . $prefix . '_se" value="0" />';
}
$OUT .= "</tr>\n";
$OUT .= "</table>\n";
$TEST = date('Y', time()) / 4;
$M1 = date('m', time());
// If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
- if ((floor($TEST) == $TEST) && ($M1 == "02") && ($postData[$prefix."_mo"] > "02")) $SWITCH = getConfig('ONE_DAY');
+ if ((floor($TEST) == $TEST) && ($M1 == '02') && ($postData[$prefix . '_mo'] > '02')) $SWITCH = getConfig('ONE_DAY');
// First add years...
- $ret += $postData[$prefix."_ye"] * (31536000 + $SWITCH);
+ $ret += $postData[$prefix . '_ye'] * (31536000 + $SWITCH);
// Next months...
- $ret += $postData[$prefix."_mo"] * 2628000;
+ $ret += $postData[$prefix . '_mo'] * 2628000;
// Next weeks
- $ret += $postData[$prefix."_we"] * 604800;
+ $ret += $postData[$prefix . '_we'] * 604800;
// Next days...
- $ret += $postData[$prefix."_da"] * 86400;
+ $ret += $postData[$prefix . '_da'] * 86400;
// Next hours...
- $ret += $postData[$prefix."_ho"] * 3600;
+ $ret += $postData[$prefix . '_ho'] * 3600;
// Next minutes..
- $ret += $postData[$prefix."_mi"] * 60;
+ $ret += $postData[$prefix . '_mi'] * 60;
// And at last seconds...
- $ret += $postData[$prefix."_se"];
+ $ret += $postData[$prefix . '_se'];
// Return calculated value
return $ret;
}
$host = extractHostnameFromUrl($script);
// Add data
- $scriptData = http_build_query($data, '', '&');
+ $body = http_build_query($data, '', '&');
// Do we have a question-mark in the script?
if (strpos($script, '?') === false) {
// No, so first char must be question mark
- $scriptData = '?' . $scriptData;
+ $body = '?' . $body;
} else {
// Ok, add &
- $scriptData = '&' . $scriptData;
+ $body = '&' . $body;
}
// Add script data
- $script .= $scriptData;
+ $script .= $body;
// Generate GET request header
$request = 'GET /' . trim($script) . ' HTTP/1.1' . getConfig('HTTP_EOL');
} else {
$request .= 'User-Agent: ' . getConfig('TITLE') . '/' . getConfig('VERSION') . getConfig('HTTP_EOL');
}
- $request .= 'Content-Type: text/plain' . getConfig('HTTP_EOL');
+ $request .= 'Accept: text/plain;q=0.8' . getConfig('HTTP_EOL');
+ $request .= 'Accept-Charset: UTF-8,*' . getConfig('HTTP_EOL');
$request .= 'Cache-Control: no-cache' . getConfig('HTTP_EOL');
+ $request .= 'Content-Type: text/plain' . getConfig('HTTP_EOL');
+ $request .= 'Content-Length: '.strlen($body) . getConfig('HTTP_EOL');
$request .= 'Connection: Close' . getConfig('HTTP_EOL') . getConfig('HTTP_EOL');
// Send the raw request
$host = extractHostnameFromUrl($script);
// Construct request
- $data = http_build_query($postData, '', '&');
+ $body = http_build_query($postData, '', '&');
// Generate POST request header
$request = 'POST /' . trim($script) . ' HTTP/1.1' . getConfig('HTTP_EOL');
$request .= 'Host: ' . $host . getConfig('HTTP_EOL');
$request .= 'Referer: ' . getConfig('URL') . '/admin.php' . getConfig('HTTP_EOL');
$request .= 'User-Agent: ' . getConfig('TITLE') . '/' . getConfig('FULL_VERSION') . getConfig('HTTP_EOL');
- $request .= 'Content-Type: application/x-www-form-urlencoded' . getConfig('HTTP_EOL');
- $request .= 'Content-length: ' . strlen($data) . getConfig('HTTP_EOL');
$request .= 'Cache-Control: no-cache' . getConfig('HTTP_EOL');
+ $request .= 'Content-Type: application/x-www-form-urlencoded' . getConfig('HTTP_EOL');
$request .= 'Connection: Close' . getConfig('HTTP_EOL') . getConfig('HTTP_EOL');
- $request .= $data;
+ $request .= $body;
// Send the raw request
$response = sendRawRequest($host, $request);
$errorCode = getCode('UNKNOWN_STATUS');
// Generate constant name
- $codeName = sprintf("ID_%s", $status);
+ $codeName = sprintf("ACCOUNT_%s", strtoupper($status));
// Is the constant there?
if (isCodeSet($codeName)) {
$message = '';
switch ($code) {
case '': break;
- case getCode('LOGOUT_DONE') : $message = getMessage('LOGOUT_DONE'); break;
- case getCode('LOGOUT_FAILED') : $message = '<span class="guest_failed">{--LOGOUT_FAILED--}</span>'; break;
- case getCode('DATA_INVALID') : $message = getMessage('MAIL_DATA_INVALID'); break;
- case getCode('POSSIBLE_INVALID') : $message = getMessage('MAIL_POSSIBLE_INVALID'); break;
- case getCode('ACCOUNT_LOCKED') : $message = getMessage('MEMBER_ACCOUNT_LOCKED_UNC'); break;
- case getCode('USER_404') : $message = getMessage('USER_404'); break;
- case getCode('STATS_404') : $message = getMessage('MAIL_STATS_404'); break;
- case getCode('ALREADY_CONFIRMED') : $message = getMessage('MAIL_ALREADY_CONFIRMED'); break;
- case getCode('WRONG_PASS') : $message = getMessage('LOGIN_WRONG_PASS'); break;
- case getCode('WRONG_ID') : $message = getMessage('LOGIN_WRONG_ID'); break;
- case getCode('STATUS_LOCKED') : $message = getMessage('LOGIN_STATUS_LOCKED'); break;
- case getCode('STATUS_UNCONFIRMED'): $message = getMessage('LOGIN_STATUS_UNCONFIRMED'); break;
- case getCode('COOKIES_DISABLED') : $message = getMessage('LOGIN_COOKIES_DISABLED'); break;
- case getCode('BEG_SAME_AS_OWN') : $message = getMessage('BEG_SAME_UID_AS_OWN'); break;
- case getCode('LOGIN_FAILED') : $message = getMessage('LOGIN_FAILED_GENERAL'); break;
- case getCode('MODULE_MEM_ONLY') : $message = sprintf(getMessage('MODULE_MEM_ONLY'), getRequestElement('mod')); break;
- case getCode('OVERLENGTH') : $message = getMessage('MEMBER_TEXT_OVERLENGTH'); break;
- case getCode('URL_FOUND') : $message = getMessage('MEMBER_TEXT_CONTAINS_URL'); break;
- case getCode('SUBJ_URL') : $message = getMessage('MEMBER_SUBJ_CONTAINS_URL'); break;
- case getCode('BLIST_URL') : $message = "{--MEMBER_URL_BLACK_LISTED--}<br />\n{--MEMBER_BLIST_TIME--}: ".generateDateTime(getRequestElement('blist'), 0); break;
- case getCode('NO_RECS_LEFT') : $message = getMessage('MEMBER_SELECTED_MORE_RECS'); break;
- case getCode('INVALID_TAGS') : $message = getMessage('MEMBER_HTML_INVALID_TAGS'); break;
- case getCode('MORE_POINTS') : $message = getMessage('MEMBER_MORE_POINTS_NEEDED'); break;
- case getCode('MORE_RECEIVERS1') : $message = getMessage('MEMBER_ENTER_MORE_RECEIVERS'); break;
- case getCode('MORE_RECEIVERS2') : $message = getMessage('MEMBER_NO_MORE_RECEIVERS_FOUND'); break;
- case getCode('MORE_RECEIVERS3') : $message = sprintf(getMessage('MEMBER_ENTER_MORE_MIN_RECEIVERS'), getConfig('order_min')); break;
- case getCode('INVALID_URL') : $message = getMessage('MEMBER_ENTER_INVALID_URL'); break;
+ case getCode('LOGOUT_DONE') : $message = getMessage('LOGOUT_DONE'); break;
+ case getCode('LOGOUT_FAILED') : $message = '<span class="guest_failed">{--LOGOUT_FAILED--}</span>'; break;
+ case getCode('DATA_INVALID') : $message = getMessage('MAIL_DATA_INVALID'); break;
+ case getCode('POSSIBLE_INVALID') : $message = getMessage('MAIL_POSSIBLE_INVALID'); break;
+ case getCode('USER_404') : $message = getMessage('USER_404'); break;
+ case getCode('STATS_404') : $message = getMessage('MAIL_STATS_404'); break;
+ case getCode('ALREADY_CONFIRMED') : $message = getMessage('MAIL_ALREADY_CONFIRMED'); break;
+ case getCode('WRONG_PASS') : $message = getMessage('LOGIN_WRONG_PASS'); break;
+ case getCode('WRONG_ID') : $message = getMessage('LOGIN_WRONG_ID'); break;
+ case getCode('ACCOUNT_LOCKED') : $message = getMessage('LOGIN_STATUS_LOCKED'); break;
+ case getCode('ACCOUNT_UNCONFIRMED'): $message = getMessage('LOGIN_STATUS_UNCONFIRMED'); break;
+ case getCode('COOKIES_DISABLED') : $message = getMessage('LOGIN_COOKIES_DISABLED'); break;
+ case getCode('BEG_SAME_AS_OWN') : $message = getMessage('BEG_SAME_UID_AS_OWN'); break;
+ case getCode('LOGIN_FAILED') : $message = getMessage('LOGIN_FAILED_GENERAL'); break;
+ case getCode('MODULE_MEM_ONLY') : $message = getMaskedMessage('MODULE_MEM_ONLY', getRequestElement('mod')); break;
+ case getCode('OVERLENGTH') : $message = getMessage('MEMBER_TEXT_OVERLENGTH'); break;
+ case getCode('URL_FOUND') : $message = getMessage('MEMBER_TEXT_CONTAINS_URL'); break;
+ case getCode('SUBJ_URL') : $message = getMessage('MEMBER_SUBJ_CONTAINS_URL'); break;
+ case getCode('BLIST_URL') : $message = "{--MEMBER_URL_BLACK_LISTED--}<br />\n{--MEMBER_BLIST_TIME--}: ".generateDateTime(getRequestElement('blist'), 0); break;
+ case getCode('NO_RECS_LEFT') : $message = getMessage('MEMBER_SELECTED_MORE_RECS'); break;
+ case getCode('INVALID_TAGS') : $message = getMessage('MEMBER_HTML_INVALID_TAGS'); break;
+ case getCode('MORE_POINTS') : $message = getMessage('MEMBER_MORE_POINTS_NEEDED'); break;
+ case getCode('MORE_RECEIVERS1') : $message = getMessage('MEMBER_ENTER_MORE_RECEIVERS'); break;
+ case getCode('MORE_RECEIVERS2') : $message = getMessage('MEMBER_NO_MORE_RECEIVERS_FOUND'); break;
+ case getCode('MORE_RECEIVERS3') : $message = getMessage('MEMBER_ENTER_MORE_MIN_RECEIVERS'); break;
+ case getCode('INVALID_URL') : $message = getMessage('MEMBER_ENTER_INVALID_URL'); break;
+ case getCode('UNKNOWN_ERROR') : $message = getMessage('LOGIN_UNKNOWN_ERROR'); break;
+ case getCode('UNKNOWN_STATUS') : $message = getMessage('LOGIN_UNKNOWN_STATUS'); break;
case getCode('ERROR_MAILID'):
if (isExtensionActive('mailid', true)) {
$message = getMessage('ERROR_CONFIRMING_MAIL');
} else {
- $message = sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'mailid');
+ $message = getMaskedMessage('EXTENSION_PROBLEM_NOT_INSTALLED', 'mailid');
}
break;
break;
case getCode('URL_TLOCK'):
+ // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
$result = SQL_QUERY_ESC("SELECT `timestamp` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
array(bigintval(getRequestElement('id'))), __FILE__, __LINE__);
// Load timestamp from last order
list($timestamp) = SQL_FETCHROW($result);
- $timestamp = generateDateTime($timestamp, 1);
// Free memory
SQL_FREERESULT($result);
+ // Translate it for templates
+ $timestamp = generateDateTime($timestamp, 1);
+
// Calculate hours...
$STD = round(getConfig('url_tlock') / 60 / 60);
default:
// Missing/invalid code
- $message = sprintf(getMessage('UNKNOWN_MAILID_CODE'), $code);
+ $message = getMaskedMessage('UNKNOWN_MAILID_CODE', $code);
// Log it
logDebugMessage(__FUNCTION__, __LINE__, $message);
} // END - if
// Default message
- $message = sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), $ext_name);
+ $message = getMaskedMessage('EXTENSION_PROBLEM_EXT_INACTIVE', $ext_name);
// Is an admin logged in?
if (isAdmin()) {
// Then output admin message
- $message = sprintf(getMessage('ADMIN_EXTENSION_PROBLEM_EXT_INACTIVE'), $ext_name);
+ $message = getMaskedMessage('ADMIN_EXTENSION_PROBLEM_EXT_INACTIVE', $ext_name);
} // END - if
// Return prepared message
} // END - if
// Default message
- $message = sprintf(getMessage('EXTENSION_PROBLEM_EXT_NOT_INSTALLED'), $ext_name);
+ $message = getMaskedMessage('EXTENSION_PROBLEM_EXT_NOT_INSTALLED', $ext_name);
// Is an admin logged in?
if (isAdmin()) {
// Then output admin message
- $message = sprintf(getMessage('ADMIN_EXTENSION_PROBLEM_EXT_NOT_INSTALLED'), $ext_name);
+ $message = getMaskedMessage('ADMIN_EXTENSION_PROBLEM_EXT_NOT_INSTALLED', $ext_name);
} // END - if
// Return prepared message
$TITLE = '';
// Title decoration enabled?
- if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_left') != '')) $TITLE .= trim(getConfig('title_left'))." ";
+ if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_left') != '')) $TITLE .= trim(getConfig('title_left')) . ' ';
// Do we have some extra title?
if (isExtraTitleSet()) {
$pageTitle = '[-- ' . getConfig('MAIN_TITLE') . ' - ' . getModuleTitle(getModule()) . ' --]';
} elseif ((isInstalled()) && (!isAdminRegistered())) {
// Installed but no admin registered
- $pageTitle = sprintf(getMessage('SETUP_OF_MXCHANGE'), getConfig('MAIN_TITLE'));
+ $pageTitle = getMessage('SETUP_OF_MXCHANGE');
} elseif ((!isInstalled()) || (!isAdminRegistered())) {
// Installation mode
$pageTitle = getMessage('INSTALLATION_OF_MXCHANGE');
} // END - if
// Try to load it
- require($GLOBALS['inc_loaded'][$inc]);
+ include($GLOBALS['inc_loaded'][$inc]);
}
// Loads an include file once
if (getTotalFatalErrors() > 0) {
$OUT = '';
foreach (getFatalArray() as $value) {
- $OUT .= " <li>" . $value . "</li>\n";
+ $OUT .= ' <li>' . $value . '</li>';
} // END foreach
$content['fatal_errors'] = $OUT;
$OUT = '';
foreach ($mysql as $key => $value) {
- $OUT .= " <input type=\"hidden\" name=\"mysql[" . $key . "]\" value=\"" . $value . "\" />\n";
+ $OUT .= ' <input type="hidden" name="mysql[' . $key . ']" value="' . $value . '" />';
} // END foreach
$content['mysql_hidden'] = $OUT;
$content['spath'] = postRequestElement('spath');
default:
logDebugMessage(__FILE__, __LINE__, sprintf("Wrong page %s detected", getRequestElement('page')));
- addTemplateToInstallContent('admin_settings_saved', "<div class=\"install_error\">{--WRONG_PAGE--}</div>");
+ addTemplateToInstallContent('admin_settings_saved', '<div class="install_error">{--WRONG_PAGE--}</div>');
break;
} // END - switch
} else {
return $return;
}
+// Getter for message string as a mask
+function getMaskedMessage ($messageId, $data) {
+ return sprintf(getMessage($messageId), $data);
+}
+
// Init messages
function initMessages () {
$GLOBALS['messages'][getLanguage()] = array();
'BONUS_STATS_TOTAL' => "100%-Klickratebonus",
'BONUS_POINTS_DISABLED' => "Aktiv-Rallye derzeit nicht aktiv.",
'BONUS_MEMBER_STATS_SUBJECT' => "Ihr Aktiv-Bonus wegen 100% Klickrate",
- 'BONUS_LOGIN_BONUS_ADDED' => "Login-Bonus mit <u>%s {?POINTS?}</u> vergütet.",
+ 'BONUS_LOGIN_BONUS_ADDED' => "Login-Bonus mit <u>{%config,translateComma=login_bonus%} {?POINTS?}</u> vergütet.",
'BONUS_LOGIN_BONUS_NOT_ADDED' => "Login-Bonus nicht vergütet.",
'LIST_UNCONFIRMED_BONUS_LINKS' => "Unbest. Bonus-Mail",
'ADMIN_BONUS_MAIL_ALREADY_DELETED' => "Bonus-Mail bereits gelöscht.",
'POINTS_REF' => "Einmalige Referal-Gutschrift",
'EDIT_REGFORM_SETTINGS' => "Einstellungen am Anmeldeformular",
'LEAST_CATS' => "Mindestens auszuwählende Kategorieanzahl",
- 'CATS_LEAST' => "Bitte wählen Sie mehr Kategorien aus! Minimum ist: %s",
+ 'CATS_LEAST' => "Bitte wählen Sie mehr Kategorien aus! Minimum ist: <span class=\"data\">{?least_cats?}</span>",
'EMAIL_ALREADY_DB' => "Sie haben sich bereits mit dieser Email-Adresse angemeldet, oder jemand anderes verwendet Ihre. Doppelte Anmeldungen sind bei uns verboten.",
'REJECT_DOUBLE_EMAIL' => "Doppelt angemeldete Email-Adressen ablehnen?",
'REJECT_DOUBLE_PASS' => "Gleiche Passwörter bei der Anmeldung ablehnen? (Wird nicht angezeigt!)",
'TOP' => "Nach oben",
'YOUR_LOGIN' => "Ihre Login-Id lautet",
'LOGIN_URL' => "URL zum Login",
- 'GUEST_WELCOME_MEMBER' => "Willkommen zum Login-Bereich für Mitglieder",
+ 'GUEST_LOGIN_MEMBER' => "Einloggen zum Mitgliederbereich",
'GUEST_ENTER_LOGIN' => "Login-Id",
'GUEST_ENTER_PASSWORD' => "Passwort",
'LOGIN_SUBMIT' => "Einloggen",
'LOGIN_UNKNOWN_CODE' => "Unbekannter Rückgabewert.",
'LOGIN_WRONG_PASS' => "Falsches Passwort eingegben.",
'LOGIN_WRONG_ID' => "Es wurde kein Account unter Ihren eingegebenen Logindaten gefunden.",
- 'LOGIN_STATUS_LOCKED' => "Ihr Account wurde gesperrt.",
+ 'LOGIN_STATUS_LOCKED' => "Ihr Account wurde gesperrt. Sperrgrund: <span class=\"data\">{%user,lock_reason%}</span>, Sperrzeitpunkt: <span class=\"data\">{%user,lock_timestamp,generateDateTime%}</span>",
'LOGIN_STATUS_UNCONFIRMED' => "Bitte bestätigen Sie erst Ihre Email-Adresse! Haben Sie den Bestätigungslink verloren? Links im Menü unter "Bestätigungslink" können Sie ihn erneut anfordern.",
'LOGIN_COOKIES_DISABLED' => "Sie haben in Ihrem Browser entweder die Cookies ausgeschaltet, oder die Sicherheitsstufe ist zu hoch eingestellt.",
+ 'LOGIN_UNKNOWN_ERROR' => "Es ist ein unerwarteter Account-Status aufgetreten. Bitte melden Sie sich beim Support dieses {?mt_word2?}.",
+ 'LOGIN_UNKNOWN_STATUS' => "Ihr Account weisst einen unbekannten Status auf. Bitte melden Sie sich beim Support dieses {?mt_word2?}.",
'GUEST_REG_POINTS_1' => "Für Ihre Anmeldung haben wir Ihnen als Willkommensgutschrift",
'GUEST_REG_POINTS_2' => "{?POINTS?} gutgeschrieben. Sie können bereits jetzt schon Mails an die anderen Mitglieder verschicken - solange Empfänger auch erreichbar sind.",
'GUEST_SELECT_LIFETIME' => "Wie lange soll Auto-Login aktiv sein?",
'ACCOUNT_STATUS' => "Account-Status",
'ACCOUNT_UNCONFIRMED' => "<span class=\"admin_failed\">Unbestätigt</span>",
'ACCOUNT_CONFIRMED' => "<span class=\"admin_green\">Bestätigt</span>",
- 'ACCOUNT_LOCKED' => "Gesperrt",
- 'ACCOUNT_DELETED' => "Gelöscht",
+ 'ACCOUNT_LOCKED' => "<span class=\"admin_failed\">Gesperrt</span>",
+ 'ACCOUNT_DELETED' => "<span class=\"admin_failed\">Gelöscht</span>",
'ADMIN_ALL_ACCOUNTS' => "Alle Mitglieder-Accounts auflisten",
'ADMIN_NO_NONE_REGISTERED' => "Ihre Suchkriterieren ergaben keine Treffer in der Mitgliederliste. ",
'ADMIN_MEMBER_404' => "Mitglieds-Account <span class=\"data\">%s</span> existiert nicht.",
'ADMIN_DEL_UNCONFIRMED_LINKS' => "Alle unbestätigten Mails löschen",
'ADMIN_LINKS_DELETED' => "Links für unbestätigte Mails wurden gelöscht.",
'ADMIN_DEL_LINK_SUBJ' => "Ihr unbestätigen Mails wurden gelöscht.",
- 'MEMBER_LINKS_LEFT' => "Sie haben <span class=\"data\">%s</span> unbestätigte Mails. Bitte bestätigen Sie diese zuerst. Wenn Sie weniger als <span class=\"data\">%s</span> Mails im Account haben, können Sie auch wieder buchen.",
+ 'MEMBER_LINKS_LEFT' => "Sie haben <span class=\"data\">%s</span> unbestätigte Mails. Bitte bestätigen Sie diese zuerst. Wenn Sie weniger als <span class=\"data\">{?unconfirmed?}</span> Mails im Account haben, können Sie auch wieder buchen.",
'TODAY' => "Heute",
'MEMBER_PROFILE_LOCKED' => "Sie können Ihren Account erst am <span class=\"data\">%s</span> wieder ändern.",
'MEMBER_HAS_ZERO_MMAILS' => "Sie haben Ihren Empfang auf <strong>Urlaub</strong> stehen! Bitte stellen Sie unter "Profildaten ändern" den Empfang höher ein.",
'ADMIN_EDIT' => "Ändern",
'ADMIN_EDIT_EXTENSIONS' => "Ändern von Erweiterungen",
'POOL_DELETED' => "Bereinigt",
- 'ONLINE_TIMEOUT_IS' => "Die Liste zeigt die Besucher der letzten <span class=\"data\">%s</span> an.",
+ 'ONLINE_TIMEOUT_IS' => "Die Liste zeigt die Besucher der letzten <span class=\"data\">{%config,createFancyTime=online_timeout%}</span> an.",
'ADMIN_CONFIG_EXTENSIONS_SETTINGS' => "Erweiterungs-Management konfigurieren",
'ADMIN_VERBOSE_SQL' => "SQL-Anweisungen beim Registrieren/Updates/Entfernen ausgeben",
'ADMIN_REMOVING_THESE_EXTENSIONS' => "Diese Erweiterungen werden deinstalliert",
'MEMBER_NO_MORE_RECEIVERS_FOUND' => "Es konnten nicht ausreichend genug empfangsbereite Mitglieder gefunden werden.",
'ADMIN_USER_PROFILE_TITLE' => "Mitgliedsprofil aufrufen",
'LIST_UNCONFIRMED_MEMBER_LINKS' => "Unbestätigte Maillinks eines Mitgliedes auflisten",
- 'MEMBER_ENTER_MORE_MIN_RECEIVERS' => "Geben Sie mehr als <span class=\"data\">%s</span> Empfänger ein.",
+ 'MEMBER_ENTER_MORE_MIN_RECEIVERS' => "Geben Sie mehr als <span class=\"data\">{?order_min?}</span> Empfänger ein.",
'NO_TEMPLATE_SUPPLIED' => "Keinen Template-Namen übergeben! Fehler im Script erkannt. Bitte den Webmaster ({?WEBMASTER?}) verständigen.",
'_OR' => "oder",
'GUEST_NEW_PASSWORD_SEND' => "Neues Passwort ist zu Ihrem Postfach unterwegs.",
'MXCHANGE_HAS_DIED' => "{?TITLE?} ist in Script/Funktion <span class=\"data\">%s</span>, Zeile <span class=\"data\">%s</span> mit folgender Meldung gestorben: <span class=\"data\">%s</span>",
'ADMIN_CONFIG_POINTS_TITLE' => "Einstellungen für {?POINTS?}",
'APP_DIE_TITLE' => "Fehler im Script erkannt!",
+ 'ADMIN_CONTACT_LINK_TITLE' => "Kontakt zum Administrator",
+ 'ADMIN_MAIL_NOTHING_DELETED' => "Die Mail mit der Id <span class=\"data\">%s</span weisst keine Mitglieder auf.",
'ADMIN_SEND_RESET_LINK_TITLE' => "1/4: Administratorkennwort zurücksetzen",
'ADMIN_VALIDATE_HASH_TITLE' => "2/4: Validierung Iher Logindaten",
'CACHE_CANNOT_LOAD' => "Kann nicht Cache-Datei <strong><span class=\"data\">%s</span></strong> laden.",
'CACHE_CANNOT_INITIALIZE' => "Konnte das Caching-System nicht initialisieren. Bitte die Dokumentation <strong>DOCS/de/cache/README.txt</strong> lesen.",
'CACHE_CANNOT_UNLINK' => "Kann nicht die Cache-Datei <strong><span class=\"data\">%s</span></strong> vom Server entfernen.",
+
+ // Expert settings
+ 'ADMIN_EXPERT_SETTINGS_STATUS_UPDATE' => "Ihr {?mt_word?} weisst nicht die nötige Erweiterung <span class=\"data\">admins</span> mindestens in der Version <span class=\"data\">0.7.3</span> auf, um Experten-Einstellungen zu prüfen. Bitte aktualisieren Sie Ihre {?mt_word?}-Installation.",
+ 'ADMIN_EXPERT_SETTINGS_STATUS_FAILED' => "Es ist ein allgemeiner Fehler beim Prüfen der Experteneinstellungen aufgetreten für den Sie vermutlich nichts können.",
+ 'ADMIN_EXPERT_SETTINGS_STATUS_FORBIDDEN' => "Sie haben nicht die Berechtigung, Experten-Einstellungen zu ändern.",
+ 'ADMIN_EXPERT_SETTINGS_TITLE' => "Änderungen von Experten-Einstellungen",
+ 'ADMIN_EXPERT_SETTINGS_NOTE' => "Sie sind im Begriff Einstellungen zu ändern, die sehr sensibel sind und sich auf die Funktionalität Ihres {?mt_word2?} negativ auswirken können. Sie sollten daher hier nichts ändern, solange Sie nicht wissen, was Sie da tun.",
+ 'ADMIN_EXPERT_SETTINGS_MAKE_PERMANENT' => "Ja, ich weiss was ich tue und möchte diesen Hinweis nicht mehr angezeigt bekommen.",
+ 'ADMIN_EXPERT_SETTINGS_CONTINUE' => "Dennoch die Experten-Einstellungen aufrufen",
));
// Description of all months
// Language definitions
addMessages(array(
'INSTALLATION_OF_MXCHANGE' => "Installation von {?mt_word?}-Projekt-Script",
- 'SETUP_OF_MXCHANGE' => "Installation von {?mt_word?}-Projekt-Script - %s",
+ 'SETUP_OF_MXCHANGE' => "Installation von {?mt_word?}-Projekt-Script - {?MAIN_TITLE?}",
'INSTALL_MISSING_DUMPS' => "Die SQL-Dumps wurden nicht gefunden! Diese sollten auch mit hochgeladen werden und lesbar sein (CHMOD 644).",
'INSTALL_ENABLE_BACKLINK' => "Backlink (=Rückverlinkung zu mxchange.org setzen?) <em>rel="external"</em> ist gesetzt. Bitte nicht den Backlink einbauen, und <strong>nofollow</strong> verwenden! Das schadet allen.",
'WRONG_PAGE' => "Sie oder dieses Script haben eine falsche Seite ausgewählt.",
// Language definitions
addMessages(array(
- 'ADMIN_LOGS_DIR_404' => "Das Verzeichnis mit den Zugriffslogbüchern konnte nicht gefunden werden! (<span class=\"data\">%s</span>) Vermutlich unterstützt Ihr Server dieses nicht.",
+ 'ADMIN_LOGS_DIR_404' => "Das Verzeichnis mit den Zugriffslogbüchern konnte nicht gefunden werden! (<span class=\"data\">{?logs_base?}</span>) Vermutlich unterstützt Ihr Server dieses nicht.",
'ADMIN_LOGFILE_NOT_READABLE' => "Das Logbuch <span class=\"data\">%s</span> konnte nicht geladen werden.",
'ADMIN_UNKNOWN_LOGFILE_FORMAT' => "Das Logbuch <span class=\"data\">%s</span> hat ein ungültiges oder nicht unterstütztes Format.",
));
'ADMIN_ORDER_ORDER' => "So viele wie auf Empfang eingestellt.",
'MEMBER_ORDER_ALLOWED_RECEIVE' => "Sie können heute noch <span class=\"data\">%s</span> von <span class=\"data\">%s</span> Mailbuchungen aufgeben.",
'MEMBER_ORDER_ALLOWED_MAX' => "Sie können solange Mailbuchungen aufgeben, bis alle Mitglieder nicht mehr empfangsbereit sind.",
- 'MEMBER_ORDER_ALLOWED_UNKNOWN' => "Fehler in Konfiguration erkannt! cfg=<span class=\"data\">%s</span> Bitte den Administrator benachrichtigen.",
+ 'MEMBER_ORDER_ALLOWED_UNKNOWN' => "Fehler in Konfiguration erkannt! cfg=<span class=\"data\">{?order_max_full?}</span> Bitte den Administrator benachrichtigen.",
'ADMIN_ORDER_SELECTION_COLUMN' => "Tabellenspalte, nach der umsortiert werden soll",
'ADMIN_ORDER_SELECTION_MODE' => "Sortierreihenfolge",
'ADMIN_ORDER_SELECTION_SETTINGS' => "Auswahlverfahren der Empfänger",
// Member messages
'PRIMERA_MEMBER_NO_ACCOUNT' => "Noch kein Primus-Account? Hier entlang.",
'PRIMERA_MEMBER_API_DATA_MISSING' => "Diese Funktion kann derzeit nicht genutzt werden, da wir sie noch einrichten müssen.",
- 'PRIMERA_MEMBER_MIN_PAYOUT_PAYOUT' => "Sie haben nicht genügend Primera zum Auszahlen! Mindestens: <span class=\"data\">%s</span> Primera.",
+ 'PRIMERA_MEMBER_MIN_PAYOUT_PAYOUT' => "Sie haben nicht genügend Primera zum Auszahlen! Mindestens: <span class=\"data\">{%config,translateComma=primera_min_payout%}</span> Primera.",
'PRIMERA_MEMBER_WITHDRAW_TITLE' => "Primera bei {?MAIN_TITLE?} einzahlen:",
'PRIMERA_MEMBER_WITHDRAW_POINTS_ACCOUNT' => "Primera hier im Account:",
'PRIMERA_MEMBER_WITHDRAW_MIN_POINTS' => "Mindest einzuzahlendes Primera-Guthaben:",
'PRIMERA_MEMBER_EMPTY_AMOUNT' => "Sie haben keine zu überweisende Betrag angegeben.",
'PRIMERA_MEMBER_INVALID_USERNAME' => "Bitte nur Zahlen für den Primus-Usernamen eingeben.",
'PRIMERA_MEMBER_INVALID_AMOUNT' => "Bitte nur Zahlen für den zu überweisenden Betrag eingeben.",
- 'PRIMERA_MEMBER_AMOUNT_SMALLER_MIN' => "Bitte geben Sie mindestens <span class=\"data\">%s</span> Primera an.",
+ 'PRIMERA_MEMBER_AMOUNT_SMALLER_MIN' => "Bitte geben Sie mindestens <span class=\"data\">{%config,translateComma=primera_min_payout%}</span> Primera an.",
'PRIMERA_MEMBER_WITHDRAW_FAILED' => "Die Einzahlung hat nicht geklappt! Rückmeldung für den Support: <em>%s</em>.",
'PRIMERA_MEMBER_WITHDRAW_DONE' => "Einzahlung auf Ihr {?MAIN_TITLE?} Konto erfolgreich abgeschlossen. :-)",
'PRIMERA_MEMBER_PAYOUT_DONE' => "Auszahlung auf Primus-Portal erfolgreich abgeschlossen. :-)",
'MEMBER_REFBACK_ERROR_INVALID_PERCENTAGE' => "Prozentsatz ungültig. 0 bis 100 sind gültige Werte.",
'MEMBER_REFBACK_ERROR_ID_MISMATCH' => "Die ausgewählte Ref-Back id gehört Ihnen nicht.",
'MEMBER_REFBACK_ERROR_NOT_UPDATED' => "Ref-Back nicht aktualisiert.",
- 'MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS' => "Sie können nur mindestens <span class=\"data\">%s%</span> und maximal <span class=\"data\">%s%</span> einstellen.",
+ 'MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS' => "Sie können nur mindestens <span class=\"data\">{?refback_min_perc?}%</span> und maximal <span class=\"data\">{?refback_max_perc?}%</span> einstellen.",
'MEMBER_REFBACK_DONE' => "Ref-Back eingestellt. Dieser ist ab jetzt gültig.",
// Subject lines
'SPONSOR_BOTH_NEW_PASSWORDS_DIDNOT_MATCH' => "Die von Ihnen eingegebenen neuen Passwörter stimmen nicht überein.",
'SPONSOR_PASSWORD_ONE_EMPTY' => "Erstes einzugebenes Passwort ist leer.",
'SPONSOR_PASSWORD_TWO_EMPTY' => "Zweites einzugebenes Passwort ist leer.",
- 'SPONSOR_PASSWORD_TOO_SHORT' => "Eingegebenes Passwort entspricht nicht der Mindestlänge von <span class=\"data\">%s</span> Zeichen.",
+ 'SPONSOR_PASSWORD_TOO_SHORT' => "Eingegebenes Passwort entspricht nicht der Mindestlänge von <span class=\"data\">{?pass_len?}</span> Zeichen.",
'SPONSOR_ACCOUNT_DATA_NOT_SAVED' => "Ihre Daten wurden <u>nicht</u> gespeichert.",
));
'TRANSFER_TO_MEMBER_NOW' => "Neue {?POINTS?}-Überweisung starten",
'TRANSFER_PLEASE_ALLOW_OPT_IN' => "Bitte erst Empfangen von Überweisungen erlauben.",
'TRANSFER_NOW_LINK' => "Überweisung zum anderen Mitglied tätigen",
+ 'TRANSFER_NOW_TITLE' => "Starten Sie hier eine Überweisung von {?POINTS?} an ein anderes Mitglied.",
'TRANSFER_SELECT_TARGET_UID' => "Empfänger auswählen",
'TRANSFER_NO_ONE_ELSE_OPT_IN' => "Niemand weiteres möchte Überweisungen empfangen.",
'TRANSFER_POINTS_MAXIMUM' => "Maximaler Betrag",
// Language definitions
addMessages(array(
- 'ADMIN_USAGE_DIRECTORY_404' => "Das Verzeichnis <span class=\"data\">%s</span> scheint auf Ihrem Server zu fehlen. Funktion nicht verfügbar.",
+ 'ADMIN_USAGE_DIRECTORY_404' => "Das Verzeichnis <span class=\"data\">{?usage_base?}</span> scheint auf Ihrem Server zu fehlen. Funktion nicht verfügbar.",
));
// [EOF]
'WERNIS_MEMBER_EMPTY_AMOUNT' => "Sie haben keine zu überweisende Betrag angegeben.",
'WERNIS_MEMBER_INVALID_USERNAME' => "Bitte nur Zahlen für den WDS66-Usernamen eingeben.",
'WERNIS_MEMBER_INVALID_AMOUNT' => "Bitte nur Zahlen für den zu überweisenden Betrag eingeben.",
- 'WERNIS_MEMBER_AMOUNT_SMALLER_MIN' => "Bitte geben Sie mindestens <span class=\"data\">%s</span> Wernis an.",
+ 'WERNIS_MEMBER_WITHDRAW_AMOUNT_SMALLER_MIN' => "Bitte geben Sie mindestens <span class=\"data\">{%config,translateComma=wernis_min_withdraw%}</span> Wernis für die Einzahlung an.",
+ 'WERNIS_MEMBER_PAYOUT_AMOUNT_SMALLER_MIN' => "Bitte geben Sie mindestens <span class=\"data\">{%config,translateComma=wernis_min_payout%}</span> Wernis für die Auszahlung an.",
'WERNIS_MEMBER_WITHDRAW_FAILED' => "Die Einzahlung hat nicht geklappt! Rückmeldung für den Support: <em>%s</em>.",
'WERNIS_MEMBER_WITHDRAW_DONE' => "Einzahlung auf Ihr {?MAIN_TITLE?} Konto erfolgreich abgeschlossen. :-)",
'WERNIS_MEMBER_PAYOUT_DONE' => "Auszahlung auf WDS66-Hauptaccount erfolgreich abgeschlossen. :-)",
if (isExtensionActive('online')) {
// Init content
$content = array(
- 'menu' => "<a class=\"menu_blur\" href=\"{%url=modules.php?module=index&what=active%}\">".getConfig('menu_blur_spacer').getMessage('GUEST_ACTIVE_LINK')."</a>",
+ 'menu' => '<a class="menu_blur" href="{%url=modules.php?module=index&what=active%}">{%config=menu_blur_spacer%}' . getMessage('GUEST_ACTIVE_LINK') . '</a>',
'what' => 'active'
);
}
// Change a lot admin account
-function adminsChangeAdminAccount ($postData) {
+function adminsChangeAdminAccount ($postData, $element = '') {
// Begin the update
$cache_update = '0';
foreach ($postData['login'] as $id => $login) {
$id = bigintval($id);
// When both passwords match update admin account
- if ($postData['pass1'][$id] == $postData['pass2'][$id]) {
+ if ((!empty($element)) && (isset($postData[$element]))) {
+ // Save this setting
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `%s`='%s' WHERE `id`=%s LIMIT 1",
+ array($element, $postData[$element][$id], $id), __FILE__, __LINE__);
+
+ // 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;
// Passwords did not match
$message = getMessage('ADMINS_ERROR_PASS_MISMATCH');
}
+ } // END - foreach
- // Display message
- if (!empty($message)) {
- loadTemplate('admin_settings_saved', false, $message);
- }
- }
+ // Display message
+ if (!empty($message)) {
+ loadTemplate('admin_settings_saved', false, $message);
+ } // END - if
// Remove cache file
runFilterChain('post_admin_edited', postRequestArray());
// Get the admin's data
$result = SQL_QUERY_ESC("SELECT login, email, default_acl AS mode, la_mode FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
- array($id), __FUNCTION__, __LINE__);
+ array($id), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Entry found
$content = SQL_FETCHARRAY($result);
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;
SQL_FREERESULT($result);
}
+// "Getter" for current admin's expert settings
+function getAminsExpertSettings () {
+ // Default is has not the right
+ $data['expert_settings'] = 'N';
+
+ // Get current admin login
+ $admin = getAdminLogin(getCurrentAdminId());
+
+ // Lookup settings in cache
+ if (isset($GLOBALS['cache_array']['admin']['expert_settings'][$admin])) {
+ // Use cache
+ $data['expert_settings'] = $GLOBALS['cache_array']['admin']['expert_settings'][$admin];
+
+ // Update cache hits
+ incrementStatsEntry('cache_hits');
+ } elseif (!isExtensionInstalled('cache')) {
+ // Load from database
+ $result = SQL_QUERY_ESC("SELECT `expert_settings` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
+ array($admin), __FUNCTION__, __LINE__);
+
+ // Entry found?
+ if (SQL_NUMROWS($result) == 1) {
+ // Fetch data
+ $data = SQL_FETCHARRAY($result);
+
+ // Set cache
+ $GLOBALS['cache_array']['admin']['expert_settings'][$admin] = $data['expert_settings'];
+ } // END - if
+
+ // Free memory
+ SQL_FREERESULT($result);
+ }
+
+ // Return the result
+ return $data['expert_settings'];
+}
+
+// "Getter" for current admin's expert warning (if he wants to see them or not
+function getAminsExpertWarning () {
+ // Default is has not the right
+ $data['expert_warning'] = 'N';
+
+ // Get current admin login
+ $admin = getAdminLogin(getCurrentAdminId());
+
+ // Lookup warning in cache
+ if (isset($GLOBALS['cache_array']['admin']['expert_warning'][$admin])) {
+ // Use cache
+ $data['expert_warning'] = $GLOBALS['cache_array']['admin']['expert_warning'][$admin];
+
+ // Update cache hits
+ incrementStatsEntry('cache_hits');
+ } elseif (!isExtensionInstalled('cache')) {
+ // Load from database
+ $result = SQL_QUERY_ESC("SELECT `expert_warning` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
+ array($admin), __FUNCTION__, __LINE__);
+
+ // Entry found?
+ if (SQL_NUMROWS($result) == 1) {
+ // Fetch data
+ $data = SQL_FETCHARRAY($result);
+
+ // Set cache
+ $GLOBALS['cache_array']['admin']['expert_warning'][$admin] = $data['expert_warning'];
+ } // END - if
+
+ // Free memory
+ SQL_FREERESULT($result);
+ }
+
+ // Return the result
+ return $data['expert_warning'];
+}
+
// [EOF]
?>
// No entries found!
$OUT = "<tr>
<td colspan=\"3\" align=\"center\" height=\"30\" class=\"bottom\">
- <div class=\"guest_failed\">".sprintf(getMessage('BONUS_NO_RANKS'), $data)."</div>
+ <div class=\"guest_failed\">".getMaskedMessage('BONUS_NO_RANKS', $data)."</div>
</td>
</tr>\n";
}
if (($bonus === true) && (getRequestElement('mode') == 'bonus')) {
// Output message with added points
- $GLOBALS['message'] .= "<div class=\"tiny\">
- ".sprintf(getMessage('BONUS_LOGIN_BONUS_ADDED'), translateComma(getConfig('login_bonus')))."
-</div>";
+ $GLOBALS['message'] .= '<div class="tiny">' . getMessage('BONUS_LOGIN_BONUS_ADDED') . '</div>';
} elseif (isExtensionActive('bonus')) {
// No login bonus added!
- $GLOBALS['message'] .= "<div class=\"member_failed\">{--BONUS_LOGIN_BONUS_NOT_ADDED--}</div>";
+ $GLOBALS['message'] .= '<div class="member_failed">{--BONUS_LOGIN_BONUS_NOT_ADDED--}</div>';
}
}
if (!isCacheInstanceValid()) return false;
// Remove cache
- if ($GLOBALS['cache_instance']->loadCacheFile('admins')) $GLOBALS['cache_instance']->removeCacheFile();
+ if ($GLOBALS['cache_instance']->loadCacheFile('admin')) $GLOBALS['cache_instance']->removeCacheFile();
// Return the data
return $data;
} // END - foreach
// Now replace the URL against anchor container and pray...
- $text = substr($text, 0, strpos($text, $check2))."<a href=\"".generateDerefererUrl($check)."\" target=\"_blank\">".$check."</a>".substr($text, strpos($text, $check2) + strlen($check));
+ $text = substr($text, 0, strpos($text, $check2)) . '<a href="' . generateDerefererUrl($check) . '" target="_blank">' . $check . '</a>' . substr($text, strpos($text, $check2) + strlen($check));
// Finally remove the url from testing string (or we have a loop and maybe server overload!)
$test = substr($test, strpos($test, $check) + strlen($check));
} // END - if
// Now replace the email against anchor with mailto and pray...
- $PARTS[] = $check2 . "<a href=\"" . generateEmailLink($check, 'user_data') . "\">" . $check . "</a>";
+ $PARTS[] = $check2 . '<a href="' . generateEmailLink($check, 'user_data') . '">' . $check . '</a>';
// Remove email from testing string (see above why...)
$test = substr($test, strlen($check));
// Getter for jackpot points
function getJackpotPoints () {
// Default is zero
- $jackpot = '0.00000';
+ $data['points'] = '0.00000';
// Read them
$result = SQL_QUERY("SELECT `points` FROM `{?_MYSQL_PREFIX?}_jackpot` WHERE `ok`='ok' LIMIT 1", __FUNCTION__, __LINE__);
SQL_QUERY("INSERT INTO `{?_MYSQL_PREFIX?}_jackpot` (`ok`, `points`) VALUES ('ok','0.00000')", __FUNCTION__, __LINE__);
} else {
// Read the line
- list($jackpot) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
}
// Free result
SQL_FREERESULT($result);
// Return them
- return $jackpot;
+ return $data['points'];
}
// Adds points to the jackpot
// We can say here, the form is sent, so check if the network is already added
if (isNetworkNameValid(postRequestElement('network_short_name'))) {
// Already there
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_NETWORK_ALREADY_ADDED'), postRequestElement('network_short_name')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_ALREADY_ADDED', postRequestElement('network_short_name')));
return;
} // END - if
loadTemplate('admin_network_added', false, postRequestArray());
} else {
// Not added
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_NETWORK_DATA_NOT_ADDED'), postRequestElement('network_short_name')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_DATA_NOT_ADDED', postRequestElement('network_short_name')));
}
}
// Do we have updates?
if ($updated > 0) {
// Updates done
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_NETWORK_UPDATED'), $updated));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_UPDATED', $updated));
} else {
// Nothing changed
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NETWORK_NOTHING_CHANGED'));
// Do we have removes?
if ($removed > 0) {
// Removals done
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_NETWORK_REMOVED'), $removed));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_REMOVED', $removed));
} else {
// Nothing removed
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NETWORK_NOTHING_REMOVED'));
loadTemplate('member_payout_list', true, $OUT);
} else {
// No payout types setup so far
- loadTemplate('admin_settings_saved', false, "<div class=\"guest_failed\">{--PAYOUT_NO_PAYOUT_TYPES--}</div");
+ loadTemplate('admin_settings_saved', false, '<div class="guest_failed">{--PAYOUT_NO_PAYOUT_TYPES--}</div>');
}
// Free memory
SQL_FREERESULT($result);
} else {
// Points is empty
- loadTemplate('admin_settings_saved', false, "<div class=\"guest_failed\">{--PAYOUT_NO_POINTS_ENTERED--}</div");
+ loadTemplate('admin_settings_saved', false, '<div class="guest_failed">{--PAYOUT_NO_POINTS_ENTERED--}</div>');
}
}
$api = new PrimeraApi($primusNick, $userMd5);
// Prepare purpose
- eval("\$purpose = \"".compileRawCode(sprintf(getMessage('PRIMERA_API_PURPOSE_WITHDRAW'), getSession('sponsorid')))."\";");
+ eval("\$purpose = \"".compileRawCode(getMaskedMessage('PRIMERA_API_PURPOSE_WITHDRAW', getSession('sponsorid')))."\";");
// Pay the Primera
return $api->payPrimera($primusNick, $amount, $purpose);
$api = new PrimeraApi(getConfig('primera_api_name'), getConfig('primera_api_md5'));
// Prepare purpose
- eval("\$purpose = \"".compileRawCode(sprintf(getMessage('PRIMERA_API_PURPOSE_PAYOUT'), getMemberId()))."\";");
+ eval("\$purpose = \"".compileRawCode(getMaskedMessage('PRIMERA_API_PURPOSE_PAYOUT', getMemberId()))."\";");
// Pay the Primera
return $api->payPrimera($primusNick, $amount, $purpose);
if (($notify == 'Y') && ($un)) {
// Load email template and send it to the user
$message = loadEmailTemplate('member_rallye_notify', $content, $content['userid']);
- sendEmail($content['userid'], sprintf(getMessage('RALLYE_MEMBER_NOTIFY'), $title), $message);
+ sendEmail($content['userid'], getMaskedMessage('RALLYE_MEMBER_NOTIFY', $title), $message);
} // END - if
} // END - while
if ($notify == 'Y') $templ = 'admin_rallye_notify';
// Send email to admin
- sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_NOTIFY'), $title), $templ, $prices, 0);
+ sendAdminNotification(getMaskedMessage('RALLYE_ADMIN_NOTIFY', $title), $templ, $prices, 0);
// Free memory
SQL_FREERESULT($result_user);
SQL_FREERESULT($result_prices);
} else {
// No prices???
- $prices = sprintf(getMessage('RALLYE_MEMBER_NO_PRICES'), $mode);
+ $prices = getMaskedMessage('RALLYE_MEMBER_NO_PRICES', $mode);
}
// Add last line for email mode
// Send notification to member
$message = loadEmailTemplate('member_rallye_notify', $content, $userid);
- sendEmail($userid, sprintf(getMessage('RALLYE_MEMBER_NOTIFY'), $title), $message);
+ sendEmail($userid, getMaskedMessage('RALLYE_MEMBER_NOTIFY', $title), $message);
} // END - if
// Check if line is already included...
// Load template
$message = loadEmailTemplate($template, $DATA, $userid);
- sendEmail($userid, sprintf(getMessage('RALLYE_MEMBER_EXPIRED_SUBJ'), $DATA['level']), $message);
+ sendEmail($userid, getMaskedMessage('RALLYE_MEMBER_EXPIRED_SUBJ', $DATA['level']), $message);
} // END - if
// Count userid
}
// Send mail to admin
- sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_EXPIRED_SUBJ'), $title), $templ, $cnt, 0);
+ sendAdminNotification(getMaskedMessage('RALLYE_ADMIN_EXPIRED_SUBJ', $title), $templ, $cnt, 0);
// Add task
createNewTask('{--RALLYE_ADMIN_EXPIRED--}: ' . $title, '{--RALLYE_ADMIN_EXPIRED_TEXT--}', 'RALLYE_EXPIRED');
$content['now_time'] = generateDateTime(time(), 1);
// Send mail to admin
- sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_PURGED_SUBJ'), $content['title']), 'admin_rallye_purged', $content, 0);
+ sendAdminNotification(getMaskedMessage('RALLYE_ADMIN_PURGED_SUBJ', $content['title']), 'admin_rallye_purged', $content, 0);
// Purge whole rallye
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_data` WHERE `id`=%s LIMIT 1",
if ($min_users > 0) {
// Rallye ends when X members are totally in your exchange
- $return = sprintf(getMessage('RALLYE_END_USERS'), $min_users);
+ $return = getMaskedMessage('RALLYE_END_USERS', $min_users);
} // END - if
// Return
if ($min_prices > 0) {
// Rallye ends when X members are totally in your exchange
- $return = sprintf(getMessage('RALLYE_END_PRICES'), $min_prices);
+ $return = getMaskedMessage('RALLYE_END_PRICES', $min_prices);
} // END - if
// Return
$constantName = sprintf("REMOVEIP_LEVEL_%s", strtoupper($suffix));
// Default message
- $message = sprintf(getMessage('REMOVEIP_UNKNOWN_LEVEL'), $suffix);
+ $message = getMaskedMessage('REMOVEIP_UNKNOWN_LEVEL', $suffix);
// Is that constant there?
if (isMessageIdValid($constantName)) {
} // END - if
// Include IP-Filter here
-//require("/usr/share/php/ipfilter.php");
+//include("/usr/share/php/ipfilter.php");
// Generate arrays which holds the relevante chars to replace
$GLOBALS['security_chars'] = array(
foreach ($postData as $k => $v) {
// Do not add 'force' !
if ($k != 'force') {
- $OUT .= "<input type=\"hidden\" name=\"" . secureString($k) . "\" value=\"" . SQL_ESCAPE($v) . "\" />\n";
+ $OUT .= '<input type="hidden" name="' . secureString($k) . '" value="' . SQL_ESCAPE($v) . '" />';
} // END - if
} // END - foreach
return;
} else {
// Already added!
- $message = sprintf(getMessage('SPONSOR_ALREADY_FOUND'), $postData['email']);
+ $message = getMaskedMessage('SPONSOR_ALREADY_FOUND', $postData['email']);
$ret = 'already';
}
} else {
// Not found!
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown status %s detected.", $status));
- $ret = sprintf(getMessage('UNKNOWN_STATUS'), $status);
+ $ret = getMaskedMessage('UNKNOWN_STATUS', $status);
}
return $ret;
}
loadIncludeOnce($INC);
} else {
// File not found!
- $OUT .= loadTemplate('admin_settings_saved', true, sprintf(getMessage('SPONSOR_CONTENT_404'), $what));
+ $OUT .= loadTemplate('admin_settings_saved', true, getMaskedMessage('SPONSOR_CONTENT_404', $what));
}
// Return content
default: // Unknown sponsor what value!
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown sponsor module (what) %s detected.", getWhat()));
- $message = sprintf(getMessage('SPONSOR_UNKNOWN_WHAT'), getWhat());
+ $message = getMaskedMessage('SPONSOR_UNKNOWN_WHAT', getWhat());
$templ = ''; $subj = '';
break;
}
ON
u.id=l.url_id
WHERE
- l.userid=%s AND (UNIX_TIMESTAMP() - ".SURFBAR_GET_SURF_LOCK().") < UNIX_TIMESTAMP(l.last_surfed) AND (((UNIX_TIMESTAMP(l.last_surfed) - u.fixed_reload) < 0 AND u.fixed_reload > 0) OR u.fixed_reload = '0')
+ l.userid=%s AND
+ (UNIX_TIMESTAMP() - ".SURFBAR_GET_SURF_LOCK().") < UNIX_TIMESTAMP(l.last_surfed) AND
+ (
+ ((UNIX_TIMESTAMP(l.last_surfed) - u.fixed_reload) < 0 AND u.fixed_reload > 0) OR
+ u.fixed_reload = '0'
+ )
LIMIT 1",
array(getMemberId()), __FUNCTION__, __LINE__
);
$value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND `task_type`='EXTENSION_UPDATE'");
if ($value > 0) {
- $content['update_tasks'] = "<a href=\"{%url=modules.php?module=admin&what=list_task&type=updates%}\">".$value."</a>";
+ $content['update_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=updates%}">' . $value . '</a>';
} // END - if
//
$value = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true);
if ($value > 0) {
- $content['confirmed_members'] = "<a href=\"{%url=modules.php?module=admin&what=list_user&status=confirmed%}\">".$value."</a>";
+ $content['confirmed_members'] = '<a href="{%url=modules.php?module=admin&what=list_user&status=confirmed%}">' . $value . '</a>';
} // END - if
// Unconfirmed accounts
$value = countSumTotalData('UNCONFIRMED', 'user_data', 'userid', 'status', true);
if ($value > 0) {
- $content['unconfirmed_members'] = "<a href=\"{%url=modules.php?module=admin&what=chk_regs%}\">".$value."</a>";
+ $content['unconfirmed_members'] = '<a href="{%url=modules.php?module=admin&what=chk_regs%}">' . $value . '</a>';
} // END - if
// And locked accounts
$value = countSumTotalData('LOCKED', 'user_data', 'userid', 'status', true);
if ($value > 0) {
- $content['locked_members'] = "<a href=\"{%url=modules.php?module=admin&what=list_user&status=locked%}\">".$value."</a>";
+ $content['locked_members'] = '<a href="{%url=modules.php?module=admin&what=list_user&status=locked%}">' . $value . '</a>';
} // END - if
//
$value = countSumTotalData(0, 'task_system', 'id', 'assigned_admin', true, " AND `status` != 'DELETED'");
if ($value > 0) {
- $content['new_tasks'] = "<a href=\"{%url=modules.php?module=admin&what=list_task&type=unassigned%}\">".$value."</a>";
+ $content['new_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=unassigned%}">' . $value . '</a>';
} // END - if
//
$value = countSumTotalData('CLOSED', 'task_system', 'id', 'status', true);
if ($value > 0) {
- $content['closed_tasks'] = "<a href=\"{%url=modules.php?module=admin&what=list_task&type=closed%}\">".$value."</a>";
+ $content['closed_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=closed%}">' . $value . '</a>';
} // END - if
//
$value = countSumTotalData('DELETED', 'task_system', 'id', 'status', true);
if ($value > 0) {
- $content['deleted_tasks'] = "<a href=\"{%url=modules.php?module=admin&what=list_task&type=deleted%}\">".$value."</a>";
+ $content['deleted_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=deleted%}">' . $value . '</a>';
} // END - if
//
$value = countSumTotalData('SOLVED', 'task_system', 'id', 'status', true, sprintf(" AND `assigned_admin`=%s", getCurrentAdminId()));
if ($value > 0) {
- $content['solved_tasks'] = "<a href=\"{%url=modules.php?module=admin&what=list_task&type=solved%}\">".$value."</a>";
+ $content['solved_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task&type=solved%}">' . $value . '</a>';
} // END - if
//
$value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'");
if ($value > 0) {
- $content['your_tasks'] = "<a href=\"{%url=modules.php?module=admin&what=list_task%}\">".$value."</a>";
+ $content['your_tasks'] = '<a href="{%url=modules.php?module=admin&what=list_task%}">' . $value . '</a>';
} // END - if
//
$value = countSumTotalData('ADMIN', 'pool', 'id', 'data_type', true);
if ($value > 0) {
- $content['pending_mails'] = "<a href=\"{%url=modules.php?module=admin&what=unlock_emails%}\">".$value."</a>";
+ $content['pending_mails'] = '<a href="{%url=modules.php?module=admin&what=unlock_emails%}">' . $value . '</a>';
} // END - if
//
$value = countSumTotalData('TEMP', 'pool', 'id', 'data_type', true);
if ($value > 0) {
- $content['canceled_mails'] = "<a href=\"{%url=modules.php?module=admin&what=email_details%}\">".$value."</a>";
+ $content['canceled_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
} // END - if
//
$value = countSumTotalData('SEND', 'pool', 'id', 'data_type', true);
if ($value > 0) {
- $content['send_emails'] = "<a href=\"{%url=modules.php?module=admin&what=email_archiv%}\">".$value."</a>";
+ $content['send_emails'] = '<a href="{%url=modules.php?module=admin&what=email_archiv%}">' . $value . '</a>';
} // END - if
//
$value = countSumTotalData('DELETED', 'pool', 'id', 'data_type', true);
if ($value > 0) {
- $content['purged_mails'] = "<a href=\"{%url=modules.php?module=admin&what=email_details%}\">".$value."</a>";
+ $content['purged_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
} // END - if
//
$value = countSumTotalData('DELETED', 'bonus', 'id', 'data_type', true);
if ($value > 0) {
- $content['purged_bonus_mails'] = "<a href=\"{%url=modules.php?module=admin&what=email_details%}\">".$value."</a>";
+ $content['purged_bonus_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
} // END - if
} elseif (isExtensionActive('bonus')) {
- $content['purged_bonus_mails'] = sprintf(getMessage('ADMIN_EXT_BONUS_OUTDATED'), '0.1.8');
+ $content['purged_bonus_mails'] = getMaskedMessage('ADMIN_EXT_BONUS_OUTDATED', '0.1.8');
} else {
$content['purged_bonus_mails'] = "<span class=\"admin_note\">{--ADMIN_EXT_BONUS_404--}</span>";
}
$value = countSumTotalData('SEND', 'bonus', 'id', 'data_type', true, " AND `is_notify`='N'");
if ($value > 0) {
- $content['send_bonus_mails'] = "<a href=\"{%url=modules.php?module=admin&what=email_details%}\">".$value."</a>";
+ $content['send_bonus_mails'] = '<a href="{%url=modules.php?module=admin&what=email_details%}">' . $value . '</a>';
} // END - if
} elseif (isExtensionActive('bonus')) {
- $content['send_bonus_mails'] = sprintf(getMessage('ADMIN_EXT_BONUS_OUTDATED'), '0.1.8');
+ $content['send_bonus_mails'] = getMaskedMessage('ADMIN_EXT_BONUS_OUTDATED', '0.1.8');
} else {
$content['send_bonus_mails'] = getMessage('ADMIN_EXT_BONUS_404');
}
if (($value > 0) && (!empty($WHATs[$key]))) {
if (empty($TITLEs[$key])) $TITLEs[$key] = getMessage('ADMIN_TASK_UNKNOWN_LIST_TITLE');
- $content['row_link'] = "<a href=\"{%url=modules.php?module=admin&what=".$WHATs[$key]."%}\" title=\"".$TITLEs[$key]."%}\">".$value."</a>";
+ $content['row_link'] = '<a href="{%url=modules.php?module=admin&what=' . $WHATs[$key] . '%}" title="' . $TITLEs[$key] . '">' . $value . '</a>';
} else {
$content['row_link'] = '0';
}
if (!empty($content['userid'])) $userid = bigintval($content['userid']);
// Is there an entry?
- if (((isUserDataValid()) && (getUserData('status') == 'CONFIRMED') && (!empty($content['userid']))) || ($content['userid'] == $userid)) {
+ if ((isUserDataValid()) && (getUserData('status') == 'CONFIRMED') && (!empty($content['userid']))) {
// Check for old MD5 passwords
- if ((strlen($content['password']) == 32) && (md5($passwd) == $content['password'])) {
+ if ((strlen(getUserData('password')) == 32) && (md5($passwd) == getUserData('password'))) {
// Just set the hash to the password from DB... :)
- $content['hash'] = $content['password'];
+ $content['hash'] = getUserData('password');
} else {
// Hash password with improved way for comparsion
- $content['hash'] = generateHash($passwd, substr($content['password'], 0, -40));
+ $content['hash'] = generateHash($passwd, substr(getUserData('password'), 0, -40));
}
// Does the password match the hash?
- if ($content['hash'] == $content['password']) {
+ if ($content['hash'] == getUserData('password')) {
// New hashed password found so let's generate a new one
$content['hash'] = generateHash($passwd);
$GLOBALS['bonus_payed'] = false;
// Probe for last online timemark
- $probe = time() - $content['last_online'];
- if (!empty($content['last_login'])) $probe = time() - $content['last_login'];
+ $probe = time() - getUserData('last_online');
+ if (getUserData('last_login') > 0) $probe = time() - getUserData('last_login');
+
if ((isExtensionInstalledAndNewer('bonus', '0.2.2')) && ($probe >= getConfig('login_timeout'))) {
// Add login bonus to user's account
$add = ', `login_bonus`=`login_bonus`+{?login_bonus?}';
// Wrong password!
$errorCode = getCode('WRONG_PASS');
}
- } elseif (((isExtensionActive('nickname')) && (isNicknameUsed($content['userid'])) && (!empty($content['userid']))) || ($content['userid'] == $userid)) {
- // Other account status?
- if (fetchUserData($userid)) {
- // Create an error code from given status
- $errorCode = generateErrorCodeFromUserStatus(getUserData('status'));
- } else {
- // id not found!
- $errorCode = getCode('WRONG_ID');
- }
- } elseif ($errorCode == '0') {
- // id not found!
+ } elseif (getUserData('status') != 'CONFIRMED') {
+ // Create an error code from given status
+ $errorCode = generateErrorCodeFromUserStatus(getUserData('status'));
+
+ // Set userid in session
+ setSession('current_userid', getUserData('userid'));
+ } elseif (!isUserDataValid()) {
+ // User id not found!
$errorCode = getCode('WRONG_ID');
+ } else {
+ // Unknown error
+ $errorCode = getCode('UNKNOWN_ERROR');
}
// Error code provided?
return $GLOBALS['wernis_data']['message'];
} elseif (isset($GLOBALS['wernis_data']['status'])) {
// Fall-back to status
- return sprintf(getMessage('WERNIS_ERROR_STATUS'), $GLOBALS['wernis_data']['status']);
+ return getMaskedMessage('WERNIS_ERROR_STATUS', $GLOBALS['wernis_data']['status']);
} else {
// Something bad happend
return getMessage('WERNIS_UNKNOWN_ERROR');
// Something bad happend... :(
return array(
'status' => 'request_error',
- 'message' => sprintf(getMessage('WERNIS_API_REQUEST_ERROR'), $response[0])
+ 'message' => getMaskedMessage('WERNIS_API_REQUEST_ERROR', $response[0])
);
} // END - if
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown error %s from WDS66 API received.", $data[1]));
$return = array(
'status' => 'request_failed',
- 'message' => sprintf(getMessage('WERNIS_API_REQUEST_FAILED'), $data[1])
+ 'message' => getMaskedMessage('WERNIS_API_REQUEST_FAILED', $data[1])
);
break;
}
$result = false;
// Prepare the purpose
- eval("\$purpose = \"".compileRawCode(sprintf(getMessage('WERNIS_API_PURPOSE_WITHDRAW'), getMemberId()))."\";");
+ eval("\$purpose = \"".compileRawCode(getMaskedMessage('WERNIS_API_PURPOSE_WITHDRAW', getMemberId()))."\";");
// Prepare the request data
$requestData = array(
$result = false;
// Prepare the purpose
- eval("\$purpose = \"".compileRawCode(sprintf(getMessage('WERNIS_API_PURPOSE_PAYOUT'), getMemberId()))."\";");
+ eval("\$purpose = \"".compileRawCode(getMaskedMessage('WERNIS_API_PURPOSE_PAYOUT', getMemberId()))."\";");
// Prepare the request data
$requestData = array(
// Translate the status IN/OUT
function WERNIS_TRANSFER_STATUS ($status) {
// Default status
- $return = sprintf(getMessage('WERNIS_STATUS_UNKNWOWN'), $status);
+ $return = getMaskedMessage('WERNIS_STATUS_UNKNWOWN', $status);
switch ($status) {
case 'IN': // Withdraw
$return = getMessage('WERNIS_STATUS_WITHDRAW');
// Pre-load extensions cacher
loadIncludeOnce('inc/loader/load_cache-extension.php');
+// Init filter system
+initFilterSystem();
+
// Load all includes
loadIncludePool('cache');
case '404': // Administrator login not found
setRequestPostElement('ok', $ret);
- $ret = sprintf(getMessage('ADMIN_404'), postRequestElement('login'));
+ $ret = getMaskedMessage('ADMIN_404', postRequestElement('login'));
destroyAdminSession();
break;
case '404': // Administrator login not found
setRequestPostElement('ok', $ret);
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_404'), getSession('admin_login')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_404', getSession('admin_login')));
destroyAdminSession();
break;
// Ok, we finally load the admin action module
loadInclude($inc);
} else {
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('ADMIN_WHAT_404'), getWhat()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('ADMIN_WHAT_404', getWhat()));
}
// [EOF]
// Ok, we finally load the admin action module
loadInclude($inc);
} else {
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('ADMIN_WHAT_404'), getWhat()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('ADMIN_WHAT_404', getWhat()));
}
// [EOF]
loadInclude($inc);
} elseif ($GLOBALS['acl_allow'] === false) {
// Access denied
- loadTemplate('admin_menu_failed', false, sprintf(getMessage('ADMIN_ACCESS_DENIED'), $what));
+ loadTemplate('admin_menu_failed', false, getMaskedMessage('ADMIN_ACCESS_DENIED', $what));
} else {
// Include file not found! :-(
- loadTemplate('admin_menu_failed', false, sprintf(getMessage('ADMIN_ACTION_404'), $action));
+ loadTemplate('admin_menu_failed', false, getMaskedMessage('ADMIN_ACTION_404', $action));
}
} else {
// Invalid action/what pair found!
- loadTemplate('admin_menu_failed', false, sprintf(getMessage('ADMIN_ACTION_INVALID'), $action . '/' . $what));
+ loadTemplate('admin_menu_failed', false, getMaskedMessage('ADMIN_ACTION_INVALID', $action . '/' . $what));
}
// Free memory
// @DEPRECATED
function adminMenuSelectionBox_DEPRECATED ($mode, $default = '', $defid = '') {
$what = "`what` != ''";
- if ($mode == 'action') $what = "(`what`='' OR `what` IS NULL) AND action !='login'";
+ if ($mode == 'action') $what = "(`what`='' OR `what` IS NULL) AND `action` !='login'";
+
$result = SQL_QUERY_ESC("SELECT %s, `title` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$what." ORDER BY `sort` ASC",
array($mode), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
$result = false;
if ($alwaysAdd === false) {
if (!empty($whereStatement)) {
- $result = SQL_QUERY("SELECT * FROM `{?_MYSQL_PREFIX?}".$tableName."` WHERE ".$whereStatement." LIMIT 1", __FUNCTION__, __LINE__);
+ $result = SQL_QUERY("SELECT * FROM `{?_MYSQL_PREFIX?}" . $tableName . "` WHERE " . $whereStatement . " LIMIT 1", __FUNCTION__, __LINE__);
} else {
- $result = SQL_QUERY("SELECT * FROM `{?_MYSQL_PREFIX?}".$tableName."` LIMIT 1", __FUNCTION__, __LINE__);
+ $result = SQL_QUERY("SELECT * FROM `{?_MYSQL_PREFIX?}" . $tableName . "` LIMIT 1", __FUNCTION__, __LINE__);
}
} // END - if
// Load from database when version of 'admins' is enough
$result = SQL_QUERY_ESC("SELECT la_mode FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
array($adminId), __FUNCTION__, __LINE__);
+
+ // Do we have an entry?
if (SQL_NUMROWS($result) == 1) {
// Load data
list($adminMode) = SQL_FETCHROW($result);
- }
+ } // END - if
// Free memory
SQL_FREERESULT($result);
// Load master template
loadTemplate(sprintf("admin_%s_%s",
- $listType,
- $table
- ), false, $OUT
+ $listType,
+ $table
+ ), false, $OUT
);
}
} // END - foreach
// Finish SQL command
- $sql = substr($sql, 0, -1) . " WHERE `".$idColumn."`=".bigintval($id)." LIMIT 1";
+ $sql = substr($sql, 0, -1) . " WHERE `" . $idColumn . "`=" . bigintval($id) . " LIMIT 1";
// Run this query
SQL_QUERY($sql, __FUNCTION__, __LINE__);
// Shall we un-/lock here or list for locking?
if ($lockNow === true) {
// Un-/lock entries
- adminBuilderStatusHandler("lock", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray);
+ adminBuilderStatusHandler('lock', $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray);
} else {
// List for editing
- adminListBuilder("lock", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
+ adminListBuilder('lock', $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
}
} // END - if
}
// Shall we un-/lock here or list for locking?
if ($undeleteNow === true) {
// Undelete entries
- adminBuilderStatusHandler("undelete", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray);
+ adminBuilderStatusHandler('undelete', $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray);
} else {
// List for editing
- adminListBuilder("undelete", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
+ adminListBuilder('undelete', $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
}
} // END - if
}
SQL_FREERESULT($result);
// Generate hash for reset link
- $content['hash'] = generateHash(getConfig('URL').':'.$content['id'].':'.$content['login'].':'.$content['password'], substr($content['password'], 10));
+ $content['hash'] = generateHash(getConfig('URL') . ':' . $content['id'] . ':' . $content['login'] . ':' . $content['password'], substr($content['password'], 10));
// Remove some data
unset($content['id']);
// Update the task
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `%s`='%s' WHERE `id`=%s LIMIT 1",
- array($row, $data, bigintval($id)), __FUNCTION__, __LINE__);
+ array(
+ $row,
+ $data,
+ bigintval($id)
+ ), __FUNCTION__, __LINE__);
}
// Checks wether if the admin menu has entries
function ifAdminMenuHasEntries ($action) {
return (
((
+ // Is the entry set?
isset($GLOBALS['admin_menu_has_entries'][$action])
) && (
+ // And do we have a menu for this action?
$GLOBALS['admin_menu_has_entries'][$action] === true
)) || (
+ // Login has always a menu
$action == 'login'
)
);
// Is the userid set correctly?
if ($userid > 0) {
// Create a link to that profile
- return '{%url=modules.php?module=admin&what=list_user&userid='.bigintval($userid) . '%}';
+ return '{%url=modules.php?module=admin&what=list_user&userid=' . bigintval($userid) . '%}';
} // END - if
// Return a link to the user list
// Generate a "link" for the given admin id (admin_id)
function generateAdminLink ($adminId) {
// No assigned admin is default
- $adminLink = "<span class=\"admin_note\">{--ADMIN_NO_ADMIN_ASSIGNED--}</span>";
+ $adminLink = '<span class="admin_note">{--ADMIN_NO_ADMIN_ASSIGNED--}</span>';
// Zero? = Not assigned
if (bigintval($adminId) > 0) {
// Is the extension there?
if (isExtensionActive('admins')) {
// Admin found
- $adminLink = "<a href=\"".generateEmailLink(getAdminEmail($adminId), 'admins')."\">" . $login."</a>";
+ $adminLink = '<a href="' . generateEmailLink(getAdminEmail($adminId), 'admins') . '" title="{--ADMIN_CONTACT_LINK_TITLE--}">' . $login . '</a>';
} else {
// Extension not found
- $adminLink = sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'admins');
+ $adminLink = getMaskedMessage('EXTENSION_PROBLEM_NOT_INSTALLED', 'admins');
}
} else {
// Maybe deleted?
- $adminLink = "<div class=\"admin_note\">".sprintf(getMessage('ADMIN_ID_404'), $adminId)."</div>";
+ $adminLink = '<div class="admin_note">' . getMaskedMessage('ADMIN_ID_404', $adminId) . '</div>';
}
} // END - if
return $adminLink;
}
+// Verifies if the current admin has confirmed to alter expert settings
+//
+// Return values:
+// 'failed' = Something goes wrong (default)
+// 'agreed' = Has verified and and confirmed it to see them
+// 'forbidden' = Has not the proper right to alter them
+// 'update' = Need to update extension 'admins'
+// 'ask' = A form was send to the admin
+function doVerifyExpertSettings () {
+ // Default return status is failed
+ $return = 'failed';
+
+ // Is the extension installed and recent?
+ if (isExtensionInstalledAndNewer('admins', '0.7.3')) {
+ // Okay, load the status
+ $expertSettings = getAminsExpertSettings();
+
+ // Is he allowed?
+ if ($expertSettings == 'Y') {
+ // Okay, does he want to see them?
+ if (getAminsExpertWarning() == 'Y') {
+ // Ask for them
+ if (isFormSent()) {
+ // Is the element set, then we need to change the admin
+ if (isPostRequestElementSet('expert_settings')) {
+ // Get it and prepare final post data array
+ $postData['login'][getCurrentAdminId()] = getAdminLogin(getCurrentAdminId());
+ $postData['expert_warning'][getCurrentAdminId()] = 'N';
+
+ // Change it in the admin
+ adminsChangeAdminAccount($postData, 'expert_warning');
+
+ // Clear form
+ unsetPostRequestElement('ok');
+ } // END - if
+
+ // All fine!
+ $return = 'agreed';
+ } else {
+ // Send form
+ loadTemplate('admin_expert_settings_form');
+
+ // Asked for it
+ $return = 'ask';
+ }
+ } else {
+ // Do not display
+ $return = 'agreed';
+ }
+ } else {
+ // Forbidden
+ $return = 'forbidden';
+ }
+ } else {
+ // Out-dated extension or not installed
+ $return = 'update';
+ }
+
+ // Output message for other status than ask/agreed
+ if (($return != 'ask') && ($return != 'agreed')) {
+ // Output message
+ loadTemplate('admin_settings_saved', false, getMessage('ADMIN_EXPERT_SETTINGS_STATUS_' . strtoupper($return)));
+ } // END - if
+
+ // Return status
+ return $return;
+}
+
// [EOF]
?>
if ($adminId == '0') {
// Assgin current admin to unassgigned task
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=%s WHERE `id`=%s LIMIT 1",
- array(getCurrentAdminId(), bigintval($tid)), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=%s WHERE `id`=%s AND `assigned_admin`=0 LIMIT 1",
+ array(
+ getCurrentAdminId(),
+ bigintval($tid)
+ ), __FILE__, __LINE__);
} // END - if
$add = '';
if ($type == 'SUPPORT_MEMBER') {
$mode = substr($text, 0, strpos($text, ':'));
$text = substr($text, strpos($text, ':') + 1);
- $add = "<li>{--ADMIN_TASK_SUPPORT_MODE--}: <strong>".$mode."</strong></li>";
+ $add = "<li>{--ADMIN_TASK_SUPPORT_MODE--}: <strong>" . $mode . "</strong></li>";
} // END - if
// Is a userid assign?
$content = getUserDataArray();
// Generate HTML list entry
- $add = "<li>{--ADMIN_MEMBER_UID--}: <strong>".generateUserProfileLink($userid, 'user_data')." (<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".translateGender($content['gender'])." ".$content['surname']." ".$content['family']."</a>)</strong></li>";
+ $add = "<li>{--ADMIN_MEMBER_UID--}: <strong>".generateUserProfileLink($userid, 'user_data')." (<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".translateGender($content['gender']) . ' ' . $content['surname'] . ' ' . $content['family']."</a>)</strong></li>";
} else {
// Invalid userid, so log and zero it
logDebugMessage(__FUNCTION__, __LINE__, 'Invalid userid=' . $userid . ' -> not found!');
// Is this non-productive?
if (isExtensionProductive() === false) {
// Issue warning
- $text .= loadTemplate('admin_settings_saved', true, sprintf(getMessage('ADMIN_EXTENSION_IS_NON_PRODUCTIVE'), $ext_name));
+ $text .= loadTemplate('admin_settings_saved', true, getMaskedMessage('ADMIN_EXTENSION_IS_NON_PRODUCTIVE', $ext_name));
} // END - if
// Set current extension name
));
} else {
// Task is closed so nothing is todo
- $OUT .= "<div class=\"admin_failed\">{--ADMIN_EXT_ALREADY_REGISTERED--}</div>\n";
+ $OUT .= '<div class="admin_failed">{--ADMIN_EXT_ALREADY_REGISTERED--}</div>';
// Close task but not already closed, solved, deleted or update tasks
if ((!in_array($status, array('CLOSED','DELETED','SOLVED'))) && ($type != 'EXTENSION_UPDATE')) {
case 'EXTENSION_UPDATE': // Extension update
// Extension updates are installed automatically
- $OUT .= "<div class=\"admin_failed medium\">{--ADMIN_EXTENSION_UPDATED--}</div>\n";
+ $OUT .= '<div class="admin_failed medium">{--ADMIN_EXTENSION_UPDATED--}</div>';
// Close task
if (($status != 'CLOSED') && ($status != 'DELETED')) {
switch ($mode) {
default: // @TODO Unknown support mode
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown support mode %s detected. This part is under construction!", $mode));
- $OUT .= "<div class=\"admin_failed medium\">".sprintf(getMessage('ADMIN_UNKNOWN_SUPPORT_MODE'), $mode)."</div>\n";
+ $OUT .= '<div class="admin_failed medium">' . getMaskedMessage('ADMIN_UNKNOWN_SUPPORT_MODE', $mode) . '</div>';
break;
}
break;
case 'PAYOUT_REQUEST': // Payout requests
if (isExtensionActive('payout')) {
// Extension is installed so let him send a notification to the user
- $result_pay = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `userid`=%s AND payout_timestamp=%s LIMIT 1",
+ $result_pay = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `userid`=%s AND `payout_timestamp`=%s LIMIT 1",
array(bigintval($userid), bigintval($created)), __FILE__, __LINE__);
list($pid) = SQL_FETCHROW($result_pay);
SQL_FREERESULT($result_pay);
$OUT .= loadTemplate('admin_payout_overview_form', true, $content);
} else {
// Problem obtaining payout id
- $OUT .= "<div class=\"admin_failed medium\">{--PAYOUT_OBTAIN_ID_FAILED--}</div>\n";
+ $OUT .= '<div class="admin_failed medium">{--PAYOUT_OBTAIN_ID_FAILED--}</div>';
}
} else {
// Extension is not installed
- $OUT .= "<div class=\"admin_failed medium\">{--ADMIN_PAYOUT_NOT_INSTALLED--}</div>\n";
+ $OUT .= '<div class="admin_failed medium">{--ADMIN_PAYOUT_NOT_INSTALLED--}</div>';
}
break;
$OUT .= loadTemplate('admin_wernis_overview_form', true, $content);
} else {
// Problem obtaining wernis id
- $OUT .= "<div class=\"admin_failed medium\">{--WERNIS_OBTAIN_ID_FAILED--}</div>\n";
+ $OUT .= '<div class="admin_failed medium">{--WERNIS_OBTAIN_ID_FAILED--}</div>';
}
} else {
// Extension is not installed
- $OUT .= "<div class=\"admin_failed medium\">{--ADMIN_WERNIS_NOT_INSTALLED--}</div>\n";
+ $OUT .= '<div class="admin_failed medium">{--ADMIN_WERNIS_NOT_INSTALLED--}</div>';
}
break;
default: // Unknown task type
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", $type));
- $OUT .= "<div class=\"admin_failed medium\">".sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $type, $id)."</div>\n";
+ $OUT .= '<div class="admin_failed medium">' . sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $type, $id) . '</div>';
break;
}
- $OUT .= " </td>
- <td width=\"1%\" class=\"switch_sw".$SW." bottom right\"> </td>
-</tr>\n";
+ $OUT .= '
+ </td>
+</tr>';
} // END - if
// Free result
} elseif (isset($postData['del'])) {
// Delete tasks
foreach ($postData['sel'] as $id => $sel) {
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s AND assigned_admin IN (%s,0) LIMIT 1",
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s AND `assigned_admin` IN (%s,0) LIMIT 1",
array(bigintval($id), getCurrentAdminId()), __FILE__, __LINE__);
}
} else {
// Member found otherwise it's a system task
$content['userid'] = generateUserProfileLink($content['userid']);
} else {
- $content['userid'] = "<em>{--ADMIN_IS_SYSTEM_TASK--}</em>";
+ $content['userid'] = '<em>{--ADMIN_IS_SYSTEM_TASK--}</em>';
}
// Prepare content
// Selected user does exist
$content = getUserDataArray();
- if ((isFormSent()) && (isPostRequestElementSet(('points')))) {
+ if ((isFormSent()) && (isPostRequestElementSet('points'))) {
// Add points and send an email to him...
addPointsDirectly('admin_single', bigintval(getRequestElement('userid')), bigintval(postRequestElement('points')));
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_POINTS_ADDED'));
} else {
// Prepare content
- $content['user'] = "<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".$content['surname']." ".$content['family']."</a>";
+ $content['user'] = '<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . $content['surname'] . ' ' . $content['family'] . '</a>';
$content['userid'] = bigintval(getRequestElement('userid'));
// Output template
}
} else {
// User not found!
- loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . getMaskedMessage('ADMIN_MEMBER_404', getRequestElement('userid')) . '</div>');
}
} else {
// Output selection form with all confirmed user accounts listed
`action`='%s',
`what`='%s',
`descr`='%s'
-WHERE ".$AND." AND id=%s LIMIT 1",
+WHERE ".$AND." AND `id`=%s LIMIT 1",
array(
$menu,
postRequestElement('sel_action', $sel),
if ((!empty($tid)) && (!empty($fid))) {
// Sort menu
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
array(bigintval(getRequestElement('tid')), bigintval($fid)), __FILE__, __LINE__);
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
array(bigintval(getRequestElement('fid')), bigintval($tid)), __FILE__, __LINE__);
}
}
$data['navi'] = '';
if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) {
// Is highest position
- $data['navi'] = "<a href=\"{%url=modules.php?module=admin&what=adminedit&sub=" . $content['sub'] . "&act=" . $data['action'] . "&w=" . $data['what'] . "&tid=" . ($data['sort']+1) . "&fid=" . $data['sort'] . "%}\">{--LOWER--}</a>";
+ $data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']+1) . '&fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
} elseif ($cnt == $max) {
// Is lowest position
- $data['navi'] = "<a href=\"{%url=modules.php?module=admin&what=adminedit&sub=" . $content['sub'] . "&act=" . $data['action'] . "&w=" . $data['what'] . "&tid=" . ($data['sort']-1) . "&fid=" . $data['sort'] . "%}\">{--HIGHER--}</a>";
+ $data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']-1) . '&fid=' . $data['sort'] . '%}">{--HIGHER--}</a>';
} elseif ($data['sort'] > 0) {
// Anything else between highest and lowest
- $data['navi'] = "<a href=\"{%url=modules.php?module=admin&what=adminedit&sub=" . $content['sub'] . "&act=" . $data['action'] . "&w=" . $data['what'] . "&tid=" . ($data['sort']-1) . "&fid=" . $data['sort'] . "%}\">{--HIGHER--}</a>/<a href=\"{%url=modules.php?module=admin&what=adminedit&sub=" . $content['sub'] . "&act=" . $data['action'] . "&w=" . $data['what'] . "&tid=" . ($data['sort']+1) . "&fid=" . $data['sort'] . "%}\">{--LOWER--}</a>";
+ $data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']-1) . '&fid=' . $data['sort'] . '%}">{--HIGHER--}</a>/<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']+1) . '&fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
}
// Fix empty elements for constant (fixes display bugs in Firefox)
'gender' => translateGender($content['gender']),
'surname' => $content['surname'],
'family' => $content['family'],
- 'email' => "<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".$content['email']."</a>",
+ 'email' => '<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . $content['email'] . '</a>',
'remote_addr' => $content['REMOTE_ADDR'],
'refid' => $content['refid'],
'user_hash' => $content['user_hash'],
} // END - switch
} else {
// Entry not saved
- $TEXT .= sprintf(getMessage('CATEGORY_NOT_SAVED'), $id);
+ $TEXT .= getMaskedMessage('CATEGORY_NOT_SAVED', $id);
}
} // END - foreach
adminSaveSettingsFromPostData();
// Display continue link
- loadTemplate('admin_settings_saved', false, "<a href=\"{%url=modules.php?module=admin&what=config_home&sub=settings%}\">{--ADMIN_CONTINUE_TO_CONFIG--}</a>");
+ loadTemplate('admin_settings_saved', false, '<a href="{%url=modules.php?module=admin&what=config_home&sub=settings%}">{--ADMIN_CONTINUE_TO_CONFIG--}</a>');
} else {
// Prepare data for the template
$content = array_fill(-1, 60, '');
// Process all entries
while ($content = SQL_FETCHARRAY($result)) {
// Link for setting 'what' as new "home"
- $newHomeLink = "<a href=\"{%url=modules.php?module=admin&what=config_home&sub=target&home=" . $content['what'] . "%}\">{--_IS_NEW_HOME--}</a>";
+ $newHomeLink = '<a href="{%url=modules.php?module=admin&what=config_home&sub=target&home=' . $content['what'] . '%}">{--_IS_NEW_HOME--}</a>';
// Is this current home?
if ($content['what'] == getConfig('index_home')) {
// Is current home
- $newHomeLink = "<div class=\"admin_mark\">{--_IS_CURRENT_HOME--}</div>";
- $content['title'] = "<div class=\"admin_mark\">" . $content['title'] . "</div>";
+ $newHomeLink = '<div class="admin_mark">{--_IS_CURRENT_HOME--}</div>';
+ $content['title'] = '<div class="admin_mark">' . $content['title'] . '</div>';
} // END - if
// Prepare content
// Edit selected modules
foreach (postRequestElement('sel') as $id => $sel) {
// Load module data
- $result = SQL_QUERY_ESC("SELECT module, title, locked, hidden, admin_only, mem_only FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `id`=%s LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
- list($mod, $title, $locked, $hidden, $admin, $mem) = SQL_FETCHROW($result);
+ // @TODO This can be moved into mysql-function.php, see checkModulePermissions() function
+ $result = SQL_QUERY_ESC("SELECT `module`, `title`, `locked`, `hidden`, `admin_only`, `mem_only` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `id`=%s LIMIT 1",
+ array(bigintval($id)), __FILE__, __LINE__);
+
+ // Load data
+ $data = SQL_FETCHARRAY($result);
+
+ // Free result
SQL_FREERESULT($result);
// Prepare array for the template
$content = array(
'sw' => $SW,
- 'mod' => $mod,
+ 'mod' => $data['module'],
'id' => $id,
- 'title' => $title,
- 'locked' => addSelectionBox('yn', $locked, 'locked', $id),
- 'hidden' => addSelectionBox('yn', $hidden, 'hidden', $id),
- 'admin' => addSelectionBox('yn', $admin , 'admin' , $id),
- 'mem' => addSelectionBox('yn', $mem , 'member', $id),
+ 'title' => $data['title'],
+ 'locked' => addSelectionBox('yn', $data['locked'] , 'locked', $id),
+ 'hidden' => addSelectionBox('yn', $data['hidden'] , 'hidden', $id),
+ 'admin' => addSelectionBox('yn', $data['admin_only'], 'admin' , $id),
+ 'mem' => addSelectionBox('yn', $data['mem_only'] , 'member', $id),
);
// Load row template
$OUT .= loadTemplate('admin_mods_edit_row', true, $content);
- }
+ } // END - foreach
// Load main template
loadTemplate('admin_mods_edit', false, $OUT);
SQL_FREERESULT($result);
// Does already exist
- $message = "<div class=\"admin_failed\">{--ADMIN_PAYOUT_TYPE_ALREADY--}</div>";
+ $message = '<div class="admin_failed">{--ADMIN_PAYOUT_TYPE_ALREADY--}</div>';
}
}
// Load row template and switch color
$OUT .= loadTemplate('admin_config_payouts_row', true, $content);
$SW = 3 - $SW;
- }
+ } // END - while
// Free memory
SQL_FREERESULT($result_type);
// Does your members request payouts?
if ((SQL_NUMROWS($result_mem) > 0) && ($display)) {
// Members has requested payouts
- loadTemplate('admin_settings_saved', false, "<a href=\"{%url=modules.php?module=admin&what=list_payouts%}\">{--ADMIN_PAYOUT_LIST_REQUESTS--}</a></P>");
+ loadTemplate('admin_settings_saved', false, '<a href="{%url=modules.php?module=admin&what=list_payouts%}">{--ADMIN_PAYOUT_LIST_REQUESTS--}</a>');
} elseif ($display) {
// No member requests so far
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_PAYOUT_NO_MEMBER_REQUESTS'));
// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
if (isGetRequestElementSet('rallye')) {
// Price submitted?
if (isPostRequestElementSet('add')) {
- if ((isPostRequestElementSet(('level'))) && ((isPostRequestElementSet(('points'))) || (isPostRequestElementSet(('info'))))) {
+ if ((isPostRequestElementSet(('level'))) && ((isPostRequestElementSet('points')) || (isPostRequestElementSet(('info'))))) {
// Submitted data is valid, but maybe we already have this price level?
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s AND `price_level`='%s' LIMIT 1",
array(bigintval(getRequestElement('rallye')), bigintval(postRequestElement('level'))), __FILE__, __LINE__);
// Delete selected entries
foreach (postRequestElement('sel') as $id => $sel) {
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
- }
+ array(bigintval($id)), __FILE__, __LINE__);
+ } // END - foreach
// Output message
loadTemplate('admin_settings_saved', false, getMessage('RALLYE_ENTRIES_DELETED'));
// Load row template and switch color
$OUT .= loadTemplate('admin_config_rallye_edit_row', true, $content);
$SW = 3 - $SW;
- }
+ } // END - foreach
$content['rows'] = $OUT;
// Prepare data for the main template
loadTemplate('admin_config_rallye_edit', false, $content);
} else {
// Nothing selected
- $content = sprintf(getMessage('RALLYE_NO_PRICES_SELECTED'), "<a href=\"{%url=modules.php?module=admin&what=config_rallye_prices&rallye=".getRequestElement('rallye')."%}\">", "</a>");
+ $content = '{--RALLYE_NO_PRICES_SELECTED_1--}<a href="{%url=modules.php?module=admin&what=config_rallye_prices&rallye=' . getRequestElement('rallye') . '%}">{--RALLYE_NO_PRICES_SELECTED_2--}</a>{--RALLYE_NO_PRICES_SELECTED_3--}');
loadTemplate('admin_settings_saved', false, $content);
}
} elseif (isPostRequestElementSet('del')) {
// Load row template and switch color
$OUT .= loadTemplate('admin_config_rallye_del_row', true, $content);
$SW = 3 - $SW;
- }
+ } // END - foreach
$content['rows'] = $OUT;
// Prepare data for the main template
loadTemplate('admin_config_rallye_del', false, $content);
} else {
// Nothing selected
- $content = "{--RALLYE_NO_PRICES_SELECTED_1--}<a href=\"{%url=modules.php?module=admin&what=config_rallye_prices&rallye=".getRequestElement('rallye')."%}\">{--RALLYE_NO_PRICES_SELECTED_2--}</a>{--RALLYE_NO_PRICES_SELECTED_3--}";
+ $content = '{--RALLYE_NO_PRICES_SELECTED_1--}<a href="{%url=modules.php?module=admin&what=config_rallye_prices&rallye=' . getRequestElement('rallye') . '%}">{--RALLYE_NO_PRICES_SELECTED_2--}</a>{--RALLYE_NO_PRICES_SELECTED_3--}';
loadTemplate('admin_settings_saved', false, $content);
}
} else {
// Load main template
loadTemplate('admin_config_rallye_prices', false, $content);
- }
+ } // END - if
}
// Add form for adding new price level
if (!isPostRequestElementSet('edit')) {
loadTemplate('admin_add_rallye_prices', false, getRequestElement('rallye'));
- }
+ } // END - if
} else {
// No rallye selected so display all available without prices
$result = SQL_QUERY("SELECT
// Load row template and switch color
$OUT .= loadTemplate('admin_list_rallye_prices_row', true, $content);
$SW = 3 - $SW;
- }
+ } // END - while
// Free memory
SQL_FREERESULT($result);
// Output message
if (getConfig('repay_deleted_mails') == 'REPAY') {
// Repayed
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_POINTS_REPAYED'),
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_POINTS_REPAYED',
translateComma($totalPoints)
));
} else {
// To jackpot
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_POINTS_TO_JACKPOT'),
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_POINTS_TO_JACKPOT',
translateComma($totalPoints)
));
}
}
} else {
// Points shredded!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_POINTS_SHREDDED'), $totalPoints));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_POINTS_SHREDDED', translateComma($totalPoints)));
}
// Remove links from DB
$cnt += SQL_AFFECTEDROWS();
// Load template for link
- loadTemplate('admin_settings_saved', false, "<a href=\"{%url=modules.php?module=admin&what=del_email&pid=" . bigintval(getRequestElement('mid')) . "%}\">{--ADMIN_REMOVE_STATS_ENTRY--}</a>");
+ loadTemplate('admin_settings_saved', false, '<a href="{%url=modules.php?module=admin&what=del_email&pid=' . bigintval(getRequestElement('mid')) . '%}">{--ADMIN_REMOVE_STATS_ENTRY--}</a>');
} // END - if
// Free the result
$cnt += SQL_AFFECTEDROWS();
// Output link for manually removing stats entry
- outputHtml(sprintf(getMessage('ADMIN_DELETED_MAILS_COUNT'), $cnt));
+ outputHtml(getMaskedMessage('ADMIN_DELETED_MAILS_COUNT', $cnt));
} else {
// Mail already deleted!
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NORMAL_MAIL_ALREADY_DELETED'));
// Delete mail only once
if (SQL_NUMROWS($result) == 1) {
// Load data
- list($id, $subject, $url, $timestamp, $sent) = SQL_FETCHROW($result);
+ $content = SQL_FETCHARRAY($result);
// Reset sent mails for recipient(s)
reduceRecipientReceivedMails('bonus_id', getRequestElement('bid'), $sent);
$cnt += SQL_AFFECTEDROWS();
// Prepare data for the template
- $content['id'] = $id;
- $content['subject'] = $subject;
- $content['url'] = generateDerefererUrl($url);
- $content['timestamp'] = generateDateTime($timestamp, 0);
+ $content['url'] = generateDerefererUrl($content['url']);
+ $content['timestamp'] = generateDateTime($content['timestamp'], 0);
$content['cnt'] = $cnt;
// Load template
// Delete mail only once
if (SQL_NUMROWS($result) == 1) {
// Load data
- list ($id, $subject, $url, $timestamp) = SQL_FETCHROW($result);
+ $content = SQL_FETCHARRAY($result);
// Init counter for deleted mails
$cnt = '0';
$cnt += SQL_AFFECTEDROWS();
// Prepare data for the template
- $content['id'] = $id;
- $content['subject'] = $subject;
- $content['url'] = generateDerefererUrl($url);
- $content['timestamp'] = generateDateTime($timestamp, 0);
+ $content['url'] = generateDerefererUrl($content['url']);
+ $content['timestamp'] = generateDateTime($content['timestamp'], 0);
$content['cnt'] = $cnt;
// Load template
$cnt++;
}
}
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('HOLIDAY_ADMIN_MULTI_DEL'), $cnt));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('HOLIDAY_ADMIN_MULTI_DEL', $cnt));
} elseif (isGetRequestElementSet('userid')) {
// Set default message
$message = getMessage('HOLIDAY_ADMIN_SINGLE_404');
array(bigintval(getRequestElement('id'))), __FILE__, __LINE__);
// Output message
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_DELETED'), bigintval(getRequestElement('id'))));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_DELETED', bigintval(getRequestElement('id'))));
} elseif (isPostRequestElementSet('no')) {
// Do not delete him...
redirectToUrl('modules.php?module=admin&what=list_sponsor&id='.bigintval(getRequestElement('id')));
}
} else {
// Sponsor not found!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_404'), bigintval(getRequestElement('id'))));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_404', bigintval(getRequestElement('id'))));
}
// Free result
$content['title'] = getMessage('TRANSFER_LIST_ALL');
// Show delete button here
-$content['delete'] = "<input type=\"reset\" class=\"admin_reset\" value=\"{--UNDO_SELECTIONS--}\" /> * <input type=\"submit\" name=\"del\" class=\"admin_delete\" value=\"{--TRANSFER_DELETE--}\" />";
+$content['delete'] = '<input type="reset" class="admin_reset" value="{--UNDO_SELECTIONS--}" />
+<input type="submit" name="del" class="admin_delete" value="{--TRANSFER_DELETE--}" />';
// Load final template
loadTemplate('admin_list_transfer', false, $content);
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_DEL_COMPLETED'));
} else {
// Account does not exists!
- loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . getMaskedMessage('ADMIN_MEMBER_404', getRequestElement('userid')) . '</div>');
}
} elseif (isPostRequestElementSet('no')) {
// Do not delete him...
'email' => generateEmailLink(getUserData('email'), 'user_data'),
'surname' => getUserData('surname'),
'family' => getUserData('family'),
- 'header' => sprintf(getMessage('ADMIN_HEADER_DEL_ACCOUNT'), getRequestElement('userid')),
- 'text' => sprintf(getMessage('ADMIN_TEXT_DEL_ACCOUNT'), getRequestElement('userid')),
+ 'header' => getMaskedMessage('ADMIN_HEADER_DEL_ACCOUNT', getRequestElement('userid')),
+ 'text' => getMaskedMessage('ADMIN_TEXT_DEL_ACCOUNT', getRequestElement('userid')),
'userid' => getRequestElement('userid')
);
loadTemplate('admin_del_user', false, $content);
} else {
// Account does not exists!
- loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . getMaskedMessage('ADMIN_MEMBER_404', getRequestElement('userid')) . '</div>');
}
}
default: // Unknown mode
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", getRequestElement('mode')));
- $message = sprintf(getMessage('ADMIN_SPONSOR_INVALID_MODE'), getRequestElement('mode'));
+ $message = getMaskedMessage('ADMIN_SPONSOR_INVALID_MODE', getRequestElement('mode'));
break;
}
} // END - if
} elseif (isFileReadable(sprintf("%stemplates/%s/html/admin/%s.tpl", getConfig('PATH'), getLanguage(), $TPL))) {
// Create mailto link
- $content['contact'] = "<a href=\"" . generateEmailLink($content['email'], 'sponsor_data') . "\">" . $content['surname'] . " " . $content['family'] . "</a>";
+ $content['contact'] = '<a href="' . generateEmailLink($content['email'], 'sponsor_data') . '">' . $content['surname'] . ' ' . $content['family'] . '</a>';
// Load mode template
loadTemplate($TPL);
} else {
// Template not found!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_MODUS_TPL_404'), getRequestElement('mode')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_MODUS_TPL_404', getRequestElement('mode')));
}
} else {
// Sponsor not found!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_404'), bigintval(getRequestElement('id'))));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_404', bigintval(getRequestElement('id'))));
}
// Free result
if ($updateUser === true) {
// We have to add the following things: birthday and max receive mails
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET
-`gender`='%s',
-`surname`='%s',
-`family`='%s',
-`street_nr`='%s',
-`country`='%s',
-`zip`=%s,
-`city`='%s',
-`email`='%s'
-".$add."
-WHERE `userid`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE
+ `{?_MYSQL_PREFIX?}_user_data`
+SET
+ `gender`='%s',
+ `surname`='%s',
+ `family`='%s',
+ `street_nr`='%s',
+ `country`='%s',
+ `zip`=%s,
+ `city`='%s',
+ `email`='%s'
+ ".$add."
+WHERE
+ `userid`=%s
+LIMIT 1",
array(
substr(postRequestElement('gender'), 0, 1),
postRequestElement('surname'),
}
} else {
// Account does not exists!
- loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . getMaskedMessage('ADMIN_MEMBER_404', getRequestElement('userid')) . '</div>');
}
// Free the result
// Shall we keep the extension always active?
if ((isset($GLOBALS['cache_array']['always_active'][getExtensionName($ext_id)])) && ($GLOBALS['cache_array']['always_active'][getExtensionName($ext_id)] == 'Y') && ($active == 'Y')) {
// Keep this extension active!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_EXTENSION_ALWAYS_ACTIVE'), getExtensionName($ext_id)));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_EXTENSION_ALWAYS_ACTIVE', getExtensionName($ext_id)));
} else {
// De/activate extension
$ACT = 'N'; setExtensionMode('deactivate');
doExtensionSqls($ext_id, getExtensionMode());
}
}
-} elseif (((isPostRequestElementSet('edit')) || (isPostRequestElementSet(('modify')))) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif (((isPostRequestElementSet('edit')) || (isPostRequestElementSet('modify'))) && (countPostSelection() > 0) && (!isDemoModeActive())) {
// Change settings like CSS file load
- if (isPostRequestElementSet(('modify'))) {
+ if (isPostRequestElementSet('modify')) {
// Change entries
$cache_update = '0';
foreach (postRequestElement('sel') as $ext_id => $sel) {
} // END - foreach
// Extensions removed
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_EXTENSIONS_REMOVED'), countPostSelection()));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_EXTENSIONS_REMOVED', countPostSelection()));
} elseif ((isGetRequestElementSet('do')) && (!isDemoModeActive())) {
// Other things to do
$do = SQL_ESCAPE(secureString(getRequestElement('do')));
// Errors?
if (getTotalFatalErrors() == '0') {
// Extension was found and successfully registered
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_EXTENSION_REGISTERED'), $ext_name));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_EXTENSION_REGISTERED', $ext_name));
// Show next link
if (isExtensionActive('task')) {
}
} else {
// Errors detected!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_EXTENSION_NOT_REGISTERED'), $ext_name));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_EXTENSION_NOT_REGISTERED', $ext_name));
}
// Do we need to update cache file?
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_REG_FAILED_ALREADY'));
} else {
// Notify the admin that we have a problem here...
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_REG_FAILED_404'), $ext_name));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_REG_FAILED_404', $ext_name));
}
} else {
// Motify the admin that we have a problem here...
$sel = bigintval($sel);
// Update entry
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
array($menu, postRequestElement('sel_action', $sel), postRequestElement('sel_what', $sel), $sel),__FILE__, __LINE__);
} // END - foreach
loadTemplate('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
case 'del': // Delete menu
foreach (postRequestElement('sel') as $sel => $menu) {
// Delete enty
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1",
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
array(bigintval($sel)), __FILE__, __LINE__);
} // END - foreach
loadTemplate('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
$sel = bigintval($sel);
// Update entry
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
array(postRequestElement('visible', $sel), postRequestElement('locked', $sel), $sel), __FILE__, __LINE__);
} // END - foreach
loadTemplate('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
$cnt++;
if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) {
// Is highest position
- $NAVI = "<a href=\"{%url=modules.php?module=admin&what=guestedit&sub=" . $content['sub'] . "&act=" . $data['action'] . "&w=" . $data['what'] . "&tid=" . ($data['sort']+1) . "&fid=" . $data['sort'] . "%}\">{--LOWER--}</a>";
+ $NAVI = '<a href="{%url=modules.php?module=admin&what=guestedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']+1) . '&fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
} elseif ($cnt == $max) {
// Is lowest position
- $NAVI = "<a href=\"{%url=modules.php?module=admin&what=guestedit&sub=" . $content['sub'] . "&act=" . $data['action'] . "&w=" . $data['what'] . "&tid=" . ($data['sort']-1) . "&fid=" . $data['sort'] . "%}\">{--HIGHER--}</a>";
+ $NAVI = '<a href="{%url=modules.php?module=admin&what=guestedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']-1) . '&fid=' . $data['sort'] . '%}">{--HIGHER--}</a>';
} elseif ($data['sort'] > 0) {
// Anything else between highest and lowest
- $NAVI = "<a href=\"{%url=modules.php?module=admin&what=guestedit&sub=" . $content['sub'] . "&act=" . $data['action'] . "&w=" . $data['what'] . "&tid=" . ($data['sort']-1) . "&fid=" . $data['sort'] . "%}\">{--HIGHER--}</a>/<a href=\"{%url=modules.php?module=admin&what=guestedit&sub=" . $content['sub'] . "&act=" . $data['action'] . "&w=" . $data['what'] . "&tid=" . ($data['sort']+1) . "&fid=" . $data['sort'] . "%}\">{--LOWER--}</a>";
+ $NAVI = '<a href="{%url=modules.php?module=admin&what=guestedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']-1) . '&fid=' . $data['sort'] . '%}">{--HIGHER--}</a>/<a href=\"{%url=modules.php?module=admin&what=guestedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']+1) . '&fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
}
if (empty($data['action'])) $data['action'] = ' ';
'gender' => translateGender($content['gender']),
'surname' => $content['surname'],
'family' => $content['family'],
- 'email' => "<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".$content['email']."</a>",
+ 'email' => '<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . $content['email'] . '</a>',
'joined' => generateDateTime($content['joined'], 2),
'last_online' => generateDateTime($content['last_online'], 2),
'notified' => generateDateTime($content['ap_notified'], 2),
$content['withdraw_form'] = loadTemplate('admin_list_beg_form', true);
} else {
// Display message "no manual withdraw possible"
- $content['withdraw_form'] = loadTemplate('admin_settings_saved', true, "<div class=\"admin_failed\">{--ADMIN_BEG_ALREADY_WITHDRAW--}</div>");
+ $content['withdraw_form'] = loadTemplate('admin_settings_saved', true, '<div class="admin_failed">{--ADMIN_BEG_ALREADY_WITHDRAW--}</div>');
}
// Prepare constant for timemark
if (isExtensionActive('autopurge')) {
$content['autopurge_timeout'] = generateDateTime(time() - getConfig('ap_inactive_since'), 2);
} else {
- $content['autopurge_timeout'] = loadTemplate('admin_settings_saved', true, sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'autopurge'));
+ $content['autopurge_timeout'] = loadTemplate('admin_settings_saved', true, getMaskedMessage('EXTENSION_PROBLEM_NOT_INSTALLED', 'autopurge'));
}
// Load final template
$content['withdraw_form'] = loadTemplate('admin_list_bonus_form', true);
} else {
// Display message "no manual withdraw possible"
- $content['withdraw_form'] = loadTemplate('admin_settings_saved', true, "<div class=\"admin_failed\">{--ADMIN_BONUS_ALREADY_WITHDRAW--}</div>");
+ $content['withdraw_form'] = loadTemplate('admin_settings_saved', true, '<div class="admin_failed">{--ADMIN_BONUS_ALREADY_WITHDRAW--}</div>');
}
// Prepare constant for timemark
if (isExtensionActive('autopurge')) {
$content['autopurge_timeout'] = generateDateTime(time() - getConfig('ap_inactive_since'), 2);
} else {
- $content['autopurge_timeout'] = loadTemplate('admin_settings_saved', true, sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'autopurge'));
+ $content['autopurge_timeout'] = loadTemplate('admin_settings_saved', true, getMaskedMessage('EXTENSION_PROBLEM_NOT_INSTALLED', 'autopurge'));
}
// Load final template
$content = getUserDataArray();
// Prepare constants
- // @TODO No longer needed? define('__CATS_BASE' , "<a href=\"{%url=modules.php?module=admin&userid=");
+ // @TODO No longer needed? define('__CATS_BASE' , '<a href="{%url=modules.php?module=admin&userid=');
$content['userid'] = bigintval(getRequestElement('userid'));
$content['member_links'] = generateMemberAdminActionLinks($content['userid']);
- $content['email'] = "<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".$content['surname']." ".$content['family']."</a>";
+ $content['email'] = '<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . $content['surname'] . ' ' . $content['family'] . '</a>';
// Ok, list categories of this user
$result_cats = SQL_QUERY("SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
}
} else {
// User not found
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_MEMBER_404'), $content['userid']));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_MEMBER_404', $content['userid']));
}
} else {
// Output selection form with all confirmed user accounts listed
), __FILE__, __LINE__);
// Country added
- $message = sprintf(getMessage('ADMIN_COUNTRY_ADDED'), strtoupper(postRequestElement('descr')));
+ $message = getMaskedMessage('ADMIN_COUNTRY_ADDED', strtoupper(postRequestElement('descr')));
} else {
// Free memory
SQL_FREERESULT($result);
// Does already exist
- $message = sprintf(getMessage('ADMIN_COUNTRY_ALREADY'), strtoupper(postRequestElement('code')));
+ $message = getMaskedMessage('ADMIN_COUNTRY_ALREADY', strtoupper(postRequestElement('code')));
}
// Display message
} else {
// Shall we modify / remove entries now?
$message = ''; initSqls();
- if ((isPostRequestElementSet(('modify'))) && (isPostRequestElementSet('id'))) {
+ if ((isPostRequestElementSet('modify')) && (isPostRequestElementSet('id'))) {
// Modify
foreach (postRequestElement('id') as $id => $sel) {
addSql("UPDATE `{?_MYSQL_PREFIX?}_countries` SET `code`='".postRequestElement('code', $id)."', `descr`='".postRequestElement('descr', $id)."', `is_active`='".postRequestElement('is_active', $id)."' WHERE `id`='".$id."' LIMIT 1");
if ($cnt > 0) {
// Something was payed out
$sumAlready += $cnt;
- $content['already_direct_link'] = "<a href=\"{%url=modules.php?module=admin&what=list_doubler&mode=already&select=direct%}\">".$cnt."</a>";
+ $content['already_direct_link'] = '<a href="{%url=modules.php?module=admin&what=list_doubler&mode=already&select=direct%}">' . $cnt . '</a>';
} // END - if
$cnt = countSumTotalData('Y','doubler','id','completed',true, " AND `is_ref`='Y'");
if ($cnt > 0) {
// Something was payed out
$sumAlready += $cnt;
- $content['already_ref_link'] = "<a href=\"{%url=modules.php?module=admin&what=list_doubler&mode=already&select=ref%}\">".$cnt."</a>";
+ $content['already_ref_link'] = '<a href="{%url=modules.php?module=admin&what=list_doubler&mode=already&select=ref%}">' . $cnt . '</a>';
} // END - if
// And the same for waiting pouts (direct and referal)
if ($cnt > 0) {
// Something was payed out
$sumWaiting += $cnt;
- $content['waiting_direct_link'] = "<a href=\"{%url=modules.php?module=admin&what=list_doubler&mode=waiting&select=direct%}\">".$cnt."</a>";
+ $content['waiting_direct_link'] = '<a href="{%url=modules.php?module=admin&what=list_doubler&mode=waiting&select=direct%}">' . $cnt . '</a>';
} // END - if
$cnt = countSumTotalData('N','doubler','id','completed',true, " AND `is_ref`='Y'");
if ($cnt > 0) {
// Something was payed out
$sumWaiting += $cnt;
- $content['waiting_ref_link'] = "<a href=\"{%url=modules.php?module=admin&what=list_doubler&mode=waiting&select=ref%}\">".$cnt."</a>";
+ $content['waiting_ref_link'] = '<a href="{%url=modules.php?module=admin&what=list_doubler&mode=waiting&select=ref%}">' . $cnt . '</a>';
} // END - if
// Links for all
- $content['already_all_link'] = "<a href=\"{%url=modules.php?module=admin&what=list_doubler&mode=already&select=all%}\">".$sumAlready."</a>";
- $content['waiting_all_link'] = "<a href=\"{%url=modules.php?module=admin&what=list_doubler&mode=waiting&select=all%}\">".$sumWaiting."</a>";
+ $content['already_all_link'] = '<a href="{%url=modules.php?module=admin&what=list_doubler&mode=already&select=all%}">' . $sumAlready . '</a>';
+ $content['waiting_all_link'] = '<a href="{%url=modules.php?module=admin&what=list_doubler&mode=waiting&select=all%}">' . $sumWaiting . '</a>';
// All data is loaded here...
break;
$result_data = SQL_QUERY_ESC("SELECT `subject`, `timestamp_ordered` AS `timestamp`, `cat_id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
$type = 'mailid'; $DATA = $id; $PROBLEM = getMessage('NORMAL_MAIL_PROBLEM');
- $LINK = "<a href=\"{%url=mailid.php?userid=".getRequestElement('userid')."&mailid=".$id."%}\" target=\"_blank\">".$id."</a>";
+ $LINK = '<a href="{%url=mailid.php?userid=' . getRequestElement('userid') . '&mailid=' . $id . '%}" target="_blank">' . $id . '</a>';
break;
case 'BONUS':
$result_data = SQL_QUERY_ESC("SELECT `subject`, `timestamp`, `cat_id` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
array(bigintval($id2)), __FILE__, __LINE__);
$type = 'bonusid'; $DATA = $id2; $PROBLEM = getMessage('BONUS_MAIL_PROBLEM');
- $LINK = "<a href=\"{%url=mailid.php?userid=".getRequestElement('userid')."&bonusid=".$id2."%}\" target=\"_blank\">".$id2."</a>";
+ $LINK = '<a href="{%url=mailid.php?userid=' . getRequestElement('userid') . '&bonusid=' . $id2 . '%}" target="_blank">' . $id2 . '</a>';
break;
default: // Problem in application detected!
// Remember list in constant for the template
$content['surname'] = getUserData('surname');
$content['family'] = getUserData('family');
- $content['email'] = "<a href=\"" . generateEmailLink(getUserData('email'), 'user_data') . "\">".getUserData('email')."</a>";
+ $content['email'] = '<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">' . getUserData('email') . '</a>';
$content['rows'] = $OUT;
$content['nums'] = $nums;
$content['userid'] = bigintval(getRequestElement('userid'));
}
} else {
// No mails left to confirm
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_MEMBER_LINKS'), getRequestElement('userid')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_MEMBER_LINKS', getRequestElement('userid')));
}
} else {
// User not found
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_MEMBER_404', getRequestElement('userid')));
}
} else {
// Output selection form with all confirmed user accounts listed
// Add description as navigation point
addMenuDescription('admin', __FILE__);
+// These are expert settings!
+if (doVerifyExpertSettings() != 'agreed') {
+ // Abort here
+ return;
+} // END - if
+
// Handle form here
doNetworkHandleForm();
loadTemplate('admin_list_network_types', false, $OUT);
} else {
// No entries found
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_NETWORK_TYPES_404'), $networkData['network_title']));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_NETWORK_TYPES_404', $networkData['network_title']));
}
// Free result
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-// By default we should display list/add new forms
-$GLOBALS['network_display'] = true;
+// These are expert settings!
+if (doVerifyExpertSettings() != 'agreed') {
+ // Abort here
+ return;
+} // END - if
// Handle form here
doNetworkHandleForm();
+// By default we should display list/add new forms
+$GLOBALS['network_display'] = true;
+
// Display forms?
if ($GLOBALS['network_display'] === false) {
// Abort here
$result_max = SQL_QUERY($SQL2, __FILE__, __LINE__);
} else {
// Bonus extension required!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_EXTENSION_PROBLEM_EXT_NOT_INSTALLED'), 'bonus'));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_EXTENSION_PROBLEM_EXT_NOT_INSTALLED', 'bonus'));
}
// Create limitation line
}
} else {
// Cannot load payout id
- loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">{--PAYOUT_FAILED_OBTAIN_PAYOUT_ID--}</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="admin_failed">{--PAYOUT_FAILED_OBTAIN_PAYOUT_ID--}</div>');
}
} else {
// Prepare content
$content = array(
'task' => $task,
'pid' => bigintval(getRequestElement('pid')),
- 'user' => "<a href=\"".generateEmailLink(getUserData('email'), 'user_data')."\">".translateGender(getUserData('gender'))." ".getUserData('surname')." ".getUserData('family')."</a>",
+ 'user' => '<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">' . translateGender(getUserData('gender')) . ' ' . getUserData('surname') . ' ' . getUserData('family') . '</a>',
);
// Load template
$content = array(
'task' => $task,
'pid' => bigintval(getRequestElement('pid')),
- 'user' => "<a href=\"".generateEmailLink(getUserData('email'), 'user_data')."\">".translateGender(getUserData('gender'))." ".getUserData('surname')." ".getUserData('family')."</a>",
+ 'user' => '<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">' . translateGender(getUserData('gender')) . ' ' . getUserData('surname') . ' ' . getUserData('family') . '</a>',
);
// Load template
while ($content = SQL_FETCHARRAY($result)) {
if ($content['status'] == 'NEW') {
// Generate links for direct accepting and rejecting
- $content['status'] = "<a href=\"{%url=modules.php?module=admin&what=list_payouts&do=accept&pid=" . $content['id'] . "%}\">{--PAYOUT_ACCEPT_PAYOUT--}</a> | <a href=\"{%url=modules.php?module=admin&what=list_payouts&do=reject&pid=" . $content['id'] . "%}\">{--PAYOUT_REJECT_PAYOUT--}</a>";
+ $content['status'] = '<a href="{%url=modules.php?module=admin&what=list_payouts&do=accept&pid=' . $content['id'] . '%}">{--PAYOUT_ACCEPT_PAYOUT--}</a> | <a href="{%url=modules.php?module=admin&what=list_payouts&do=reject&pid=' . $content['id'] . '%}">{--PAYOUT_REJECT_PAYOUT--}</a>';
} else {
// Translate status
$content['status'] = getMessage('PAYOUT_STATUS_'.strtoupper($content['status']).'');
- $content['status'] = "<div class=\"admin_failed\">".$content['status']."</div>";
+ $content['status'] = '<div class="admin_failed">' . $content['status'] . '</div>';
}
// Nothing entered must be secured in member/what-payputs.php !
}
// Admins can addionally test the URL for framekillers
- $content['target_bank'] = "<a href=\"".generateFrametesterUrl($content['url'])."\" target=\"_blank\">{--CLICK_HERE--}</a>";
+ $content['target_bank'] = '<a href="' . generateFrametesterUrl($content['url']) . '" target="_blank">{--CLICK_HERE--}</a>';
} else {
// e-currency payout request
if (empty($content['target_account'])) $content['target_account'] = '---';
// Add row and switch color
$OUT .= loadTemplate('admin_list_payouts_row', true, $content);
$SW = 3 - $SW;
- }
+ } // END - while
// Free memory
SQL_FREERESULT($result);
// Did some users joined this rallye?
if ($joined > 0) {
// List joined users
- $joined = "<a href=\"{%url=modules.php?module=admin&what=list_rallyes&sub=users&rallye=" . $data['id'] . "%}\" title=\"{--RALLYE_LIST_USERS_TITLE--}\">".$joined."</a>";
+ $joined = '<a href="{%url=modules.php?module=admin&what=list_rallyes&sub=users&rallye=' . $data['id'] . '%}" title="{--RALLYE_LIST_USERS_TITLE--}">' . $joined . '</a>';
} // END - if
// Alter some variables
// Transfer data into array for the template
$row = array(
- 'select' => "<input type=\"checkbox\" name=\"sel[".$data['id']."]\" class=\"admin_normal\" value=\"1\" />",
+ 'select' => '<input type="checkbox" name="sel[' . $data['id'] . ']" class="admin_normal" value="1" />',
'admin_id' => $data['admin_id'],
'admin_link' => generateAdminLink($data['admin_id']),
'login' => $data['login'],
switch ($data['is_active']) {
case 'Y':
// Rallye is active so do not edit it!
- $row['select'] = "<div class=\"big\">".$row['id']."</div>";
+ $row['select'] = '<div class="big">' . $row['id'] . '</div>';
$row['active_title'] = getMessage('RALLYE_DEACTIVATE_NOW');
$row['active'] = '0';
break;
$menge_lck = countSumTotalData($userid, 'user_data', 'userid', 'refid', true, " AND `status` != 'CONFIRMED'");
// Output info message
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink(getRequestElement('userid')), $menge, $menge_lck));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_USER_TOTAL_REFS', generateUserProfileLink(getRequestElement('userid')), $menge, $menge_lck));
// Load all referal levels
$result_levels = SQL_QUERY("SELECT
$menge_lck = countSumTotalData($userid, 'user_data', 'userid', 'refid', true, " AND `status` != 'CONFIRMED'");
// Output info message
- $levels['info'] = sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink($userid), $menge, $menge_lck);
+ $levels['info'] = getMaskedMessage('ADMIN_USER_TOTAL_REFS', generateUserProfileLink($userid), $menge, $menge_lck);
// Init variables
$OUT_REFS = ''; $SW = 2;
} // END - while
} else {
// Output info message
- $levels['info'] = sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink($userid), 0, 0);
+ $levels['info'] = getMaskedMessage('ADMIN_USER_TOTAL_REFS', generateUserProfileLink($userid), 0, 0);
// No refs found
$levels['rows'] = loadTemplate('admin_list_refs_norefs', true, array('userid' => $userid));
SQL_FREERESULT($result_levels);
} else {
// User not found
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_MEMBER_404', getRequestElement('userid')));
}
} else {
// Output selection form with all confirmed user accounts listed
loadTemplate('admin_list_sponsor_details', false, $content);
} else {
// Sponsor not found
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_404'), getRequestElement('id')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_404', getRequestElement('id')));
}
} elseif (isGetRequestElementSet('rid')) {
// Search for sponsor
SQL_FREERESULT($result);
} else {
// No refs made so far
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_REFS_404'), "<a href=\"{%url=modules.php?module=admin&what=list_sponsor&id=" . bigintval(getRequestElement('rid')) . "%}\">" . bigintval(getRequestElement('rid')) . "</a>"));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_REFS_404', '<a href="{%url=modules.php?module=admin&what=list_sponsor&id=' . bigintval(getRequestElement('rid')) . '%}">' . bigintval(getRequestElement('rid')) . '</a>'));
}
} else {
// Sponsor not found
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_404'), bigintval(getRequestElement('rid'))));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_404', bigintval(getRequestElement('rid'))));
}
} else {
// List all sponsors
), __FILE__, __LINE__);
// Payment type added!
- $message = sprintf(getMessage('ADMIN_SPONSOR_PAYTYPE_ADDED'), postRequestElement('pay_name'));
+ $message = getMaskedMessage('ADMIN_SPONSOR_PAYTYPE_ADDED', postRequestElement('pay_name'));
} else {
// Free memory
SQL_FREERESULT($result);
// Entry does already exists
- $message = sprintf(getMessage('ADMIN_SPONSOR_PAYTYPE_ALREADY'), postRequestElement('pay_name'));
+ $message = getMaskedMessage('ADMIN_SPONSOR_PAYTYPE_ALREADY', postRequestElement('pay_name'));
}
// Output message
SQL_FREERESULT($result);
} else {
// Sponsor not found!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_404'), bigintval(getRequestElement('id'))));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_404', bigintval(getRequestElement('id'))));
}
} else {
// Not called by what-list_sponsor.php
default: // Unknown type
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", getRequestElement('type')));
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_TASK_UNKNOWN_MODE'), getRequestElement('type')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_TASK_UNKNOWN_MODE', getRequestElement('type')));
break;
} // END - switch
'userid' => $content['userid'],
'link' => $LINK,
'id' => $ID,
- 'email' => "<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".translateGender($content['gender'])." ".$content['surname']." ".$content['family']."</a>",
+ 'email' => '<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . translateGender($content['gender']) . ' ' . $content['surname'] . ' ' . $content['family'] . '</a>',
'status' => translateUserStatus($content['status']),
);
// Load row template and switch colors
$OUT .= loadTemplate('admin_list_unconfirmed_row', true, $content);
$SW = 3 - $SW;
- }
+ } // END - while
// Render it in our new listing
$OUT = loadTemplate('admin_list_unconfirmed_list', true, $OUT);
if (SQL_NUMROWS($result1) == 1) {
// pool table
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_UNCONFIRMED_POOL_MISSING'), $ID));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_UNCONFIRMED_POOL_MISSING', $ID));
} elseif (SQL_NUMROWS($result2) == 1) {
// user_stats table
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_UNCONFIRMED_STATS_MISSING'), $ID));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_UNCONFIRMED_STATS_MISSING', $ID));
} else {
// both or link is invalid
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_UNCONFIRMED_INVALID_LINK'));
loadTemplate('admin_user_details', false, $content);
} else {
// Account does not exist!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_MEMBER_404'), $userid));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_MEMBER_404', $userid));
}
// Free the result
} // END - if
// Add reload lock
- $entry['already'] = sprintf(getMessage('ADMIN_YOOMEDIA_TEXTMAIL_SEND_AGAIN'), createFancyTime($countdown));
+ $entry['already'] = getMaskedMessage('ADMIN_YOOMEDIA_TEXTMAIL_SEND_AGAIN', createFancyTime($countdown));
} else {
// Never resentable unless manual removal
$entry['already'] = getMessage('ADMIN_YOOMEDIA_TEXTMAIL_MANUALLY_LOCKED');
}
} else {
// Sponsor not found!
- $message = sprintf(getMessage('ADMIN_SPONSOR_404'), bigintval(getRequestElement('id')));
+ $message = getMaskedMessage('ADMIN_SPONSOR_404', bigintval(getRequestElement('id')));
}
// Free result
} // END - if
// Prepare message
- $message = sprintf(getMessage('USER_ACCOUNT_LOCKED'), getRequestElement('userid'));
+ $message = getMaskedMessage('USER_ACCOUNT_LOCKED', getRequestElement('userid'));
$ACT = true;
} elseif ((isPostRequestElementSet('unlock')) && (getUserData('status') == 'LOCKED')) {
// Ok, unlock the account!
} // END - if
// Prepare message
- $message = sprintf(getMessage('USER_ACCOUNT_UNLOCKED'), getRequestElement('userid'));
+ $message = getMaskedMessage('USER_ACCOUNT_UNLOCKED', getRequestElement('userid'));
$ACT = true;
} elseif (isPostRequestElementSet('del')) {
// Delete the account
switch ($content['status']) {
case 'CONFIRMED': // Yes, lock him down... ;-)
$content['ok'] = 'lock';
- $content['header'] = sprintf(getMessage('ADMIN_HEADER_LOCK_ACCOUNT'), $content['userid']);
- $content['text'] = sprintf(getMessage('ADMIN_TEXT_LOCK_ACCOUNT'), $content['userid']);
+ $content['header'] = getMaskedMessage('ADMIN_HEADER_LOCK_ACCOUNT', $content['userid']);
+ $content['text'] = getMaskedMessage('ADMIN_TEXT_LOCK_ACCOUNT', $content['userid']);
break;
case 'LOCKED': // Unlock the user
$content['ok'] = 'unlock';
- $content['header'] = sprintf(getMessage('ADMIN_HEADER_UNLOCK_ACCOUNT'), $content['userid']);
- $content['text'] = sprintf(getMessage('ADMIN_TEXT_UNLOCK_ACCOUNT'), $content['userid']);
+ $content['header'] = getMaskedMessage('ADMIN_HEADER_UNLOCK_ACCOUNT', $content['userid']);
+ $content['text'] = getMaskedMessage('ADMIN_TEXT_UNLOCK_ACCOUNT', $content['userid']);
break;
case 'UNCONFIRMED': // Unconfirmed accounts cannot be unlocked!
$content['ok'] = 'del';
- $content['header'] = sprintf(getMessage('ADMIN_HEADER_DEL_ACCOUNT'), $content['userid']);
- $content['text'] = sprintf(getMessage('ADMIN_TEXT_DEL_ACCOUNT'), $content['userid']);
+ $content['header'] = getMaskedMessage('ADMIN_HEADER_DEL_ACCOUNT', $content['userid']);
+ $content['text'] = getMaskedMessage('ADMIN_TEXT_DEL_ACCOUNT', $content['userid']);
break;
}
loadTemplate('admin_lock_user', false, $content);
} else {
// Account does not exists!
- loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . getMaskedMessage('ADMIN_MEMBER_404', getRequestElement('userid')) . '</div>');
}
}
} elseif ($ACT) {
// An action was performed...
if (!empty($message)) {
- loadTemplate('admin_settings_saved', false, "<div class=\"admin_green\">".$message."</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . $message . '</div>');
} else {
- loadTemplate('admin_settings_saved', false, "<div class=\"admin_green\">".getMessage('ADMIN_USER_UPDATED')."</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . getMessage('ADMIN_USER_UPDATED') . '</div>');
}
}
} else {
// Account does not exists!
- loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . getMaskedMessage('ADMIN_MEMBER_404', getRequestElement('userid')) . '</div>');
}
} else {
// List all users
outputHtml($OUTPUT);
// Output message
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_UNKNOWN_LOGFILE_FORMAT'), $access));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_UNKNOWN_LOGFILE_FORMAT', $access));
return;
}
shutdown();
} else {
// Not readable!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('LOGFILE_NOT_READABLE'), $access));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('LOGFILE_NOT_READABLE', $access));
}
} else {
// Is the directory there?
outputHtml('</ol>');
} else {
// logs directory does not exist
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_LOGS_DIR_404'), getConfig('logs_base')));
+ loadTemplate('admin_settings_saved', false, getMessage('ADMIN_LOGS_DIR_404'));
}
}
if ((!empty($tid)) && (!empty($fid))) {
// Sort menu
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
array(bigintval(getRequestElement('tid')), bigintval($fid)), __FILE__, __LINE__);
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
array(bigintval(getRequestElement('fid')), bigintval($tid)), __FILE__, __LINE__);
} // END - -fi
- }
+ } // END - if
if (!empty($SUB)) {
// Edit sub menus
$cnt++;
if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) {
// Is highest position
- $data['navi'] = "<a href=\"{%url=modules.php?module=admin&what=memedit&sub=" . $content['sub'] . "&act=" . $data['action'] . "&w=" . $data['what'] . "&tid=".($data['sort']+1)."&fid=" . $data['sort'] . "%}\">{--LOWER--}</a>";
+ $data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']+1) . '&fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
} elseif ($cnt == $max) {
// Is lowest position
- $data['navi'] = "<a href=\"{%url=modules.php?module=admin&what=memedit&sub=" . $content['sub'] . "&act=" . $data['action'] . "&w=" . $data['what'] . "&tid=".($data['sort']-1)."&fid=" . $data['sort'] . "%}\">{--HIGHER--}</a>";
+ $data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']-1) . '&fid=' . $data['sort'] . '%}">{--HIGHER--}</a>';
} elseif ($data['sort'] > 0) {
// Anything else between highest and lowest
- $data['navi'] = "<a href=\"{%url=modules.php?module=admin&what=memedit&sub=" . $content['sub'] . "&act=" . $data['action'] . "&w=" . $data['what'] . "&tid=".($data['sort']-1)."&fid=" . $data['sort'] . "%}\">{--HIGHER--}</a>/<a href=\"{%url=modules.php?module=admin&what=memedit&sub=" . $content['sub'] . "&act=" . $data['action'] . "&w=" . $data['what'] . "&tid=" . ($data['sort']+1) . "&fid=" . $data['sort'] . "%}\">{--LOWER--}</a>";
+ $data['navi'] = '<a href="{%url=modules.php?module=admin&what=adminedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']-1) . '&fid=' . $data['sort'] . '%}">{--HIGHER--}</a>/<a href="{%url=modules.php?module=admin&what=memedit&sub=' . $content['sub'] . '&act=' . $data['action'] . '&w=' . $data['what'] . '&tid=' . ($data['sort']+1) . '&fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
}
// Fix empty values for Firefox
// Load row template and switch color
$OUT .= loadTemplate('admin_menu_overview_row', true, $data);
$SW = 3 - $SW;
- }
+ } // END - while
// Free memory
SQL_FREERESULT($result);
// Are we in 'welcome' page and are there jobs to be done?
if (!ifAdminMenuHasEntries(getAction())) {
// This menu is empty and so no content is displayed
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_MENU_IS_EMPTY'), getAction()));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_MENU_IS_EMPTY', getAction()));
} elseif ($jobsDone === true) {
// Generate overview of all main menus
if ((is_array($GLOBALS['menu']['description'])) && (count($GLOBALS['menu']['description']) > 0)) {
} elseif ($taskExt === false) {
if (isExtensionActive('task')) {
// Output warning message
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('EXTENSION_WARNING_EXT_INACTIVE'), 'task'));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('EXTENSION_WARNING_EXT_INACTIVE', 'task'));
}
// List selected tasks on overview when task management is not active
// Repair finished
if ($REP > 0) {
- $message = sprintf(getMessage('ADMIN_REPAIR_ENTRIES_FIXED'), $REP);
+ $message = getMaskedMessage('ADMIN_REPAIR_ENTRIES_FIXED', $REP);
} else {
$message = getMessage('ADMIN_REPAIR_NOTHING_FIXED');
}
if ($REMOVED > 0) {
// Entries repaired
- $content = sprintf(getMessage('ADMIN_REPAIR_ENTRIES_FIXED'), $REMOVED);
+ $content = getMaskedMessage('ADMIN_REPAIR_ENTRIES_FIXED', $REMOVED);
} else {
// Nothing repaired
- $content = "<div class=\"admin_failed\">{--ADMIN_REPAIR_NOTHING_FIXED--}</div>";
+ $content = '<div class="admin_failed">{--ADMIN_REPAIR_NOTHING_FIXED--}</div>';
}
} else {
// No category selections found, no members registered?
- $content = "<div class=\'admin_failed\">{--ADMIN_REPAIR_CATS_NOTHING--}</div>";
+ $content = '<div class="admin_failed">{--ADMIN_REPAIR_CATS_NOTHING--}</div>';
}
// Load template
// Repair finished
if ($REP > 0) {
- $message = sprintf(getMessage('ADMIN_REPAIR_ENTRIES_FIXED'), $REP);
+ $message = getMaskedMessage('ADMIN_REPAIR_ENTRIES_FIXED', $REP);
} else {
$message = getMessage('ADMIN_REPAIR_NOTHING_FIXED');
}
// Repair finished
if ($REP > 0) {
- $message = sprintf(getMessage('ADMIN_REPAIR_ENTRIES_FIXED'), $REP);
+ $message = getMaskedMessage('ADMIN_REPAIR_ENTRIES_FIXED', $REP);
} else {
$message = getMessage('ADMIN_REPAIR_NOTHING_FIXED');
}
// Selected user does exist
$content = getUserDataArray();
- if ((isFormSent()) && (isPostRequestElementSet(('points')))) {
+ if ((isFormSent()) && (isPostRequestElementSet('points'))) {
// Ok, add to used points and send an email to him...
subtractPoints('admin_single', bigintval(getRequestElement('userid')), postRequestElement('points'));
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_POINTS_SUBTRACTED'));
} else {
// Prepare content
- $content['user'] = "<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".$content['surname']." ".$content['family']."</a>";
+ $content['user'] = '<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . $content['surname'] . ' ' . $content['family'] . '</a>';
$content['userid'] = bigintval(getRequestElement('userid'));
// Load form
}
} else {
// User not found!
- loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . getMaskedMessage('ADMIN_MEMBER_404', getRequestElement('userid')) . '</div>');
}
} else {
// Output selection form with all confirmed user accounts listed
// Is the loaded theme name != current theme name?
$LINK = $content['theme_path'];
- if ($content['theme_path'] != getCurrentTheme()) $LINK = "<a href=\"{%url=modules.php?module=admin&what=theme_edit&default_theme=".$content['theme_path']."%}\" title=\"{--ADMIN_SET_AS_NEW_THEME--}\">".$content['theme_path']."</a>";
+ if ($content['theme_path'] != getCurrentTheme()) $LINK = '<a href="{%url=modules.php?module=admin&what=theme_edit&default_theme=' . $content['theme_path'] . '%}" title="{--ADMIN_SET_AS_NEW_THEME--}">' . $content['theme_path'] . '</a>';
// Prepare data for the row template
$content = array(
'link' => $LINK,
'name' => $content['theme_name'],
'is_act' => translateYesNo($content['theme_active']),
- 'email' => "<a href=\"mailto:".$GLOBALS['theme_data']['email']."?Subject=[Theme:] ".$GLOBALS['theme_data']['name']." (".$content['theme_path'].")'.'\">".$GLOBALS['theme_data']['author']."</a>",
+ 'email' => '<a href="mailto:' . $GLOBALS['theme_data']['email'] . '?Subject=[Theme:] ' . $GLOBALS['theme_data']['name'] . ' (' . $content['theme_path'] . ')\>' . $GLOBALS['theme_data']['author'] . '</a>',
'url_link' => generateDerefererUrl($GLOBALS['theme_data']['url']),
'url_title' => $GLOBALS['theme_data']['url'],
'ver' => $content['theme_ver'],
rebuildCacheFile('themes', 'them');
// Prepare message
- $message = sprintf(getMessage('ADMIN_THEME_IMPORTED'), postRequestElement('theme'));
+ $message = getMaskedMessage('ADMIN_THEME_IMPORTED', postRequestElement('theme'));
} else {
// Include file not found!
- $message = sprintf(getMessage('ADMIN_THEME_INC_404'), postRequestElement('theme'));
+ $message = getMaskedMessage('ADMIN_THEME_INC_404', postRequestElement('theme'));
}
} else {
// Theme already imported
- $message = sprintf(getMessage('ADMIN_THEME_ALREADY_INSTALLED'), postRequestElement('theme'));
+ $message = getMaskedMessage('ADMIN_THEME_ALREADY_INSTALLED', postRequestElement('theme'));
}
// Output message
$OUT = ''; $SW = 2;
foreach ($THEMES['theme_unix'] as $key => $unix) {
// Already installed is default
- $formContent = '<div class="admin_note">' . sprintf(getMessage('ADMIN_THEME_ALREADY_INSTALLED'), $unix) . '</div>';
+ $formContent = '<div class="admin_note">' . getMaskedMessage('ADMIN_THEME_ALREADY_INSTALLED', $unix) . '</div>';
// Check if current theme is already imported or not
if (!ifThemeExists($unix)) {
// Transfer data to array
$data = array(
'admin_id' => $content['email'],
- 'order' => ($content['pay_count'] * $content['pay_rate'])." ".$content['pay_currency'],
+ 'order' => ($content['pay_count'] * $content['pay_rate']) . ' ' . $content['pay_currency'],
'stamp' => generateDateTime($content['pay_ordered'], 2),
'pname' => $content['pay_name'],
);
// Is a newer version available?
if (empty($ONLINE['version'])) {
// Disconnected?
- loadTemplate('admin_settings_saved', false, "<div class=\"admin_failed\">{--ADMIN_CANNOT_CHECK_VERSION--} (".$ONLINE['code'].")</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="admin_failed">{--ADMIN_CANNOT_CHECK_VERSION--} (' . $ONLINE['code'] . ')</div>');
} elseif (($ONLINE['version'] != getConfig('FULL_VERSION')) || ($ONLINE['revision'] != getConfig('CURR_SVN_REVISION'))) {
// New full-version available (all previous released patches are included in this version!)
$ONLINE['changed'] = generateDateTime($ONLINE['changed'], 2);
outputHtml($content);
} else {
// Nothing to load, then we have no directory 'usage'
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_USAGE_DIRECTORY_404'), getConfig('usage_base')));
+ loadTemplate('admin_settings_saved', false, getMessage('ADMIN_USAGE_DIRECTORY_404'));
}
-//
+// [EOF]
?>
}
} else {
// Not found?
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('USER_ACCOUNT_404'), bigintval(getRequestElement('userid'))));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('USER_ACCOUNT_404', bigintval(getRequestElement('userid'))));
}
} else {
// Display selection box
// Remember rows and fancy time in array
$content['rows'] = $OUT;
- $content['online_timeout'] = sprintf(getMessage('ONLINE_TIMEOUT_IS'), createFancyTime(getConfig('online_timeout')));
+ $content['online_timeout'] = getMaskedMessage('ONLINE_TIMEOUT_IS');
// Load footer template
loadTemplate('admin_list_online', false, $content);
// Ok, we finally load the guest action module
loadInclude($inc);
} else {
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('GUEST_LOCKED_ACTION'), getWhat()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('GUEST_LOCKED_ACTION', getWhat()));
}
// [EOF]
<td colspan=\"7\" align=\"center\">
<span class=\"guest_failed\">";
+ // Do we have a userid set?
+ if (isSessionVariableSet('current_userid')) {
+ // Then prefetch data for this account
+ fetchUserData(getSession('current_userid'));
+ } // END - if
+
// Convert the code to message
$message .= getMessageFromErrorCode($errorCode);
// Rallye will expire in less one day!
$content['extras'] = getMessage('RALLYE_EXPIRE_ONE_DAY');
} else {
- $content['extras'] = "<a href=\"{%url=modules.php?module=index&what=register%}\">{--RALLYE_REGISTER_NOW--}</a>";
+ $content['extras'] = '<a href="{%url=modules.php?module=index&what=register%}">{--RALLYE_REGISTER_NOW--}</a>';
}
// Set admin line (currently set to impressum, later to contact form)
- // @TODO Reactivate this: $content['admin'] = "<a href=\"{%url=modules.php?module=index&what=impressum&admin=" . $adminId . "%}\">" . $login . "</a>";
+ // @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&what=impressum&admin=' . $adminId . '%}">' . $login . '</a>';
// Set title
$content['title'] = $title;
if ($expired === true) {
$content['prices'] = addReferalRallyeWinners($id);
- $content['top_users'] = "<div align=\"center\" class=\"big\">".$content['extras']."</div>";
+ $content['top_users'] = '<div align="center" class="big">' . $content['extras'] . '</div>';
$content['can_win_this'] = getMessage('RALLYE_OUR_WINNERS_ARE');
} else {
$content['prices'] = addReferalRallyePrices($id, 'html');
} // END - if
if ((!empty($cats)) && ($cats < getConfig('least_cats'))) {
- registerOutputFailedMessage('', sprintf(getMessage('CATS_LEAST'), getConfig('least_cats')));
+ registerOutputFailedMessage('', getMessage('CATS_LEAST'));
} // END - if
// Generate birthday selection
}
} elseif (strlen(postRequestElement('pass1')) < getConfig('pass_len')) {
// Password is to short!
- $FORM_ERRORS[] = sprintf(getMessage('SPONSOR_PASSWORD_TOO_SHORT'), getConfig('pass_len'));
+ $FORM_ERRORS[] = getMessage('SPONSOR_PASSWORD_TOO_SHORT');
}
// Check if he has accepted the terms&conditions
$message = $messageArray['added'];
} else {
// Sponsor account not found???
- $message = sprintf(getMessage('SPONSOR_EMAIL_404'), postRequestElement('email'));
+ $message = getMaskedMessage('SPONSOR_EMAIL_404', postRequestElement('email'));
}
// Free memory
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown status %s detected.", $STATUS));
if (!isAdmin()) {
// Message for testing admin
- $message = sprintf(getMessage('ADMIN_SPONSOR_UNKNOWN_STATUS'), $STATUS);
+ $message = getMaskedMessage('ADMIN_SPONSOR_UNKNOWN_STATUS', $STATUS);
} else {
// Message for the guest
- $message = sprintf(getMessage('SPONSOR_UNKNOWN_STATUS'), $STATUS);
+ $message = getMaskedMessage('SPONSOR_UNKNOWN_STATUS', $STATUS);
}
break;
}
// Ok, we finally load the member action module
loadInclude($inc);
} else {
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_WHAT'), getWhat()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('MEMBER_404_WHAT', getWhat()));
}
// [EOF]
// Ok, we finally load the member action module
loadInclude($inc);
} else {
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_WHAT'), getWhat()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('MEMBER_404_WHAT', getWhat()));
}
// [EOF]
// Ok, we finally load the member action module
loadInclude($inc);
} else {
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_WHAT'), getWhat()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('MEMBER_404_WHAT', getWhat()));
}
// [EOF]
// Ok, we finally load the member action module
loadInclude($inc);
} else {
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_WHAT'), getWhat()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('MEMBER_404_WHAT', getWhat()));
}
// [EOF]
// Ok, we finally load the member action module
loadInclude($inc);
} else {
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_WHAT'), getWhat()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('MEMBER_404_WHAT', getWhat()));
}
// [EOF]
// Ok, we finally load the member action module
loadInclude($inc);
} else {
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_WHAT'), getWhat()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('MEMBER_404_WHAT', getWhat()));
}
// [EOF]
// Ok, we finally load the member action module
loadInclude($inc);
} else {
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_WHAT'), getWhat()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('MEMBER_404_WHAT', getWhat()));
}
// [EOF]
// Ok, we finally load the member action module
loadInclude($inc);
} else {
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_WHAT'), getWhat()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('MEMBER_404_WHAT', getWhat()));
}
// [EOF]
// Ok, we finally load the member action module
loadInclude($inc);
} else {
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_WHAT'), getWhat()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('MEMBER_404_WHAT', getWhat()));
}
// [EOF]
loadTemplate('admin_settings_saved', false, getMessage('MEMBER_CATS_NOT_SAVED'));
}
} else {
- if ($LEAST) {
+ if ($LEAST === true) {
// Also here we have to secure it... :(
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('CATS_LEAST'), getConfig('least_cats')));
+ loadTemplate('admin_settings_saved', false, getMessage('CATS_LEAST'));
} // END - if
// Put some data into constants for the template
}
// Display message and exit here
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('HOLIDAY_MEMBER_ORDER'), generateDateTime($stamp, 1)));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('HOLIDAY_MEMBER_ORDER', generateDateTime($stamp, 1)));
return;
}
} // END - if
// How far is last change on his profile away from now?
if ((($content['last_update'] + getConfig('profile_lock')) > time()) && (!isAdmin()) && (getConfig('profile_lock') > 0)) {
// You cannot change your account
- $content['change'] = loadTemplate('admin_settings_saved', true, '<div class="member_failed">' . sprintf(getMessage('MEMBER_PROFILE_LOCKED'), generateDateTime($content['last_update'] + getConfig('profile_lock'), 0)) . '</div>');
+ $content['change'] = loadTemplate('admin_settings_saved', true, '<div class="member_failed">' . getMaskedMessage('MEMBER_PROFILE_LOCKED', generateDateTime($content['last_update'] + getConfig('profile_lock'), 0)) . '</div>');
} else {
// He is allowed to change his profile
$content['change'] = loadTemplate('member_mydata_button', true);
// How far is last change on his profile away from now?
if (($content['update_check'] > time()) && (!isAdmin()) && (getConfig('profile_lock') > 0)) {
- $content['update_check'] = sprintf(getMessage('MEMBER_PROFILE_LOCKED'), generateDateTime($content['update_check'] + getConfig('profile_lock'), 0));
+ $content['update_check'] = getMaskedMessage('MEMBER_PROFILE_LOCKED', generateDateTime($content['update_check'] + getConfig('profile_lock'), 0));
// You cannot change your account
loadTemplate('admin_settings_saved', false, $content['update_check']);
$content['country'] = $OUT;
} else {
// Ouput default input box
- $content['country'] = "<input type=\"text\" name=\"cntry\" class=\"member_normal\" size=\"2\" maxlength=\"3\" value=\"".$content['country']."\" />";
+ $content['country'] = '<input type="text" name="cntry" class="member_normal" size="2" maxlength="3" value="' . $content['country'] . '" />';
}
// Load template
$hash = generateHash(postRequestElement('pass1'), substr($content['password'], 0, -40));
if ((($hash == $content['password']) || (postRequestElement('pass1') == postRequestElement('pass2'))) && (isPostRequestElementSet('pass1'))) {
// Only on simple changes normal mode is active = no email or password changed
- $mode = 'normal'; $AND = '';
+ $mode = 'normal';
+ $AND = '';
// Did the user changed the password?
- if ($hash != $content['password']) { $AND = ", `password`='".$hash."'"; $mode = 'pass'; }
+ if ($hash != $content['password']) {
+ $AND = ", `password`='" . $hash . "'";
+ $mode = 'pass';
+ } // END - if
// Or did he changed his password?
if (postRequestElement('email') != $content['email']) {
} else {
// Do we have already submit the form?
if (isPostRequestElementSet('nickname')) {
- loadTemplate('admin_settings_saved', false, "<div class=\"member_failed\">{--NICKNAME_IS_INVALID--}</div");
+ loadTemplate('admin_settings_saved', false, '<div class="member_failed">{--NICKNAME_IS_INVALID--}</div>');
} // END - if
// Load Template
$links = countSumTotalData(getMemberId(), 'user_links', 'id', 'userid', true);
// Do we have ext-holiday installed?
-$HOLIDAY = 'serid';
+// @TODO Rewrite this to a filter
+$HOLIDAY = 'userid';
if ((isExtensionActive('holiday')) && (getExtensionVersion('holiday') >= '0.1.3')) {
// Fetch also holiday activation data
$HOLIDAY = 'holiday_active';
} // END - if
-$result_mmails = SQL_QUERY_ESC("SELECT `userid`, `receive_mails`, `mail_orders`, `".$HOLIDAY."`
-FROM `{?_MYSQL_PREFIX?}_user_data`
-WHERE `userid`=%s AND `max_mails` > 0 LIMIT 1",
+$result_mmails = SQL_QUERY_ESC("SELECT
+ `userid`, `receive_mails`, `mail_orders`, `".$HOLIDAY."`
+FROM
+ `{?_MYSQL_PREFIX?}_user_data`
+WHERE
+ `userid`=%s AND
+ `max_mails` > 0
+LIMIT 1",
array(getMemberId()), __FILE__, __LINE__);
$mmails = SQL_NUMROWS($result_mmails);
default: // Unknown/invalid
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown order_mas_full config detected.", getConfig('order_max_full')));
- $content['order_max_full'] = sprintf(getMessage('MEMBER_ORDER_ALLOWED_UNKNOWN'), getConfig('order_max_full'));
+ $content['order_max_full'] = getMessage('MEMBER_ORDER_ALLOWED_UNKNOWN');
break;
} // END - switch
loadTemplate('admin_settings_saved', false, getMessage('MEMBER_HAS_ZERO_MMAILS'));
} else {
// Please confirm some mails first
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('MEMBER_LINKS_LEFT'), $links, getConfig('unconfirmed')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('MEMBER_LINKS_LEFT'), $links);
}
if (!empty($URL)) {
return;
} // END - if
-$result_depths = SQL_QUERY("SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY level", __FILE__, __LINE__);
-$totalPoints = '0';
-while ($content = SQL_FETCHARRAY($result_depths)) {
- // Load referal points
- $result_points = SQL_QUERY_ESC("SELECT `points` FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s AND `ref_depth`='%s' LIMIT 1",
- array(getMemberId(), bigintval($content['level'])), __FILE__, __LINE__);
-
- // Entry found?
- if (SQL_NUMROWS($result_points) == 1) {
- // Load points
- list($points) = SQL_FETCHROW($result_points);
-
- // Add them to total
- $totalPoints += $points;
- } // END - if
-
- // Free result
- SQL_FREERESULT($result_points);
-} // END - while
-
-// Free memory
-SQL_FREERESULT($result_depths);
+// Get total points
+$totalPoints = countSumTotalData(getMemberId(), 'user_points', 'points');
// Get used points
$usedPoints = countSumTotalData(getMemberId(), 'user_data', 'used_points');
// Textlink
$content['target_account'] = $content['alt'];
}
- $content['target_bank'] = "<a href=\"".generateDerefererUrl($content['url'])."\" target=\"_blank\">{--CLICK_HERE--}</a>";
+ $content['target_bank'] = '<a href="' . generateDerefererUrl($content['url']) . '" target="_blank">{--CLICK_HERE--}</a>';
} else {
// e-currency payout request
if (empty($content['target_account'])) $content['target_account'] = '---';
$content['rowspan'] = ($depths*2+15);
// Init some vars...
-$totalPoints = '0'; $TREF = '0'; $TLOCK = '0'; $OUT = '';
+$totalPoints = '0';
+$totalReferals = '0';
+$totalLocked = '0';
+$OUT = '';
// Load ref levels
while ($data = SQL_FETCHARRAY($result_depths)) {
// Merge it together
$content = merge_array($content, $data);
- // Initialize ref-count
- $REFS = '0';
+ // Initialize array elements
+ $content['counter'] = '0';
+ $content['points'] = '0.00000';
+ $content['locked_points'] = '0.00000';
// Load referal points
- $result_points = SQL_QUERY_ESC("SELECT `points`, `locked_points` FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s AND `ref_depth`='%s' LIMIT 1", array(getMemberId(), bigintval($content['level'])), __FILE__, __LINE__);
+ $result_points = SQL_QUERY_ESC("SELECT `points`, `locked_points` FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s AND `ref_depth`='%s' LIMIT 1",
+ array(
+ getMemberId(),
+ bigintval($content['level'])
+ ), __FILE__, __LINE__);
+
+ // Do we have an entry?
if (SQL_NUMROWS($result_points) == 1) {
- list($points, $locked) = SQL_FETCHROW($result_points);
- // Also count locked points
- $totalPoints += $points; $TLOCK += $locked;
- } else {
- $points = '0.00000'; $locked = '0.00000';
- }
+ // Load data
+ $content = merge_array($content, SQL_FETCHARRAY($result_points);
+
+ // Add both points
+ $totalPoints += $content['points'];
+ $totalLocked += $content['locked_points'];
+ } // END - if
// Free result
SQL_FREERESULT($result_points);
// Load referal counts
$result_refs = SQL_QUERY_ESC("SELECT `counter` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `userid`=%s AND `level`='%s' LIMIT 1",
- array(getMemberId(), bigintval($content['level'])), __FILE__, __LINE__);
+ array(
+ getMemberId(),
+ bigintval($content['level'])
+ ), __FILE__, __LINE__);
+
+ // Do we have an entry?
if (SQL_NUMROWS($result_refs) == 1) {
- list($REFS) = SQL_FETCHROW($result_refs);
- $TREF += $REFS;
- } else {
- $REFS = '0';
- }
+ // Load data
+ $content = merge_array($content, SQL_FETCHARRAY($result_refs));
+
+ // Add them to total refs
+ $totalReferals += $content['counter'];
+ } // END - if
// Free result
SQL_FREERESULT($result_refs);
$row = array(
'level' => $content['level'],
'percents' => translateComma($content['percents']),
- 'points' => translateComma($points),
- 'refs' => translateComma($REFS),
+ 'points' => translateComma($content['points']),
+ 'refs' => translateComma($content['counter']),
);
// Output row
}
// If TLOCK is 0 add 3 zeros for floating
-if ($TLOCK == '0') $TLOCK = '0.00000';
+if ($totalLocked == '0') $totalLocked = '0.00000';
// Remember several values in constants
$content['sum'] = translateComma($totalPoints - getUserData('used_points'));
-$content['tref'] = $TREF;
-$content['tlock'] = translateComma($TLOCK);
+$content['tref'] = $totalReferals;
+$content['tlock'] = translateComma($totalLocked);
// Fixes a bug when there is no bonus extension installed
if (isExtensionInstalledAndOlder('bonus', '0.4.4')) setConfigEntry('bonus_active', "X");
// Is this enougth for a payout?
if ($points < getConfig('primera_min_payout')) {
// No, then abort here
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('PRIMERA_MEMBER_MIN_PAYOUT_PAYOUT'), translateComma(getConfig('primera_min_payout'))));
+ loadTemplate('admin_settings_saved', false, getMessage('PRIMERA_MEMBER_MIN_PAYOUT_PAYOUT'));
return;
}
$content['points'] = $points;
} else {
// Invalid mode!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('PRIMERA_MEMBER_MODE_INVALID'), getRequestElement('mode')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('PRIMERA_MEMBER_MODE_INVALID', getRequestElement('mode')));
return;
}
loadTemplate('admin_settings_saved', false, getMessage('PRIMERA_MEMBER_INVALID_AMOUNT'));
} elseif (postRequestElement('amount') < getConfig('primera_min_payout')) {
// Not enougth entered!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('PRIMERA_MEMBER_AMOUNT_SMALLER_MIN'), getConfig(('primera_min_payout'))));
+ loadTemplate('admin_settings_saved', false, getMessage('PRIMERA_MEMBER_AMOUNT_SMALLER_MIN'));
} elseif (postRequestElement('amount') > $points) {
// Not enougth points left!
loadTemplate('admin_settings_saved', false, sprintf(getMessage('PRIMERA_MEMBER_PAYOUT_POINTS_DEPLETED'), bigintval(postRequestElement('amount')), bigintval($points)));
loadTemplate('admin_settings_saved', false, GET_PRIMERA_ERROR_MESSAGE());
} else {
// Something went wrong
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('PRIMERA_MEMBER_PAYOUT_FAILED'), GET_PRIMERA_ERROR_MESSAGE()));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('PRIMERA_MEMBER_PAYOUT_FAILED', GET_PRIMERA_ERROR_MESSAGE()));
}
}
break;
default: // Invalid mode!
logDebugMessage(__FILE__, __LINE__, sprintf("Invalid mode %s detected.", getRequestElement('mode')));
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('PRIMERA_MEMBER_MODE_INVALID'), getRequestElement('mode')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('PRIMERA_MEMBER_MODE_INVALID', getRequestElement('mode')));
return;
}
} // END - if
$content['extras'] = getMessage('RALLYE_EXPIRE_ONE_DAY');
} else {
// Link to referal links page
- $content['extras'] = "<a href=\"{%url=modules.php?module=login&what=reflinks%}\">{--RALLYE_GET_REFLINK--}</a>";
+ $content['extras'] = '<a href="{%url=modules.php?module=login&what=reflinks%}">{--RALLYE_GET_REFLINK--}</a>';
}
// Set admin line (currently set to impressum, later to contact form)
- // @TODO Reactivate this: $content['admin'] = "<a href=\"{%url=modules.php?module=index&what=impressum&admin=" . $content['admin_id'] . "%}\">" . $content['login'] . "</a>";
+ // @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&what=impressum&admin=' . $content['admin_id'] . '%}">' . $content['login'] . '</a>';
// Handle description...
if ((empty($content['descr'])) && (!empty($content['template']))) {
if ($expired === true) {
$content['prices'] = addReferalRallyeWinners($content['id']);
- $content['top_users'] = "<div align=\"center\" class=\"big\">".$content['extras']."</div>";
+ $content['top_users'] = '<div align="center" class="big">' . $content['extras'] . '</div>';
$content['can_win_this'] = getMessage('RALLYE_OUR_WINNERS_ARE');
} else {
$content['prices'] = addReferalRallyePrices($content['id'], 'html');
loadTemplate('admin_settings_saved', false, getMessage('MEMBER_REFBACK_DONE'));
} elseif (isset($status['message'])) {
// Something went wrong with error message
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('MEMBER_REFBACK_ERROR_MESSAGE'), $status['message']));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('MEMBER_REFBACK_ERROR_MESSAGE', $status['message']));
} else {
// No message found
loadTemplate('admin_settings_saved', false, getMessage('MEMBER_REFBACK_ERROR_EMPTY_MESSAGE'));
}
} else {
// Percents out-of-bounds ;-)
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS'), getConfig('refback_min_perc'), getConfig('refback_max_perc')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS'));
}
// Insert line
loadTemplate('admin_settings_saved', false, getMessage('TRANSFER_COMPLETED') . "<br /><a href=\"{%url=modules.php?module=login&what=transfer%}\">{--TRANSFER_CONTINUE_OVERVIEW--}</a>");
} elseif ($valid_code === false) {
// Invalid Touring code!
- loadTemplate('admin_settings_saved', false, "<div class=\"member_note\">{--TRANSFER_INVALID_CODE--}</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="member_note">{--TRANSFER_INVALID_CODE--}</div>');
unsetPostRequestElement('ok');
} elseif ($valid_pass === false) {
// Wrong password entered
- loadTemplate('admin_settings_saved', false, "<div class=\"member_note\">{--TRANSFER_INVALID_PASSWORD--}</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="member_note">{--TRANSFER_INVALID_PASSWORD--}</div>');
unsetPostRequestElement('ok');
} elseif ($valid_amount === false) {
// Too much points entered
- loadTemplate('admin_settings_saved', false, "<div class=\"member_note\">{--TRANSFER_INVALID_POINTS--}</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="member_note">{--TRANSFER_INVALID_POINTS--}</div>');
unsetPostRequestElement('ok');
} elseif ($valid_reason === false) {
// No transfer reason entered
- loadTemplate('admin_settings_saved', false, "<div class=\"member_note\">{--TRANSFER_INVALID_REASON--}</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="member_note">{--TRANSFER_INVALID_REASON--}</div>');
unsetPostRequestElement('ok');
} elseif ($valid_recipient === false) {
// No recipient selected
- loadTemplate('admin_settings_saved', false, "<div class=\"member_note\">{--TRANSFER_INVALID_RECIPIENT--}</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="member_note">{--TRANSFER_INVALID_RECIPIENT--}</div>');
unsetPostRequestElement('ok');
} elseif ($valid_data === false) {
// No recipient/sender selected
- loadTemplate('admin_settings_saved', false, "<div class=\"member_note\">{--TRANSFER_INVALID_DATA--}</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="member_note">{--TRANSFER_INVALID_DATA--}</div>');
unsetPostRequestElement('ok');
}
$rand = mt_rand(0, 99999);
$code = generateRandomCode(getConfig('transfer_code'), $rand, getMemberId(), $content['max_transferable']);
$img = generateImageOrCode($code, false);
- $content['captcha_code'] = "<input type=\"hidden\" name=\"code_chk\" value=\"".$rand."\" /><input type=\"text\" name=\"code\" class=\"member_normal\" size=\"5\" maxlength=\"7\"".$content['to_disabled']." /> " . $img;
+ $content['captcha_code'] = '<input type="hidden" name="code_chk" value="' . $rand . '" /><input type="text" name="code" class="member_normal" size="5" maxlength="7"' . $content['to_disabled'] . ' /> ' . $img;
} else {
$code = '00000';
$content['captcha_code'] = loadTemplate('admin_settings_saved', true, getMessage('TRANSFER_NO_CODE'));
$total = countSumTotalData(getMemberId(), 'user_transfers_in', 'id', 'userid', true);
$content['in_link'] = $total;
if ($total > 0) {
- $content['in_link'] = "<a href=\"{%url=modules.php?module=login&what=transfer&mode=list_in%}\">" . $total . "</a>";
+ $content['in_link'] = '<a href="{%url=modules.php?module=login&what=transfer&mode=list_in%}">' . $total . '</a>';
} // END - if
// Check outgoing transfers
$content['out_link'] = $dmy;
if ($dmy > 0) {
- $content['out_link'] = "<a href=\"{%url=modules.php?module=login&what=transfer&mode=list_out%}\">" . $dmy . "</a>";
+ $content['out_link'] = '<a href="{%url=modules.php?module=login&what=transfer&mode=list_out%}">' . $dmy . '</a>';
} // END - if
// Total transactions
$content['all_link'] = $total;
if ($total > 0) {
- $content['all_link'] = "<a href=\"{%url=modules.php?module=login&what=transfer&mode=list_all%}\">" . $total . "</a>";
+ $content['all_link'] = '<a href="{%url=modules.php?module=login&what=transfer&mode=list_all%}">' . $total . '</a>';
} // END - if
if (isFormSent()) {
getUserData('opt_in') = substr(postRequestElement('opt_in'), 0, 1);
// "Settings saved..."
- loadTemplate('admin_settings_saved', false, "<div class=\"member_done\">{--SETTINGS_SAVED--}</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="member_done">{--SETTINGS_SAVED--}</div>');
} // END - if
// Init entries
// Set 'new transfer' link according to above option
switch (getUserData('opt_in')) {
case 'Y':
- $content['new_link'] = "<a href=\"{%url=modules.php?module=login&what=transfer&mode=new%}\">{--TRANSFER_NOW_LINK--}</a>";
+ $content['new_link'] = '<a href="{%url=modules.php?module=login&what=transfer&mode=new%}" title="{--TRANSFER_NOW_TITLE--}">{--TRANSFER_NOW_LINK--}</a>';
break;
case 'N':
if (SQL_NUMROWS($result) == 1) {
// Load newest transaction
list($newest) = SQL_FETCHROW($result);
- $content['settings'] = sprintf(getMessage('TRANSFER_LATEST_IS'), generateDateTime($newest, 3));
+ $content['settings'] = getMaskedMessage('TRANSFER_LATEST_IS', generateDateTime($newest, 3));
} else {
// Load template
$content['settings'] = loadTemplate('member_transfer_settings', true, $content);
$content['userid'] = getMemberId();
// Get timestamp from insert
- $content['user_status'] = sprintf(getMessage('MEMBER_MAIL_BONUS_CONFIRMED_ON'),
+ $content['user_status'] = getMaskedMessage('MEMBER_MAIL_BONUS_CONFIRMED_ON',
generateDateTime(getTimestampFromUserStats('bonusid', $content['id']), 2)
);
$content['userid'] = getMemberId();
// Get timestamp from insert
- $content['user_status'] = sprintf(getMessage('MEMBER_MAIL_NORMAL_CONFIRMED_ON'),
+ $content['user_status'] = getMaskedMessage('MEMBER_MAIL_NORMAL_CONFIRMED_ON',
generateDateTime(getTimestampFromUserStats('mailid', $content['id']), 2)
);
$content['wernis_userid'] = getUserData('wernis_userid');
} else {
// Invalid mode!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_MODE_INVALID'), getRequestElement('mode')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('WERNIS_MEMBER_MODE_INVALID', getRequestElement('mode')));
return;
}
case 'withdraw': // Widthdraws WDS66 -> This exchange
if (postRequestElement('amount') < getConfig('wernis_min_withdraw')) {
// Not enougth entered!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_AMOUNT_SMALLER_MIN'), translateComma(getConfig('wernis_min_withdraw'))));
+ loadTemplate('admin_settings_saved', false, getMessage('WERNIS_MEMBER_WITHDRAW_AMOUNT_SMALLER_MIN'));
} else {
// All is fine here so do the withdraw
$success = WERNIS_EXECUTE_WITHDRAW(postRequestElement('wernis_userid'), md5(postRequestElement('wds66_password')), postRequestElement('amount'));
loadTemplate('admin_settings_saved', false, GET_WERNIS_ERROR_MESSAGE());
} else {
// Something went wrong
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_WITHDRAW_FAILED'), GET_WERNIS_ERROR_MESSAGE()));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('WERNIS_MEMBER_WITHDRAW_FAILED', GET_WERNIS_ERROR_MESSAGE()));
}
}
break;
case 'payout': // Payout this exchange -> WDS66
if (postRequestElement('amount') < getConfig('wernis_min_payout')) {
// Not enougth entered!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_AMOUNT_SMALLER_MIN'), translateComma(getConfig('wernis_min_payout'))));
+ loadTemplate('admin_settings_saved', false, getMessage('WERNIS_MEMBER_PAYOUT_AMOUNT_SMALLER_MIN'));
} elseif (postRequestElement('amount') > $points) {
// Not enougth points left!
loadTemplate('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_PAYOUT_POINTS_DEPLETED'), bigintval(postRequestElement('amount')), bigintval($points)));
loadTemplate('admin_settings_saved', false, GET_WERNIS_ERROR_MESSAGE());
} else {
// Something went wrong
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_WITHDRAW_FAILED'), GET_WERNIS_ERROR_MESSAGE()));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('WERNIS_MEMBER_WITHDRAW_FAILED', GET_WERNIS_ERROR_MESSAGE()));
}
}
break;
default: // Invalid mode!
logDebugMessage(__FILE__, __LINE__, sprintf("Invalid mode %s detected.", getRequestElement('mode')));
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_MODE_INVALID'), getRequestElement('mode')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('WERNIS_MEMBER_MODE_INVALID', getRequestElement('mode')));
return;
}
}
$message = getMessage('SPONSOR_PASSWORD_TWO_EMPTY');
} elseif ((isPostRequestElementSet('pass1')) && (strlen(postRequestElement('pass1')) < getConfig('pass_len'))) {
// Too short password
- $message = sprintf(getMessage('SPONSOR_PASSWORD_TOO_SHORT'), getConfig('pass_len'));
+ $message = getMessage('SPONSOR_PASSWORD_TOO_SHORT');
} else {
// Default is we don't want to change password!
$PASS_AND = ''; $PASS_DATA = '';
} else {
// Locked or so?
$STATUS = sponsorTranslateUserStatus($content['status']);
- $OUT = loadTemplate('admin_settings_saved', true, sprintf(getMessage('SPONSOR_ACCOUNT_FAILED'), $STATUS));
+ $OUT = loadTemplate('admin_settings_saved', true, getMaskedMessage('SPONSOR_ACCOUNT_FAILED', $STATUS));
}
} else {
// Sponsor account not found!
- $OUT = loadTemplate('admin_settings_saved', true, sprintf(getMessage('SPONSOR_ACCOUNT_404'), getSession('sponsorid')));
+ $OUT = loadTemplate('admin_settings_saved', true, getMaskedMessage('SPONSOR_ACCOUNT_404', getSession('sponsorid')));
}
// Free memory
} else {
// Locked or so?
$STATUS = sponsorTranslateUserStatus($content['status']);
- $OUT = loadTemplate('admin_settings_saved', true, sprintf(getMessage('SPONSOR_ACCOUNT_FAILED'), $STATUS));
+ $OUT = loadTemplate('admin_settings_saved', true, getMaskedMessage('SPONSOR_ACCOUNT_FAILED', $STATUS));
}
} else {
// Sponsor account not found!
- $OUT = loadTemplate('admin_settings_saved', true, sprintf(getMessage('SPONSOR_ACCOUNT_404'), getSession('sponsorid')));
+ $OUT = loadTemplate('admin_settings_saved', true, getMaskedMessage('SPONSOR_ACCOUNT_404', getSession('sponsorid')));
}
// Free memory
// Load cache
loadIncludeOnce('inc/load_cache.php');
- // Init filter system
- initFilterSystem();
-
// Run the init filter chain
runFilterChain('init');
} // END - if
// "Getter" for module title
-function getModuleTitle ($mod) {
+function getModuleTitle ($module) {
// Init variables
- $title = '';
+ $data['title'] = '';
$result = false;
// Is the script installed?
if (isInstalled()) {
// Check if cache is valid
- if ((isExtensionInstalledAndNewer('cache', '0.1.2')) && (isset($GLOBALS['cache_array']['modules']['module'])) && (in_array($mod, $GLOBALS['cache_array']['modules']['module']))) {
+ if ((isExtensionInstalledAndNewer('cache', '0.1.2')) && (isset($GLOBALS['cache_array']['modules']['module'])) && (in_array($module, $GLOBALS['cache_array']['modules']['module']))) {
// Load from cache
- $title = $GLOBALS['cache_array']['modules']['title'][$mod];
+ $data['title'] = $GLOBALS['cache_array']['modules']['title'][$module];
// Update cache hits
incrementStatsEntry('cache_hits');
} elseif (!isExtensionActive('cache')) {
// Load from database
$result = SQL_QUERY_ESC("SELECT `title` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `module`='%s' LIMIT 1",
- array($mod), __FUNCTION__, __LINE__);
+ array($module), __FUNCTION__, __LINE__);
// Is the entry there?
if (SQL_NUMROWS($result)) {
// Get the title from database
- list($title) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
} // END - if
// Free the result
} // END - if
// Trim name
- $title = trim($title);
+ $data['title'] = trim($data['title']);
// Still no luck or empty title?
- if (empty($title)) {
+ if (empty($data['title'])) {
// No name found
- $title = sprintf("%s (%s)", getMessage('LANG_UNKNOWN_MODULE'), $mod);
+ $data['title'] = sprintf("%s (%s)", getMessage('LANG_UNKNOWN_MODULE'), $module);
if (SQL_NUMROWS($result) == '0') {
// Add module to database
- $dummy = checkModulePermissions($mod);
+ $dummy = checkModulePermissions($module);
} // END - if
} // END - if
// Return name
- return $title;
+ return $data['title'];
}
// "Getter" for module description
} // END - if
// Default is not found
- $ret = '??? (' . $what . ')';
+ $data['title'] = '??? (' . $what . ')';
// Look for title
$result = SQL_QUERY_ESC("SELECT `title` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `%s`='%s'" . $ADD . " LIMIT 1",
// Is there an entry?
if (SQL_NUMROWS($result) == 1) {
// Fetch the title
- list($ret) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
} // END - if
// Free result
SQL_FREERESULT($result);
// Return it
- return $ret;
+ return $data['title'];
}
// Check validity of a given module name (no file extension)
-function checkModulePermissions ($mod = '') {
+function checkModulePermissions ($module = '') {
// Is it empty (default), then take the current one
- if (empty($mod)) $mod = getModule();
+ if (empty($module)) $module = getModule();
// Do we have cache?
- if (isset($GLOBALS['module_status'][$mod])) {
+ if (isset($GLOBALS['module_status'][$module])) {
// Then use it
- return $GLOBALS['module_status'][$mod];
+ return $GLOBALS['module_status'][$module];
} // END - if
// Filter module name (names with low chars and underlines are fine!)
- $mod = preg_replace('/[^a-z_]/', '', $mod);
+ $module = preg_replace('/[^a-z_]/', '', $module);
// Check for prefix is a extension...
- $modSplit = explode('_', $mod);
- $extension = ''; $mod_chk = $mod;
- //* DEBUG: */ print(__LINE__."*".count($modSplit)."*/".$mod."*<br />");
+ $modSplit = explode('_', $module);
+ $extension = ''; $module_chk = $module;
+ //* DEBUG: */ print(__LINE__."*".count($modSplit)."*/".$module."*<br />");
if (count($modSplit) == 2) {
// Okay, there is a seperator (_) in the name so is the first part a module?
//* DEBUG: */ print(__LINE__."*".$modSplit[0]."*<br />");
if (isExtensionActive($modSplit[0])) {
// The prefix is an extension's name, so let's set it
- $extension = $modSplit[0]; $mod = $modSplit[1];
+ $extension = $modSplit[0]; $module = $modSplit[1];
} // END - if
} // END - if
return 'done';
} // END - if
- // Init variables
- $locked = 'Y';
- $hidden = 'N';
- $admin = 'N';
- $mem = 'N';
+ // Init data array
+ $data = array(
+ 'locked' => 'Y',
+ 'hidden' => 'N',
+ 'admin_only' => 'N',
+ 'mem_only' => 'N'
+ );
+
+ // By default nothing is found
$found = false;
// Check if cache is latest version
if (isExtensionInstalledAndNewer('cache', '0.1.2')) {
// Is the cache there?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Using cache.');
- if (isset($GLOBALS['cache_array']['modules']['locked'][$mod_chk])) {
+ if (isset($GLOBALS['cache_array']['modules']['locked'][$module_chk])) {
// Check cache
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cache found.');
- $locked = $GLOBALS['cache_array']['modules']['locked'][$mod_chk];
- $hidden = $GLOBALS['cache_array']['modules']['hidden'][$mod_chk];
- $admin = $GLOBALS['cache_array']['modules']['admin_only'][$mod_chk];
- $mem = $GLOBALS['cache_array']['modules']['mem_only'][$mod_chk];
+ $data['locked'] = $GLOBALS['cache_array']['modules']['locked'][$module_chk];
+ $data['hidden'] = $GLOBALS['cache_array']['modules']['hidden'][$module_chk];
+ $data['admin_only'] = $GLOBALS['cache_array']['modules']['admin_only'][$module_chk];
+ $data['mem_only'] = $GLOBALS['cache_array']['modules']['mem_only'][$module_chk];
// Update cache hits
incrementStatsEntry('cache_hits');
// Check for module in database
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Using database.');
$result = SQL_QUERY_ESC("SELECT `locked`, `hidden`, `admin_only`, `mem_only` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `module`='%s' LIMIT 1",
- array($mod_chk), __FUNCTION__, __LINE__);
+ array($module_chk), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Read data
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Entry found.');
- list($locked, $hidden, $admin, $mem) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
$found = true;
} elseif (isDebugModeEnabled()) {
// Debug message only in debug-mode...
- logDebugMessage(__FUNCTION__, __LINE__, 'Module ' . $mod_chk . ' not found!');
+ logDebugMessage(__FUNCTION__, __LINE__, 'Module ' . $module_chk . ' not found!');
}
// Free result
if ($found === true) {
// Check returned values against current access permissions
//
- // Admin access ----- Guest access ----- --- Guest or member? ---
- if ((isAdmin()) || (($locked != 'Y') && ($admin != 'Y') && (($mem != 'Y') || (isMember())))) {
+ // Admin access ----- Guest access ----- --- Guest or member? ---
+ if ((isAdmin()) || (($data['locked'] != 'Y') && ($data['admin_only'] != 'Y') && (($data['mem_only'] != 'Y') || (isMember())))) {
// If you are admin you are welcome for everything!
$ret = 'done';
- } elseif ($locked == 'Y') {
+ } elseif ($data['locked'] == 'Y') {
// Module is locked
$ret = 'locked';
- } elseif (($mem == 'Y') && (!isMember())) {
+ } elseif (($data['mem_only'] == 'Y') && (!isMember())) {
// You have to login first!
$ret = 'mem_only';
- } elseif (($admin == 'Y') && (!isAdmin())) {
+ } elseif (($data['admin_only'] == 'Y') && (!isAdmin())) {
// Only the Admin is allowed to enter this module!
$ret = 'admin_only';
} else {
// @TODO Nothing helped???
logDebugMessage(__FUNCTION__, __LINE__, sprintf("ret=%s,locked=%s,admin=%s,mem=%s",
$ret,
- $locked,
- $admin,
- $mem
+ $data['locked'],
+ $data['admin_only'],
+ $data['mem_only']
));
}
} // END - if
// Still no luck or not found?
if (($found === false) && (!isExtensionActive('cache')) && ($ret != 'done')) {
// ----- Legacy module ----- ---- Module in base folder ---- --- Module with extension's name ---
- if ((isIncludeReadable(sprintf("inc/modules/%s.php", $mod))) || (isIncludeReadable(sprintf("%s.php", $mod))) || (isIncludeReadable(sprintf("%s/%s.php", $extension, $mod)))) {
+ if ((isIncludeReadable(sprintf("inc/modules/%s.php", $module))) || (isIncludeReadable(sprintf("%s.php", $module))) || (isIncludeReadable(sprintf("%s/%s.php", $extension, $module)))) {
// Data is missing so we add it
if (isExtensionInstalledAndNewer('sql_patches', '0.3.6')) {
// Since 0.3.6 we have a has_menu column, this took me a half hour
// to find a loop here... *sigh*
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_mod_reg`
(`module`, `locked`, `hidden`, `mem_only`, `admin_only`, `has_menu`) VALUES
-('%s','Y','N','N','N','N')", array($mod_chk), __FUNCTION__, __LINE__);
+('%s','Y','N','N','N','N')", array($module_chk), __FUNCTION__, __LINE__);
} else {
// Wrong/missing sql_patches!
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_mod_reg`
(`module`, `locked`, `hidden`, `mem_only`, `admin_only`) VALUES
-('%s','Y','N','N','N')", array($mod_chk), __FUNCTION__, __LINE__);
+('%s','Y','N','N','N')", array($module_chk), __FUNCTION__, __LINE__);
}
// Everthing is fine?
if ((getOutputMode() == '0') || (getOutputMode() == -1)) rebuildCacheFile('modules', 'modules');
// And reload data
- unset($GLOBALS['module_status'][$mod]);
- $ret = checkModulePermissions($mod_chk);
+ unset($GLOBALS['module_status'][$module]);
+ $ret = checkModulePermissions($module_chk);
} else {
// Module not found we don't add it to the database
$ret = '404';
} elseif ($found === false) {
// Problem with module detected
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Problem in module %s detected. ret=%s, locked=%s, hidden=%s, mem=%s, admin=%s, output_mode=%s",
- $mod,
+ $module,
$ret,
- $locked,
- $hidden,
- $mem,
- $admin,
+ $data['locked'],
+ $data['hidden'],
+ $data['mem_only'],
+ $data['admin_only'],
getOutputMode()
));
}
// Return the value
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ret=' . $ret);
- $GLOBALS['module_status'][$mod] = $ret;
+ $GLOBALS['module_status'][$module] = $ret;
return $ret;
}
// Begin the navigation line
if ((!isset($GLOBALS['nav_depth'])) && ($return === false)) {
$GLOBALS['nav_depth'] = '0';
- $prefix = "<div class=\"you_are_here\">{--YOU_ARE_HERE--} <strong><a class=\"you_are_here\" href=\"{%url=modules.php?module=" . getModule() . $LINK_ADD . "%}\">Home</a></strong>";
+ $prefix = '<div class="you_are_here">{--YOU_ARE_HERE--} <strong><a class="you_are_here" href="{%url=modules.php?module=' . getModule() . $LINK_ADD . '%}">Home</a></strong>';
} else {
if ($return === false) $GLOBALS['nav_depth']++;
$prefix = '';
if (((isExtensionInstalledAndNewer('sql_patches', '0.2.3')) && (getConfig('youre_here') == 'Y')) || ((isAdmin()) && ($modCheck == 'admin'))) {
// Output HTML code
- $OUT = $prefix . "<strong><a class=\"you_are_here\" href=\"{%url=modules.php?module=" . $modCheck . '&' . $type . '=' . $search . $LINK_ADD . "%}\">" . getTitleFromMenu($accessLevel, $search, $type, $ADD) . "</a></strong>\n";
+ $OUT = $prefix . '<strong><a class="you_are_here" href="{%url=modules.php?module=' . $modCheck . '&' . $type . '=' . $search . $LINK_ADD . '%}">' . getTitleFromMenu($accessLevel, $search, $type, $ADD) . '</a></strong>';
// Can we close the you-are-here navigation?
//* DEBUG: */ print(__LINE__."*".$type.'/'.getWhat()."*<br />");
if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'overview')))) {
//* DEBUG: */ print(__LINE__.'+'.$type."+<br />");
// Add closing div and br-tag
- $OUT .= "</div><br />\n";
+ $OUT .= '</div><br />';
$GLOBALS['nav_depth'] = '0';
// Run the filter chain
if (isIncludeReadable($inc)) {
// Mark currently selected menu - open
if ((!empty($what)) && (($what == $content['sub_what']))) {
- $OUT = "<strong>";
+ $OUT = '<strong>';
} // END - if
// Navigation link
- $OUT .= "<a name=\"menu\" class=\"menu_blur\" href=\"{%url=modules.php?module=" . getModule() . '&what=' . $content['sub_what'] . "%}\" target=\"_self\">";
+ $OUT .= '<a name="menu" class="menu_blur" href="{%url=modules.php?module=' . getModule() . '&what=' . $content['sub_what'] . '%}" target="_self">';
} else {
// Not found! - open
- $OUT .= "<em style=\"cursor:help\" class=\"admin_note\" title=\"{--MENU_WHAT_404--}\">";
+ $OUT .= '<em style="cursor:help" class="admin_note" title="{--MENU_WHAT_404--}">';
}
// Menu title
$OUT .= getConfig('menu_blur_spacer') . $content['sub_title'];
if (isIncludeReadable($inc)) {
- $OUT .= "</a>";
+ $OUT .= '</a>';
// Mark currently selected menu - close
if ((!empty($what)) && (($what == $content['sub_what']))) {
- $OUT .= "</strong>";
+ $OUT .= '</strong>';
} // END - if
} else {
// Not found! - close
- $OUT .= "</em>";
+ $OUT .= '</em>';
}
// Cunt it up
// By default none was found
$found = false;
+ // Extra statements
+ $ADD = '';
+ if (isExtensionInstalledAndNewer('user', '0.3.5')) $ADD = ', UNIX_TIMESTAMP(`lock_timestamp`) AS `lock_timestamp`';
+
// Query for the user
- $result = SQL_QUERY_ESC("SELECT * FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `%s`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT *".$ADD." FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `%s`='%s' LIMIT 1",
array($column, $userid), __FUNCTION__, __LINE__);
// Do we have a record?
// Count cache hits
incrementStatsEntry('cache_hits');
} elseif ((!empty($admin)) && ((!isExtensionActive('cache'))) || (isAdminHashSet($admin) === false)) {
- // Search for admin
- $result = SQL_QUERY_ESC("SELECT HIGH_PRIORITY `password` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
- array($admin), __FUNCTION__, __LINE__);
-
- // Is he admin?
- $passDB = '';
- if (SQL_NUMROWS($result) == 1) {
- // Admin login was found so let's load password from DB
- list($passDB) = SQL_FETCHROW($result);
-
- // Temporary cache it
- setAdminHash($admin, $passDB);
-
- // Generate password hash
- $valPass = generatePassString($passDB);
- } // END - if
-
- // Free memory
- SQL_FREERESULT($result);
+ // Get admin hash and hash it
+ $valPass = generatePassString(getAdminHash($admin));
}
if (!empty($valPass)) {
switch ($mode) {
case 'guest':
// Guests (in the registration form) are not allowed to select 0 mails per day.
- $result = SQL_QUERY("SELECT value, comment FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE value > 0 ORDER BY value",
+ $result = SQL_QUERY("SELECT `value`, `comment` FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE `value` > 0 ORDER BY `value` ASC",
__FUNCTION__, __LINE__);
break;
case 'member':
// Members are allowed to set to zero mails per day (we will change this soon!)
- $result = SQL_QUERY("SELECT value, comment FROM `{?_MYSQL_PREFIX?}_max_receive` ORDER BY value",
+ $result = SQL_QUERY("SELECT `value`, `comment` FROM `{?_MYSQL_PREFIX?}_max_receive` ORDER BY `value` ASC",
__FUNCTION__, __LINE__);
break;
if (SQL_NUMROWS($result) > 0) {
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
- $OUT .= " <option value=\"".$content['value']."\"";
+ $OUT .= ' <option value="' . $content['value'] . '"';
if (postRequestElement('max_mails') == $content['value']) $OUT .= ' selected="selected"';
- $OUT .= ">".$content['value']." {--PER_DAY--}";
- if (!empty($content['comment'])) $OUT .= " (".$content['comment'].')';
- $OUT .= "</option>\n";
+ $OUT .= '>' . $content['value'] . ' {--PER_DAY--}';
+ if (!empty($content['comment'])) $OUT .= '(' . $content['comment'] . ')';
+ $OUT .= '</option>';
}
// Load template
// Get action value from mode (admin/guest/member) and what-value
function getModeAction ($mode, $what) {
// Init status
- $ret = '';
+ $data['action'] = '';
//* DEBUG: */ print(__LINE__.'='.$mode.'/'.$what.'/'.getAction()."=<br />");
if (!isExtensionInstalledAndNewer('sql_patches', '0.0.5')) {
return getAction();
} elseif (($what == 'overview') || (!isWhatSet())) {
// Default value for admin area
- $ret = 'login';
+ $data['action'] = 'login';
}
} elseif (isActionSet()) {
// Get it directly from URL
return getAction();
}
- //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ret=".$ret.'<br />');
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ret=".$data['action'].'<br />');
// Does the module have a menu?
if (ifModuleHasMenu($mode)) {
$mode = mapModuleToTable($mode);
// Guest and member menu is 'main' as the default
- if (empty($ret)) $ret = 'main';
+ if (empty($data['action'])) $data['action'] = 'main';
// Load from database
$result = SQL_QUERY_ESC("SELECT `action` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `what`='%s' LIMIT 1",
array($mode, $what), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load action value and pray that this one is the right you want... ;-)
- list($ret) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
} // END - if
// Free memory
}
// Return action value
- return $ret;
+ return $data['action'];
}
// Get category name back
function getCategory ($cid) {
// Default is not found
- $ret = getMessage('_CATEGORY_404');
+ $data['cat'] = getMessage('_CATEGORY_404');
// Is the category id set?
if ($cid == '0') {
// No category
- $ret = getMessage('_CATEGORY_NONE');
+ $data['cat'] = getMessage('_CATEGORY_NONE');
} elseif ($cid > 0) {
// Lookup the category in database
- $result = SQL_QUERY_ESC("SELECT cat FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
- array(bigintval($cid)), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `cat` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
+ array(bigintval($cid)), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Category found... :-)
- list($ret) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
} // END - if
// Free result
} // END - if
// Return result
- return $ret;
+ return $data['cat'];
}
// Get a string of "mail title" and price back
$ret = getMessage('_PAYMENT_404');
// Load payment data
- $result = SQL_QUERY_ESC("SELECT mail_title, price FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`=%s LIMIT 1",
- array(bigintval($pid)), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `mail_title`, `price` FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`=%s LIMIT 1",
+ array(bigintval($pid)), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Payment type found... :-)
+ $data = SQL_FETCHARRAY($result);
+
+ // Only title or also including price?
if ($full === false) {
- // Return only title
- list($ret) = SQL_FETCHROW($result);
+ $ret = $data['mail_title'];
} else {
- // Return title and price
- list($t, $p) = SQL_FETCHROW($result);
- $ret = $t.' / '.translateComma($p).' {?POINTS?}';
+ $ret = $data['mail_title'] . ' / ' . translateComma($data['price']) . ' {?POINTS?}';
}
}
// Get (basicly) the price of given payment id
function getPaymentPoints ($pid, $lookFor = 'price') {
// Default value...
- $ret = '-1';
+ $data[$lookFor] = '-1';
// Search for it in database
- $result = SQL_QUERY_ESC("SELECT %s FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`=%s LIMIT 1",
- array($lookFor, $pid), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `%s` FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`=%s LIMIT 1",
+ array($lookFor, $pid), __FUNCTION__, __LINE__);
// Is the entry there?
if (SQL_NUMROWS($result) == 1) {
// Payment type found... :-)
- list($ret) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
} // END - if
// Free result
SQL_FREERESULT($result);
// Return value
- return $ret;
+ return $data[$lookFor];
}
// Remove a receiver's id from $receivers and add a link for him to confirm
// Calculate sum (default) or count records of given criteria
function countSumTotalData ($search, $tableName, $lookFor = 'id', $whereStatement = 'userid', $countRows = false, $add = '') {
- $ret = '0';
+ // Init count/sum
+ $data['res'] = '0';
+
//* DEBUG: */ print($search.'/'.$tableName.'/'.$lookFor.'/'.$whereStatement.'/'.$add.'<br />');
if ((empty($search)) && ($search != '0')) {
// Count or sum whole table?
if ($countRows === true) {
// Count whole table
- $result = SQL_QUERY_ESC("SELECT COUNT(`%s`) FROM `{?_MYSQL_PREFIX?}_%s`".$add,
+ $result = SQL_QUERY_ESC("SELECT COUNT(`%s`) AS res FROM `{?_MYSQL_PREFIX?}_%s`".$add,
array($lookFor, $tableName), __FUNCTION__, __LINE__);
} else {
// Sum whole table
- $result = SQL_QUERY_ESC("SELECT SUM(`%s`) FROM `{?_MYSQL_PREFIX?}_%s`".$add,
+ $result = SQL_QUERY_ESC("SELECT SUM(`%s`) AS res FROM `{?_MYSQL_PREFIX?}_%s`".$add,
array($lookFor, $tableName), __FUNCTION__, __LINE__);
}
} elseif (($countRows === true) || ($lookFor == 'userid')) {
// Count rows
//* DEBUG: */ print("COUNT!<br />");
- $result = SQL_QUERY_ESC("SELECT COUNT(`%s`) FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`='%s'".$add,
+ $result = SQL_QUERY_ESC("SELECT COUNT(`%s`) AS res FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`='%s'".$add,
array($lookFor, $tableName, $whereStatement, $search), __FUNCTION__, __LINE__);
} else {
// Add all rows
//* DEBUG: */ print("SUM!<br />");
- $result = SQL_QUERY_ESC("SELECT SUM(`%s`) FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`='%s'".$add,
+ $result = SQL_QUERY_ESC("SELECT SUM(`%s`) AS res FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`='%s'".$add,
array($lookFor, $tableName, $whereStatement, $search), __FUNCTION__, __LINE__);
}
// Load row
- list($ret) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
// Free result
SQL_FREERESULT($result);
// Fix empty values
- if ((empty($ret)) && ($lookFor != 'counter') && ($lookFor != 'id') && ($lookFor != 'userid')) {
+ if ((empty($data['res'])) && ($lookFor != 'counter') && ($lookFor != 'id') && ($lookFor != 'userid')) {
// Float number
- $ret = '0.00000';
- } elseif (''.$ret.'' == '') {
+ $data['res'] = '0.00000';
+ } elseif (''.$data['res'].'' == '') {
// Fix empty result
- $ret = '0';
+ $data['res'] = '0';
}
// Return value
- //* DEBUG: */ print 'ret='.$ret.'<br />';
- return $ret;
+ //* DEBUG: */ print 'ret=' . $data['res'] . '<br />';
+ return $data['res'];
}
// Getter fro ref level percents
function getReferalLevelPercents ($level) {
// Default is zero
- $per = '0';
+ $data['percents'] = '0';
// Do we have cache?
if ((isset($GLOBALS['cache_array']['refdepths']['level'])) && (isExtensionActive('cache'))) {
$key = array_search($level, $GLOBALS['cache_array']['refdepths']['level']);
if ($key !== false) {
// Entry found!
- $per = $GLOBALS['cache_array']['refdepths']['percents'][$key];
+ $data['percents'] = $GLOBALS['cache_array']['refdepths']['percents'][$key];
// Count cache hit
incrementStatsEntry('cache_hits');
// Entry found?
if (SQL_NUMROWS($result_level) == 1) {
// Get percents
- list($per) = SQL_FETCHROW($result_level);
+ $data = SQL_FETCHARRAY($result_level);
} // END - if
// Free result
}
// Return percent
- return $per;
+ return $data['percents'];
}
/**
// Get id number from administrator's login name
function getAdminId ($login) {
// By default no admin is found
- $ret = '-1';
+ $data['id'] = '-1';
// Check cache
if (isset($GLOBALS['cache_array']['admin']['admin_id'][$login])) {
// Use it if found to save SQL queries
- $ret = $GLOBALS['cache_array']['admin']['admin_id'][$login];
+ $data['id'] = $GLOBALS['cache_array']['admin']['admin_id'][$login];
// Update cache hits
incrementStatsEntry('cache_hits');
// Load from database
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
array($login), __FUNCTION__, __LINE__);
+
+ // Do we have an entry?
if (SQL_NUMROWS($result) == 1) {
- list($ret) = SQL_FETCHROW($result);
+ // Get it
+ $data = SQL_FETCHARRAY($result);
} // END - if
// Free result
SQL_FREERESULT($result);
}
- return $ret;
+
+ // Return the id
+ return $data['id'];
}
// "Getter" for current admin id
// Get password hash from administrator's login name
function getAdminHash ($admin) {
// By default an invalid hash is returned
- $ret = '-1';
+ $data['password'] = '-1';
if (isAdminHashSet($admin)) {
// Check cache
- $ret = $GLOBALS['cache_array']['admin']['password'][$admin];
+ $data['password'] = $GLOBALS['cache_array']['admin']['password'][$admin];
// Update cache hits
incrementStatsEntry('cache_hits');
} elseif (!isExtensionActive('cache')) {
// Load from database
- $result = SQL_QUERY_ESC("SELECT password FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `password` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
array($admin), __FUNCTION__, __LINE__);
+
+ // Do we have an entry?
if (SQL_NUMROWS($result) == 1) {
// Fetch data
- list($ret) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
// Set cache
- setAdminHash($admin, $ret);
+ setAdminHash($admin, $data['password']);
} // END - if
// Free result
SQL_FREERESULT($result);
}
- return $ret;
+
+ // Return password hash
+ return $data['password'];
}
// "Getter" for admin login
function getAdminLogin ($adminId) {
// By default a non-existent login is returned (other functions react on this!)
- $ret = '***';
+ $data['login'] = '***';
if (isset($GLOBALS['cache_array']['admin']['login'][$adminId])) {
// Get cache
- $ret = $GLOBALS['cache_array']['admin']['login'][$adminId];
+ $data['login'] = $GLOBALS['cache_array']['admin']['login'][$adminId];
// Update cache hits
incrementStatsEntry('cache_hits');
} elseif (!isExtensionActive('cache')) {
// Load from database
- $result = SQL_QUERY_ESC("SELECT login FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
- array(bigintval($adminId)), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `login` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+ array(bigintval($adminId)), __FUNCTION__, __LINE__);
+
+ // Entry found?
if (SQL_NUMROWS($result) == 1) {
// Fetch data
- list($ret) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
// Set cache
- $GLOBALS['cache_array']['admin']['login'][$adminId] = $ret;
+ $GLOBALS['cache_array']['admin']['login'][$adminId] = $data['login'];
} // END - if
// Free memory
SQL_FREERESULT($result);
}
- return $ret;
+
+ // Return the result
+ return $data['login'];
}
// Get email address of admin id
function getAdminEmail ($adminId) {
// By default an invalid emails is returned
- $ret = '***';
+ $data['email'] = '***';
if (isset($GLOBALS['cache_array']['admin']['email'][$adminId])) {
// Get cache
- $ret = $GLOBALS['cache_array']['admin']['email'][$adminId];
+ $data['email'] = $GLOBALS['cache_array']['admin']['email'][$adminId];
// Update cache hits
incrementStatsEntry('cache_hits');
} elseif (!isExtensionActive('cache')) {
// Load from database
- $result_admin_id = SQL_QUERY_ESC("SELECT email FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+ $result_admin_id = SQL_QUERY_ESC("SELECT `email` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
array(bigintval($adminId)), __FUNCTION__, __LINE__);
+
+ // Entry found?
if (SQL_NUMROWS($result_admin_id) == 1) {
// Get data
- list($ret) = SQL_FETCHROW($result_admin_id);
+ $data = SQL_FETCHARRAY($result_admin_id);
// Set cache
- $GLOBALS['cache_array']['admin']['email'][$adminId] = $ret;
+ $GLOBALS['cache_array']['admin']['email'][$adminId] = $data['email'];
} // END - if
// Free result
}
// Return email
- return $ret;
+ return $data['email'];
}
// Get default ACL of admin id
function getAdminDefaultAcl ($adminId) {
// By default an invalid ACL value is returned
- $ret = '***';
+ $data['default_acl'] = '***';
// Is sql_patches there and was it found in cache?
if (!isExtensionActive('sql_patches')) {
// Not found, which is bad, so we need to allow all
- $ret = 'allow';
+ $data['default_acl'] = 'allow';
} elseif (isset($GLOBALS['cache_array']['admin']['def_acl'][$adminId])) {
// Use cache
- $ret = $GLOBALS['cache_array']['admin']['def_acl'][$adminId];
+ $data['default_acl'] = $GLOBALS['cache_array']['admin']['def_acl'][$adminId];
// Update cache hits
incrementStatsEntry('cache_hits');
array(bigintval($adminId)), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result_admin_id) == 1) {
// Fetch data
- list($ret) = SQL_FETCHROW($result_admin_id);
+ $data = SQL_FETCHARRAY($result_admin_id);
// Set cache
- $GLOBALS['cache_array']['admin']['def_acl'][$adminId] = $ret;
+ $GLOBALS['cache_array']['admin']['def_acl'][$adminId] = $data['default_acl'];
}
// Free result
SQL_FREERESULT($result_admin_id);
}
- // Return email
- return $ret;
+ // Return default ACL
+ return $data['default_acl'];
}
// Generates an option list from various parameters
// Deletes a user account with given reason
function deleteUserAccount ($userid, $reason) {
- $points = '0';
+ // Init points
+ $data['points'] = '0';
+
$result = SQL_QUERY_ESC("SELECT
(SUM(p.points) - d.used_points) AS points
FROM
WHERE
p.userid=%s",
array(bigintval($userid)), __FUNCTION__, __LINE__);
+
+ // Do we have an entry?
if (SQL_NUMROWS($result) == 1) {
// Save his points to add them to the jackpot
- list($points) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
// Delete points entries as well
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s", array(bigintval($userid)), __FUNCTION__, __LINE__);
// Update mediadata as well
if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
// Update database
- updateMediadataEntry(array('total_points'), 'sub', $points);
+ updateMediadataEntry(array('total_points'), 'sub', $data['points']);
} // END - if
// Now, when we have all his points adds them do the jackpot!
- if (isExtensionActive('jackpot')) addPointsToJackpot($points);
+ if (isExtensionActive('jackpot')) addPointsToJackpot($data['points']);
} // END - if
// Free the result
array(bigintval($userid)), __FUNCTION__, __LINE__);
// Remove from rallye if found
+ // @TODO Rewrite this to a filter
if (isExtensionActive('rallye')) {
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_users` WHERE `userid`=%s",
array(bigintval($userid)), __FUNCTION__, __LINE__);
} // END - if
+ // Add reason and translate points
+ $data['text'] = $reason;
+ $data['points'] = translateComma($data['points']);
+
// Now a mail to the user and that's all...
- $message = loadEmailTemplate('del-user', array('text' => $reason), $userid);
+ $message = loadEmailTemplate('del-user', $data, $userid);
sendEmail($userid, getMessage('ADMIN_DEL_ACCOUNT'), $message);
// Ok, delete the account!
}
// Generates meta description for given module and 'what' value
-function generateMetaDescriptionCode ($mod, $what) {
+function generateMetaDescriptionCode ($module, $what) {
// Exclude admin and member's area
- if (($mod != 'admin') && ($mod != 'login')) {
+ if (($module != 'admin') && ($module != 'login')) {
// Construct dynamic description
$DESCR = '{?MAIN_TITLE?} '.trim(getConfig('title_middle')) . ' ' . getTitleFromMenu('guest', $what);
return $numRows;
}
-// Returns HTML code with an "<option> list" of all categories
+// Returns HTML code with an option list of all categories
function generateCategoryOptionsList ($mode) {
// Prepare WHERE statement
$whereStatement = " WHERE `visible`='Y'";
$CATS['name'][] = $content['cat'];
// Check which users are in this category
- $result_userids = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `cat_id`=%s",
+ $result_userids = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `cat_id`=%s ORDER BY `userid` ASC",
array(bigintval($content['id'])), __FUNCTION__, __LINE__);
- // Start adding all
+ // Init count
$userid_cnt = '0';
- // @TODO Rewrite this to $content = SQL_FETCHARRAY()
- while (list($ucat) = SQL_FETCHROW($result_userids)) {
- $result_ver = SQL_QUERY_ESC("SELECT
- `userid`
-FROM
- `{?_MYSQL_PREFIX?}_user_data`
-WHERE
- `userid`=%s AND
- `status`='CONFIRMED' AND
- `receive_mails` > 0".runFilterChain('exclude_users', $mode)."
-LIMIT 1",
- array(bigintval($ucat)), __FUNCTION__, __LINE__);
+ // Start adding all
+ while ($data = SQL_FETCHARRAY($result_userids)) {
// Add user count
- $userid_cnt += SQL_NUMROWS($result_ver);
-
- // Free memory
- SQL_FREERESULT($result_ver);
+ $userid_cnt += countSumTotalData($data['userid'], 'user_data', 'userid', 'userid', true, " AND `status`='CONFIRMED' AND `receive_mails` > 0");
} // END - while
// Free memory
// Get timestamp for given stats type and data
function getTimestampFromUserStats ($type, $data, $userid = '0') {
// Default timestamp is zero
- $stamp = '0';
+ $data['inserted'] = '0';
// User id set?
if ((isMemberIdSet()) && ($userid == '0')) {
// Is the extension installed and updated?
if ((!isExtensionActive('sql_patches')) || (isExtensionOlder('sql_patches', '0.5.6'))) {
// Return zero here
- return $stamp;
+ return $data['inserted'];
} // END - if
// Try to find the entry
$result = SQL_QUERY_ESC("SELECT
- UNIX_TIMESTAMP(`inserted`) AS stamp
+ UNIX_TIMESTAMP(`inserted`) AS inserted
FROM
`{?_MYSQL_PREFIX?}_user_stats_data`
WHERE
- `userid`=%s AND `stats_type`='%s' AND `stats_data`='%s'
+ `userid`=%s AND
+ `stats_type`='%s' AND
+ `stats_data`='%s'
LIMIT 1",
array(
bigintval($userid),
// Is the entry there?
if (SQL_NUMROWS($result) == 1) {
// Get this stamp
- list($stamp) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
} // END - if
// Free result
SQL_FREERESULT($result);
// Return stamp
- return $stamp;
+ return $data['inserted'];
}
// Inserts user stats
ur.refid=ud.userid
WHERE
ur.userid=%s AND ur.level=%s
-ORDER BY ur.refid ASC",
+ORDER BY
+ ur.refid ASC",
array(
bigintval($userid),
bigintval($level)
if ($num === 0) $userids[$data['userid']] = $data['userid'];
} // END - while
- // Now update all user accounts
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `emails_received`=`emails_received`-1 WHERE `userid` IN (%s) LIMIT %s",
- array(implode(',', $userids), count($userids)), __FUNCTION__, __LINE__);
+ if (count($userids) > 0) {
+ // Now update all user accounts
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `emails_received`=`emails_received`-1 WHERE `userid` IN (%s) LIMIT %s",
+ array(implode(',', $userids), count($userids)), __FUNCTION__, __LINE__);
+ } else {
+ // Nothing deleted
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_MAIL_NOTHING_DELETED', $id));
+ }
} // END - if
// Free result
\r
$INCLUDE_DIR = "../";\r
\r
-require("phpunit.php");\r
-require($INCLUDE_DIR . "class.phpmailer.php");\r
+include("phpunit.php");\r
+include($INCLUDE_DIR . "class.phpmailer.php");\r
error_reporting(E_ALL);\r
\r
/**\r
return (getenv('REQUEST_URI'));
}
+// "Getter" for query string
+function detectQueryString () {
+ return str_replace('&', '&', (getenv('QUERY_STRING')));
+}
+
// Check wether we are installing
function isInstalling () {
// Determine wether we are installing
// Setter for current userid
function setCurrentUserId ($userid) {
+ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.$userid);
$GLOBALS['current_userid'] = bigintval($userid);
}
// Init start time
$GLOBALS['startTime'] = microtime(true);
-// Tell every module / include file we are installing
+// Tell every module / require file we are installing
$GLOBALS['mxchange_installing'] = true;
// Set CSS variable for "normal mode"
break;
} // END - switch
} else {
- loadTemplate('admin_settings_saved', false, "<div class=\"member_failed\">{--MAIL_ALREADY_CONFIRMED--} (6)</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="member_failed">{--MAIL_ALREADY_CONFIRMED--} (6)</div>');
$mode = 'failed';
}
} else {
- loadTemplate('admin_settings_saved', false, "<div class=\"member_failed\">{--MAIL_ALREADY_CONFIRMED--} (5)</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="member_failed">{--MAIL_ALREADY_CONFIRMED--} (5)</div>');
$mode = 'failed';
}
} else {
- loadTemplate('admin_settings_saved', false, "<div class=\"member_failed\">{--MAIL_ALREADY_CONFIRMED--} (4)</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="member_failed">{--MAIL_ALREADY_CONFIRMED--} (4)</div>');
$mode = 'failed';
}
} else {
SQL_FREERESULT($result);
- loadTemplate('admin_settings_saved', false, "<div class=\"member_failed\">{--MAIL_ALREADY_CONFIRMED--} (3)</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="member_failed">{--MAIL_ALREADY_CONFIRMED--} (3)</div>');
$mode = 'failed';
}
} else {
SQL_FREERESULT($result);
- loadTemplate('admin_settings_saved', false, "<div class=\"member_failed\">{--MAIL_ALREADY_CONFIRMED--} (2)</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="member_failed">{--MAIL_ALREADY_CONFIRMED--} (2)</div>');
$mode = 'failed';
}
} else {
SQL_FREERESULT($result);
- loadTemplate('admin_settings_saved', false, "<div class=\"member_failed\">{--MAIL_ALREADY_CONFIRMED--} (1)</div>");
+ loadTemplate('admin_settings_saved', false, '<div class="member_failed">{--MAIL_ALREADY_CONFIRMED--} (1)</div>');
$mode = 'failed';
}
$isModuleValid = true;
} elseif (getTotalFatalErrors() == '0') {
// Module not found!
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), getModule()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('LANG_MOD_REG_404', getModule()));
}
break;
case '404':
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), getModule()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('LANG_MOD_REG_404', getModule()));
break;
case 'locked':
if (!isIncludeReadable($GLOBALS['module_inc'])) {
// Module does addionally not exists
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), getModule()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('LANG_MOD_REG_404', getModule()));
} // END - if
// Add fatal message
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_LOCKED'), getModule()));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('LANG_MOD_REG_LOCKED', getModule()));
break;
default:
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown status %s return from module check. Module=%s", $check, getModule()));
- addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_UNKNOWN'), $check));
+ addFatalMessage(__FILE__, __LINE__, getMaskedMessage('LANG_MOD_REG_UNKNOWN', $check));
break;
} // END - switch
} elseif (getTotalFatalErrors() == '0') {
Ihre Mitglieder-Id war: $userid
------------------------------------
+Ihr Guthaben von $content[points] {?POINTS?} sind hiermit verfallen.
+
Wir wünschen Ihnen weiterhin noch alles Gute und können Sie vielleicht irgentwann einmal wieder begruessen.
Vielen Dank.
--- /dev/null
+<form accept-charset="utf-8" action="{%url=modules.php?dummy=1%}&{%server,query_string%}" method="post">
+<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed" align="center">
+ <tr>
+ <td colspan="2" align="center" class="admin_title bottom">
+ <strong>{--ADMIN_EXPERT_SETTINGS_TITLE--}:</strong>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" align="center">
+ <div class="admin_note">{--ADMIN_EXPERT_SETTINGS_NOTE--}</div>
+ </td>
+ </tr>
+ <tr>
+ <td class="bottom" align="right">
+ {--ADMIN_EXPERT_SETTINGS_MAKE_PERMANENT--}
+ </td>
+ <td class="bottom" align="center">
+ <input type="checkbox" class="admin_normal" name="expert_settings" value="Y" />
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" class="admin_footer">
+ <input type="reset" class="admin_reset" value="{--CLEAR_FORM--}" />
+ <input type="submit" name="ok" class="admin_submit" value="{--ADMIN_EXPERT_SETTINGS_CONTINUE--}" />
+ </td>
+ </tr>
+</table>
+</form>
<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
<tr>
- <td colspan="3" align="center" class="admin_task_header top bottom left right">
+ <td colspan="2" align="center" class="admin_task_header bottom">
<strong>{--ADMIN_SELECTED_TASKS_ASSIGN--}:</strong>
</td>
</tr>
$content
+<tr>
+ <td colspan="2" align="center" class="admin_footer">
+
+ </td>
+</tr>
</table>
<tr>
- <td width="79%" class="switch_sw$content[sw] bottom left">
+ <td width="80%" class="switch_sw$content[sw] bottom">
<ul style="margin-left: 0px">
- <li style="white-space: normal">{--ADMIN_TASK_SUBJECT--}: <strong>$content[subject]</strong></li>
- $content[add]
- <li style="white-space: normal">{--ADMIN_TASK_TEXT--}: $content[text]</li>
- <li style="white-space: normal"><div style="text-align: right"><a href="#ext_$content[extension]">{--TOP--}</a></div></li>
- <li style="white-space: normal">{--ADMIN_TASK_CREATED--}: <strong>$content[created]</strong></li>
+ <li style="white-space: normal">{--ADMIN_TASK_SUBJECT--}: <strong>$content[subject]</strong></li>
+ $content[add]
+ <li style="white-space: normal">{--ADMIN_TASK_TEXT--}: $content[text]</li>
+ <li style="white-space: normal"><div style="text-align: right"><a href="#ext_$content[extension]">{--TOP--}</a></div></li>
+ <li style="white-space: normal">{--ADMIN_TASK_CREATED--}: <strong>$content[created]</strong></li>
</ul>
</td>
<td width="20%" class="switch_sw$content[sw] bottom" align="right" valign="top" style="padding-top: 40px">
<table border="0" cellspacing="0" cellpadding="0" class="guest_login dashed" width="480">
<tr>
<td colspan="4" align="center" class="guest_login_header">
- <strong>{--GUEST_WELCOME_MEMBER--}</strong>
+ <strong>{--GUEST_LOGIN_MEMBER--}</strong>
</td>
</tr>
<tr>
<table border="0" cellspacing="0" cellpadding="0" class="guest_login dashed" width="540">
<tr>
<td colspan="4" class="guest_login_header">
- <strong>{--GUEST_WELCOME_MEMBER--}</strong>
+ <strong>{--GUEST_LOGIN_MEMBER--}</strong>
</td>
</tr>
<tr>
+++ /dev/null
-<!-- @DEPRECATED //-->
// Do we have the banner?
if (SQL_NUMROWS($result) == 1) {
// Load the URL
- list($url) = SQL_FETCHROW($result);
+ $data = SQL_FETCHARRAY($result);
// Update counter
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_refbanner` SET `counter`=`counter`+1 WHERE `id`=%s LIMIT 1",
array(bigintval(getRequestElement('banner'))), __FILE__, __LINE__);
// Set header and ...
- setContentType('image/' . substr($url, -3, 3));
+ setContentType('image/' . substr($data['url'], -3, 3));
// Redirect
- redirectToUrl($url, false);
+ redirectToUrl($data['url'], false);
} else {
// @TODO No banner found, output some default banner
logDebugMessage(__FILE__, __LINE__, 'Banner ' . bigintval(getRequestElement('banner')) . ' not dound.');