Support admin controller and view over plugins
This commit is contained in:
parent
537cfbf616
commit
b092d3048a
2 changed files with 7 additions and 6 deletions
|
@ -1,9 +1,10 @@
|
||||||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||||
|
|
||||||
// Session
|
// Start the session
|
||||||
|
// If the session is not possible to start the admin area is not available
|
||||||
Session::start();
|
Session::start();
|
||||||
if (Session::started()===false) {
|
if (Session::started()===false) {
|
||||||
exit('Bludit CMS. Session initialization failure.');
|
exit('Bludit CMS. Session initialization failed.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$login = new Login();
|
$login = new Login();
|
||||||
|
@ -61,8 +62,8 @@ else
|
||||||
// Slug is login.
|
// Slug is login.
|
||||||
if ($url->notFound() || !$login->isLogged() || ($url->slug()==='login') ) {
|
if ($url->notFound() || !$login->isLogged() || ($url->slug()==='login') ) {
|
||||||
$layout['controller'] = 'login';
|
$layout['controller'] = 'login';
|
||||||
$layout['view'] = 'login';
|
$layout['view'] = 'login';
|
||||||
$layout['template'] = 'login.php';
|
$layout['template'] = 'login.php';
|
||||||
|
|
||||||
// Generate the tokenCSRF for the user not logged, when the user log-in the token will be change.
|
// Generate the tokenCSRF for the user not logged, when the user log-in the token will be change.
|
||||||
$security->generateTokenCSRF();
|
$security->generateTokenCSRF();
|
||||||
|
@ -83,7 +84,7 @@ else
|
||||||
// Load controller.
|
// Load controller.
|
||||||
if (Sanitize::pathFile(PATH_ADMIN_CONTROLLERS, $layout['controller'].'.php')) {
|
if (Sanitize::pathFile(PATH_ADMIN_CONTROLLERS, $layout['controller'].'.php')) {
|
||||||
include(PATH_ADMIN_CONTROLLERS.$layout['controller'].'.php');
|
include(PATH_ADMIN_CONTROLLERS.$layout['controller'].'.php');
|
||||||
} else if(!empty($layout['plugin']) && method_exists($layout['plugin'], 'adminController')) {
|
} elseif ($layout['plugin'] && method_exists($layout['plugin'], 'adminController')) {
|
||||||
$layout['plugin']->adminController();
|
$layout['plugin']->adminController();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ if (file_exists(PATH_KERNEL.'bludit.pro.php')) {
|
||||||
$pages = new Pages();
|
$pages = new Pages();
|
||||||
$users = new Users();
|
$users = new Users();
|
||||||
$tags = new Tags();
|
$tags = new Tags();
|
||||||
$categories = new Categories();
|
$categories = new Categories();
|
||||||
$site = new Site();
|
$site = new Site();
|
||||||
$url = new Url();
|
$url = new Url();
|
||||||
$security = new Security();
|
$security = new Security();
|
||||||
|
|
Loading…
Add table
Reference in a new issue