Ejemplo n.º 1
0
define('APP_ROOT', '..');
require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'Base.php';
SP\Request::checkReferer('POST');
if (!SP\Init::isLoggedIn()) {
    SP\Response::printJSON(_('La sesión no se ha iniciado o ha caducado'), 10);
}
$sk = SP\Request::analyze('sk', false);
if (!$sk || !SessionUtil::checkSessionKey($sk)) {
    SP\Response::printJSON(_('CONSULTA INVÁLIDA'));
}
// Variables POST del formulario
$actionId = SP\Request::analyze('actionId', 0);
$activeTab = SP\Request::analyze('activeTab', 0);
$doActionOnClose = "sysPassUtil.Common.doAction({$actionId},'',{$activeTab});";
if ($actionId === SP\Controller\ActionsInterface::ACTION_CFG_GENERAL || $actionId === SP\Controller\ActionsInterface::ACTION_CFG_WIKI || $actionId === SP\Controller\ActionsInterface::ACTION_CFG_LDAP || $actionId === SP\Controller\ActionsInterface::ACTION_CFG_MAIL) {
    $Log = SP\Log::newLog(_('Modificar Configuración'));
    if ($actionId === SP\Controller\ActionsInterface::ACTION_CFG_GENERAL) {
        // General
        $siteLang = SP\Request::analyze('sitelang');
        $siteTheme = SP\Request::analyze('sitetheme', 'material-blue');
        $sessionTimeout = SP\Request::analyze('session_timeout', 300);
        $httpsEnabled = SP\Request::analyze('https_enabled', false, false, true);
        $logEnabled = SP\Request::analyze('log_enabled', false, false, true);
        $debugEnabled = SP\Request::analyze('debug', false, false, true);
        $maintenanceEnabled = SP\Request::analyze('maintenance', false, false, true);
        $checkUpdatesEnabled = SP\Request::analyze('updates', false, false, true);
        $checkNoticesEnabled = SP\Request::analyze('notices', false, false, true);
        SP\Config::setCacheConfigValue('sitelang', $siteLang);
        SP\Config::setCacheConfigValue('sitetheme', $siteTheme);
        SP\Config::setCacheConfigValue('session_timeout', $sessionTimeout);
        SP\Config::setCacheConfigValue('https_enabled', $httpsEnabled);