bludit/admin/controllers/configure-plugin.php

47 lines
1.4 KiB
PHP
Raw Normal View History

2015-07-14 04:16:28 +02:00
<?php defined('BLUDIT') or die('Bludit CMS.');
2015-07-14 06:41:32 +02:00
// ============================================================================
// Check role
// ============================================================================
if($Login->role()!=='admin') {
2015-07-20 05:14:12 +02:00
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
2015-07-14 06:41:32 +02:00
Redirect::page('admin', 'dashboard');
}
2015-07-14 04:16:28 +02:00
// ============================================================================
// Functions
// ============================================================================
// ============================================================================
// Main before POST
// ============================================================================
$_Plugin = false;
2015-07-28 03:01:52 +02:00
$pluginClassName = $layout['parameters'];
2015-07-14 04:16:28 +02:00
foreach($plugins['all'] as $P)
{
2015-07-28 03:01:52 +02:00
if($P->className()==$pluginClassName) {
2015-07-14 04:16:28 +02:00
$_Plugin = $P;
}
}
// Check if the plugin exists.
if($_Plugin===false) {
Redirect::page('admin', 'plugins');
}
// ============================================================================
// POST Method
// ============================================================================
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
$_Plugin->setDb($_POST);
2015-07-20 05:14:12 +02:00
Alert::set($Language->g('the-changes-have-been-saved'));
2015-07-14 04:16:28 +02:00
}
// ============================================================================
// Main after POST
// ============================================================================