コード例 #1
0
ファイル: AjaxManager.php プロジェクト: rasismeiro/cintient
 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;
 }
コード例 #2
0
 public static function tests_system()
 {
     $s = new SystemSettings();
     $s->setSetting('test2', true);
     //$s->setSetting('test', true);
     $s->setSetting('allowUserSignUp', true);
     exit;
 }