bludit/admin/controllers/install-theme.php

39 lines
1.4 KiB
PHP
Raw Normal View History

2015-08-03 00:05:20 +02:00
<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Check role
// ============================================================================
if($Login->role()!=='admin') {
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
Redirect::page('admin', 'dashboard');
}
// ============================================================================
// Functions
// ============================================================================
2015-08-03 02:49:12 +02:00
// ============================================================================
// Main before POST
// ============================================================================
2015-08-03 00:05:20 +02:00
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
2015-08-03 02:49:12 +02:00
// Main after POST
2015-08-03 00:05:20 +02:00
// ============================================================================
$themeDirname = $layout['parameters'];
if( Sanitize::pathFile(PATH_THEMES.$themeDirname) )
{
$Site->set(array('theme'=>$themeDirname));
Alert::set($Language->g('The changes have been saved'));
}
else
{
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to install the theme: '.$themeDirname);
}
Redirect::page('admin', 'themes');