incrementConfigEntry('cache_hits');
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
- $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1", array($mod), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1",
+ array($mod), __FILE__, __LINE__);
list($name) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
}
if (EXT_IS_ACTIVE($modSplit[0])) {
// The prefix is an extension's name, so let's set it
$extension = $modSplit[0]; $mod = $modSplit[1];
- }
- }
+ } // END - if
+ } // END - if
// Major error in module registry is the default
$ret = "major";
// Check if script is installed if not return a "done" to prevent some errors
- if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (!isBooleanConstantAndTrue('admin_registered'))) return "done";
+ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (!isBooleanConstantAndTrue('admin_registered'))) {
+ // Not installed or no admin registered or in installation phase
+ return "done";
+ } // END - if
+
+ // Init variables
+ $locked = "Y";
+ $hidden = "N";
+ $admin = "N";
+ $mem = "N";
+ $found = false;
// Check if cache is latest version
- $locked = "Y"; $hidden = "N"; $admin = "N"; $mem = "N"; $found = false;
if (GET_EXT_VERSION("cache") >= "0.1.2") {
// Is the module cached?
if (isset($GLOBALS['cache_array']['modules']['locked'][$mod_chk])) {
}
} elseif (!EXT_IS_ACTIVE("cache")) {
// Check for module in 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), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT locked, hidden, admin_only, mem_only FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1",
+ array($mod_chk), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Read data
list($locked, $hidden, $admin, $mem) = SQL_FETCHROW($result);
} elseif (($admin == "Y") && (!IS_ADMIN())) {
// Only the Admin is allowed to enter this module!
$ret = "admin_only";
+ } else {
+ // @TODO Nothing helped???
+ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("ret=%s,locked=%s,admin=%s,mem=%s",
+ $ret,
+ $locked,
+ $admin,
+ $mem
+ ));
}
} // END - if
// Still no luck or not found?
if (($ret == "cache_miss") || (!$found)) {
- // ----- Legacy module ----- ---- Module in base folder ---- --- Module with extension's name ---
+ // ----- Legacy module ----- ---- Module in base folder ---- --- Module with extension's name ---
if ((FILE_READABLE(sprintf("%sinc/modules/%s.php", constant('PATH'), $mod))) || (FILE_READABLE(sprintf("%s%s.php", constant('PATH'), $mod))) || (FILE_READABLE(sprintf("%s%s/%s.php", constant('PATH'), $extension, $mod)))) {
// Data is missing so we add it
if (GET_EXT_VERSION("sql_patches") >= "0.3.6") {
// Add menu description pending on given file name (without path!)
function ADD_DESCR ($ACC_LVL, $FQFN, $return = false, $output = true) {
- global $NAV_DEPTH;
-
// Use only filename of the FQFN...
$file = basename($FQFN);
}
// Begin the navigation line
- if ((!isset($NAV_DEPTH)) && (!$return)) {
- $NAV_DEPTH = 0;
+ if ((!isset($GLOBALS['nav_depth'])) && (!$return)) {
+ $GLOBALS['nav_depth'] = 0;
$prefix = "<div class=\"you_are_here\">{--YOU_ARE_HERE--} <strong><a class=\"you_are_here\" href=\"{!URL!}/modules.php?module=".$GLOBALS['module'].$LINK_ADD."\">Home</a></strong>";
} else {
- if (!$return) $NAV_DEPTH++;
+ if (!$return) $GLOBALS['nav_depth']++;
$prefix = "";
}
//* DEBUG: */ echo __LINE__."+".$type."+<br />\n";
// Add closing div and br-tag
$OUT .= "</div><br />\n";
- $NAV_DEPTH = "0";
+ $GLOBALS['nav_depth'] = "0";
// Run the filter chain
$ret = RUN_FILTER('post_youhere_line', array('access_level' => $ACC_LVL, 'type' => $type, 'content' => ""));
// Generates a list of "max receiveable emails per day"
function ADD_MAX_RECEIVE_LIST ($MODE, $default = "", $return = false) {
- global $_POST;
$OUT = "";
switch ($MODE) {
case "guest":
$OUT = "";
while (list($value, $comment) = SQL_FETCHROW($result)) {
$OUT .= " <option value=\"".$value."\"";
- if ($_POST['max_mails'] == $value) $OUT .= " selected=\"selected\"";
+ if (REQUEST_POST('max_mails') == $value) $OUT .= " selected=\"selected\"";
$OUT .= ">".$value." {--PER_DAY--}";
if (!empty($comment)) $OUT .= " (".$comment.")";
$OUT .= "</option>\n";
// Checks wether the current user is a member
function IS_MEMBER () {
- global $status, $LAST;
- if (!is_array($LAST)) $LAST = array();
+ // @TODO Why is this global??? #100
+ global $status;
+ if (!is_array($GLOBALS['last'])) $GLOBALS['last'] = array();
$ret = false;
// is the cache entry there?
$valPass = generatePassString($password);
// Transfer last module and online time
- if ((!empty($mod)) && (empty($LAST['module']))) {
- $LAST['module'] = $mod;
- $LAST['online'] = $onl;
+ if ((!empty($mod)) && (empty($GLOBALS['last']['module']))) {
+ $GLOBALS['last']['module'] = $mod;
+ $GLOBALS['last']['online'] = $onl;
} // END - if
// So did we now have valid data and an unlocked user?
// Return result
return $ret;
}
+
//
-function GET_MOD_DESCR($MODE, $wht, $column="what")
-{
+function GET_MOD_DESCR($MODE, $wht, $column="what") {
// Fix empty "what"
if (empty($wht)) {
$wht = "welcome";
// Now let's compare passwords
$hash = generatePassString($hashDB);
- if (($hash == get_session('u_hash')) || ($_POST['pass1'] == $_POST['pass2'])) {
+ if (($hash == get_session('u_hash')) || (REQUEST_POST('pass1') == REQUEST_POST('pass2'))) {
// Load user's data
$result = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, country, zip, city, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND password='%s' LIMIT 1",
array($GLOBALS['userid'], $hashDB), __FILE__, __LINE__);
case "normal": break; // Do not add any special lines
case "email": // Email was changed!
- $content = MEMBER_CHANGED_EMAIL.": ".$_POST['old_addy']."\n";
+ $content = MEMBER_CHANGED_EMAIL.": ".REQUEST_POST('old_addy')."\n";
break;
case "pass": // Password was changed
if (EXT_IS_ACTIVE("country")) {
// Replace code with description
- $DATA[4] = COUNTRY_GENERATE_INFO($_POST['country_code']);
+ $DATA[4] = COUNTRY_GENERATE_INFO(REQUEST_POST('country_code'));
} // END - if
// Load template
}
// Get action value from mode (admin/guest/member) and what-value
function GET_ACTION ($MODE, &$wht) {
- global $ret;
-
- // @DEPRECATED Init status
+ // Init status
$ret = "";
//* DEBUG: */ echo __LINE__."=".$MODE."/".$wht."/".$GLOBALS['action']."=<br />";
// And sent it away
SEND_EMAIL($email, SUBJECT_DIRECT_PAYMENT, $msg);
- if (!isset($_GET['mid'])) LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_POINTS_ADDED'));
+ if (!REQUEST_ISSET_GET(('mid'))) LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_POINTS_ADDED'));
}
// Maybe there's another ref?