public static function admin_executables() { if (!$GLOBALS['user']->hasCos(UserCos::ROOT)) { $msg = 'Not authorized!'; SystemEvent::raise(SystemEvent::INFO, $msg, __METHOD__); echo json_encode(array('success' => false, 'error' => $msg)); exit; } $settings = new SystemSettings(); foreach ($_POST['executablesForm'] as $key => $value) { $settingsValue = $value['value']; if ($value['type'] == 'checkbox') { $settingsValue = $value['value'] ? '1' : '0'; } $settings->setSetting($key, $settingsValue); } $GLOBALS['settings'] = $settings; SystemEvent::raise(SystemEvent::DEBUG, "Executables settings changed. {$GLOBALS['user']->getUsername()}.", __METHOD__); echo json_encode(array('success' => true, 'error' => 'Executables settings saved.')); exit; }
public static function tests_system() { $s = new SystemSettings(); $s->setSetting('test2', true); //$s->setSetting('test', true); $s->setSetting('allowUserSignUp', true); exit; }