diff --git a/class2.php b/class2.php index 9df9c9108..ce7daa42b 100755 --- a/class2.php +++ b/class2.php @@ -715,16 +715,7 @@ init_session(); // Set up a lot of the user-related constants -/** - * @deprecated but necessary. BC Fix. - * @return string - */ -function getip() -{ - trigger_error('getip() is deprecated. Use e107::getIPHandler()->ipDecode(USERIP) instead.', E_USER_DEPRECATED); // NO LAN - return e107::getIPHandler()->ipDecode(USERIP); -} $developerMode = (vartrue($pref['developer'],false) || E107_DEBUG_LEVEL > 0); @@ -1386,7 +1377,7 @@ if(!defined('THEME')) { e_theme::initTheme($pref['admintheme']); } - elseif (USERTHEME !== false && !e_ADMIN_AREA) + elseif (USERTHEME !== false && e_ADMIN_AREA === false) { e_theme::initTheme(USERTHEME); } @@ -1395,7 +1386,6 @@ if(!defined('THEME')) e_theme::initTheme($pref['sitetheme']); } - } $theme_pref = varset($pref['sitetheme_pref']); @@ -2146,30 +2136,7 @@ function message_handler($mode, $message, $line = 0, $file = '') show_emessage($mode, $message, $line, $file); } -/* -// ----------------------------------------------------------------------------- -function table_exists($check) -{ - if (!$GLOBALS['mySQLtablelist']) - { - $tablist=mysql_list_tables($GLOBALS['mySQLdefaultdb']); - while (list($temp) = mysql_fetch_array($tablist)) - { - $GLOBALS['mySQLtablelist'][] = $temp; - } - } - $mltable=MPREFIX.strtolower($check); - - foreach ($GLOBALS['mySQLtablelist'] as $lang) - { - if (strpos($lang, $mltable) !== false) - { - return true; - } - } -} -*/ function class_list($uid = '') { @@ -2245,42 +2212,6 @@ function include_lan($path, $force = false) - -// Routine looks in standard paths for language files associated with a plugin or theme - primarily for core routines, which won't know -// for sure where the author has put them. -// $unitName is the name (directory path) of the plugin or theme -// $type determines what is to be loaded: -// 'runtime' - the standard runtime language file for a plugin -// 'admin' - the standard admin language file for a plugin -// 'theme' - the standard language file for a plugin (these are usually pretty small, so one is enough) -// Otherwise, $type is treated as part of a filename within the plugin's language directory, prefixed with the current language -// Returns false on failure (not found). -// Returns the include_once error return if there is one -// Otherwise returns an empty string. - -// Note - if the code knows precisely where the language file is located, use include_lan() - -// $pref['noLanguageSubs'] can be set true to prevent searching for the English files if the files for the current site language don't exist. -//DEPRECATED - use e107::loadLanFiles(); -/** - * @deprecated - use e107::loadLanFiles(); - * @param $unitName - * @param string $type - * @return bool|string - */ -function loadLanFiles($unitName, $type='runtime') -{ - trigger_error('loadLanFiles() is deprecated. Use e107::loadLanFiles() instead.', E_USER_DEPRECATED); // NO LAN - - $info = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2); - e107::getMessage()->addDebug("Using deprecated function loanLanFiles(). Replace with e107::loadLanFiles().".print_a($info,true)); - return e107::loadLanFiles($unitName, $type); -} - - - - - /** * Check that all required user fields (including extended fields) are valid. * @param array $currentUser - data for user @@ -2691,46 +2622,7 @@ class e_http_header function send() { - // Disable caching of html. - /* - $this->setHeader("Expires: 0", true); - $this->setHeader("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT", true); - $this->setHeader("Cache-Control: no-store, no-cache, must-revalidate", true); - $this->setHeader("Cache-Control: post-check=0, pre-check=0", false); - $this->setHeader("Pragma: no-cache"); - $this->setHeader("Cache-Control: max-age=0", false); - */ - // $this->setHeader("Cache-Control: public", true); -/* - if(defined('e_HTTP_STATIC')) - { - unset($_COOKIE); - - $siteurl = str_replace('https','http',SITEURL); - $static = str_replace('https','http', e_HTTP_STATIC); - - if($siteurl === $static && deftrue('e_SUBDOMAIN')) - { - $accessControl = str_replace(e_SUBDOMAIN.'.', '', SITEURLBASE); - - $this->unsetHeader("Cache-Control"); - // $this->unsetHeader("Content-Type"); - $this->unsetHeader("Set-Cookie"); - $this->unsetHeader("Pragma"); - $this->unsetHeader("Expires"); - - $this->setHeader("Access-Control-Allow-Origin: ".$accessControl, true); - $this->setHeader("Cache-Control: public", true); - } - else - { - $this->setHeader("Access-Control-Allow-Origin: ".$static, true); - } - } -*/ - - $canCache = e107::canCache(); // $this->setHeader("Cache-Control: must-revalidate", true); @@ -2805,43 +2697,6 @@ class e_http_header -} - - -/** - * @deprecated Use ini_set() directly. - * @param $var - * @param $value - * @return false|string - */ -function e107_ini_set($var, $value) -{ - trigger_error('e107_ini_set() is deprecated. Use ini_set() instead.', E_USER_DEPRECATED); // NO LAN - - if (function_exists('ini_set')) - { - return ini_set($var, $value); - } - - return false; -} - -// Return true if specified plugin installed, false if not -//DEPRECATED - -/** - * @deprecated - use e107::isInstalled(); - * @param $plugname - * @return bool - */ -function plugInstalled($plugname) -{ - trigger_error('plugInstalled() is deprecated. Use logTime('(After class2)'); diff --git a/e107_admin/footer.php b/e107_admin/footer.php index b99dbc276..4be89487a 100644 --- a/e107_admin/footer.php +++ b/e107_admin/footer.php @@ -22,7 +22,7 @@ $In_e107_Footer = TRUE; // For registered shutdown function global $error_handler,$db_time,$ADMIN_FOOTER; // Legacy fix - call header if not already done, mainly fixing left side menus to work proper -if(!deftrue('e_ADMIN_UI') && !deftrue('ADMIN_AREA')) +if(!deftrue('e_ADMIN_UI') /*&& !deftrue('ADMIN_AREA')*/) { // close the old buffer $content = ob_get_contents(); diff --git a/e107_admin/menus.php b/e107_admin/menus.php index bf32627c0..196ee8114 100644 --- a/e107_admin/menus.php +++ b/e107_admin/menus.php @@ -38,9 +38,8 @@ else { define('e_ADMIN_AREA', true); define("USER_AREA", false); -// define('ADMIN_AREA', true); -// define('ADMIN_AREA', true); -// define('USER_AREA', false); + define('ADMIN_AREA', true); + define('e_MENUMANAGER_ACTIVE', false); } diff --git a/e107_handlers/core_functions.php b/e107_handlers/core_functions.php index 1a5402076..d86dc3944 100644 --- a/e107_handlers/core_functions.php +++ b/e107_handlers/core_functions.php @@ -287,6 +287,108 @@ function echo_gzipped_page() } +/** + * @deprecated but necessary. BC Fix. + * @return string + */ +function getip() +{ + trigger_error('getip() is deprecated. Use e107::getIPHandler()->ipDecode(USERIP) instead.', E_USER_DEPRECATED); // NO LAN + + return e107::getIPHandler()->ipDecode(USERIP); +} + +/** + * @deprecated - use e107::loadLanFiles(); + * @param $unitName + * @param string $type + * @return bool|string + * Routine looks in standard paths for language files associated with a plugin or theme - primarily for core routines, which won't know + * for sure where the author has put them. + * $unitName is the name (directory path) of the plugin or theme + * $type determines what is to be loaded: + * 'runtime' - the standard runtime language file for a plugin + * 'admin' - the standard admin language file for a plugin + * 'theme' - the standard language file for a plugin (these are usually pretty small, so one is enough) + * Otherwise, $type is treated as part of a filename within the plugin's language directory, prefixed with the current language + * Returns false on failure (not found). + * Returns the include_once error return if there is one + * Otherwise returns an empty string. + * + * Note - if the code knows precisely where the language file is located, use include_lan() + * + * $pref['noLanguageSubs'] can be set true to prevent searching for the English files if the files for the current site language don't exist. + */ +function loadLanFiles($unitName, $type='runtime') +{ + trigger_error('loadLanFiles() is deprecated. Use e107::loadLanFiles() instead.', E_USER_DEPRECATED); // NO LAN + + $info = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2); + e107::getMessage()->addDebug("Using deprecated function loanLanFiles(). Replace with e107::loadLanFiles().".print_a($info,true)); + return e107::loadLanFiles($unitName, $type); +} + + +/** + * @deprecated Use ini_set() directly. + * @param $var + * @param $value + * @return false|string + */ +function e107_ini_set($var, $value) +{ + trigger_error('e107_ini_set() is deprecated. Use ini_set() instead.', E_USER_DEPRECATED); // NO LAN + + if (function_exists('ini_set')) + { + return ini_set($var, $value); + } + + return false; +} + +/** + * @deprecated - use e107::isInstalled(); + * @param $plugname + * @return bool + */ +function plugInstalled($plugname) +{ + trigger_error('plugInstalled() is deprecated. Use assertTrue($result); +/* + $pid = e107::getDb()->retrieve('plugin', 'plugin_id', "plugin_path = 'gallery'"); + + $result = getperms('P', 'P'.$pid); + $this->assertFalse($result); + + // define('e_CURRENT_PLUGIN', 'gallery'); + $result = getperms('P', 'P'.$pid); + $this->assertTrue($result); +*/ + }