mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Disable ExamplePlugin (#13391)
This commit is contained in:
@@ -191,7 +191,7 @@ class PluginManager
|
||||
try {
|
||||
$plugin = Plugin::create([
|
||||
'plugin_name' => $name,
|
||||
'plugin_active' => 1,
|
||||
'plugin_active' => $name !== 'ExamplePlugin',
|
||||
'version' => 2,
|
||||
]);
|
||||
$this->getPlugins()->put($name, $plugin);
|
||||
|
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class DisableExamplePlugin extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
// disable ExamplePlugin that was accidentally enabled for everyone
|
||||
DB::table('plugins')
|
||||
->where([
|
||||
'plugin_name' => 'ExamplePlugin',
|
||||
'version' => 2,
|
||||
])->update([
|
||||
'plugin_active' => 0,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user