bludit/bl-kernel/admin/controllers/install-plugin.php

46 lines
1.4 KiB
PHP
Raw Normal View History

2015-06-11 04:27:04 +02:00
<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Check role
// ============================================================================
if($Login->role()!=='admin') {
2015-07-20 05:14:12 +02:00
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
Redirect::page('dashboard');
2015-06-11 04:27:04 +02:00
}
// ============================================================================
// Functions
// ============================================================================
2015-08-03 02:49:12 +02:00
// ============================================================================
// Main before POST
// ============================================================================
2015-06-11 04:27:04 +02:00
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
2015-08-03 02:49:12 +02:00
// Main after POST
2015-06-11 04:27:04 +02:00
// ============================================================================
2015-06-12 06:00:04 +02:00
$pluginClassName = $layout['parameters'];
foreach($plugins['all'] as $plugin) {
if($plugin->className()==$pluginClassName) {
// Install plugin
if( $plugin->install() ) {
// Add to syslog
$Syslog->add(array(
'dictionaryKey'=>'plugin-installed',
'notes'=>$plugin->name()
));
// Create an alert
Alert::set($Language->g('Plugin installed'));
}
2015-07-28 03:01:52 +02:00
}
}
2015-06-12 06:00:04 +02:00
Redirect::page('plugins');