X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmysql-manager.php;h=38ddd85c08c04581cd9e56b8707697f5d412c7ee;hp=4647c5a00f06e52214d44d34a71742ba287ec004;hb=58fd6eb829a44ec6d3b9049e62e1c89edad89902;hpb=6c763653e88b9d10627e651ca59c7201d4b7d62b diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 4647c5a00f..38ddd85c08 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -50,7 +50,7 @@ function ADD_MODULE_TITLE($mod) { $name = $cacheArray['modules']['title'][$mod]; // Update cache hits - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } 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__); @@ -115,7 +115,7 @@ function CHECK_MODULE ($mod) { $mem = $cacheArray['modules']['mem_only'][$mod_chk]; // Update cache hits - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } $found = true; } else { // No, then we have to update it! @@ -267,7 +267,7 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) { // Get the title from menu $result = SQL_QUERY_ESC("SELECT title FROM "._MYSQL_PREFIX."_%s_menu WHERE %s='%s' ".$AND." LIMIT 1", - array($ACC_LVL, $type, $search), __FILE__, __LINE__); + array($ACC_LVL, $type, $search), __FILE__, __LINE__); // Menu found? if (SQL_NUMROWS($result) == 1) { @@ -278,7 +278,7 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) { if ($return) { // Return title return $ret; - } elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && ($_CONFIG['youre_here'] == "Y")) || ((IS_ADMIN()) && ($modCheck == "admin"))) { + } elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && (getConfig('youre_here') == "Y")) || ((IS_ADMIN()) && ($modCheck == "admin"))) { // Output HTML code $OUT = $prefix."".$ret."\n"; @@ -287,24 +287,13 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) { //* DEBUG: */ die("
".print_r($_CONFIG, true)."
"); if (($type == "what") || (($type == "action") && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview")))) { //* DEBUG: */ echo __LINE__."+".$type."+
\n"; - $OUT .= "\n"; - - // Extension removeip activated? - if ((EXT_IS_ACTIVE("removeip")) && (isset($_CONFIG['removeip_'.strtolower($ACC_LVL).'_show'])) && ($_CONFIG['removeip_'.strtolower($ACC_LVL).'_show'] == "Y")) { - // Add anoymity/privacy infos - $OUT .= REMOVEIP_ADD_INFOS(); - } // END - if - - // Add line-break tag - $OUT .= "
\n"; + // Add closing div and br-tag + $OUT .= "
\n"; $NAV_DEPTH = "0"; - // Handle failed logins here if not in guest - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):type={$type},action={$GLOBALS['action']},what={$GLOBALS['what']},lvl={$ACC_LVL}
\n"; - if ((($type == "what") || ($type == "action") && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview") || ($GLOBALS['what'] == $_CONFIG['index_home']))) && ($ACC_LVL != "guest") && ((GET_EXT_VERSION("sql_patches") >= "0.4.7") || (GET_EXT_VERSION("admins") >= "0.7.0"))) { - // Handle failture - $OUT .= HANDLE_LOGIN_FAILTURES($ACC_LVL); - } // END - if + // Run the filter chain + $ret = RUN_FILTER('post_youhere_line', array('access_level' => $ACC_LVL, 'type' => $type, 'content' => "")); + $OUT .= $ret['content']; } // END - if } } // END - if @@ -384,7 +373,7 @@ function ADD_MENU($MODE, $act, $wht) { } // Menu title - $content .= $_CONFIG['menu_blur_spacer'].$sub_title; + $content .= getConfig('menu_blur_spacer') . $sub_title; if ($test) { $content .= ""; @@ -459,7 +448,7 @@ function IS_ADMIN($admin="") $valPass = $cacheArray['admin_hash']; } elseif ((!empty($passCookie)) && (isset($cacheArray['admins']['password'][$admin])) && (!empty($admin))) { // Count cache hits - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } // Login data is valid or not? $valPass = generatePassString($cacheArray['admins']['password'][$admin]); @@ -667,52 +656,6 @@ function IS_MEMBER() return $ret; } // -function UPDATE_LOGIN_DATA () { - global $LAST, $_CONFIG; - if (!is_array($LAST)) $LAST = array(); - - // Recheck if logged in - if (!IS_MEMBER()) return false; - - // Secure user ID - $GLOBALS['userid'] = bigintval(get_session('userid')); - - // Extract last online time (life) and how long is auto-login valid (time) - $newl = time() + bigintval(get_session('lifetime')); - - // Load last module and last online time - $result = SQL_QUERY_ESC("SELECT last_module, last_online FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) { - // Load last module and online time - list($mod, $onl) = SQL_FETCHROW($result); - SQL_FREERESULT($result); - - // Maybe first login time? - if (empty($mod)) $mod = "login"; - - if (set_session("userid", $GLOBALS['userid'], $newl, COOKIE_PATH) && set_session("u_hash", get_session('u_hash'), $newl, COOKIE_PATH) && set_session("lifetime", bigintval(get_session('lifetime')), $newl, COOKIE_PATH)) { - // This will be displayed on welcome page! :-) - if (empty($LAST['module'])) { - $LAST['module'] = $mod; $LAST['online'] = $onl; - } // END - if - - // "what" not set? - if (empty($GLOBALS['what'])) { - // Fix it to default - $GLOBALS['what'] = "welcome"; - if (!empty($_CONFIG['index_home'])) $GLOBALS['what'] = $_CONFIG['index_home']; - } // END - if - - // Update last module / online time - $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET last_module='%s', last_online=UNIX_TIMESTAMP(), REMOTE_ADDR='%s' WHERE userid=%s LIMIT 1", - array($GLOBALS['what'], GET_REMOTE_ADDR(), $GLOBALS['userid']), __FILE__, __LINE__); - } - } else { - // Destroy session, we cannot update! - destroy_user_session(); - } -} -// function VALIDATE_MENU_ACTION ($MODE, $act, $wht, $UPDATE=false) { $ret = false; @@ -767,7 +710,7 @@ function GET_MOD_DESCR($MODE, $wht, $column="what") // Fix empty "what" if (empty($wht)) { $wht = "welcome"; - if (!empty($_CONFIG['index_home'])) $wht = $_CONFIG['index_home']; + if (getConfig('index_home') != "") $wht = getConfig('index_home'); } // END - if // Default is not found @@ -853,7 +796,7 @@ function SEND_MODE_MAILS($mod, $modes) // Load template $msg = LOAD_EMAIL_TEMPLATE("member_mydata_notify", $content, $GLOBALS['userid']); - if ($_CONFIG['admin_notify'] == "Y") { + if (getConfig('admin_notify') == "Y") { // The admin needs to be notified about a profile change $msg_admin = "admin_mydata_notify"; $sub_adm = ADMIN_CHANGED_DATA; @@ -899,7 +842,7 @@ function SEND_MODE_MAILS($mod, $modes) if ((!empty($sub_adm)) && (!empty($msg_admin))) { // Send admin mail SEND_ADMIN_NOTIFICATION($sub_adm, $msg_admin, $content, $GLOBALS['userid']); - } elseif ($_CONFIG['admin_notify'] == "Y") { + } elseif (getConfig('admin_notify') == "Y") { // Cannot send mails to admin! $content = CANNOT_SEND_ADMIN_MAILS; } else { @@ -929,7 +872,7 @@ function GET_ACTION ($MODE, &$wht) //* DEBUG: */ echo __LINE__."=".$MODE."/".$wht."/".$GLOBALS['action']."=
"; if ((empty($wht)) && ($MODE != "admin")) { $wht = "welcome"; - if (!empty($_CONFIG['index_home'])) $wht = $_CONFIG['index_home']; + if (getConfig('index_home') != "") $wht = getConfig('index_home'); } // END - if if ($MODE == "admin") { @@ -945,7 +888,7 @@ function GET_ACTION ($MODE, &$wht) // Get it directly from URL return $GLOBALS['action']; } - //* DEBUG: */ echo __LINE__."*".$ret."*
\n"; + //* DEBUG: */ echo __FUNCTION__."(".__LINE__."): ret=".$ret."
\n"; if (MODULE_HAS_MENU($MODE)) { // Rewriting modules to menu @@ -959,7 +902,7 @@ function GET_ACTION ($MODE, &$wht) // Load from database $result = SQL_QUERY_ESC("SELECT action FROM "._MYSQL_PREFIX."_%s_menu WHERE what='%s' LIMIT 1", - array($MODE, $wht), __FILE__, __LINE__); + array($MODE, $wht), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load action value and pray that this one is the right you want... ;-) list($ret) = SQL_FETCHROW($result); @@ -1129,7 +1072,7 @@ function GET_REF_LEVEL_PERCENTS ($level) { $per = $cacheArray['ref_depths']['percents'][$key]; // Count cache hit - if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } + if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; } } } elseif (!EXT_IS_ACTIVE("cache")) { // Get referal data @@ -1164,7 +1107,7 @@ function GET_REF_LEVEL_PERCENTS ($level) { */ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid="0", $locked=false, $add_mode="ref") { //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ------------------------