mirror of
https://github.com/e107inc/e107.git
synced 2025-04-16 18:42:01 +02:00
Path fixes.
This commit is contained in:
parent
573d204cc0
commit
49a998b6d9
@ -667,10 +667,13 @@ class admin_shortcodes
|
||||
}
|
||||
unset($tmp);
|
||||
|
||||
|
||||
$curScript = basename($_SERVER['SCRIPT_FILENAME']);
|
||||
|
||||
// Obsolete
|
||||
ob_start();
|
||||
//Show upper_right menu if the function exists
|
||||
$tmp = explode('.',e_PAGE);
|
||||
$tmp = explode('.',$curScript);
|
||||
$adminmenu_parms = "";
|
||||
|
||||
$adminmenu_func = $tmp[0].'_adminmenu';
|
||||
@ -687,6 +690,8 @@ class admin_shortcodes
|
||||
}
|
||||
}
|
||||
$plugindir = (str_replace('/','',str_replace('..', '', e_PLUGIN)).'/');
|
||||
|
||||
// FIXME @TODO $plugPath is using the URL to detect the path. It should use $_SERVER['SCRIPT_FILENAME']
|
||||
$plugpath = e_PLUGIN.str_replace(basename(e_SELF),'',str_replace('/'.$plugindir,'','/'.strstr(e_SELF,$plugindir))).'admin_menu.php';
|
||||
|
||||
if(file_exists($plugpath))
|
||||
|
@ -4146,7 +4146,7 @@ class e107
|
||||
$tmp2 = explode('?', e_REQUEST_URI);
|
||||
define('e_REQUEST_HTTP', array_shift($tmp2)); // SELF URL without the QUERY string and leading domain part
|
||||
|
||||
if(!deftrue('e_SINGLE_ENTRY'))
|
||||
if(!deftrue('e_SINGLE_ENTRY') && !deftrue('e_SELF_OVERRIDE') )
|
||||
{
|
||||
$page = substr(strrchr($_SERVER['PHP_SELF'], '/'), 1);
|
||||
|
||||
@ -4162,6 +4162,11 @@ class e107
|
||||
else
|
||||
{
|
||||
define('e_SELF', e_REQUEST_SELF);
|
||||
|
||||
if(deftrue('e_SELF_OVERRIDE')) // see multisite plugin.
|
||||
{
|
||||
define('e_PAGE', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4173,14 +4178,15 @@ class e107
|
||||
$inAdminDir = FALSE;
|
||||
$isPluginDir = strpos($_self,'/'.$PLUGINS_DIRECTORY) !== FALSE; // True if we're in a plugin
|
||||
$e107Path = str_replace($this->base_path, '', $_self); // Knock off the initial bits
|
||||
$curPage = basename($_SERVER['SCRIPT_FILENAME']);
|
||||
|
||||
if (
|
||||
(!$isPluginDir && strpos($e107Path, $ADMIN_DIRECTORY) === 0 ) // Core admin directory
|
||||
|| ($isPluginDir && (strpos(e_PAGE,'_admin.php') !== false || strpos(e_PAGE,'admin_') === 0 || strpos($e107Path, 'admin/') !== FALSE)) // Plugin admin file or directory
|
||||
|| ($isPluginDir && (strpos($curPage,'_admin.php') !== false || strpos($curPage,'admin_') === 0 || strpos($e107Path, 'admin/') !== FALSE)) // Plugin admin file or directory
|
||||
|| (vartrue($eplug_admin) || deftrue('ADMIN_AREA')) // Admin forced
|
||||
|| (preg_match('/^\/(.*?)\/user(settings\.php|\/edit)(\?|\/)(\d+)$/i', $_SERVER['REQUEST_URI']) && ADMIN)
|
||||
|| ($isPluginDir && e_PAGE === 'prefs.php') //BC Fix for old plugins
|
||||
|| ($isPluginDir && e_PAGE === 'config.php') // BC Fix for old plugins
|
||||
|| ($isPluginDir && $curPage === 'prefs.php') //BC Fix for old plugins
|
||||
|| ($isPluginDir && $curPage === 'config.php') // BC Fix for old plugins
|
||||
)
|
||||
{
|
||||
$inAdminDir = TRUE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user