User disabled plugins now stay disabled after sign in
Fixes #1795 Fixes #3691
This commit is contained in:
parent
be839d0a07
commit
ab7dda260b
|
|
@ -1,5 +1,6 @@
|
|||
<?php namespace System\Classes;
|
||||
|
||||
use Db;
|
||||
use App;
|
||||
use Str;
|
||||
use File;
|
||||
|
|
@ -492,6 +493,7 @@ class PluginManager
|
|||
$this->disabledPlugins = array_merge($this->disabledPlugins, $disabled);
|
||||
}
|
||||
else {
|
||||
$this->populateDisabledPluginsFromDb();
|
||||
$this->writeDisabled();
|
||||
}
|
||||
}
|
||||
|
|
@ -520,6 +522,23 @@ class PluginManager
|
|||
File::put($this->metaFile, json_encode($this->disabledPlugins));
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates information about disabled plugins from database
|
||||
* @return void
|
||||
*/
|
||||
protected function populateDisabledPluginsFromDb()
|
||||
{
|
||||
if (!App::hasDatabase()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$disabled = Db::table('system_plugin_versions')->where('is_disabled', '1')->lists('code');
|
||||
|
||||
foreach ($disabled as $code) {
|
||||
$this->disabledPlugins[$code] = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables a single plugin in the system.
|
||||
* @param string $id Plugin code/namespace
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<?php namespace System\Classes;
|
||||
|
||||
use Db;
|
||||
use App;
|
||||
use Url;
|
||||
use File;
|
||||
|
|
|
|||
Loading…
Reference in New Issue