ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilObjSystemFolderGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once "./Services/Object/classes/class.ilObjectGUI.php";
5 require_once('./Services/Repository/classes/class.ilObjectPlugin.php');
6 
19 {
25  var $type;
26 
31  function __construct($a_data,$a_id,$a_call_by_reference)
32  {
33  $this->type = "adm";
34  parent::__construct($a_data,$a_id,$a_call_by_reference, false);
35 
36  $this->lng->loadLanguageModule("administration");
37  $this->lng->loadLanguageModule("adm");
38  }
39 
40  function executeCommand()
41  {
42  global $ilTabs;
43 
44  $next_class = $this->ctrl->getNextClass($this);
45  $this->prepareOutput();
46 
47  switch($next_class)
48  {
49  case 'ilpermissiongui':
50  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
51  $perm_gui = new ilPermissionGUI($this);
52  $ret =& $this->ctrl->forwardCommand($perm_gui);
53  break;
54 
55  case 'ilimprintgui':
56  // page editor will set its own tabs
57  $ilTabs->clearTargets();
58  $ilTabs->setBackTarget($this->lng->txt("back"),
59  $this->ctrl->getLinkTarget($this, ""));
60 
61  include_once("./Services/Imprint/classes/class.ilImprintGUI.php");
62  $igui = new ilImprintGUI();
63 
64  // needed for editor
65  $igui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0, "impr"));
66 
67  if(!$this->checkPermissionBool("write"))
68  {
69  $igui->setEnableEditing(false);
70  }
71 
72  $ret = $this->ctrl->forwardCommand($igui);
73  if ($ret != "")
74  {
75  $this->tpl->setContent($ret);
76  }
77  break;
78 
79  case "ilobjectownershipmanagementgui":
80  $this->setSystemCheckSubTabs("no_owner");
81  include_once("Services/Object/classes/class.ilObjectOwnershipManagementGUI.php");
82  $gui = new ilObjectOwnershipManagementGUI(0);
83  $this->ctrl->forwardCommand($gui);
84  break;
85 
86  case "ilcronmanagergui":
87  $ilTabs->activateTab("cron_jobs");
88  include_once("Services/Cron/classes/class.ilCronManagerGUI.php");
89  $gui = new ilCronManagerGUI();
90  $this->ctrl->forwardCommand($gui);
91  break;
92 
93  default:
94 //var_dump($_POST);
95  $cmd = $this->ctrl->getCmd("view");
96 
97  $cmd .= "Object";
98  $this->$cmd();
99 
100  break;
101  }
102 
103  return true;
104  }
105 
111  function viewObject()
112  {
113  global $ilAccess;
114 
115  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
116  {
117  return $this->showBasicSettingsObject();
118  }
119  return $this->showServerInfoObject();
120  }
121 
122  function viewScanLogObject()
123  {
124  return $this->viewScanLog();
125  }
126 
130  function setSystemCheckSubTabs($a_activate)
131  {
132  global $ilTabs, $ilCtrl;
133 
134  $ilTabs->addSubTab("system_check_sub", $this->lng->txt("system_check"),
135  $ilCtrl->getLinkTarget($this, "check"));
136  $ilTabs->addSubTab("no_owner", $this->lng->txt("system_check_no_owner"),
137  $ilCtrl->getLinkTargetByClass("ilObjectOwnershipManagementGUI"));
138 
139  $ilTabs->setSubTabActive($a_activate);
140  $ilTabs->setTabActive("system_check");
141  }
142 
148  function checkObject()
149  {
150  global $rbacsystem, $ilias, $objDefinition, $ilSetting;
151 
152  $this->setSystemCheckSubTabs("system_check_sub");
153 
154  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
155  {
156  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
157  }
158 //echo "1";
159 
160  if ($_POST['count_limit'] !== null || $_POST['age_limit'] !== null || $_POST['type_limit'] !== null)
161  {
162  $ilias->account->writePref('systemcheck_count_limit',
163  (is_numeric($_POST['count_limit']) && $_POST['count_limit'] > 0) ? $_POST['count_limit'] : ''
164  );
165  $ilias->account->writePref('systemcheck_age_limit',
166  (is_numeric($_POST['age_limit']) && $_POST['age_limit'] > 0) ? $_POST['age_limit'] : '');
167  $ilias->account->writePref('systemcheck_type_limit', trim($_POST['type_limit']));
168  }
169 
170  if ($_POST["mode"])
171  {
172 //echo "3";
173  $this->writeCheckParams();
174  $this->startValidator($_POST["mode"],$_POST["log_scan"]);
175  }
176  else
177  {
178 //echo "4";
179  include_once "./Services/Repository/classes/class.ilValidator.php";
180  $validator = new ilValidator();
181  $hasScanLog = $validator->hasScanLog();
182 
183  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.adm_check.html",
184  "Modules/SystemFolder");
185 
186  if ($hasScanLog)
187  {
188  $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_last_log"));
189  }
190 
191  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
192  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("systemcheck"));
193  $this->tpl->setVariable("COLSPAN", 3);
194  $this->tpl->setVariable("TXT_ANALYZE_TITLE", $this->lng->txt("analyze_data"));
195  $this->tpl->setVariable("TXT_ANALYSIS_OPTIONS", $this->lng->txt("analysis_options"));
196  $this->tpl->setVariable("TXT_REPAIR_OPTIONS", $this->lng->txt("repair_options"));
197  $this->tpl->setVariable("TXT_OUTPUT_OPTIONS", $this->lng->txt("output_options"));
198  $this->tpl->setVariable("TXT_SCAN", $this->lng->txt("scan"));
199  $this->tpl->setVariable("TXT_SCAN_DESC", $this->lng->txt("scan_desc"));
200  $this->tpl->setVariable("TXT_DUMP_TREE", $this->lng->txt("dump_tree"));
201  $this->tpl->setVariable("TXT_DUMP_TREE_DESC", $this->lng->txt("dump_tree_desc"));
202  $this->tpl->setVariable("TXT_CLEAN", $this->lng->txt("clean"));
203  $this->tpl->setVariable("TXT_CLEAN_DESC", $this->lng->txt("clean_desc"));
204  $this->tpl->setVariable("TXT_RESTORE", $this->lng->txt("restore_missing"));
205  $this->tpl->setVariable("TXT_RESTORE_DESC", $this->lng->txt("restore_missing_desc"));
206  $this->tpl->setVariable("TXT_PURGE", $this->lng->txt("purge_missing"));
207  $this->tpl->setVariable("TXT_PURGE_DESC", $this->lng->txt("purge_missing_desc"));
208  $this->tpl->setVariable("TXT_RESTORE_TRASH", $this->lng->txt("restore_trash"));
209  $this->tpl->setVariable("TXT_RESTORE_TRASH_DESC", $this->lng->txt("restore_trash_desc"));
210  $this->tpl->setVariable("TXT_PURGE_TRASH", $this->lng->txt("purge_trash"));
211  $this->tpl->setVariable("TXT_PURGE_TRASH_DESC", $this->lng->txt("purge_trash_desc"));
212  $this->tpl->setVariable("TXT_COUNT_LIMIT", $this->lng->txt("purge_count_limit"));
213  $this->tpl->setVariable("TXT_COUNT_LIMIT_DESC", $this->lng->txt("purge_count_limit_desc"));
214  $this->tpl->setVariable("COUNT_LIMIT_VALUE", $ilias->account->getPref("systemcheck_count_limit"));
215  $this->tpl->setVariable("TXT_AGE_LIMIT", $this->lng->txt("purge_age_limit"));
216  $this->tpl->setVariable("TXT_AGE_LIMIT_DESC", $this->lng->txt("purge_age_limit_desc"));
217  $this->tpl->setVariable("AGE_LIMIT_VALUE", $ilias->account->getPref("systemcheck_age_limit"));
218  $this->tpl->setVariable("TXT_TYPE_LIMIT", $this->lng->txt("purge_type_limit"));
219  $this->tpl->setVariable("TXT_TYPE_LIMIT_DESC", $this->lng->txt("purge_type_limit_desc"));
220 
221  if($ilias->account->getPref('systemcheck_mode_scan'))
222  $this->tpl->touchBlock('mode_scan_checked');
223  if($ilias->account->getPref('systemcheck_mode_dump_tree'))
224  $this->tpl->touchBlock('mode_dump_tree_checked');
225  if($ilias->account->getPref('systemcheck_mode_clean'))
226  $this->tpl->touchBlock('mode_clean_checked');
227  if($ilias->account->getPref('systemcheck_mode_restore'))
228  {
229  $this->tpl->touchBlock('mode_restore_checked');
230  $this->tpl->touchBlock('mode_purge_disabled');
231  }
232  elseif($ilias->account->getPref('systemcheck_mode_purge'))
233  {
234  $this->tpl->touchBlock('mode_purge_checked');
235  $this->tpl->touchBlock('mode_restore_disabled');
236  }
237  if($ilias->account->getPref('systemcheck_mode_restore_trash'))
238  {
239  $this->tpl->touchBlock('mode_restore_trash_checked');
240  $this->tpl->touchBlock('mode_purge_trash_disabled');
241  }
242  elseif($ilias->account->getPref('systemcheck_mode_purge_trash'))
243  {
244  $this->tpl->touchBlock('mode_purge_trash_checked');
245  $this->tpl->touchBlock('mode_restore_trash_disabled');
246  }
247  if($ilias->account->getPref('systemcheck_log_scan'))
248  $this->tpl->touchBlock('log_scan_checked');
249 
250 
251  // #9520 - restrict to types which can be found in tree
252 
253  $obj_types_in_tree = array();
254 
255  global $ilDB;
256  $set = $ilDB->query('SELECT type FROM object_data od'.
257  ' JOIN object_reference ref ON (od.obj_id = ref.obj_id)'.
258  ' JOIN tree ON (tree.child = ref.ref_id)'.
259  ' WHERE tree.tree < 1'.
260  ' GROUP BY type');
261  while($row = $ilDB->fetchAssoc($set))
262  {
263  $obj_types_in_tree[] = $row['type'];
264  }
265 
266  $types = $objDefinition->getAllObjects();
267  $ts = array("" => "");
268  foreach ($types as $t)
269  {
270  if ($t != "" && !$objDefinition->isSystemObject($t) && $t != "root" &&
271  in_array($t, $obj_types_in_tree))
272  {
273  if ($objDefinition->isPlugin($t))
274  {
276  $ts[$t] = $pl->txt("obj_".$t);
277  }
278  else
279  {
280  $ts[$t] = $this->lng->txt("obj_".$t);
281  }
282  }
283  }
284  asort($ts);
285  $this->tpl->setVariable("TYPE_LIMIT_CHOICE",
287  $ilias->account->getPref("systemcheck_type_limit"),
288  'type_limit',
289  $ts, false, true
290  )
291  );
292  $this->tpl->setVariable("TXT_LOG_SCAN", $this->lng->txt("log_scan"));
293  $this->tpl->setVariable("TXT_LOG_SCAN_DESC", $this->lng->txt("log_scan_desc"));
294  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("start_scan"));
295 
296  $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save_params_for_cron"));
297 
298  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
299 
300  $cron_form = new ilPropertyFormGUI();
301  $cron_form->setFormAction($this->ctrl->getFormAction($this));
302  $cron_form->setTitle($this->lng->txt('systemcheck_cronform'));
303 
304  $radio_group = new ilRadioGroupInputGUI($this->lng->txt('systemcheck_cron'), 'cronjob' );
305  $radio_group->setValue( $ilSetting->get('systemcheck_cron') );
306 
307  $radio_opt = new ilRadioOption($this->lng->txt('disabled'),0);
308  $radio_group->addOption($radio_opt);
309 
310  $radio_opt = new ilRadioOption($this->lng->txt('enabled'),1);
311  $radio_group->addOption($radio_opt);
312 
313  $cron_form->addItem($radio_group);
314 
315  $cron_form->addCommandButton('saveCheckCron',$this->lng->txt('save'));
316 
317  $this->tpl->setVariable('CRON_FORM',$cron_form->getHTML());
318  }
319  }
320 
321  private function saveCheckParamsObject()
322  {
323  $this->writeCheckParams();
324  unset($_POST['mode']);
325  return $this->checkObject();
326  }
327 
328  private function writeCheckParams()
329  {
330  include_once "./Services/Repository/classes/class.ilValidator.php";
331  $validator = new ilValidator();
332  $modes = $validator->getPossibleModes();
333 
334  $prefs = array();
335  foreach($modes as $mode)
336  {
337  if( isset($_POST['mode'][$mode]) ) $value = (int)$_POST['mode'][$mode];
338  else $value = 0;
339  $prefs[ 'systemcheck_mode_'.$mode ] = $value;
340  }
341 
342  if( isset($_POST['log_scan']) ) $value = (int)$_POST['log_scan'];
343  else $value = 0;
344  $prefs['systemcheck_log_scan'] = $value;
345 
346  global $ilUser;
347  foreach($prefs as $key => $val)
348  {
349  $ilUser->writePref($key,$val);
350  }
351  }
352 
353  private function saveCheckCronObject()
354  {
355  global $ilSetting;
356 
357  $systemcheck_cron = ($_POST['cronjob'] ? 1 : 0);
358  $ilSetting->set('systemcheck_cron',$systemcheck_cron);
359 
360  unset($_POST['mode']);
361  return $this->checkObject();
362  }
363 
370  {
371  global $rbacsystem, $styleDefinition;
372 
373  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.header_title_edit.html",
374  "Modules/SystemFolder");
375 
376  $array_push = true;
377 
378  if ($_SESSION["error_post_vars"])
379  {
380  $_SESSION["translation_post"] = $_SESSION["error_post_vars"];
381  $_GET["mode"] = "session";
382  $array_push = false;
383  }
384 
385  // load from db if edit category is called the first time
386  if (($_GET["mode"] != "session"))
387  {
388  $data = $this->object->getHeaderTitleTranslations();
389  $_SESSION["translation_post"] = $data;
390  $array_push = false;
391  } // remove a translation from session
392  elseif ($_GET["entry"] != 0)
393  {
394  array_splice($_SESSION["translation_post"]["Fobject"],$_GET["entry"],1,array());
395 
396  if ($_GET["entry"] == $_SESSION["translation_post"]["default_language"])
397  {
398  $_SESSION["translation_post"]["default_language"] = "";
399  }
400  }
401 
402  $data = $_SESSION["translation_post"];
403 
404  // add additional translation form
405  if (!$_GET["entry"] and $array_push)
406  {
407  $count = array_push($data["Fobject"],array("title" => "","desc" => ""));
408  }
409  else
410  {
411  $count = count($data["Fobject"]);
412  }
413 
414  // stripslashes in form?
415  $strip = isset($_SESSION["translation_post"]) ? true : false;
416 
417  foreach ($data["Fobject"] as $key => $val)
418  {
419  // add translation button
420  if ($key == $count -1)
421  {
422  $this->tpl->setCurrentBlock("addTranslation");
423  $this->tpl->setVariable("TXT_ADD_TRANSLATION",$this->lng->txt("add_translation")." >>");
424  $this->tpl->parseCurrentBlock();
425  }
426 
427  // remove translation button
428  if ($key != 0)
429  {
430  $this->tpl->setCurrentBlock("removeTranslation");
431  $this->tpl->setVariable("TXT_REMOVE_TRANSLATION",$this->lng->txt("remove_translation"));
432  $this->ctrl->setParameter($this, "entry", $key);
433  $this->ctrl->setParameter($this, "mode", "edit");
434  $this->tpl->setVariable("LINK_REMOVE_TRANSLATION",
435  $this->ctrl->getLinkTarget($this, "removeTranslation"));
436  $this->tpl->parseCurrentBlock();
437  }
438 
439  // lang selection
440  $this->tpl->addBlockFile("SEL_LANGUAGE", "sel_language", "tpl.lang_selection.html",
441  "Services/MetaData");
442  $this->tpl->setVariable("SEL_NAME", "Fobject[".$key."][lang]");
443 
444  include_once('Services/MetaData/classes/class.ilMDLanguageItem.php');
445 
447 
448  foreach ($languages as $code => $language)
449  {
450  $this->tpl->setCurrentBlock("lg_option");
451  $this->tpl->setVariable("VAL_LG", $code);
452  $this->tpl->setVariable("TXT_LG", $language);
453 
454  if ($code == $val["lang"])
455  {
456  $this->tpl->setVariable("SELECTED", "selected=\"selected\"");
457  }
458 
459  $this->tpl->parseCurrentBlock();
460  }
461 
462  // object data
463  $this->tpl->setCurrentBlock("obj_form");
464 
465  if ($key == 0)
466  {
467  $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("change_header_title"));
468  }
469  else
470  {
471  $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("translation")." ".$key);
472  }
473 
474  if ($key == $data["default_language"])
475  {
476  $this->tpl->setVariable("CHECKED", "checked=\"checked\"");
477  }
478 
479  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
480  $this->tpl->setVariable("TXT_DESC", $this->lng->txt("desc"));
481  $this->tpl->setVariable("TXT_DEFAULT", $this->lng->txt("default"));
482  $this->tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language"));
483  $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($val["title"],$strip));
484  $this->tpl->setVariable("DESC", ilUtil::stripSlashes($val["desc"]));
485  $this->tpl->setVariable("NUM", $key);
486  $this->tpl->parseCurrentBlock();
487  }
488 
489  // global
490  $this->tpl->setCurrentBlock("adm_content");
491 
492  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
493  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
494  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
495  $this->tpl->setVariable("CMD_SUBMIT", "saveHeaderTitle");
496  $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
497  }
498 
503  {
504  $data = $_POST;
505 
506  // default language set?
507  if (!isset($data["default_language"]))
508  {
509  $this->ilias->raiseError($this->lng->txt("msg_no_default_language"),$this->ilias->error_obj->MESSAGE);
510  }
511 
512  // prepare array fro further checks
513  foreach ($data["Fobject"] as $key => $val)
514  {
515  $langs[$key] = $val["lang"];
516  }
517 
518  $langs = array_count_values($langs);
519 
520  // all languages set?
521  if (array_key_exists("",$langs))
522  {
523  $this->ilias->raiseError($this->lng->txt("msg_no_language_selected"),$this->ilias->error_obj->MESSAGE);
524  }
525 
526  // no single language is selected more than once?
527  if (array_sum($langs) > count($langs))
528  {
529  $this->ilias->raiseError($this->lng->txt("msg_multi_language_selected"),$this->ilias->error_obj->MESSAGE);
530  }
531 
532  // copy default translation to variable for object data entry
533  $_POST["Fobject"]["title"] = $_POST["Fobject"][$_POST["default_language"]]["title"];
534  $_POST["Fobject"]["desc"] = $_POST["Fobject"][$_POST["default_language"]]["desc"];
535 
536  // first delete all translation entries...
537  $this->object->removeHeaderTitleTranslations();
538 
539  // ...and write new translations to object_translation
540  foreach ($data["Fobject"] as $key => $val)
541  {
542  if ($key == $data["default_language"])
543  {
544  $default = 1;
545  }
546  else
547  {
548  $default = 0;
549  }
550 
551  $this->object->addHeaderTitleTranslation(ilUtil::stripSlashes($val["title"]),ilUtil::stripSlashes($val["desc"]),$val["lang"],$default);
552  }
553 
554  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
555 
556  $this->ctrl->redirect($this);
557  }
558 
559  function cancelObject()
560  {
561  $this->ctrl->redirect($this, "view");
562  }
563 
570  {
571  $_SESSION["translation_post"] = $_POST;
572 
573  $this->ctrl->setParameter($this, "mode", "session");
574  $this->ctrl->setParameter($this, "entry", "0");
575  $this->ctrl->redirect($this, "changeHeaderTitle");
576  }
577 
584  {
585  $this->ctrl->setParameter($this, "entry", $_GET["entry"]);
586  $this->ctrl->setParameter($this, "mode", "session");
587  $this->ctrl->redirect($this, "changeHeaderTitle");
588  }
589 
590 
591  function startValidator($a_mode,$a_log)
592  {
593  global $rbacsystem;
594 
595  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
596  {
597  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
598  }
599 
600  $logging = ($a_log) ? true : false;
601  include_once "./Services/Repository/classes/class.ilValidator.php";
602  $validator = new ilValidator($logging);
603  $validator->setMode("all",false);
604 
605  $modes = array();
606  foreach ($a_mode as $mode => $value)
607  {
608  $validator->setMode($mode,(bool) $value);
609  $modes[] = $mode.'='.$value;
610  }
611 
612  $scan_log = $validator->validate();
613 
614  $mode = $this->lng->txt("scan_modes").": ".implode(', ',$modes);
615 
616  // output
617  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.adm_scan.html",
618  "Modules/SystemFolder");
619 
620  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
621  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scanning_system"));
622  $this->tpl->setVariable("COLSPAN", 3);
623  $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
624  $this->tpl->setVariable("TXT_MODE", $mode);
625 
626  if ($logging === true)
627  {
628  $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_log"));
629  }
630 
631  $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
632 
633  $validator->writeScanLogLine($mode);
634  }
635 
636  function viewScanLog()
637  {
638  include_once "./Services/Repository/classes/class.ilValidator.php";
639  $validator = new IlValidator();
640  $scan_log =& $validator->readScanLog();
641 
642  if (is_array($scan_log))
643  {
644  $scan_log = '<pre>'.implode("",$scan_log).'</pre>';
645  $this->tpl->setVariable("ADM_CONTENT", $scan_log);
646  }
647  else
648  {
649  $scan_log = "no scanlog found.";
650  }
651 
652  // output
653  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.adm_scan.html",
654  "Modules/SystemFolder");
655  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scan_details"));
656  $this->tpl->setVariable("COLSPAN", 3);
657  $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
658  $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
659  }
660 
661 
665  function benchmarkObject()
666  {
667  global $ilBench, $rbacsystem, $lng, $ilCtrl, $ilSetting, $tpl;
668 
669  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
670  {
671  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
672  }
673 
674  $this->benchmarkSubTabs("settings");
675 
676  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
677  $this->form = new ilPropertyFormGUI();
678 
679  // Activate DB Benchmark
680  $cb = new ilCheckboxInputGUI($lng->txt("adm_activate_db_benchmark"), "enable_db_bench");
681  $cb->setChecked($ilSetting->get("enable_db_bench"));
682  $cb->setInfo($lng->txt("adm_activate_db_benchmark_desc"));
683  $this->form->addItem($cb);
684 
685  // DB Benchmark User
686  $ti = new ilTextInputGUI($lng->txt("adm_db_benchmark_user"), "db_bench_user");
687  $ti->setValue($ilSetting->get("db_bench_user"));
688  $ti->setInfo($lng->txt("adm_db_benchmark_user_desc"));
689  $this->form->addItem($ti);
690 
691  $this->form->addCommandButton("saveBenchSettings", $lng->txt("save"));
692 
693  $this->form->setTitle($lng->txt("adm_db_benchmark"));
694  $this->form->setFormAction($ilCtrl->getFormAction($this));
695 
696  $tpl->setContent($this->form->getHTML());
697  }
698 
703  {
704  $this->benchmarkSubTabs("chronological");
705  $this->showDbBenchResults("chronological");
706  }
707 
712  {
713  $this->benchmarkSubTabs("slowest_first");
714  $this->showDbBenchResults("slowest_first");
715  }
716 
721  {
722  $this->benchmarkSubTabs("sorted_by_sql");
723  $this->showDbBenchResults("sorted_by_sql");
724  }
725 
730  {
731  $this->benchmarkSubTabs("by_first_table");
732  $this->showDbBenchResults("by_first_table");
733  }
734 
740  function showDbBenchResults($a_mode)
741  {
742  global $ilBench, $lng, $tpl;
743 
744  $rec = $ilBench->getDbBenchRecords();
745 
746  include_once("./Modules/SystemFolder/classes/class.ilBenchmarkTableGUI.php");
747  $table = new ilBenchmarkTableGUI($this, "benchmark", $rec, $a_mode);
748  $tpl->setContent($table->getHTML());
749  }
750 
757  function benchmarkSubTabs($a_current)
758  {
759  global $ilTabs, $lng, $ilCtrl, $ilBench;
760 
761  $ilTabs->activateTab("benchmarks"); // #18083
762 
763  $ilTabs->addSubtab("settings",
764  $lng->txt("settings"),
765  $ilCtrl->getLinkTarget($this, "benchmark"));
766 
767  $rec = $ilBench->getDbBenchRecords();
768  if (count($rec) > 0)
769  {
770  $ilTabs->addSubtab("chronological",
771  $lng->txt("adm_db_bench_chronological"),
772  $ilCtrl->getLinkTarget($this, "showDbBenchChronological"));
773  $ilTabs->addSubtab("slowest_first",
774  $lng->txt("adm_db_bench_slowest_first"),
775  $ilCtrl->getLinkTarget($this, "showDbBenchSlowestFirst"));
776  $ilTabs->addSubtab("sorted_by_sql",
777  $lng->txt("adm_db_bench_sorted_by_sql"),
778  $ilCtrl->getLinkTarget($this, "showDbBenchSortedBySql"));
779  $ilTabs->addSubtab("by_first_table",
780  $lng->txt("adm_db_bench_by_first_table"),
781  $ilCtrl->getLinkTarget($this, "showDbBenchByFirstTable"));
782  }
783 
784  $ilTabs->activateSubTab($a_current);
785  }
786 
787 
792  {
793  global $ilBench;
794 
795  if ($_POST["enable_db_bench"])
796  {
797  $ilBench->enableDbBench(true, ilUtil::stripSlashes($_POST["db_bench_user"]));
798  }
799  else
800  {
801  $ilBench->enableDbBench(false);
802  }
803 
804  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
805 
806  $this->ctrl->redirect($this, "benchmark");
807  }
808 
809 
814  {
815  global $ilBench;
816 
817  $this->ctrl->setParameter($this,'cur_mod',$_POST['module']);
818  $this->ctrl->redirect($this, "benchmark");
819  }
820 
821 
825  function clearBenchObject()
826  {
827  global $ilBench;
828 
829  $ilBench->clearData();
830  $this->saveBenchSettingsObject();
831 
832  }
833 
834  // get tabs
835  function getAdminTabs()
836  {
837  global $rbacsystem, $ilHelp;
838 
839 // $ilHelp->setScreenIdComponent($this->object->getType());
840 
841  $this->ctrl->setParameter($this,"ref_id",$this->object->getRefId());
842 
843  // general settings
844  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
845  {
846  $this->tabs_gui->addTarget("general_settings",
847  $this->ctrl->getLinkTarget($this, "showBasicSettings"),
848  array("showBasicSettings", "saveBasicSettings"), get_class($this));
849  }
850 
851  // server info
852  if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
853  {
854  $this->tabs_gui->addTarget("server",
855  $this->ctrl->getLinkTarget($this, "showServerInfo"),
856  array("showServerInfo", "view"), get_class($this));
857  }
858 
859  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
860  {
861  $this->tabs_gui->addTarget("cron_jobs",
862  $this->ctrl->getLinkTargetByClass("ilCronManagerGUI", ""), "", get_class($this));
863 
864 // $tabs_gui->addTarget("system_check",
865 // $this->ctrl->getLinkTarget($this, "check"), array("check","viewScanLog","saveCheckParams","saveCheckCron"), get_class($this));
866 
867  $this->tabs_gui->addTarget("benchmarks",
868  $this->ctrl->getLinkTarget($this, "benchmark"), "benchmark", get_class($this));
869  }
870 
871  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
872  {
873  $this->tabs_gui->addTarget("perm_settings",
874  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
875  }
876  }
877 
881  function showPHPInfoObject()
882  {
883  phpinfo();
884  exit;
885  }
886 
887  //
888  //
889  // Server Info
890  //
891  //
892 
896  function setServerInfoSubTabs($a_activate)
897  {
898  global $ilTabs, $ilCtrl, $rbacsystem;
899 
900  $ilTabs->addSubTabTarget("server_data", $ilCtrl->getLinkTarget($this, "showServerInfo"));
901 
902  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
903  {
904  $ilTabs->addSubTabTarget("adm_https", $ilCtrl->getLinkTarget($this, "showHTTPS"));
905  $ilTabs->addSubTabTarget("proxy", $ilCtrl->getLinkTarget($this, "showProxy"));
906  $ilTabs->addSubTabTarget("java_server", $ilCtrl->getLinkTarget($this, "showJavaServer"));
907  $ilTabs->addSubTabTarget("webservices", $ilCtrl->getLinkTarget($this, "showWebServices"));
908  }
909 
910  $ilTabs->setSubTabActive($a_activate);
911  $ilTabs->setTabActive("server");
912  }
913 
917  function showServerInfoObject()
918  {
925  global $tpl, $ilCtrl, $ilToolbar, $lng;
926 
927  require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
928  $button = ilLinkButton::getInstance();
929  $button->setCaption('vc_information');
930  $button->setUrl($this->ctrl->getLinkTarget($this, 'showVcsInformation'));
931  $ilToolbar->addButtonInstance($button);
932 
933  $this->initServerInfoForm();
934  $this->setServerInfoSubTabs("server_data");
935 
936  $btpl = new ilTemplate("tpl.server_data.html", true, true, "Modules/SystemFolder");
937  $btpl->setVariable("FORM", $this->form->getHTML());
938  $btpl->setVariable("PHP_INFO_TARGET", $ilCtrl->getLinkTarget($this, "showPHPInfo"));
939  $tpl->setContent($btpl->get());
940  }
941 
947  public function initServerInfoForm()
948  {
949  global $lng, $ilClientIniFile, $ilSetting;
950 
951  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
952  $this->form = new ilPropertyFormGUI();
953 
954  // installation name
955  $ne = new ilNonEditableValueGUI($lng->txt("inst_name"), "");
956  $ne->setValue($ilClientIniFile->readVariable("client","name"));
957  $ne->setInfo($ilClientIniFile->readVariable("client","description"));
958  $this->form->addItem($ne);
959 
960  // client id
961  $ne = new ilNonEditableValueGUI($lng->txt("client_id"), "");
962  $ne->setValue(CLIENT_ID);
963  $this->form->addItem($ne);
964 
965  // installation id
966  $ne = new ilNonEditableValueGUI($lng->txt("inst_id"), "");
967  $ne->setValue($ilSetting->get("inst_id"));
968  $this->form->addItem($ne);
969 
970  // database version
971  $ne = new ilNonEditableValueGUI($lng->txt("db_version"), "");
972  $ne->setValue($ilSetting->get("db_version"));
973 
974  include_once ("./Services/Database/classes/class.ilDBUpdate.php");
975  $this->form->addItem($ne);
976 
977  // ilias version
978  $ne = new ilNonEditableValueGUI($lng->txt("ilias_version"), "");
979  $ne->setValue($ilSetting->get("ilias_version"));
980  $this->form->addItem($ne);
981 
982  // host
983  $ne = new ilNonEditableValueGUI($lng->txt("host"), "");
984  $ne->setValue($_SERVER["SERVER_NAME"]);
985  $this->form->addItem($ne);
986 
987  // ip & port
988  $ne = new ilNonEditableValueGUI($lng->txt("ip_address")." & ".$this->lng->txt("port"), "");
989  $ne->setValue($_SERVER["SERVER_ADDR"].":".$_SERVER["SERVER_PORT"]);
990  $this->form->addItem($ne);
991 
992  // server
993  $ne = new ilNonEditableValueGUI($lng->txt("server_software"), "");
994  $ne->setValue($_SERVER["SERVER_SOFTWARE"]);
995  $this->form->addItem($ne);
996 
997  // http path
998  $ne = new ilNonEditableValueGUI($lng->txt("http_path"), "");
999  $ne->setValue(ILIAS_HTTP_PATH);
1000  $this->form->addItem($ne);
1001 
1002  // absolute path
1003  $ne = new ilNonEditableValueGUI($lng->txt("absolute_path"), "");
1004  $ne->setValue(ILIAS_ABSOLUTE_PATH);
1005  $this->form->addItem($ne);
1006 
1007  $not_set = $lng->txt("path_not_set");
1008 
1009  // convert
1010  $ne = new ilNonEditableValueGUI($lng->txt("path_to_convert"), "");
1011  $ne->setValue((PATH_TO_CONVERT) ? PATH_TO_CONVERT : $not_set);
1012  $this->form->addItem($ne);
1013 
1014  // zip
1015  $ne = new ilNonEditableValueGUI($lng->txt("path_to_zip"), "");
1016  $ne->setValue((PATH_TO_ZIP) ? PATH_TO_ZIP : $not_set);
1017  $this->form->addItem($ne);
1018 
1019  // unzip
1020  $ne = new ilNonEditableValueGUI($lng->txt("path_to_unzip"), "");
1021  $ne->setValue((PATH_TO_UNZIP) ? PATH_TO_UNZIP : $not_set);
1022  $this->form->addItem($ne);
1023 
1024  // java
1025  $ne = new ilNonEditableValueGUI($lng->txt("path_to_java"), "");
1026  $ne->setValue((PATH_TO_JAVA) ? PATH_TO_JAVA : $not_set);
1027  $this->form->addItem($ne);
1028 
1029  // mkisofs
1030  $ne = new ilNonEditableValueGUI($lng->txt("path_to_mkisofs"), "");
1031  $ne->setValue((PATH_TO_MKISOFS) ? PATH_TO_MKISOFS : $not_set);
1032  $this->form->addItem($ne);
1033 
1034  // latex
1035  $ne = new ilNonEditableValueGUI($lng->txt("url_to_latex"), "");
1036  $ne->setValue((URL_TO_LATEX) ? URL_TO_LATEX : $not_set);
1037  $this->form->addItem($ne);
1038 
1039 
1040  $this->form->setTitle($lng->txt("server_data"));
1041  $this->form->setFormAction($this->ctrl->getFormAction($this));
1042 
1043  }
1044 
1045  //
1046  //
1047  // General Settings
1048  //
1049  //
1050 
1054  function setGeneralSettingsSubTabs($a_activate)
1055  {
1056  global $ilTabs, $ilCtrl;
1057 
1058  $ilTabs->addSubTabTarget("basic_settings", $ilCtrl->getLinkTarget($this, "showBasicSettings"));
1059  $ilTabs->addSubTabTarget("header_title", $ilCtrl->getLinkTarget($this, "showHeaderTitle"));
1060  $ilTabs->addSubTabTarget("contact_data", $ilCtrl->getLinkTarget($this, "showContactInformation"));
1061  $ilTabs->addSubTabTarget("adm_imprint", $ilCtrl->getLinkTargetByClass("ilimprintgui", "preview"));
1062 
1063  $ilTabs->setSubTabActive($a_activate);
1064  $ilTabs->setTabActive("general_settings");
1065  }
1066 
1067  //
1068  //
1069  // Basic Settings
1070  //
1071  //
1072 
1077  {
1078  global $tpl;
1079 
1080  $this->initBasicSettingsForm();
1081  $this->setGeneralSettingsSubTabs("basic_settings");
1082 
1083  $tpl->setContent($this->form->getHTML());
1084  }
1085 
1086 
1090  public function initBasicSettingsForm()
1091  {
1096  global $lng, $ilSetting;
1097 
1098  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1099  $this->form = new ilPropertyFormGUI();
1100  $lng->loadLanguageModule("pd");
1101 
1102  // installation short title
1103  $ti = new ilTextInputGUI($this->lng->txt("short_inst_name"), "short_inst_name");
1104  $ti->setMaxLength(200);
1105  $ti->setSize(40);
1106  $ti->setValue($ilSetting->get("short_inst_name"));
1107  $ti->setInfo($this->lng->txt("short_inst_name_info"));
1108  $this->form->addItem($ti);
1109 
1110  // public section
1111  $cb = new ilCheckboxInputGUI($this->lng->txt("pub_section"), "pub_section");
1112  $cb->setInfo($lng->txt("pub_section_info"));
1113  if ($ilSetting->get("pub_section"))
1114  {
1115  $cb->setChecked(true);
1116  }
1117  $this->form->addItem($cb);
1118 
1119  // Enable Global Profiles
1120  $cb_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_user_publish'), 'enable_global_profiles');
1121  $cb_prop->setInfo($lng->txt('pd_enable_user_publish_info'));
1122  $cb_prop->setChecked($ilSetting->get('enable_global_profiles'));
1123  $cb->addSubItem($cb_prop);
1124 
1125  // search engine
1126  include_once('Services/PrivacySecurity/classes/class.ilRobotSettings.php');
1127  $robot_settings = ilRobotSettings::_getInstance();
1128  $cb2 = new ilCheckboxInputGUI($this->lng->txt("search_engine"), "open_google");
1129  $cb2->setInfo($this->lng->txt("enable_search_engine"));
1130  $this->form->addItem($cb2);
1131 
1132  if(!$robot_settings->checkRewrite())
1133  {
1134  $cb2->setAlert($lng->txt("allow_override_alert"));
1135  $cb2->setChecked(false);
1136  $cb2->setDisabled(true);
1137  }
1138  else
1139  {
1140  if ($ilSetting->get("open_google"))
1141  {
1142  $cb2->setChecked(true);
1143  }
1144  }
1145 
1146  // locale
1147  $ti = new ilTextInputGUI($this->lng->txt("adm_locale"), "locale");
1148  $ti->setMaxLength(80);
1149  $ti->setSize(40);
1150  $ti->setInfo($this->lng->txt("adm_locale_info"));
1151  $ti->setValue($ilSetting->get("locale"));
1152  $this->form->addItem($ti);
1153 
1154  // starting point
1155  include_once "Services/User/classes/class.ilUserUtil.php";
1156  $si = new ilRadioGroupInputGUI($this->lng->txt("adm_user_starting_point"), "usr_start");
1157  $si->setRequired(true);
1158  $si->setInfo($this->lng->txt("adm_user_starting_point_info"));
1160  foreach(ilUserUtil::getPossibleStartingPoints(true) as $value => $caption)
1161  {
1162  $opt = new ilRadioOption($caption, $value);
1163  $si->addOption($opt);
1164 
1165  if(!in_array($value, $valid))
1166  {
1167  $opt->setInfo($this->lng->txt("adm_user_starting_point_invalid_info"));
1168  }
1169  }
1170  $si->setValue(ilUserUtil::getStartingPoint());
1171  $this->form->addItem($si);
1172 
1173  // starting point: repository object
1174  $repobj = new ilRadioOption($lng->txt("adm_user_starting_point_object"), ilUserUtil::START_REPOSITORY_OBJ);
1175  $repobj_id = new ilTextInputGUI($lng->txt("adm_user_starting_point_ref_id"), "usr_start_ref_id");
1176  $repobj_id->setRequired(true);
1177  $repobj_id->setSize(5);
1178  if($si->getValue() == ilUserUtil::START_REPOSITORY_OBJ)
1179  {
1180  $start_ref_id = ilUserUtil::getStartingObject();
1181  $repobj_id->setValue($start_ref_id);
1182  if($start_ref_id)
1183  {
1184  $start_obj_id = ilObject::_lookupObjId($start_ref_id);
1185  if($start_obj_id)
1186  {
1187  $repobj_id->setInfo($lng->txt("obj_".ilObject::_lookupType($start_obj_id)).
1188  ": ".ilObject::_lookupTitle($start_obj_id));
1189  }
1190  }
1191  }
1192  $repobj->addSubItem($repobj_id);
1193  $si->addOption($repobj);
1194 
1195  // starting point: personal
1196  $startp = new ilCheckboxInputGUI($lng->txt("adm_user_starting_point_personal"), "usr_start_pers");
1197  $startp->setInfo($lng->txt("adm_user_starting_point_personal_info"));
1198  $startp->setChecked(ilUserUtil::hasPersonalStartingPoint());
1199  $si->addSubItem($startp);
1200 
1201 
1202  // save and cancel commands
1203  $this->form->addCommandButton("saveBasicSettings", $lng->txt("save"));
1204 
1205  $this->form->setTitle($lng->txt("basic_settings"));
1206  $this->form->setFormAction($this->ctrl->getFormAction($this));
1207 
1208  }
1209 
1214  public function saveBasicSettingsObject()
1215  {
1216  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
1217 
1218  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
1219  {
1220  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1221  }
1222 
1223  $this->initBasicSettingsForm();
1224  if ($this->form->checkInput())
1225  {
1226  $ilSetting->set("short_inst_name", $_POST["short_inst_name"]);
1227  $ilSetting->set("pub_section", $_POST["pub_section"]);
1228 
1229  $global_profiles = ($_POST["pub_section"])
1230  ? (int)$_POST['enable_global_profiles']
1231  : 0;
1232  $ilSetting->set('enable_global_profiles', $global_profiles);
1233 
1234  $ilSetting->set("open_google", $_POST["open_google"]);
1235  $ilSetting->set("locale", $_POST["locale"]);
1236 
1237  include_once "Services/User/classes/class.ilUserUtil.php";
1238  ilUserUtil::setStartingPoint($this->form->getInput('usr_start'), $this->form->getInput('usr_start_ref_id'));
1239  ilUserUtil::togglePersonalStartingPoint($this->form->getInput('usr_start_pers'));
1240 
1241  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1242  $ilCtrl->redirect($this, "showBasicSettings");
1243  }
1244  $this->setGeneralSettingsSubTabs("basic_settings");
1245  $this->form->setValuesByPost();
1246  $tpl->setContent($this->form->getHtml());
1247  }
1248 
1249  //
1250  //
1251  // Header title
1252  //
1253  //
1254 
1258  function showHeaderTitleObject($a_get_post_values = false)
1259  {
1260  global $tpl;
1261 
1262  $this->setGeneralSettingsSubTabs("header_title");
1263  include_once("./Services/Object/classes/class.ilObjectTranslationTableGUI.php");
1264  $table = new ilObjectTranslationTableGUI($this, "showHeaderTitle", false);
1265  if ($a_get_post_values)
1266  {
1267  $vals = array();
1268  foreach($_POST["title"] as $k => $v)
1269  {
1270  $vals[] = array("title" => $v,
1271  "desc" => $_POST["desc"][$k],
1272  "lang" => $_POST["lang"][$k],
1273  "default" => ($_POST["default"] == $k));
1274  }
1275  $table->setData($vals);
1276  }
1277  else
1278  {
1279  $data = $this->object->getHeaderTitleTranslations();
1280  if (is_array($data["Fobject"]))
1281  {
1282  foreach($data["Fobject"] as $k => $v)
1283  {
1284  if ($k == $data["default_language"])
1285  {
1286  $data["Fobject"][$k]["default"] = true;
1287  }
1288  else
1289  {
1290  $data["Fobject"][$k]["default"] = false;
1291  }
1292  }
1293  }
1294  else
1295  {
1296  $data["Fobject"] = array();
1297  }
1298  $table->setData($data["Fobject"]);
1299  }
1300  $tpl->setContent($table->getHTML());
1301  }
1302 
1307  {
1308  global $ilCtrl, $lng, $rbacsystem;
1309 
1310  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
1311  {
1312  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1313  }
1314 
1315 // var_dump($_POST);
1316 
1317  // default language set?
1318  if (!isset($_POST["default"]) && count($_POST["lang"]) > 0)
1319  {
1320  ilUtil::sendFailure($lng->txt("msg_no_default_language"));
1321  return $this->showHeaderTitleObject(true);
1322  }
1323 
1324  // all languages set?
1325  if (array_key_exists("",$_POST["lang"]))
1326  {
1327  ilUtil::sendFailure($lng->txt("msg_no_language_selected"));
1328  return $this->showHeaderTitleObject(true);
1329  }
1330 
1331  // no single language is selected more than once?
1332  if (count(array_unique($_POST["lang"])) < count($_POST["lang"]))
1333  {
1334  ilUtil::sendFailure($lng->txt("msg_multi_language_selected"));
1335  return $this->showHeaderTitleObject(true);
1336  }
1337 
1338  // save the stuff
1339  $this->object->removeHeaderTitleTranslations();
1340  foreach($_POST["title"] as $k => $v)
1341  {
1342  $this->object->addHeaderTitleTranslation(
1344  ilUtil::stripSlashes($_POST["desc"][$k]),
1345  ilUtil::stripSlashes($_POST["lang"][$k]),
1346  ($_POST["default"] == $k));
1347  }
1348 
1349  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1350  $ilCtrl->redirect($this, "showHeaderTitle");
1351  }
1352 
1357  {
1358  global $ilCtrl, $lng;
1359 
1360  if (is_array($_POST["title"]))
1361  {
1362  foreach($_POST["title"] as $k => $v) {}
1363  }
1364  $k++;
1365  $_POST["title"][$k] = "";
1366  $this->showHeaderTitleObject(true);
1367  }
1368 
1373  {
1374  global $ilCtrl, $lng;
1375 //var_dump($_POST);
1376  foreach($_POST["title"] as $k => $v)
1377  {
1378  if ($_POST["check"][$k])
1379  {
1380  unset($_POST["title"][$k]);
1381  unset($_POST["desc"][$k]);
1382  unset($_POST["lang"][$k]);
1383  if ($k == $_POST["default"])
1384  {
1385  unset($_POST["default"]);
1386  }
1387  }
1388  }
1389  $this->saveHeaderTitlesObject();
1390  }
1391 
1392 
1393  //
1394  //
1395  // Cron Jobs
1396  //
1397  //
1398 
1399  /*
1400  * OLD GLOBAL CRON JOB SWITCHES (ilSetting)
1401  *
1402  * cron_user_check => obsolete
1403  * cron_inactive_user_delete => obsolete
1404  * cron_inactivated_user_delete => obsolete
1405  * cron_link_check => obsolete
1406  * cron_web_resource_check => migrated
1407  * cron_lucene_index => obsolete
1408  * forum_notification => migrated
1409  * mail_notification => migrated
1410  * disk_quota/enabled => migrated
1411  * crsgrp_ntf => migrated
1412  * cron_upd_adrbook => migrated
1413  */
1414 
1416  {
1417  // #13010 - this is used for external settings
1418  $this->ctrl->redirectByClass("ilCronManagerGUI", "render");
1419  }
1420 
1421 
1422  //
1423  //
1424  // Contact Information
1425  //
1426  //
1427 
1432  {
1433  global $tpl;
1434 
1435  $this->initContactInformationForm();
1436  $this->setGeneralSettingsSubTabs("contact_data");
1437  $tpl->setContent($this->form->getHTML());
1438  }
1439 
1443  public function initContactInformationForm()
1444  {
1445  global $lng, $ilSetting;
1446 
1447  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1448  $this->form = new ilPropertyFormGUI();
1449 
1450  // first name
1451  $ti = new ilTextInputGUI($this->lng->txt("firstname"), "admin_firstname");
1452  $ti->setMaxLength(64);
1453  $ti->setSize(40);
1454  $ti->setRequired(true);
1455  $ti->setValue($ilSetting->get("admin_firstname"));
1456  $this->form->addItem($ti);
1457 
1458  // last name
1459  $ti = new ilTextInputGUI($this->lng->txt("lastname"), "admin_lastname");
1460  $ti->setMaxLength(64);
1461  $ti->setSize(40);
1462  $ti->setRequired(true);
1463  $ti->setValue($ilSetting->get("admin_lastname"));
1464  $this->form->addItem($ti);
1465 
1466  // title
1467  $ti = new ilTextInputGUI($this->lng->txt("title"), "admin_title");
1468  $ti->setMaxLength(64);
1469  $ti->setSize(40);
1470  $ti->setValue($ilSetting->get("admin_title"));
1471  $this->form->addItem($ti);
1472 
1473  // position
1474  $ti = new ilTextInputGUI($this->lng->txt("position"), "admin_position");
1475  $ti->setMaxLength(64);
1476  $ti->setSize(40);
1477  $ti->setValue($ilSetting->get("admin_position"));
1478  $this->form->addItem($ti);
1479 
1480  // institution
1481  $ti = new ilTextInputGUI($this->lng->txt("institution"), "admin_institution");
1482  $ti->setMaxLength(200);
1483  $ti->setSize(40);
1484  $ti->setValue($ilSetting->get("admin_institution"));
1485  $this->form->addItem($ti);
1486 
1487  // street
1488  $ti = new ilTextInputGUI($this->lng->txt("street"), "admin_street");
1489  $ti->setMaxLength(64);
1490  $ti->setSize(40);
1491  //$ti->setRequired(true);
1492  $ti->setValue($ilSetting->get("admin_street"));
1493  $this->form->addItem($ti);
1494 
1495  // zip code
1496  $ti = new ilTextInputGUI($this->lng->txt("zipcode"), "admin_zipcode");
1497  $ti->setMaxLength(10);
1498  $ti->setSize(5);
1499  //$ti->setRequired(true);
1500  $ti->setValue($ilSetting->get("admin_zipcode"));
1501  $this->form->addItem($ti);
1502 
1503  // city
1504  $ti = new ilTextInputGUI($this->lng->txt("city"), "admin_city");
1505  $ti->setMaxLength(64);
1506  $ti->setSize(40);
1507  //$ti->setRequired(true);
1508  $ti->setValue($ilSetting->get("admin_city"));
1509  $this->form->addItem($ti);
1510 
1511  // country
1512  $ti = new ilTextInputGUI($this->lng->txt("country"), "admin_country");
1513  $ti->setMaxLength(64);
1514  $ti->setSize(40);
1515  //$ti->setRequired(true);
1516  $ti->setValue($ilSetting->get("admin_country"));
1517  $this->form->addItem($ti);
1518 
1519  // phone
1520  $ti = new ilTextInputGUI($this->lng->txt("phone"), "admin_phone");
1521  $ti->setMaxLength(64);
1522  $ti->setSize(40);
1523  //$ti->setRequired(true);
1524  $ti->setValue($ilSetting->get("admin_phone"));
1525  $this->form->addItem($ti);
1526 
1527  // email
1528  $ti = new ilEmailInputGUI($this->lng->txt("email"), "admin_email");
1529  $ti->setMaxLength(64);
1530  $ti->setSize(40);
1531  $ti->setRequired(true);
1532  $ti->allowRFC822(true);
1533  $ti->setValue($ilSetting->get("admin_email"));
1534  $this->form->addItem($ti);
1535 
1536  // feedback recipient
1537  /* currently used in:
1538  - footer
1539  - terms of service: no document found message
1540  */
1541  /*$ti = new ilEmailInputGUI($this->lng->txt("feedback_recipient"), "feedback_recipient");
1542  $ti->setInfo(sprintf($this->lng->txt("feedback_recipient_info"), $this->lng->txt("contact_sysadmin")));
1543  $ti->setMaxLength(64);
1544  $ti->setSize(40);
1545  $ti->setRequired(true);
1546  $ti->allowRFC822(true);
1547  $ti->setValue($ilSetting->get("feedback_recipient"));
1548  $this->form->addItem($ti);*/
1549 
1550  // System support contacts
1551  include_once("./Modules/SystemFolder/classes/class.ilSystemSupportContacts.php");
1552  $ti = new ilTextInputGUI($this->lng->txt("adm_support_contacts"), "adm_support_contacts");
1553  $ti->setMaxLength(500);
1554  $ti->setValue(ilSystemSupportContacts::getList());
1555  //$ti->setSize();
1556  $ti->setInfo($this->lng->txt("adm_support_contacts_info"));
1557  $this->form->addItem($ti);
1558 
1559 
1560  // error recipient
1561  /*$ti = new ilEmailInputGUI($this->lng->txt("error_recipient"), "error_recipient");
1562  $ti->setMaxLength(64);
1563  $ti->setSize(40);
1564  $ti->allowRFC822(true);
1565  $ti->setValue($ilSetting->get("error_recipient"));
1566  $this->form->addItem($ti);*/
1567 
1568  $this->form->addCommandButton("saveContactInformation", $lng->txt("save"));
1569 
1570  $this->form->setTitle($lng->txt("contact_data"));
1571  $this->form->setFormAction($this->ctrl->getFormAction($this));
1572 
1573  }
1574 
1580  {
1581  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
1582 
1583  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
1584  {
1585  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1586  }
1587 
1588  $this->initContactInformationForm();
1589  if ($this->form->checkInput())
1590  {
1591  $fs = array("admin_firstname", "admin_lastname", "admin_title", "admin_position",
1592  "admin_institution", "admin_street", "admin_zipcode", "admin_city",
1593  "admin_country", "admin_phone", "admin_email");
1594  foreach ($fs as $f)
1595  {
1596  $ilSetting->set($f, $_POST[$f]);
1597  }
1598 
1599  include_once("./Modules/SystemFolder/classes/class.ilSystemSupportContacts.php");
1600  ilSystemSupportContacts::setList($_POST["adm_support_contacts"]);
1601 
1602  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1603  $ilCtrl->redirect($this, "showContactInformation");
1604  }
1605  else
1606  {
1607  $this->setGeneralSettingsSubTabs("contact_data");
1608  $this->form->setValuesByPost();
1609  $tpl->setContent($this->form->getHtml());
1610  }
1611  }
1612 
1613  //
1614  //
1615  // Web Services
1616  //
1617  //
1618 
1623  {
1624  global $tpl;
1625 
1626  $this->initWebServicesForm();
1627  $this->setServerInfoSubTabs("webservices");
1628  $tpl->setContent($this->form->getHTML());
1629  }
1630 
1634  public function initWebServicesForm()
1635  {
1636  global $lng, $ilSetting;
1637 
1638  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1639  $this->form = new ilPropertyFormGUI();
1640 
1641  // soap administration
1642  $cb = new ilCheckboxInputGUI($this->lng->txt("soap_user_administration"), "soap_user_administration");
1643  $cb->setInfo($this->lng->txt("soap_user_administration_desc"));
1644  if ($ilSetting->get("soap_user_administration"))
1645  {
1646  $cb->setChecked(true);
1647  }
1648  $this->form->addItem($cb);
1649 
1650  // wsdl path
1651  $wsdl = new ilTextInputGUI($this->lng->txt('soap_wsdl_path'), 'soap_wsdl_path');
1652  $wsdl->setInfo(sprintf($this->lng->txt('soap_wsdl_path_info'), "<br />'".ILIAS_HTTP_PATH."/webservice/soap/server.php?wsdl'"));
1653  $wsdl->setValue((string)$ilSetting->get('soap_wsdl_path'));
1654  $wsdl->setSize(60);
1655  $wsdl->setMaxLength(255);
1656  $this->form->addItem($wsdl);
1657 
1658  // response timeout
1659  $ctime = new ilNumberInputGUI($this->lng->txt('soap_connect_timeout'), 'ctimeout');
1660  $ctime->setMinValue(1);
1661  $ctime->setSize(2);
1662  $ctime->setMaxLength(3);
1663  include_once './Services/WebServices/SOAP/classes/class.ilSoapClient.php';
1664  $ctime->setValue((int) $ilSetting->get('soap_connect_timeout', ilSoapClient::DEFAULT_CONNECT_TIMEOUT));
1665  $ctime->setInfo($this->lng->txt('soap_connect_timeout_info'));
1666  $this->form->addItem($ctime);
1667 
1668  $this->form->addCommandButton("saveWebServices", $lng->txt("save"));
1669 
1670  $this->form->setTitle($lng->txt("webservices"));
1671  $this->form->setFormAction($this->ctrl->getFormAction($this));
1672 
1673  }
1674 
1679  public function saveWebServicesObject()
1680  {
1681  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
1682 
1683  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
1684  {
1685  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1686  }
1687 
1688  $this->initWebServicesForm();
1689  if ($this->form->checkInput())
1690  {
1691  $ilSetting->set('soap_user_administration', $this->form->getInput('soap_user_administration'));
1692  $ilSetting->set('soap_wsdl_path', trim($this->form->getInput('soap_wsdl_path')));
1693  $ilSetting->set('soap_connect_timeout',$this->form->getInput('ctimeout'));
1694 
1695  ilUtil::sendSuccess($lng->txt('msg_obj_modified'), true);
1696  $ilCtrl->redirect($this, 'showWebServices');
1697  }
1698  else
1699  {
1700  $this->setGeneralSettingsSubTabs("webservices");
1701  $this->form->setValuesByPost();
1702  $tpl->setContent($this->form->getHtml());
1703  }
1704  }
1705 
1706  //
1707  //
1708  // Java Server
1709  //
1710  //
1711 
1716  {
1717  global $tpl;
1718 
1719  $tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.java_settings.html','Modules/SystemFolder');
1720 
1721  $GLOBALS['lng']->loadLanguageModule('search');
1722 
1723  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1724  $toolbar = new ilToolbarGUI();
1725  $toolbar->addButton($this->lng->txt('lucene_create_ini'),
1726  $this->ctrl->getLinkTarget($this,'createJavaServerIni'));
1727  $tpl->setVariable('ACTION_BUTTONS',$toolbar->getHTML());
1728 
1729  $this->initJavaServerForm();
1730  $this->setServerInfoSubTabs("java_server");
1731  $tpl->setVariable('SETTINGS_TABLE',$this->form->getHTML());
1732  }
1733 
1738  public function createJavaServerIniObject()
1739  {
1740  $this->setGeneralSettingsSubTabs('java_server');
1741  $this->initJavaServerIniForm();
1742  $this->tpl->setContent($this->form->getHTML());
1743  }
1744 
1745  protected function initJavaServerIniForm()
1746  {
1747  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
1748 
1749  $this->form = new ilPropertyFormGUI();
1750 
1751  $GLOBALS['lng']->loadLanguageModule('search');
1752 
1753  $this->form->setTitle($this->lng->txt('lucene_tbl_create_ini'));
1754  $this->form->setFormAction($this->ctrl->getFormAction($this,'createJavaServerIni'));
1755  $this->form->addCommandButton('downloadJavaServerIni',$this->lng->txt('lucene_download_ini'));
1756  $this->form->addCommandButton('showJavaServer', $this->lng->txt('cancel'));
1757 
1758  // Host
1759  $ip = new ilTextInputGUI($this->lng->txt('lucene_host'),'ho');
1760  $ip->setInfo($this->lng->txt('lucene_host_info'));
1761  $ip->setMaxLength(128);
1762  $ip->setSize(32);
1763  $ip->setRequired(true);
1764  $this->form->addItem($ip);
1765 
1766  // Port
1767  $port = new ilNumberInputGUI($this->lng->txt('lucene_port'),'po');
1768  $port->setSize(5);
1769  $port->setMinValue(1);
1770  $port->setMaxValue(65535);
1771  $port->setRequired(true);
1772  $this->form->addItem($port);
1773 
1774  // Index Path
1775  $path = new ilTextInputGUI($this->lng->txt('lucene_index_path'),'in');
1776  $path->setSize(80);
1777  $path->setMaxLength(1024);
1778  $path->setInfo($this->lng->txt('lucene_index_path_info'));
1779  $path->setRequired(true);
1780  $this->form->addItem($path);
1781 
1782  // Logging
1783  $log = new ilTextInputGUI($this->lng->txt('lucene_log'),'lo');
1784  $log->setSize(80);
1785  $log->setMaxLength(1024);
1786  $log->setInfo($this->lng->txt('lucene_log_info'));
1787  $log->setRequired(true);
1788  $this->form->addItem($log);
1789 
1790  // Level
1791  $lev = new ilSelectInputGUI($this->lng->txt('lucene_level'),'le');
1792  $lev->setOptions(array(
1793  'DEBUG' => 'DEBUG',
1794  'INFO' => 'INFO',
1795  'WARN' => 'WARN',
1796  'ERROR' => 'ERROR',
1797  'FATAL' => 'FATAL'));
1798  $lev->setValue('INFO');
1799  $lev->setRequired(true);
1800  $this->form->addItem($lev);
1801 
1802  // CPU
1803  $cpu = new ilNumberInputGUI($this->lng->txt('lucene_cpu'),'cp');
1804  $cpu->setValue(1);
1805  $cpu->setSize(1);
1806  $cpu->setMaxLength(2);
1807  $cpu->setMinValue(1);
1808  $cpu->setRequired(true);
1809  $this->form->addItem($cpu);
1810 
1811  // Max file size
1812  $fs = new ilNumberInputGUI($this->lng->txt('lucene_max_fs'), 'fs');
1813  $fs->setInfo($this->lng->txt('lucene_max_fs_info'));
1814  $fs->setValue(500);
1815  $fs->setSize(4);
1816  $fs->setMaxLength(4);
1817  $fs->setMinValue(1);
1818  $fs->setRequired(true);
1819  $this->form->addItem($fs);
1820 
1821  return true;
1822  }
1823 
1828  protected function downloadJavaServerIniObject()
1829  {
1830  $this->initJavaServerIniForm();
1831  if($this->form->checkInput())
1832  {
1833  include_once './Services/WebServices/RPC/classes/class.ilRpcIniFileWriter.php';
1834  $ini = new ilRpcIniFileWriter();
1835  $ini->setHost($this->form->getInput('ho'));
1836  $ini->setPort($this->form->getInput('po'));
1837  $ini->setIndexPath($this->form->getInput('in'));
1838  $ini->setLogPath($this->form->getInput('lo'));
1839  $ini->setLogLevel($this->form->getInput('le'));
1840  $ini->setNumThreads($this->form->getInput('cp'));
1841  $ini->setMaxFileSize($this->form->getInput('fs'));
1842 
1843  $ini->write();
1844  ilUtil::deliverData($ini->getIniString(),'ilServer.ini','text/plain','utf-8');
1845  return true;
1846  }
1847 
1848  $this->form->setValuesByPost();
1849  ilUtil::sendFailure($this->lng->txt('err_check_input'));
1850  $this->setGeneralSettingsSubTabs('java_server');
1851  $this->tpl->setContent($this->form->getHTML());
1852  return true;
1853  }
1854 
1858  public function initJavaServerForm()
1859  {
1860  global $lng, $ilSetting;
1861 
1862  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1863  $this->form = new ilPropertyFormGUI();
1864 
1865  // host
1866  $ti = new ilTextInputGUI($this->lng->txt("java_server_host"), "rpc_server_host");
1867  $ti->setMaxLength(64);
1868  $ti->setSize(32);
1869  $ti->setValue($ilSetting->get("rpc_server_host"));
1870  $this->form->addItem($ti);
1871 
1872  // port
1873  $ti = new ilNumberInputGUI($this->lng->txt("java_server_port"), "rpc_server_port");
1874  $ti->setMaxLength(5);
1875  $ti->setSize(5);
1876  $ti->setValue($ilSetting->get("rpc_server_port"));
1877  $this->form->addItem($ti);
1878 
1879  // pdf fonts
1880  $pdf = new ilFormSectionHeaderGUI();
1881  $pdf->setTitle($this->lng->txt('rpc_pdf_generation'));
1882  $this->form->addItem($pdf);
1883 
1884  $pdf_font = new ilTextInputGUI($this->lng->txt('rpc_pdf_font'), 'rpc_pdf_font');
1885  $pdf_font->setInfo($this->lng->txt('rpc_pdf_font_info'));
1886  $pdf_font->setSize(64);
1887  $pdf_font->setMaxLength(1024);
1888  $pdf_font->setRequired(true);
1889  $pdf_font->setValue(
1890  $ilSetting->get('rpc_pdf_font','Helvetica, unifont'));
1891  $this->form->addItem($pdf_font);
1892 
1893 
1894  // save and cancel commands
1895  $this->form->addCommandButton("saveJavaServer", $lng->txt("save"));
1896 
1897  $this->form->setTitle($lng->txt("java_server"));
1898  $this->form->setDescription($lng->txt("java_server_info").
1899  '<br /><a href="Services/WebServices/RPC/lib/README.txt" target="_blank">'.
1900  $lng->txt("java_server_readme").'</a>');
1901  $this->form->setFormAction($this->ctrl->getFormAction($this));
1902 
1903  }
1904 
1909  public function saveJavaServerObject()
1910  {
1911  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
1912 
1913  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
1914  {
1915  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1916  }
1917 
1918  $this->initJavaServerForm();
1919  if ($this->form->checkInput())
1920  {
1921  $ilSetting->set("rpc_server_host", trim($_POST["rpc_server_host"]));
1922  $ilSetting->set("rpc_server_port", trim($_POST["rpc_server_port"]));
1923  $ilSetting->set('rpc_pdf_font',ilUtil::stripSlashes($_POST['rpc_pdf_font']));
1924  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1925  $ilCtrl->redirect($this, "showJavaServer");
1926 
1927  // TODO check settings, ping server
1928  }
1929  else
1930  {
1931  $this->setGeneralSettingsSubTabs("java_server");
1932  $this->form->setValuesByPost();
1933  $tpl->setContent($this->form->getHtml());
1934  }
1935  }
1936 
1944  public function showProxyObject()
1945  {
1946  global $tpl, $ilAccess, $ilSetting;
1947 
1948  if(!$ilAccess->checkAccess('write', '', $this->object->getRefId()))
1949  {
1950  $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
1951  }
1952 
1953  require_once './Services/Http/classes/class.ilProxySettings.php';
1954 
1955  $this->initProxyForm();
1956  $this->form->setValuesByArray(array(
1957  'proxy_status' => ilProxySettings::_getInstance()->isActive(),
1958  'proxy_host' => ilProxySettings::_getInstance()->getHost(),
1959  'proxy_port' => ilProxySettings::_getInstance()->getPort()
1960  ));
1961  if(ilProxySettings::_getInstance()->isActive())
1962  {
1963  $this->printProxyStatus();
1964  }
1965 
1966  $tpl->setContent($this->form->getHTML());
1967  }
1968 
1976  private function printProxyStatus()
1977  {
1978  try
1979  {
1980  ilProxySettings::_getInstance()->checkConnection();
1981  $this->form->getItemByPostVar('proxy_availability')->setHTML(
1982  '<img src="'.ilUtil::getImagePath('icon_ok.svg').'" /> '.
1983  $this->lng->txt('proxy_connectable')
1984  );
1985  }
1986  catch(ilProxyException $e)
1987  {
1988  $this->form->getItemByPostVar('proxy_availability')->setHTML(
1989  '<img src="'.ilUtil::getImagePath('icon_not_ok.svg').'" /> '.
1990  $this->lng->txt('proxy_not_connectable')
1991  );
1992  ilUtil::sendFailure(sprintf($this->lng->txt('proxy_socket_error'), $e->getMessage()));
1993  }
1994  }
1995 
2003  public function saveProxyObject()
2004  {
2005  global $tpl, $ilAccess, $ilSetting, $lng;
2006 
2007  if(!$ilAccess->checkAccess('write', '', $this->object->getRefId()))
2008  {
2009  $this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
2010  }
2011 
2012  require_once './Services/Http/classes/class.ilProxySettings.php';
2013 
2014  $this->initProxyForm();
2015  $isFormValid = $this->form->checkInput();
2016  ilProxySettings::_getInstance()->isActive((int)$this->form->getInput('proxy_status'))
2017  ->setHost(trim($this->form->getInput('proxy_host')))
2018  ->setPort(trim($this->form->getInput('proxy_port')));
2019  if($isFormValid)
2020  {
2021  if(ilProxySettings::_getInstance()->isActive())
2022  {
2023  if(!strlen(ilProxySettings::_getInstance()->getHost()))
2024  {
2025  $isFormValid = false;
2026  $this->form->getItemByPostVar('proxy_host')->setAlert($lng->txt('msg_input_is_required'));
2027  }
2028  if(!strlen(ilProxySettings::_getInstance()->getPort()))
2029  {
2030  $isFormValid = false;
2031  $this->form->getItemByPostVar('proxy_port')->setAlert($lng->txt('msg_input_is_required'));
2032  }
2033  if(!preg_match('/[0-9]{1,}/', ilProxySettings::_getInstance()->getPort()) ||
2034  ilProxySettings::_getInstance()->getPort() < 0 ||
2035  ilProxySettings::_getInstance()->getPort() > 65535)
2036  {
2037  $isFormValid = false;
2038  $this->form->getItemByPostVar('proxy_port')->setAlert($lng->txt('proxy_port_numeric'));
2039  }
2040  }
2041 
2042  if($isFormValid)
2043  {
2045  ilUtil::sendSuccess($lng->txt('saved_successfully'));
2046  if(ilProxySettings::_getInstance()->isActive())
2047  {
2048  $this->printProxyStatus();
2049  }
2050  }
2051  else
2052  {
2053  ilUtil::sendFailure($lng->txt('form_input_not_valid'));
2054  }
2055  }
2056 
2057  $this->form->setValuesByPost();
2058  $tpl->setContent($this->form->getHTML());
2059  }
2060 
2068  private function initProxyForm()
2069  {
2070  global $lng, $ilCtrl;
2071 
2072  $this->setServerInfoSubTabs('proxy');
2073 
2074  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
2075  $this->form = new ilPropertyFormGUI();
2076  $this->form->setFormAction($ilCtrl->getFormAction($this, 'saveProxy'));
2077 
2078  // Proxy status
2079  $proxs = new ilCheckboxInputGUI($lng->txt('proxy_status'), 'proxy_status');
2080  $proxs->setInfo($lng->txt('proxy_status_info'));
2081  $proxs->setValue(1);
2082  $this->form->addItem($proxs);
2083 
2084  // Proxy availability
2085  $proxa = new ilCustomInputGUI('', 'proxy_availability');
2086  $proxs->addSubItem($proxa);
2087 
2088  // Proxy
2089  $prox = new ilTextInputGUI($lng->txt('proxy_host'), 'proxy_host');
2090  $prox->setInfo($lng->txt('proxy_host_info'));
2091  $proxs->addSubItem($prox);
2092 
2093  // Proxy Port
2094  $proxp = new ilTextInputGUI($lng->txt('proxy_port'), 'proxy_port');
2095  $proxp->setInfo($lng->txt('proxy_port_info'));
2096  $proxp->setSize(10);
2097  $proxp->setMaxLength(10);
2098  $proxs->addSubItem($proxp);
2099 
2100  // save and cancel commands
2101  $this->form->addCommandButton('saveProxy', $lng->txt('save'));
2102  }
2103 
2104  public function showHTTPSObject()
2105  {
2106  global $tpl, $ilAccess;
2107 
2108  if(!$ilAccess->checkAccess('write', '', $this->object->getRefId()))
2109  {
2110  $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
2111  }
2112 
2113  $form = $this->initHTTPSForm();
2114  $tpl->setContent($form->getHTML());
2115  }
2116 
2117  public function saveHTTPSObject()
2118  {
2119  global $tpl, $lng, $ilCtrl;
2120 
2121  $form = $this->initHTTPSForm();
2122  if($form->checkInput())
2123  {
2124  $security = ilSecuritySettings::_getInstance();
2125 
2126  // ilias https handling settings
2127  $security->setHTTPSEnabled($_POST["https_enabled"]);
2128 
2129  if($security->validate($form))
2130  {
2131  $security->save();
2132 
2133  ilUtil::sendSuccess($lng->txt('saved_successfully'), true);
2134  $ilCtrl->redirect($this, "showHTTPS");
2135  }
2136  }
2137 
2138  $form->setValuesByPost();
2139  $tpl->setContent($form->getHTML());
2140  }
2141 
2142  private function initHTTPSForm()
2143  {
2144  global $ilCtrl, $lng;
2145 
2146  $this->setServerInfoSubTabs('adm_https');
2147 
2148  $lng->loadLanguageModule('ps');
2149 
2150  include_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
2151  $security = ilSecuritySettings::_getInstance();
2152 
2153  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
2154  $form = new ilPropertyFormGUI();
2155  $form->setTitle($lng->txt("adm_https"));
2156  $form->setFormAction($ilCtrl->getFormAction($this, 'saveHTTPS'));
2157 
2158  $check2 = new ilCheckboxInputGUI($lng->txt('activate_https'),'https_enabled');
2159  $check2->setChecked($security->isHTTPSEnabled() ? 1 : 0);
2160  $check2->setValue(1);
2161  $form->addItem($check2);
2162 
2163  // save and cancel commands
2164  $form->addCommandButton('saveHTTPS', $lng->txt('save'));
2165 
2166  return $form;
2167  }
2168 
2169  public function addToExternalSettingsForm($a_form_id)
2170  {
2171  switch($a_form_id)
2172  {
2174 
2175  include_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
2176  $security = ilSecuritySettings::_getInstance();
2177 
2178  $subitems = null;
2179 
2180  $fields['activate_https'] =
2181  array($security->isHTTPSEnabled(), ilAdministrationSettingsFormHandler::VALUE_BOOL);
2182 
2183  return array("general_settings" => array("showHTTPS", $fields));
2184  }
2185  }
2186 
2190  public static function _goto()
2191  {
2192  global $ilAccess, $ilErr, $lng;
2193 
2194  $a_target = SYSTEM_FOLDER_ID;
2195 
2196  if ($ilAccess->checkAccess("read", "", $a_target))
2197  {
2198  ilUtil::redirect("ilias.php?baseClass=ilAdministrationGUI");
2199  exit;
2200  }
2201  else
2202  {
2203  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
2204  {
2205  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
2206  ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
2208  }
2209  }
2210  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
2211  }
2212 
2216  protected function showVcsInformationObject()
2217  {
2218  $vc_info = array();
2219 
2220  require_once 'Services/Administration/classes/class.ilSubversionInformation.php';
2221  require_once 'Services/Administration/classes/class.ilGitInformation.php';
2222 
2223  foreach(array(new ilSubversionInformation(), new ilGitInformation()) as $vc)
2224  {
2225  $html = $vc->getInformationAsHtml();
2226  if($html)
2227  {
2228  $vc_info[] = $html;
2229  }
2230  }
2231 
2232  if($vc_info)
2233  {
2234  ilUtil::sendInfo(implode("<br />", $vc_info));
2235  }
2236  else
2237  {
2238  ilUtil::sendInfo($this->lng->txt('vc_information_not_determined'));
2239  }
2240 
2241  $this->showServerInfoObject();
2242  }
2243 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
saveJavaServerObject()
Save java server form.
initWebServicesForm()
Init web services form.
addHeaderTitleTranslationObject()
adds a translation form & save post vars to session
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
global $ilErr
Definition: raiseError.php:16
This class represents an option in a radio group.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
$path
Definition: aliased.php:25
showWebServicesObject()
Show Web Services.
switchBenchModuleObject()
save benchmark settings
showPHPInfoObject()
Show PHP Information.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
benchmarkSubTabs($a_current)
Benchmark sub tabs.
setValue($a_value)
Set Value.
showContactInformationObject()
Show contact information.
$_SESSION["AccountId"]
This class represents a selection list property in a property form.
initJavaServerForm()
Init java server form.
This class represents a property form user interface.
Class ilGitInformation.
showProxyObject()
Show proxy settings.
saveBasicSettingsObject()
Save basic settings form.
$_GET["client_id"]
$pdf
Definition: example_001.php:31
This class represents a section header in a property form.
static setList($a_list)
Set list.
$code
Definition: example_050.php:99
saveProxyObject()
Save proxy settings.
$valid
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$cmd
Definition: sahs_server.php:35
showHeaderTitleObject($a_get_post_values=false)
Show header title.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
benchmarkObject()
Benchmark settings.
changeHeaderTitleObject()
edit header title form
This class represents a checkbox property in a property form.
static _lookupTitle($a_id)
lookup object title
const DEFAULT_CONNECT_TIMEOUT
deleteHeaderTitlesObject()
Remove header titles.
clearBenchObject()
delete all benchmark records
static getStartingPoint()
Get current starting point setting.
removeTranslationObject()
removes a translation form & save post vars to session
Class for proxy related exception handling in ILIAS.
setInfo($a_info)
Set Info.
Class ilObjectOwnershipManagementGUI.
saveContactInformationObject()
Save contact information form.
Class ilObjSystemFolderGUI.
Creates a java server ini file for the current client
static hasPersonalStartingPoint()
Can starting point be personalized?
global $ilCtrl
Definition: ilias.php:18
static getPossibleStartingPoints($a_force_all=false)
Get all valid starting points.
showDbBenchResults($a_mode)
Show Db Benchmark Results.
setInfo($a_info)
Set Information Text.
static _getInstance()
Get instance.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setChecked($a_checked)
Set Checked.
showDbBenchByFirstTableObject()
Show db benchmark results.
prepareOutput($a_show_subobjects=true)
prepare output
checkObject()
displays system check menu
showDbBenchSortedBySqlObject()
Show db benchmark results.
This class represents a property in a property form.
setValue($a_value)
Set Value.
printProxyStatus()
Print proxy settings.
saveHeaderTitlesObject()
Save header titles.
setMinValue($a_minvalue, $a_display_always=false)
Set Minimum Value.
showDbBenchChronologicalObject()
Show db benchmark results.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
This class represents a number property in a property form.
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static getStartingObject()
Get ref id of starting object.
This class represents a text property in a property form.
$ilUser
Definition: imgupload.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
downloadJavaServerIniObject()
Create and offer server ini file for download.
setMaxLength($a_maxlength)
Set Max Length.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setOptions($a_options)
Set Options.
static getRepoPluginObjectByType($type)
Return either a repoObject plugin or a orgunit extension plugin or null if the type is not a plugin...
addHeaderTitleObject()
Add a header title.
Class ilSubversionInformation.
Create styles array
The data for the language used.
setSystemCheckSubTabs($a_activate)
Set sub tabs for general settings.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
showDbBenchSlowestFirstObject()
Show db benchmark results.
setSize($a_size)
Set Size.
static _goto()
goto target group
setServerInfoSubTabs($a_activate)
Set sub tabs for server info.
Class ilImprintGUI.
This class represents a custom property in a property form.
saveHeaderTitleObject()
save header title
TableGUI class for title/description translations.
setMaxLength($a_maxlength)
Set Max Length.
saveWebServicesObject()
Save web services form.
initContactInformationForm()
Init contact information form.
This class represents a non editable value in a property form.
Create new PHPExcel object
obj_idprivate
global $ilSetting
Definition: privfeed.php:17
initProxyForm()
Initialize proxy settings form.
initServerInfoForm()
Init server info form.
global $ilBench
Definition: ilias.php:18
global $ilDB
$ret
Definition: parser.php:6
Class ilCronManagerGUI.
const START_REPOSITORY_OBJ
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
showJavaServerObject()
Show Java Server Settings.
setGeneralSettingsSubTabs($a_activate)
Set sub tabs for general settings.
$languages
Definition: cssgen2.php:34
__construct($a_data, $a_id, $a_call_by_reference)
Constructor public.
createJavaServerIniObject()
Create a server ini file.
ILIAS Data Validator & Recovery Tool.
viewObject()
show admin subpanels and basic settings form
static setStartingPoint($a_value, $a_ref_id=null)
Set starting point setting.
setValue($a_value)
Set Value.
static redirect($a_script)
http redirect to other script
static togglePersonalStartingPoint($a_value)
Toggle personal starting point setting.
static _getInstance()
Getter for unique instance.
static _getInstance()
Get instance of ilSecuritySettings.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
$_POST["username"]
$html
Definition: example_001.php:87
saveBenchSettingsObject()
Save benchmark settings.
showBasicSettingsObject()
Show basic settings.
$ini
Definition: raiseError.php:4