1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 04:10:38 +02:00

Fixed E_NOTICE in plugin install/uninstall process

- FIX: e107::coreLan() now loads the lan_admin.php file if the $admin argument is true
- FIX: Variable scope of $eplug_folder in e107plugin::uninstall()
- FIX: isset() check order in pluginsTest::makePluginReport()
- FIX: class2.php: Missing ADMINPERMS constant in CLI mode
This commit is contained in:
Nick Liu
2020-01-17 17:11:26 +01:00
parent bfad3f7202
commit 62a547aed2
4 changed files with 132 additions and 134 deletions

View File

@@ -1417,12 +1417,6 @@ define('TIMEOFFSET', $e_deltaTime);
// ----------------------------------------------------------------------------
$sql->db_Mark_Time('Find/Load Theme');
if(e_ADMIN_AREA) // Load admin phrases ASAP
{
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_admin.php');
}
if(!defined('THEME'))
{
@@ -2032,6 +2026,7 @@ e107::getDebug()->log("Timezone: ".USERTIMEZONE); // remove later on.
define('USERNAME', 'e107-cli');
define('USERTHEME', false);
define('ADMIN', true);
define('ADMINPERMS', false);
define('GUEST', false);
define('USERCLASS', '');
define('USEREMAIL', '');

View File

@@ -3145,6 +3145,11 @@ class e107
*/
public static function coreLan($fname, $admin = false)
{
if ($admin)
{
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_admin.php');
}
$cstring = 'corelan/'.e_LANGUAGE.'_'.$fname.($admin ? '_admin' : '_front');
if(self::getRegistry($cstring)) return;

View File

@@ -4311,7 +4311,6 @@ class e107plugin
}
public function uninstall($id, $options = array())
{
$pref = e107::getPref();
@@ -4338,11 +4337,11 @@ class e107plugin
$text = '';
//Uninstall Plugin
$eplug_folder = $plug['plugin_path'];
if ($plug['plugin_installflag'] == true)
{
$this->log("plugin_installflag = true, proceeding to uninstall");
$eplug_folder = $plug['plugin_path'];
$_path = e_PLUGIN . $plug['plugin_path'] . '/';
if (file_exists($_path . 'plugin.xml'))
@@ -4475,7 +4474,6 @@ class e107plugin
$this->log("Uninstall completed");
return $text;
}

View File

@@ -42,10 +42,10 @@
$debug_text .= "---- Pref: plug_installed (version)\n\n";
$pref = e107::getConfig('core',true,true)->get('plug_installed');
$debug_text .= print_r($pref[$pluginDir],true);
$installedPref = isset($pref[$pluginDir]) ? $pref[$pluginDir] : false;
$debug_text .= print_r($installedPref,true);
$debug_text .= "\n\n---- Plugin Prefs: \n\n";
$pluginPref = e107::pref($pluginDir);
$debug_text .= print_r($pluginPref,true);