ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 "./classes/class.ilObjectGUI.php";
5 
17 {
23  var $type;
24 
29  function ilObjSystemFolderGUI($a_data,$a_id,$a_call_by_reference)
30  {
31  $this->type = "adm";
32  $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, false);
33 
34  $this->lng->loadLanguageModule("administration");
35  }
36 
37  function &executeCommand()
38  {
39  global $rbacsystem;
40 
41  $next_class = $this->ctrl->getNextClass($this);
42  $this->prepareOutput();
43  switch($next_class)
44  {
45  case 'ilpermissiongui':
46  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
47  $perm_gui =& new ilPermissionGUI($this);
48  $ret =& $this->ctrl->forwardCommand($perm_gui);
49  break;
50 
51  default:
52 //var_dump($_POST);
53  $cmd = $this->ctrl->getCmd("view");
54 
55  $cmd .= "Object";
56  $this->$cmd();
57 
58  break;
59  }
60 
61  return true;
62  }
63 
64 
70  function viewObject()
71  {
72  global $rbacsystem;
73 
74 return $this->showServerInfoObject();
75 // old stuff
76 
77  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
78  {
79  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
80  }
81 
82  //prepare objectlist
83  $this->objectList = array();
84  $this->data["data"] = array();
85  $this->data["ctrl"] = array();
86  $this->data["cols"] = array("type", "title");
87 
88  $childs = $this->tree->getChilds($this->object->getRefId(),$_GET["order"],$_GET["direction"]);
89 
90  foreach ($childs as $key => $val)
91  {
92  // visible
93  if (!$rbacsystem->checkAccess("visible",$val["ref_id"]))
94  {
95  continue;
96  }
97 
98  // hide object types in devmode
99  if ($this->objDefinition->getDevMode($val["type"]))
100  {
101  continue;
102  }
103 
104  // hide RecoveryFolder if empty
105  if ($val["ref_id"] == RECOVERY_FOLDER_ID and !$this->tree->getChilds(RECOVERY_FOLDER_ID))
106  {
107  continue;
108  }
109 
110  //visible data part
111  $this->data["data"][] = array(
112  "type" => $val["type"],
113  "title" => $val["title"]."#separator#".$val["desc"],
114  "ref_id" => $val["ref_id"]
115  );
116 
117  //control information is set below
118 
119  } //foreach
120 
121  // add entry for switching to repository admin
122  $this->data["data"][] = array(
123  "type" => "root",
124  "title" => $this->lng->txt("repository_admin")."#separator#".
125  $this->lng->txt("repository_admin_desc"),
126  "ref_id" => ROOT_FOLDER_ID
127  );
128 
129  $this->maxcount = count($this->data["data"]);
130 
131  // sorting array
132  if ($_GET["sort_by"] == "")
133  {
134  $_GET["sort_by"] = "title";
135  }
136  $this->data["data"] = ilUtil::sortArray($this->data["data"],$_GET["sort_by"],$_GET["sort_order"]);
137 
138  // now compute control information
139  foreach ($this->data["data"] as $key => $val)
140  {
141  $this->data["ctrl"][$key] = array(
142  "type" => $val["type"],
143  "ref_id" => $val["ref_id"]
144  );
145 
146  unset($this->data["data"][$key]["ref_id"]);
147  }
148 
149  //var_dump("<pre>",$this->data,"</pre>");
150 
151  // display admin subpanels
152  $this->displayList();
153 
154  // display basic settings form
155  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
156  {
157  $this->displayBasicSettings();
158  }
159  }
160 
166  function displayList()
167  {
168  global $rbacsystem;
169 
170  include_once "./Services/Table/classes/class.ilTableGUI.php";
171 
172  // load template for table
173  $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
174  // load template for table content data
175  $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
176 
177  $num = 0;
178 
179  if (!$this->call_by_reference)
180  {
181  $this->ctrl->setParameter($this, "obj_id", $this->obj_id);
182  }
183 
184  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
185 
186  // create table
187  $tbl = new ilTableGUI();
188 
189  // title & header columns
190  $tbl->setTitle($this->lng->txt("obj_".$this->object->getType()),"icon_".$this->object->getType().".gif",$this->lng->txt("obj_".$this->object->getType()));
191  //$tbl->setHelp("tbl_help.php","icon_help.gif",$this->lng->txt("help"));
192 
193  /*
194  foreach ($this->data["cols"] as $val)
195  {
196  $header_names[] = $this->lng->txt($val);
197  }*/
198 
199  $header_names[] = "";
200  $header_names[] = $this->lng->txt("obj_cat");
201 
202  $tbl->setHeaderNames($header_names);
203 
204  $header_params = $this->ctrl->getParameterArray($this, "view");
205  $tbl->setHeaderVars($this->data["cols"],$header_params);
206  $tbl->setColumnWidth(array("15","99%"));
207 
208  // control
209  $tbl->setOrderColumn($_GET["sort_by"]);
210  $tbl->setOrderDirection($_GET["sort_order"]);
211  $tbl->setLimit(0);
212  $tbl->setOffset(0);
213  $tbl->setMaxCount($this->maxcount);
214 
215  // footer
216  $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
217  $tbl->disable("numinfo");
218 
219  // render table
220  $tbl->render();
221 
222  if (is_array($this->data["data"][0]))
223  {
224  //table cell
225  for ($i=0; $i < count($this->data["data"]); $i++)
226  {
227  $data = $this->data["data"][$i];
228  $ctrl = $this->data["ctrl"][$i];
229 
230  // color changing
231  $css_row = ilUtil::switchColor($i+1,"tblrow1","tblrow2");
232 
233  $this->tpl->setCurrentBlock("table_cell");
234  $this->tpl->setVariable("CELLSTYLE", "tblrow1");
235  $this->tpl->parseCurrentBlock();
236 
237  if ($ctrl["ref_id"] != ROOT_FOLDER_ID)
238  {
239  foreach ($data as $key => $val)
240  {
241  //build link
242  $obj_type = ilObject::_lookupType($ctrl["ref_id"],true);
243  $class_name = $this->objDefinition->getClassName($obj_type);
244  $class = strtolower("ilObj".$class_name."GUI");
245  $this->ctrl->setParameterByClass($class, "ref_id", $ctrl["ref_id"]);
246  $this->ctrl->setParameterByClass($class, "obj_id", $ctrl["ref_id"]);
247  $link = $this->ctrl->getLinkTargetByClass($class, "view");
248 
249  if ($key == "title")
250  {
251  $name_field = explode("#separator#",$val);
252  }
253 
254  if ($key == "title" || $key == "type")
255  {
256  $this->tpl->setCurrentBlock("begin_link");
257  $this->tpl->setVariable("LINK_TARGET", $link);
258 
259  $this->tpl->parseCurrentBlock();
260  $this->tpl->touchBlock("end_link");
261  }
262 
263  $this->tpl->setCurrentBlock("text");
264 
265  if ($key == "type")
266  {
267  $val = ilUtil::getImageTagByType($val,$this->tpl->tplPath);
268  }
269 
270  if ($key == "title")
271  {
272  $this->tpl->setVariable("TEXT_CONTENT", $name_field[0]);
273 
274  $this->tpl->setCurrentBlock("subtitle");
275  $this->tpl->setVariable("DESC", $name_field[1]);
276  $this->tpl->parseCurrentBlock();
277  }
278  else
279  {
280  $this->tpl->setVariable("TEXT_CONTENT", $val);
281  }
282 
283  $this->tpl->parseCurrentBlock();
284  $this->tpl->setCurrentBlock("table_cell");
285  $this->tpl->parseCurrentBlock();
286 
287  } //foreach
288  }
289  else // extra root folder handling (repository)
290  {
291  //$this->tpl->parseCurrentBlock();
292  // link
293 
294  // icon
295  $val = ilUtil::getImageTagByType("root",$this->tpl->tplPath);
296  $this->tpl->setCurrentBlock("text");
297  $this->tpl->setVariable("TEXT_CONTENT", $val);
298  $this->tpl->parseCurrentBlock();
299 
300  $this->tpl->setCurrentBlock("table_cell");
301  $this->tpl->parseCurrentBlock();
302 
303  // Link
304  $this->tpl->setCurrentBlock("begin_link");
305  $this->ctrl->setParameterByClass("iladministrationgui",
306  "admin_mode", "repository");
307  $this->ctrl->setParameterByClass("iladministrationgui",
308  "ref_id", ROOT_FOLDER_ID);
309  $this->tpl->setVariable("LINK_TARGET",
310  $this->ctrl->getLinkTargetByClass("iladministrationgui", "frameset"));
311  $this->tpl->setVariable("FRAME_TARGET",
312  " target=\"".ilFrameTargetInfo::_getFrame("MainContent")."\"");
313  $this->ctrl->clearParametersByClass("iladministrationgui");
314  $this->tpl->parseCurrentBlock();
315  $this->tpl->touchBlock("end_link");
316 
317 
318  // text
319  $name_field = explode("#separator#", $data["title"]);
320  $this->tpl->setCurrentBlock("text");
321  $this->tpl->setVariable("TEXT_CONTENT", $name_field[0]);
322  $this->tpl->setCurrentBlock("subtitle");
323  $this->tpl->setVariable("DESC", $name_field[1]);
324  $this->tpl->parseCurrentBlock();
325 
326  $this->tpl->setCurrentBlock("table_cell");
327  $this->tpl->parseCurrentBlock();
328 
329  }
330 
331  $this->tpl->setCurrentBlock("tbl_content");
332  $this->tpl->setVariable("CSS_ROW", $css_row);
333  $this->tpl->parseCurrentBlock();
334  } //for
335 
336  } //if is_array
337  else
338  {
339  $this->tpl->setCurrentBlock("notfound");
340  $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
341  $this->tpl->setVariable("NUM_COLS", $num);
342  $this->tpl->parseCurrentBlock();
343  }
344  }
345 
347  {
348  global $rbacsystem, $ilCtrl;
349 
350  $settings = $this->ilias->getAllSettings();
351 
352  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
353  {
354  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
355  }
356 
357  //init checking var
358  $form_valid = true;
359 
360  // moved to privacy/security
361 
362  /*if($_POST['https'])
363  {
364  include_once './classes/class.ilHTTPS.php';
365 
366  if(!ilHTTPS::_checkHTTPS())
367  {
368  ilUtil::sendInfo($this->lng->txt('https_not_possible'));
369  $form_valid = false;
370  }
371  if(!ilHTTPS::_checkHTTP())
372  {
373  ilUtil::sendInfo($this->lng->txt('http_not_possible'));
374  $form_valid = false;
375  }
376  }*/
377 
378  // check required user information
379  if (empty($_POST["admin_firstname"]) or empty($_POST["admin_lastname"])
380  or empty($_POST["admin_street"]) or empty($_POST["admin_zipcode"])
381  or empty($_POST["admin_country"]) or empty($_POST["admin_city"])
382  or empty($_POST["admin_phone"]) or empty($_POST["admin_email"]))
383  {
384  // feedback
385  ilUtil::sendFailure($this->lng->txt("fill_out_all_required_fields"));
386  $form_valid = false;
387  }
388  // check email adresses
389  // feedback_recipient
390  if (!ilUtil::is_email($_POST["feedback_recipient"]) and !empty($_POST["feedback_recipient"]) and $form_valid)
391  {
392  ilUtil::sendFailure($this->lng->txt("input_error").": '".$this->lng->txt("feedback_recipient")."'<br/>".$this->lng->txt("email_not_valid"));
393  $form_valid = false;
394  }
395 
396  // error_recipient
397  if (!ilUtil::is_email($_POST["error_recipient"]) and !empty($_POST["error_recipient"]) and $form_valid)
398  {
399  ilUtil::sendFailure($this->lng->txt("input_error").": '".$this->lng->txt("error_recipient")."'<br/>".$this->lng->txt("email_not_valid"));
400  $form_valid = false;
401  }
402 
403  // admin email
404  if (!ilUtil::is_email($_POST["admin_email"]) and $form_valid)
405  {
406  ilUtil::sendFailure($this->lng->txt("input_error").": '".$this->lng->txt("email")."'<br/>".$this->lng->txt("email_not_valid"));
407  $form_valid = false;
408  }
409 
410  // prepare output
411  foreach ($_POST as $key => $val)
412  {
413  if($key != "cmd")
414  {
415  $_POST[$key] = ilUtil::prepareFormOutput($val,true);
416  }
417  }
418 
419  if (!$form_valid) //required fields not satisfied. Set formular to already fill in values
420  {
422  // load user modified settings again
423 
424  // basic data
425  $settings["feedback_recipient"] = $_POST["feedback_recipient"];
426  $settings["error_recipient"] = $_POST["error_recipient"];
427 
428  // modules
429  $settings["pub_section"] = $_POST["pub_section"];
430  $settings["open_google"] = $_POST["open_google"];
431  $settings["default_repository_view"] = $_POST["default_rep_view"];
432  $settings["password_assistance"] = $_POST["password_assistance"];
433  $settings['short_inst_title'] = $_POST['short_inst_title'];
434  $settings["passwd_auto_generate"] = $_POST["password_auto_generate"];
435  //$settings["js_edit"] = $_POST["js_edit"];
436  $settings["enable_trash"] = $_POST["enable_trash"];
437  //$settings["https"] = $_POST["https"];
438 
439  //session_reminder
440  $settings['session_reminder_enabled'] = (int)$_POST['session_reminder_enabled'];
441 
442  // session control
443 
444 
445  // contact
446  $settings["admin_firstname"] = $_POST["admin_firstname"];
447  $settings["admin_lastname"] = $_POST["admin_lastname"];
448  $settings["admin_title"] = $_POST["admin_title"];
449  $settings["admin_position"] = $_POST["admin_position"];
450  $settings["admin_institution"] = $_POST["admin_institution"];
451  $settings["admin_street"] = $_POST["admin_street"];
452  $settings["admin_zipcode"] = $_POST["admin_zipcode"];
453  $settings["admin_city"] = $_POST["admin_city"];
454  $settings["admin_country"] = $_POST["admin_country"];
455  $settings["admin_phone"] = $_POST["admin_phone"];
456  $settings["admin_email"] = $_POST["admin_email"];
457 
458  // cron
459  $settings["cron_user_check"] = $_POST["cron_user_check"];
460  $settings["cron_link_check"] = $_POST["cron_link_check"];
461  $settings["cron_web_resource_check"] = $_POST["cron_web_resource_check"];
462  $settings["cron_lucene_index"] = $_POST["cron_lucene_index"];
463  $settings["mail_notification"] = $_POST["mail_notification"];
464  $settings["mail_notification_message"] = $_POST["mail_notification_message"];
465 
466  // soap
467  $settings["soap_user_administration"] = $_POST["soap_user_administration"];
468 
469  $settings["suffix_repl_additional"] = $_POST["suffix_repl_additional"];
470 
471  // dynamic links
472  $settings["links_dynamic"] = $_POST["links_dynamic"];
473  }
474  else // all required fields ok
475  {
476 
478  // write new settings
479 
480  // basic data
481  $this->ilias->setSetting("feedback_recipient",$_POST["feedback_recipient"]);
482  $this->ilias->setSetting("error_recipient",$_POST["error_recipient"]);
483  //$this->ilias->ini->setVariable("language","default",$_POST["default_language"]);
484 
485  //set default skin and style
486  /*
487  if ($_POST["default_skin_style"] != "")
488  {
489  $sknst = explode(":", $_POST["default_skin_style"]);
490 
491  if ($this->ilias->ini->readVariable("layout","style") != $sknst[1] ||
492  $this->ilias->ini->readVariable("layout","skin") != $sknst[0])
493  {
494  $this->ilias->ini->setVariable("layout","skin", $sknst[0]);
495  $this->ilias->ini->setVariable("layout","style",$sknst[1]);
496  }
497  }*/
498  // set default view target
499  /*
500  if ($_POST["open_views_inside_frameset"] == "1")
501  {
502  $this->ilias->ini->setVariable("layout","view_target","frame");
503  }
504  else
505  {
506  $this->ilias->ini->setVariable("layout","view_target","window");
507  }*/
508 
509  // modules
510  $this->ilias->setSetting("pub_section",$_POST["pub_section"]);
511  $this->ilias->setSetting('open_google',$_POST['open_google']);
512  $this->ilias->setSetting("default_repository_view",$_POST["default_rep_view"]);
513  //$this->ilias->setSetting('https',$_POST['https']);
514  $this->ilias->setSetting('password_assistance',$_POST['password_assistance']);
515  $this->ilias->setSetting('passwd_auto_generate',$_POST['password_auto_generate']);
516 
517  //$this->ilias->setSetting('enable_js_edit',$_POST['js_edit']);
518  $this->ilias->setSetting('short_inst_name',$_POST['short_inst_name']);
519  $this->ilias->setSetting('enable_trash',$_POST['enable_trash']);
520 
521  //session_reminder
522  $this->ilias->setSetting('session_reminder_enabled', (int)$_POST['session_reminder_enabled']);
523 
524  // contact
525  $this->ilias->setSetting("admin_firstname",$_POST["admin_firstname"]);
526  $this->ilias->setSetting("admin_lastname",$_POST["admin_lastname"]);
527  $this->ilias->setSetting("admin_title",$_POST["admin_title"]);
528  $this->ilias->setSetting("admin_position",$_POST["admin_position"]);
529  $this->ilias->setSetting("admin_institution",$_POST["admin_institution"]);
530  $this->ilias->setSetting("admin_street",$_POST["admin_street"]);
531  $this->ilias->setSetting("admin_zipcode",$_POST["admin_zipcode"]);
532  $this->ilias->setSetting("admin_city",$_POST["admin_city"]);
533  $this->ilias->setSetting("admin_country",$_POST["admin_country"]);
534  $this->ilias->setSetting("admin_phone",$_POST["admin_phone"]);
535  $this->ilias->setSetting("admin_email",$_POST["admin_email"]);
536 
537  // cron
538  $this->ilias->setSetting("cron_user_check",$_POST["cron_user_check"]);
539  $this->ilias->setSetting("cron_link_check",$_POST["cron_link_check"]);
540  $this->ilias->setSetting("cron_web_resource_check",$_POST["cron_web_resource_check"]);
541  $this->ilias->setSetting("cron_lucene_index",$_POST["cron_lucene_index"]);
542  $this->ilias->setSetting("mail_notification", $_POST["mail_notification"]);
543  $this->ilias->setSetting("mail_notification_message", $_POST["mail_notification_message"]);
544 
545 
546  // webservice
547  $this->ilias->setSetting("soap_user_administration",$_POST["soap_user_administration"]);
548  $this->ilias->setSetting("rpc_server_host",trim($_POST["rpc_server_host"]));
549  $this->ilias->setSetting("rpc_server_port",trim($_POST["rpc_server_port"]));
550 
551  // write ini settings
552  $this->ilias->ini->write();
553 
554  // links dynamic
555  $this->ilias->setSetting('links_dynamic',$_POST['links_dynamic']);
556 
557  $this->ilias->setSetting("suffix_repl_additional",
558  ilUtil::stripSlashes($_POST["suffix_repl_additional"]));
559 
560  $settings = $this->ilias->getAllSettings();
561 
562  // feedback
563  $feedback = $this->lng->txt("saved_successfully");
564  if (trim($_POST["rpc_server_host"]) != "" ||
565  trim($_POST["rpc_server_port"]) != "")
566  {
567  include_once 'Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
568  $rpc_settings = ilRPCServerSettings::getInstance();
569  if(!$rpc_settings->pingServer())
570  {
571  $feedback .= "<br />\n".$this->lng->txt('java_server_no_connection');
572  }
573  }
574  ilUtil::sendInfo($feedback);
575  }
576 
577  $ilCtrl->redirect($this, "view");
578  //$this->displayBasicSettings();
579  }
580 
582  {
583  include_once("./Modules/Scorm2004/classes/class.ilScormEditorDBCreator.php");
584  $db_creator = new ilScormEditorDBCreator();
585  $db_creator->createTables();
586 
587  ilUtil::sendSuccess("Tables are updated.", true);
588  $this->viewObject();
589  }
590 
597  {
598  global $rbacsystem, $ilCtrl, $ilClientIniFile;
599 
600  $this->tpl->addBlockFile("SYSTEMSETTINGS", "systemsettings", "tpl.adm_basicdata.html",
601  "Modules/SystemFolder");
602 
603  $settings = $this->ilias->getAllSettings();
604 
605  $this->tpl->setVariable("TXT_BASIC_DATA", $this->lng->txt("basic_data"));
606 
608  // setting language vars
609 
610  // basic data
611  $this->tpl->setVariable("TXT_ILIAS_VERSION", $this->lng->txt("ilias_version"));
612  $this->tpl->setVariable("TXT_DB_VERSION", $this->lng->txt("db_version"));
613  $this->tpl->setVariable("TXT_CLIENT_ID", $this->lng->txt("client_id"));
614  $this->tpl->setVariable("TXT_INST_ID", $this->lng->txt("inst_id"));
615  $this->tpl->setVariable("TXT_ACTIVATE_HTTPS",$this->lng->txt('activate_https'));
616  $this->tpl->setVariable("TXT_HOSTNAME", $this->lng->txt("host"));
617  $this->tpl->setVariable("TXT_IP_ADDRESS", $this->lng->txt("ip_address"));
618  $this->tpl->setVariable("TXT_SERVER_DATA", $this->lng->txt("server_data"));
619  $this->tpl->setVariable("TXT_SERVER_PORT", $this->lng->txt("port"));
620  $this->tpl->setVariable("TXT_SERVER_SOFTWARE", $this->lng->txt("server_software"));
621  $this->tpl->setVariable("TXT_HTTP_PATH", $this->lng->txt("http_path"));
622  $this->tpl->setVariable("TXT_ABSOLUTE_PATH", $this->lng->txt("absolute_path"));
623  $this->tpl->setVariable("TXT_INST_NAME", $this->lng->txt("inst_name"));
624  $this->tpl->setVariable("TXT_INST_INFO", $this->lng->txt("inst_info"));
625  //$this->tpl->setVariable("TXT_OPEN_VIEWS_INSIDE_FRAMESET", $this->lng->txt("open_views_inside_frameset"));
626  $this->tpl->setVariable("TXT_FEEDBACK_RECIPIENT", $this->lng->txt("feedback_recipient"));
627  $this->tpl->setVariable("TXT_ERROR_RECIPIENT", $this->lng->txt("error_recipient"));
628  $this->tpl->setVariable("TXT_HEADER_TITLE", $this->lng->txt("header_title"));
629  $this->tpl->setVariable("TXT_SHORT_NAME", $this->lng->txt("short_inst_name"));
630  $this->tpl->setVariable("TXT_SHORT_NAME_INFO", $this->lng->txt("short_inst_name_info"));
631 
632  $this->tpl->setVariable("VAL_SHORT_INST_NAME", $settings['short_inst_name']);
633  $this->tpl->setVariable("TXT_CHANGE", $this->lng->txt("change"));
634  $this->tpl->setVariable("LINK_HEADER_TITLE",
635  $this->ctrl->getLinkTarget($this, "changeHeaderTitle"));
636  $this->tpl->setVariable("VAL_HEADER_TITLE",
638 
639  include_once ("./Services/Database/classes/class.ilDBUpdate.php");
640  $dbupdate = new ilDBUpdate($this->ilias->db,true);
641 
642  if (!$dbupdate->getDBVersionStatus())
643  {
644  $this->tpl->setVariable("TXT_DB_UPDATE", "&nbsp;(<span class=\"warning\">".$this->lng->txt("db_need_update")."</span>)");
645  }
646 
647  //$this->tpl->setVariable("TXT_MODULES", $this->lng->txt("modules"));
648  $this->tpl->setVariable("TXT_PUB_SECTION", $this->lng->txt("pub_section"));
649 
650 
651  $this->tpl->setVariable('TXT_SEARCH_ENGINE',$this->lng->txt('search_engine'));
652  $this->tpl->setVariable('TXT_ENABLE_SEARCH_ENGINE',$this->lng->txt('enable_search_engine'));
653  include_once('Services/PrivacySecurity/classes/class.ilRobotSettings.php');
654  $robot_settings = ilRobotSettings::_getInstance();
655 
656  $error_se = false;
657  if(!$robot_settings->checkModRewrite())
658  {
659  $error_se = true;
660  $this->tpl->setVariable('OPEN_GOOGLE_CHECKED','disabled="disabled"');
661 
662  $this->tpl->setCurrentBlock('search_engine_alert');
663  $this->tpl->setVariable('SE_ALERT_IMG',ilUtil::getImagePath('icon_alert_s.gif'));
664  $this->tpl->setVariable('SE_ALT_ALERT',$this->lng->txt('alert'));
665  $this->tpl->setVariable('TXT_SE_ALERT',$this->lng->txt('mod_rewrite_disabled'));
666  $this->tpl->parseCurrentBlock();
667  }
668  elseif(!$robot_settings->checkRewrite())
669  {
670  $error_se = true;
671  $this->tpl->setVariable('OPEN_GOOGLE_CHECKED','disabled="disabled"');
672 
673  $this->tpl->setCurrentBlock('search_engine_alert');
674  $this->tpl->setVariable('SE_ALERT_IMG',ilUtil::getImagePath('icon_alert_s.gif'));
675  $this->tpl->setVariable('SE_ALT_ALERT',$this->lng->txt('alert'));
676  $this->tpl->setVariable('TXT_SE_ALERT',$this->lng->txt('allow_override_alert'));
677  $this->tpl->parseCurrentBlock();
678  }
679  if($settings['open_google'] and !$error_se)
680  {
681  $this->tpl->setVariable('OPEN_GOOGLE_CHECKED','checked="checked"');
682  }
683 
684  $this->tpl->setVariable("TXT_DEFAULT_REPOSITORY_VIEW", $this->lng->txt("def_repository_view"));
685  $this->tpl->setVariable("TXT_FLAT", $this->lng->txt("flatview"));
686  $this->tpl->setVariable("TXT_TREE", $this->lng->txt("treeview"));
687 
688  $this->tpl->setVariable("TXT_ENABLE_PASSWORD_ASSISTANCE", $this->lng->txt("enable_password_assistance"));
689  $this->tpl->setVariable("TXT_PASSWORD_AUTO_GENERATE_INFO",$this->lng->txt('passwd_generation_info'));
690  //rku: password assistent should be availabe always, even in mixed mode.
691  /* if (AUTH_DEFAULT != AUTH_LOCAL)
692  {
693  $this->tpl->setVariable("DISABLE_PASSWORD_ASSISTANCE", 'disabled=\"disabled\"');
694  $this->tpl->setVariable("TXT_PASSWORD_ASSISTANCE_DISABLED", $this->lng->txt("password_assistance_disabled"));
695  }*/
696 
697  $this->tpl->setVariable("TXT_PASSWORD_ASSISTANCE_INFO", $this->lng->txt("password_assistance_info"));
698 
699  $this->tpl->setVariable("TXT_ENABLE_PASSWORD_GENERATION",$this->lng->txt('passwd_generation'));
700 
701  // File Suffix Replacements
702  $this->tpl->setVariable("TXT_FILE_SUFFIX_REPL", $this->lng->txt("file_suffix_repl"));
703  $this->tpl->setVariable("INFO_FILE_SUFFIX_REPL",
704  $this->lng->txt("file_suffix_repl_info")." ".SUFFIX_REPL_DEFAULT);
705 
706  $this->tpl->setVariable("TXT_DYNAMIC_LINKS",$this->lng->txt('links_dynamic'));
707  $this->tpl->setVariable("INFO_DYNAMIC_LINKS",$this->lng->txt('links_dynamic_info'));
708 
709  $this->tpl->setVariable("TXT_ENABLE_TRASH",$this->lng->txt('enable_trash'));
710  $this->tpl->setVariable("INFO_ENABLE_TRASH",$this->lng->txt('enable_trash_info'));
711 
712  $this->tpl->setVariable('TXT_SESSION_REMINDER', $this->lng->txt('session_reminder'));
713  $this->tpl->setVariable('INFO_SESSION_REMINDER', $this->lng->txt('session_reminder_info'));
714  $expires = $ilClientIniFile->readVariable("session", "expire");
715  $time = ilFormat::_secondsToString($expires, true);
716  $this->tpl->setVariable('SESSION_REMINDER_SESSION_DURATION',
717  sprintf($this->lng->txt('session_reminder_session_duration'), $time));
718 
719 
720  // paths
721  $this->tpl->setVariable("TXT_SOFTWARE", $this->lng->txt("3rd_party_software"));
722  $this->tpl->setVariable("TXT_CONVERT_PATH", $this->lng->txt("path_to_convert"));
723  $this->tpl->setVariable("TXT_ZIP_PATH", $this->lng->txt("path_to_zip"));
724  $this->tpl->setVariable("TXT_UNZIP_PATH", $this->lng->txt("path_to_unzip"));
725  $this->tpl->setVariable("TXT_JAVA_PATH", $this->lng->txt("path_to_java"));
726  $this->tpl->setVariable("TXT_HTMLDOC_PATH", $this->lng->txt("path_to_htmldoc"));
727  $this->tpl->setVariable("TXT_MKISOFS_PATH", $this->lng->txt("path_to_mkisofs"));
728  $this->tpl->setVariable("TXT_LATEX_URL", $this->lng->txt("url_to_latex"));
729 
730  // Cron
731  $this->tpl->setVariable("TXT_CRON",$this->lng->txt('cron_jobs'));
732  $this->tpl->setVariable("TXT_CRON_DESC",$this->lng->txt('cron_jobs_desc'));
733  $this->tpl->setVariable("TXT_CRON_USER_ACCOUNTS",$this->lng->txt('check_user_accounts'));
734  $this->tpl->setVariable("CRON_USER_ACCOUNTS_DESC",$this->lng->txt('check_user_accounts_desc'));
735  $this->tpl->setVariable("TXT_CRON_LINK_CHECK",$this->lng->txt('check_link'));
736  $this->tpl->setVariable("CRON_LINK_CHECK_DESC",$this->lng->txt('check_link_desc'));
737  $this->tpl->setVariable("TXT_CRON_WEB_RESOURCE_CHECK",$this->lng->txt('check_web_resources'));
738  $this->tpl->setVariable("CRON_WEB_RESOURCE_CHECK_DESC",$this->lng->txt('check_web_resources_desc'));
739 
740  $this->tpl->setVariable("TXT_CRON_LUCENE_INDEX",$this->lng->txt('cron_lucene_index'));
741  $this->tpl->setVariable("TXT_CRON_LUCENE_INDEX_INFO",$this->lng->txt('cron_lucene_index_info'));
742 
743  $this->tpl->setVariable("TXT_CRON_MAIL_NOTIFICATION",$this->lng->txt('cron_mail_notification'));
744  $this->tpl->setVariable("TXT_CRON_MAIL_NOTIFICATION_NEVER",$this->lng->txt('cron_mail_notification_never'));
745  $this->tpl->setVariable("TXT_CRON_MAIL_NOTIFICATION_CRON",$this->lng->txt('cron_mail_notification_cron'));
746  $this->tpl->setVariable("CRON_MAIL_NOTIFICATION_DESC",$this->lng->txt('cron_mail_notification_desc'));
747 
748  $this->tpl->setVariable("TXT_CRON_MAIL_MESSAGE_CHECK", $this->lng->txt('cron_mail_notification_message'));
749  $this->tpl->setVariable("CRON_MAIL_MESSAGE_CHECK", $this->lng->txt('cron_mail_notification_message_enabled'));
750  $this->tpl->setVariable("CRON_MAIL_MESSAGE_CHECK_DESC", $this->lng->txt('cron_mail_notification_message_desc'));
751 
752  $this->tpl->setVariable("TXT_NEVER",$this->lng->txt('never'));
753  $this->tpl->setVariable("TXT_DAILY",$this->lng->txt('daily'));
754  $this->tpl->setVariable("TXT_WEEKLY",$this->lng->txt('weekly'));
755  $this->tpl->setVariable("TXT_MONTHLY",$this->lng->txt('monthly'));
756  $this->tpl->setVariable("TXT_QUARTERLY",$this->lng->txt('quarterly'));
757 
758  $this->tpl->setVariable("TXT_WEBSERVICES",$this->lng->txt('webservices'));
759  $this->tpl->setVariable("TXT_SOAP_USER_ADMINISTRATION",$this->lng->txt('soap_user_administration'));
760  $this->tpl->setVariable("TXT_SOAP_USER_ADMINISTRATION_DESC",$this->lng->txt('soap_user_administration_desc'));
761 
762  $this->tpl->setVariable("TXT_JAVA_SERVER",$this->lng->txt('java_server'));
763  $this->tpl->setVariable("TXT_JAVA_SERVER_HOST",$this->lng->txt('java_server_host'));
764  $this->tpl->setVariable("TXT_JAVA_SERVER_PORT",$this->lng->txt('java_server_port'));
765  $this->tpl->setVariable("TXT_JAVA_SERVER_INFO",$this->lng->txt('java_server_info'));
766  $this->tpl->setVariable("TXT_JAVA_SERVER_README",$this->lng->txt('java_server_readme'));
767 
768  // $this->tpl->setVariable("TXT_DATA_PRIVACY",$this->lng->txt('data_privacy'));
769 
770 
771  // contact
772  $this->tpl->setVariable("TXT_CONTACT_DATA", $this->lng->txt("contact_data"));
773  $this->tpl->setVariable("TXT_REQUIRED_FIELDS", $this->lng->txt("required_field"));
774  $this->tpl->setVariable("TXT_ADMIN", $this->lng->txt("administrator"));
775  $this->tpl->setVariable("TXT_FIRSTNAME", $this->lng->txt("firstname"));
776  $this->tpl->setVariable("TXT_LASTNAME", $this->lng->txt("lastname"));
777  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
778  $this->tpl->setVariable("TXT_POSITION", $this->lng->txt("position"));
779  $this->tpl->setVariable("TXT_INSTITUTION", $this->lng->txt("institution"));
780  $this->tpl->setVariable("TXT_STREET", $this->lng->txt("street"));
781  $this->tpl->setVariable("TXT_ZIPCODE", $this->lng->txt("zipcode"));
782  $this->tpl->setVariable("TXT_CITY", $this->lng->txt("city"));
783  $this->tpl->setVariable("TXT_COUNTRY", $this->lng->txt("country"));
784  $this->tpl->setVariable("TXT_PHONE", $this->lng->txt("phone"));
785  $this->tpl->setVariable("TXT_EMAIL", $this->lng->txt("email"));
786  $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
787 
788 
790  // display formula data
791 
792  // basic data
793  $this->tpl->setVariable("FORMACTION_BASICDATA", $this->ctrl->getFormAction($this));
794  $this->tpl->setVariable("HTTP_PATH",ILIAS_HTTP_PATH);
795  $this->tpl->setVariable("ABSOLUTE_PATH",ILIAS_ABSOLUTE_PATH);
796  $this->tpl->setVariable("HOSTNAME", $_SERVER["SERVER_NAME"]);
797  $this->tpl->setVariable("SERVER_PORT", $_SERVER["SERVER_PORT"]);
798  $this->tpl->setVariable("SERVER_ADMIN", $_SERVER["SERVER_ADMIN"]); // not used
799  $this->tpl->setVariable("SERVER_SOFTWARE", $_SERVER["SERVER_SOFTWARE"]);
800  $this->tpl->setVariable("IP_ADDRESS", $_SERVER["SERVER_ADDR"]);
801  $this->tpl->setVariable("DB_VERSION",$settings["db_version"]);
802  $this->tpl->setVariable("ILIAS_VERSION",$settings["ilias_version"]);
803  $this->tpl->setVariable("INST_ID",$settings["inst_id"]);
804  $this->tpl->setVariable("CLIENT_ID",CLIENT_ID);
805  $this->tpl->setVariable("INST_NAME",$this->ilias->ini->readVariable("client","name"));
806  $this->tpl->setVariable("INST_INFO",$this->ilias->ini->readVariable("client","description"));
807  $this->tpl->setVariable("FEEDBACK_RECIPIENT",$settings["feedback_recipient"]);
808  $this->tpl->setVariable("ERROR_RECIPIENT",$settings["error_recipient"]);
809 
810  $this->tpl->setVariable("PHP_INFO_LINK",
811  $this->ctrl->getLinkTarget($this, "showPHPInfo"));
812 
813  // get all templates
814  if ($settings["pub_section"])
815  {
816  $this->tpl->setVariable("PUB_SECTION","checked=\"checked\"");
817  }
818 
819  if ($settings["default_repository_view"] == "tree")
820  {
821  $this->tpl->setVariable("TREESELECTED","selected=\"1\"");
822  }
823  else
824  {
825  $this->tpl->setVariable("FLATSELECTED","selected=\"1\"");
826  }
827 
828  if($settings['password_assistance'])
829  {
830  $this->tpl->setVariable("PASSWORD_ASSISTANCE","checked=\"checked\"");
831  }
832  $this->tpl->setVariable("VAL_SHORT_NAME", $settings['short_inst_title']);
833  if($settings['passwd_auto_generate'])
834  {
835  $this->tpl->setVariable("PASSWORD_AUTO_GENERATE","checked=\"checked\"");
836  }
837 
838  // js editing
839  /*
840  if($settings['enable_js_edit'])
841  {
842  $this->tpl->setVariable("JS_EDIT","checked=\"checked\"");
843  }*/
844 
845  $this->tpl->setVariable("SUFFIX_REPL_ADDITIONAL", ilUtil::prepareFormOutput($settings['suffix_repl_additional']));
846 
847  if($settings['links_dynamic'])
848  {
849  $this->tpl->setVariable("LINKS_DYNAMIC_CHECKED","checked=\"checked\"");
850  }
851 
852  if($settings['enable_trash'])
853  {
854  $this->tpl->setVariable("ENABLE_TRASH_CHECKED","checked=\"checked\"");
855  }
856 
857  if($settings['session_reminder_enabled'])
858  {
859  $this->tpl->setVariable('SESSION_REMINDER_ENABLED','checked=checked');
860  }
861 
862  if ($settings["require_login"])
863  {
864  $this->tpl->setVariable("REQUIRE_LOGIN","checked=\"checked\"");
865  }
866  if ($settings["require_passwd"])
867  {
868  $this->tpl->setVariable("REQUIRE_PASSWD","checked=\"checked\"");
869  }
870  if ($settings["require_passwd2"])
871  {
872  $this->tpl->setVariable("REQUIRE_PASSWD2","checked=\"checked\"");
873  }
874  if ($settings["require_firstname"])
875  {
876  $this->tpl->setVariable("REQUIRE_FIRSTNAME","checked=\"checked\"");
877  }
878  if ($settings["require_gender"])
879  {
880  $this->tpl->setVariable("REQUIRE_GENDER","checked=\"checked\"");
881  }
882  if ($settings["require_lastname"])
883  {
884  $this->tpl->setVariable("REQUIRE_LASTNAME","checked=\"checked\"");
885  }
886  if ($settings["require_institution"])
887  {
888  $this->tpl->setVariable("REQUIRE_INSTITUTION","checked=\"checked\"");
889  }
890  if ($settings["require_department"])
891  {
892  $this->tpl->setVariable("REQUIRE_DEPARTMENT","checked=\"checked\"");
893  }
894  if ($settings["require_street"])
895  {
896  $this->tpl->setVariable("REQUIRE_STREET","checked=\"checked\"");
897  }
898  if ($settings["require_city"])
899  {
900  $this->tpl->setVariable("REQUIRE_CITY","checked=\"checked\"");
901  }
902  if ($settings["require_zipcode"])
903  {
904  $this->tpl->setVariable("REQUIRE_ZIPCODE","checked=\"checked\"");
905  }
906  if ($settings["require_country"])
907  {
908  $this->tpl->setVariable("REQUIRE_COUNTRY","checked=\"checked\"");
909  }
910  if ($settings["require_phone_office"])
911  {
912  $this->tpl->setVariable("REQUIRE_PHONE_OFFICE","checked=\"checked\"");
913  }
914  if ($settings["require_phone_home"])
915  {
916  $this->tpl->setVariable("REQUIRE_PHONE_HOME","checked=\"checked\"");
917  }
918  if ($settings["require_phone_mobile"])
919  {
920  $this->tpl->setVariable("REQUIRE_PHONE_MOBILE","checked=\"checked\"");
921  }
922  if ($settings["require_fax"])
923  {
924  $this->tpl->setVariable("REQUIRE_FAX","checked=\"checked\"");
925  }
926  if ($settings["require_email"])
927  {
928  $this->tpl->setVariable("REQUIRE_EMAIL","checked=\"checked\"");
929  }
930  if ($settings["require_hobby"])
931  {
932  $this->tpl->setVariable("REQUIRE_HOBBY","checked=\"checked\"");
933  }
934  if ($settings["require_default_role"])
935  {
936  $this->tpl->setVariable("REQUIRE_DEFAULT_ROLE","checked=\"checked\"");
937  }
938  if ($settings["require_referral_comment"])
939  {
940  $this->tpl->setVariable("REQUIRE_REFERRAL_COMMENT","checked=\"checked\"");
941  }
942  if ($settings["require_matriculation"])
943  {
944  $this->tpl->setVariable("REQUIRE_MATRICULATION","checked=\"checked\"");
945  }
946  if ($settings["cron_user_check"])
947  {
948  $this->tpl->setVariable("CRON_USER_CHECK","checked=\"checked\"");
949  }
950  if ($settings["cron_link_check"])
951  {
952  $this->tpl->setVariable("CRON_LINK_CHECK","checked=\"checked\"");
953  }
954  if($settings["cron_lucene_index"])
955  {
956  $this->tpl->setVariable("CRON_LUCENE_INDEX","checked=\"checked\"");
957  }
958  if ($settings["mail_notification"] == 0)
959  {
960  $this->tpl->setVariable("CRON_MAIL_NOTIFICATION_NEVER_SELECTED"," selected=\"selected\"");
961  }
962  else if ($settings["mail_notification"] == 1)
963  {
964  $this->tpl->setVariable("CRON_MAIL_NOTIFICATION_CRON_SELECTED"," selected=\"selected\"");
965  if($settings["mail_notification_message"] == 1)
966  {
967  $this->tpl->setVariable("CRON_MAIL_MESSAGE_CHECK","checked=\"checked\"");
968  }
969  else
970  {
971  $this->tpl->setVariable("CRON_MAIL_MESSAGE_CHECK_DISABLED","DISABLED");
972  }
973  }
974  if ($val = $settings["cron_web_resource_check"])
975  {
976  switch($val)
977  {
978  case 1:
979  $this->tpl->setVariable("D_SELECT",'selected="selected"');
980  break;
981  case 2:
982  $this->tpl->setVariable("W_SELECT",'selected="selected"');
983  break;
984  case 3:
985  $this->tpl->setVariable("M_SELECT",'selected="selected"');
986  break;
987  case 4:
988  $this->tpl->setVariable("Q_SELECT",'selected="selected"');
989  break;
990 
991  }
992  }
993  if ($settings["soap_user_administration"])
994  {
995  $this->tpl->setVariable("SOAP_USER_ADMINISTRATION_CHECK","checked=\"checked\"");
996  }
997 
998  $this->tpl->setVariable("JAVA_SERVER_HOST",$settings["rpc_server_host"]);
999  $this->tpl->setVariable("JAVA_SERVER_PORT",$settings["rpc_server_port"]);
1000 
1001 
1002  // paths to tools
1003  $not_set = $this->lng->txt("path_not_set");
1004 
1005  $this->tpl->setVariable("CONVERT_PATH",(PATH_TO_CONVERT) ? PATH_TO_CONVERT : $not_set);
1006  $this->tpl->setVariable("ZIP_PATH",(PATH_TO_ZIP) ? PATH_TO_ZIP : $not_set);
1007  $this->tpl->setVariable("UNZIP_PATH",(PATH_TO_UNZIP) ? PATH_TO_UNZIP : $not_set);
1008  $this->tpl->setVariable("JAVA_PATH",(PATH_TO_JAVA) ? PATH_TO_JAVA : $not_set);
1009  $this->tpl->setVariable("HTMLDOC_PATH",(PATH_TO_HTMLDOC) ? PATH_TO_HTMLDOC : $not_set);
1010  $this->tpl->setVariable("MKISOFS_PATH",(PATH_TO_MKISOFS) ? PATH_TO_MKISOFS : $not_set);
1011  $this->tpl->setVariable("LATEX_URL",(URL_TO_LATEX) ? URL_TO_LATEX : $not_set);
1012 
1013  // contact
1014  $this->tpl->setVariable("ADMIN_FIRSTNAME",$settings["admin_firstname"]);
1015  $this->tpl->setVariable("ADMIN_LASTNAME",$settings["admin_lastname"]);
1016  $this->tpl->setVariable("ADMIN_TITLE",$settings["admin_title"]);
1017  $this->tpl->setVariable("ADMIN_POSITION",$settings["admin_position"]);
1018  $this->tpl->setVariable("ADMIN_INSTITUTION",$settings["admin_institution"]);
1019  $this->tpl->setVariable("ADMIN_STREET",$settings["admin_street"]);
1020  $this->tpl->setVariable("ADMIN_ZIPCODE",$settings["admin_zipcode"]);
1021  $this->tpl->setVariable("ADMIN_CITY",$settings["admin_city"]);
1022  $this->tpl->setVariable("ADMIN_COUNTRY",$settings["admin_country"]);
1023  $this->tpl->setVariable("ADMIN_PHONE",$settings["admin_phone"]);
1024  $this->tpl->setVariable("ADMIN_EMAIL",$settings["admin_email"]);
1025 
1026  $this->tpl->parseCurrentBlock();
1027  }
1028 
1030  {
1031  return $this->viewScanLog();
1032  }
1033 
1039  function checkObject()
1040  {
1041  global $rbacsystem, $ilias, $objDefinition, $ilSetting;
1042 
1043  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1044  {
1045  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1046  }
1047 //echo "1";
1048 
1049  if ($_POST['count_limit'] !== null || $_POST['age_limit'] !== null || $_POST['type_limit'] !== null)
1050  {
1051  $ilias->account->writePref('systemcheck_count_limit',
1052  (is_numeric($_POST['count_limit']) && $_POST['count_limit'] > 0) ? $_POST['count_limit'] : ''
1053  );
1054  $ilias->account->writePref('systemcheck_age_limit',
1055  (is_numeric($_POST['age_limit']) && $_POST['age_limit'] > 0) ? $_POST['age_limit'] : '');
1056  $ilias->account->writePref('systemcheck_type_limit', trim($_POST['type_limit']));
1057  }
1058 
1059  if ($_POST["mode"])
1060  {
1061 //echo "3";
1062  $this->writeCheckParams();
1063  $this->startValidator($_POST["mode"],$_POST["log_scan"]);
1064  }
1065  else
1066  {
1067 //echo "4";
1068  include_once "classes/class.ilValidator.php";
1069  $validator = new ilValidator();
1070  $hasScanLog = $validator->hasScanLog();
1071 
1072  $this->getTemplateFile("check");
1073 
1074  if ($hasScanLog)
1075  {
1076  $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_last_log"));
1077  }
1078 
1079  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1080  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("systemcheck"));
1081  $this->tpl->setVariable("COLSPAN", 3);
1082  $this->tpl->setVariable("TXT_ANALYZE_TITLE", $this->lng->txt("analyze_data"));
1083  $this->tpl->setVariable("TXT_ANALYSIS_OPTIONS", $this->lng->txt("analysis_options"));
1084  $this->tpl->setVariable("TXT_REPAIR_OPTIONS", $this->lng->txt("repair_options"));
1085  $this->tpl->setVariable("TXT_OUTPUT_OPTIONS", $this->lng->txt("output_options"));
1086  $this->tpl->setVariable("TXT_SCAN", $this->lng->txt("scan"));
1087  $this->tpl->setVariable("TXT_SCAN_DESC", $this->lng->txt("scan_desc"));
1088  $this->tpl->setVariable("TXT_DUMP_TREE", $this->lng->txt("dump_tree"));
1089  $this->tpl->setVariable("TXT_DUMP_TREE_DESC", $this->lng->txt("dump_tree_desc"));
1090  $this->tpl->setVariable("TXT_CLEAN", $this->lng->txt("clean"));
1091  $this->tpl->setVariable("TXT_CLEAN_DESC", $this->lng->txt("clean_desc"));
1092  $this->tpl->setVariable("TXT_RESTORE", $this->lng->txt("restore_missing"));
1093  $this->tpl->setVariable("TXT_RESTORE_DESC", $this->lng->txt("restore_missing_desc"));
1094  $this->tpl->setVariable("TXT_PURGE", $this->lng->txt("purge_missing"));
1095  $this->tpl->setVariable("TXT_PURGE_DESC", $this->lng->txt("purge_missing_desc"));
1096  $this->tpl->setVariable("TXT_RESTORE_TRASH", $this->lng->txt("restore_trash"));
1097  $this->tpl->setVariable("TXT_RESTORE_TRASH_DESC", $this->lng->txt("restore_trash_desc"));
1098  $this->tpl->setVariable("TXT_PURGE_TRASH", $this->lng->txt("purge_trash"));
1099  $this->tpl->setVariable("TXT_PURGE_TRASH_DESC", $this->lng->txt("purge_trash_desc"));
1100  $this->tpl->setVariable("TXT_COUNT_LIMIT", $this->lng->txt("purge_count_limit"));
1101  $this->tpl->setVariable("TXT_COUNT_LIMIT_DESC", $this->lng->txt("purge_count_limit_desc"));
1102  $this->tpl->setVariable("COUNT_LIMIT_VALUE", $ilias->account->getPref("systemcheck_count_limit"));
1103  $this->tpl->setVariable("TXT_AGE_LIMIT", $this->lng->txt("purge_age_limit"));
1104  $this->tpl->setVariable("TXT_AGE_LIMIT_DESC", $this->lng->txt("purge_age_limit_desc"));
1105  $this->tpl->setVariable("AGE_LIMIT_VALUE", $ilias->account->getPref("systemcheck_age_limit"));
1106  $this->tpl->setVariable("TXT_TYPE_LIMIT", $this->lng->txt("purge_type_limit"));
1107  $this->tpl->setVariable("TXT_TYPE_LIMIT_DESC", $this->lng->txt("purge_type_limit_desc"));
1108 
1109  if($ilias->account->getPref('systemcheck_mode_scan'))
1110  $this->tpl->touchBlock('mode_scan_checked');
1111  if($ilias->account->getPref('systemcheck_mode_dump_tree'))
1112  $this->tpl->touchBlock('mode_dump_tree_checked');
1113  if($ilias->account->getPref('systemcheck_mode_clean'))
1114  $this->tpl->touchBlock('mode_clean_checked');
1115  if($ilias->account->getPref('systemcheck_mode_restore'))
1116  {
1117  $this->tpl->touchBlock('mode_restore_checked');
1118  $this->tpl->touchBlock('mode_purge_disabled');
1119  }
1120  elseif($ilias->account->getPref('systemcheck_mode_purge'))
1121  {
1122  $this->tpl->touchBlock('mode_purge_checked');
1123  $this->tpl->touchBlock('mode_restore_disabled');
1124  }
1125  if($ilias->account->getPref('systemcheck_mode_restore_trash'))
1126  {
1127  $this->tpl->touchBlock('mode_restore_trash_checked');
1128  $this->tpl->touchBlock('mode_purge_trash_disabled');
1129  }
1130  elseif($ilias->account->getPref('systemcheck_mode_purge_trash'))
1131  {
1132  $this->tpl->touchBlock('mode_purge_trash_checked');
1133  $this->tpl->touchBlock('mode_restore_trash_disabled');
1134  }
1135  if($ilias->account->getPref('systemcheck_log_scan'))
1136  $this->tpl->touchBlock('log_scan_checked');
1137 
1138  $types = $objDefinition->getAllObjects();
1139  $ts = array("" => "");
1140  foreach ($types as $t)
1141  {
1142  if ($t != "" && !$objDefinition->isSystemObject($t) && $t != "root")
1143  {
1144  if ($objDefinition->isPlugin($t))
1145  {
1146  $ts[$t] = ilPlugin::lookupTxt("rep_robj", $t, "obj_".$t);
1147  }
1148  else
1149  {
1150  $ts[$t] = $this->lng->txt("obj_".$t);
1151  }
1152  }
1153  }
1154  $this->tpl->setVariable("TYPE_LIMIT_CHOICE",
1156  $ilias->account->getPref("systemcheck_type_limit"),
1157  'type_limit',
1158  $ts, false, true
1159  )
1160  );
1161  $this->tpl->setVariable("TXT_LOG_SCAN", $this->lng->txt("log_scan"));
1162  $this->tpl->setVariable("TXT_LOG_SCAN_DESC", $this->lng->txt("log_scan_desc"));
1163  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("start_scan"));
1164 
1165  $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save_params_for_cron"));
1166 
1167  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1168 
1169  $cron_form = new ilPropertyFormGUI();
1170  $cron_form->setFormAction($this->ctrl->getFormAction($this));
1171  $cron_form->setTitle($this->lng->txt('systemcheck_cronform'));
1172 
1173  $radio_group = new ilRadioGroupInputGUI($this->lng->txt('systemcheck_cron'), 'cronjob' );
1174  $radio_group->setValue( $ilSetting->get('systemcheck_cron') );
1175 
1176  $radio_opt = new ilRadioOption($this->lng->txt('disabled'),0);
1177  $radio_group->addOption($radio_opt);
1178 
1179  $radio_opt = new ilRadioOption($this->lng->txt('enabled'),1);
1180  $radio_group->addOption($radio_opt);
1181 
1182  $cron_form->addItem($radio_group);
1183 
1184  $cron_form->addCommandButton('saveCheckCron',$this->lng->txt('save'));
1185 
1186  $this->tpl->setVariable('CRON_FORM',$cron_form->getHTML());
1187  }
1188  }
1189 
1190  private function saveCheckParamsObject()
1191  {
1192  $this->writeCheckParams();
1193  unset($_POST['mode']);
1194  return $this->checkObject();
1195  }
1196 
1197  private function writeCheckParams()
1198  {
1199  include_once "classes/class.ilValidator.php";
1200  $validator = new ilValidator();
1201  $modes = $validator->getPossibleModes();
1202 
1203  $prefs = array();
1204  foreach($modes as $mode)
1205  {
1206  if( isset($_POST['mode'][$mode]) ) $value = (int)$_POST['mode'][$mode];
1207  else $value = 0;
1208  $prefs[ 'systemcheck_mode_'.$mode ] = $value;
1209  }
1210 
1211  if( isset($_POST['log_scan']) ) $value = (int)$_POST['log_scan'];
1212  else $value = 0;
1213  $prefs['systemcheck_log_scan'] = $value;
1214 
1215  global $ilUser;
1216  foreach($prefs as $key => $val)
1217  {
1218  $ilUser->writePref($key,$val);
1219  }
1220  }
1221 
1222  private function saveCheckCronObject()
1223  {
1224  global $ilSetting;
1225 
1226  $systemcheck_cron = ($_POST['cronjob'] ? 1 : 0);
1227  $ilSetting->set('systemcheck_cron',$systemcheck_cron);
1228 
1229  unset($_POST['mode']);
1230  return $this->checkObject();
1231  }
1232 
1239  {
1240  global $rbacsystem, $styleDefinition;
1241 
1242  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.header_title_edit.html");
1243 
1244  $array_push = true;
1245 
1246  if ($_SESSION["error_post_vars"])
1247  {
1248  $_SESSION["translation_post"] = $_SESSION["error_post_vars"];
1249  $_GET["mode"] = "session";
1250  $array_push = false;
1251  }
1252 
1253  // load from db if edit category is called the first time
1254  if (($_GET["mode"] != "session"))
1255  {
1256  $data = $this->object->getHeaderTitleTranslations();
1257  $_SESSION["translation_post"] = $data;
1258  $array_push = false;
1259  } // remove a translation from session
1260  elseif ($_GET["entry"] != 0)
1261  {
1262  array_splice($_SESSION["translation_post"]["Fobject"],$_GET["entry"],1,array());
1263 
1264  if ($_GET["entry"] == $_SESSION["translation_post"]["default_language"])
1265  {
1266  $_SESSION["translation_post"]["default_language"] = "";
1267  }
1268  }
1269 
1270  $data = $_SESSION["translation_post"];
1271 
1272  // add additional translation form
1273  if (!$_GET["entry"] and $array_push)
1274  {
1275  $count = array_push($data["Fobject"],array("title" => "","desc" => ""));
1276  }
1277  else
1278  {
1279  $count = count($data["Fobject"]);
1280  }
1281 
1282  // stripslashes in form?
1283  $strip = isset($_SESSION["translation_post"]) ? true : false;
1284 
1285  foreach ($data["Fobject"] as $key => $val)
1286  {
1287  // add translation button
1288  if ($key == $count -1)
1289  {
1290  $this->tpl->setCurrentBlock("addTranslation");
1291  $this->tpl->setVariable("TXT_ADD_TRANSLATION",$this->lng->txt("add_translation")." >>");
1292  $this->tpl->parseCurrentBlock();
1293  }
1294 
1295  // remove translation button
1296  if ($key != 0)
1297  {
1298  $this->tpl->setCurrentBlock("removeTranslation");
1299  $this->tpl->setVariable("TXT_REMOVE_TRANSLATION",$this->lng->txt("remove_translation"));
1300  $this->ctrl->setParameter($this, "entry", $key);
1301  $this->ctrl->setParameter($this, "mode", "edit");
1302  $this->tpl->setVariable("LINK_REMOVE_TRANSLATION",
1303  $this->ctrl->getLinkTarget($this, "removeTranslation"));
1304  $this->tpl->parseCurrentBlock();
1305  }
1306 
1307  // lang selection
1308  $this->tpl->addBlockFile("SEL_LANGUAGE", "sel_language", "tpl.lang_selection.html", false);
1309  $this->tpl->setVariable("SEL_NAME", "Fobject[".$key."][lang]");
1310 
1311  include_once('Services/MetaData/classes/class.ilMDLanguageItem.php');
1312 
1313  $languages = ilMDLanguageItem::_getLanguages();
1314 
1315  foreach ($languages as $code => $language)
1316  {
1317  $this->tpl->setCurrentBlock("lg_option");
1318  $this->tpl->setVariable("VAL_LG", $code);
1319  $this->tpl->setVariable("TXT_LG", $language);
1320 
1321  if ($code == $val["lang"])
1322  {
1323  $this->tpl->setVariable("SELECTED", "selected=\"selected\"");
1324  }
1325 
1326  $this->tpl->parseCurrentBlock();
1327  }
1328 
1329  // object data
1330  $this->tpl->setCurrentBlock("obj_form");
1331 
1332  if ($key == 0)
1333  {
1334  $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("change_header_title"));
1335  }
1336  else
1337  {
1338  $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("translation")." ".$key);
1339  }
1340 
1341  if ($key == $data["default_language"])
1342  {
1343  $this->tpl->setVariable("CHECKED", "checked=\"checked\"");
1344  }
1345 
1346  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
1347  $this->tpl->setVariable("TXT_DESC", $this->lng->txt("desc"));
1348  $this->tpl->setVariable("TXT_DEFAULT", $this->lng->txt("default"));
1349  $this->tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language"));
1350  $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($val["title"],$strip));
1351  $this->tpl->setVariable("DESC", ilUtil::stripSlashes($val["desc"]));
1352  $this->tpl->setVariable("NUM", $key);
1353  $this->tpl->parseCurrentBlock();
1354  }
1355 
1356  // global
1357  $this->tpl->setCurrentBlock("adm_content");
1358 
1359  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1360  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
1361  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
1362  $this->tpl->setVariable("CMD_SUBMIT", "saveHeaderTitle");
1363  $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
1364  }
1365 
1370  {
1371  $data = $_POST;
1372 
1373  // default language set?
1374  if (!isset($data["default_language"]))
1375  {
1376  $this->ilias->raiseError($this->lng->txt("msg_no_default_language"),$this->ilias->error_obj->MESSAGE);
1377  }
1378 
1379  // prepare array fro further checks
1380  foreach ($data["Fobject"] as $key => $val)
1381  {
1382  $langs[$key] = $val["lang"];
1383  }
1384 
1385  $langs = array_count_values($langs);
1386 
1387  // all languages set?
1388  if (array_key_exists("",$langs))
1389  {
1390  $this->ilias->raiseError($this->lng->txt("msg_no_language_selected"),$this->ilias->error_obj->MESSAGE);
1391  }
1392 
1393  // no single language is selected more than once?
1394  if (array_sum($langs) > count($langs))
1395  {
1396  $this->ilias->raiseError($this->lng->txt("msg_multi_language_selected"),$this->ilias->error_obj->MESSAGE);
1397  }
1398 
1399  // copy default translation to variable for object data entry
1400  $_POST["Fobject"]["title"] = $_POST["Fobject"][$_POST["default_language"]]["title"];
1401  $_POST["Fobject"]["desc"] = $_POST["Fobject"][$_POST["default_language"]]["desc"];
1402 
1403  // first delete all translation entries...
1404  $this->object->removeHeaderTitleTranslations();
1405 
1406  // ...and write new translations to object_translation
1407  foreach ($data["Fobject"] as $key => $val)
1408  {
1409  if ($key == $data["default_language"])
1410  {
1411  $default = 1;
1412  }
1413  else
1414  {
1415  $default = 0;
1416  }
1417 
1418  $this->object->addHeaderTitleTranslation(ilUtil::stripSlashes($val["title"]),ilUtil::stripSlashes($val["desc"]),$val["lang"],$default);
1419  }
1420 
1421  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
1422 
1423  $this->ctrl->redirect($this);
1424  }
1425 
1426  function cancelObject()
1427  {
1428  $this->ctrl->redirect($this, "view");
1429  }
1430 
1437  {
1438  $_SESSION["translation_post"] = $_POST;
1439 
1440  $this->ctrl->setParameter($this, "mode", "session");
1441  $this->ctrl->setParameter($this, "entry", "0");
1442  $this->ctrl->redirect($this, "changeHeaderTitle");
1443  }
1444 
1451  {
1452  $this->ctrl->setParameter($this, "entry", $_GET["entry"]);
1453  $this->ctrl->setParameter($this, "mode", "session");
1454  $this->ctrl->redirect($this, "changeHeaderTitle");
1455  }
1456 
1457 
1458  function startValidator($a_mode,$a_log)
1459  {
1460  global $rbacsystem;
1461 
1462  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1463  {
1464  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1465  }
1466 
1467  $logging = ($a_log) ? true : false;
1468  include_once "classes/class.ilValidator.php";
1469  $validator = new ilValidator($logging);
1470  $validator->setMode("all",false);
1471 
1472  $modes = array();
1473  foreach ($a_mode as $mode => $value)
1474  {
1475  $validator->setMode($mode,(bool) $value);
1476  $modes[] = $mode.'='.$value;
1477  }
1478 
1479  $scan_log = $validator->validate();
1480 
1481  $mode = $this->lng->txt("scan_modes").": ".implode(', ',$modes);
1482 
1483  // output
1484  $this->getTemplateFile("scan");
1485 
1486  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1487  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scanning_system"));
1488  $this->tpl->setVariable("COLSPAN", 3);
1489  $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
1490  $this->tpl->setVariable("TXT_MODE", $mode);
1491 
1492  if ($logging === true)
1493  {
1494  $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_log"));
1495  }
1496 
1497  $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
1498 
1499  $validator->writeScanLogLine($mode);
1500  }
1501 
1502  function viewScanLog()
1503  {
1504  include_once "classes/class.ilValidator.php";
1505  $validator = new IlValidator();
1506  $scan_log =& $validator->readScanLog();
1507 
1508  if (is_array($scan_log))
1509  {
1510  $scan_log = '<pre>'.implode("",$scan_log).'</pre>';
1511  $this->tpl->setVariable("ADM_CONTENT", $scan_log);
1512  }
1513  else
1514  {
1515  $scan_log = "no scanlog found.";
1516  }
1517 
1518  // output
1519  $this->getTemplateFile("scan");
1520  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scan_details"));
1521  $this->tpl->setVariable("COLSPAN", 3);
1522  $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
1523  $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
1524  }
1525 
1526 
1530  function benchmarkObject()
1531  {
1532  global $ilBench, $rbacsystem, $lng, $ilCtrl, $ilSetting, $tpl;
1533 
1534  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1535  {
1536  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1537  }
1538 
1539  $this->benchmarkSubTabs("settings");
1540 
1541  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1542  $this->form = new ilPropertyFormGUI();
1543 
1544  // Activate DB Benchmark
1545  $cb = new ilCheckboxInputGUI($lng->txt("adm_activate_db_benchmark"), "enable_db_bench");
1546  $cb->setChecked($ilSetting->get("enable_db_bench"));
1547  $cb->setInfo($lng->txt("adm_activate_db_benchmark_desc"));
1548  $this->form->addItem($cb);
1549 
1550  // DB Benchmark User
1551  $ti = new ilTextInputGUI($lng->txt("adm_db_benchmark_user"), "db_bench_user");
1552  $ti->setValue($ilSetting->get("db_bench_user"));
1553  $ti->setInfo($lng->txt("adm_db_benchmark_user_desc"));
1554  $this->form->addItem($ti);
1555 
1556  $this->form->addCommandButton("saveBenchSettings", $lng->txt("save"));
1557 
1558  $this->form->setTitle($lng->txt("adm_db_benchmark"));
1559  $this->form->setFormAction($ilCtrl->getFormAction($this));
1560 
1561  $tpl->setContent($this->form->getHTML());
1562  }
1563 
1568  {
1569  $this->benchmarkSubTabs("chronological");
1570  $this->showDbBenchResults("chronological");
1571  }
1572 
1577  {
1578  $this->benchmarkSubTabs("slowest_first");
1579  $this->showDbBenchResults("slowest_first");
1580  }
1581 
1586  {
1587  $this->benchmarkSubTabs("sorted_by_sql");
1588  $this->showDbBenchResults("sorted_by_sql");
1589  }
1590 
1595  {
1596  $this->benchmarkSubTabs("by_first_table");
1597  $this->showDbBenchResults("by_first_table");
1598  }
1599 
1605  function showDbBenchResults($a_mode)
1606  {
1607  global $ilBench, $lng, $tpl;
1608 
1609  $rec = $ilBench->getDbBenchRecords();
1610 
1611  include_once("./Modules/SystemFolder/classes/class.ilBenchmarkTableGUI.php");
1612  $table = new ilBenchmarkTableGUI($this, "benchmark", $rec, $a_mode);
1613  $tpl->setContent($table->getHTML());
1614  }
1615 
1622  function benchmarkSubTabs($a_current)
1623  {
1624  global $ilTabs, $lng, $ilCtrl, $ilBench;
1625 
1626  $ilTabs->addSubtab("settings",
1627  $lng->txt("settings"),
1628  $ilCtrl->getLinkTarget($this, "benchmark"));
1629 
1630  $rec = $ilBench->getDbBenchRecords();
1631  if (count($rec) > 0)
1632  {
1633  $ilTabs->addSubtab("chronological",
1634  $lng->txt("adm_db_bench_chronological"),
1635  $ilCtrl->getLinkTarget($this, "showDbBenchChronological"));
1636  $ilTabs->addSubtab("slowest_first",
1637  $lng->txt("adm_db_bench_slowest_first"),
1638  $ilCtrl->getLinkTarget($this, "showDbBenchSlowestFirst"));
1639  $ilTabs->addSubtab("sorted_by_sql",
1640  $lng->txt("adm_db_bench_sorted_by_sql"),
1641  $ilCtrl->getLinkTarget($this, "showDbBenchSortedBySql"));
1642  $ilTabs->addSubtab("by_first_table",
1643  $lng->txt("adm_db_bench_by_first_table"),
1644  $ilCtrl->getLinkTarget($this, "showDbBenchByFirstTable"));
1645  }
1646 
1647  $ilTabs->activateSubTab($a_current);
1648  }
1649 
1650 
1655  {
1656  global $ilBench;
1657 
1658  if ($_POST["enable_db_bench"])
1659  {
1660  $ilBench->enableDbBench(true, ilUtil::stripSlashes($_POST["db_bench_user"]));
1661  }
1662  else
1663  {
1664  $ilBench->enableDbBench(false);
1665  }
1666 
1667  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1668 
1669  $this->ctrl->redirect($this, "benchmark");
1670  }
1671 
1672 
1677  {
1678  global $ilBench;
1679 
1680  $this->ctrl->setParameter($this,'cur_mod',$_POST['module']);
1681  $this->ctrl->redirect($this, "benchmark");
1682  }
1683 
1684 
1688  function clearBenchObject()
1689  {
1690  global $ilBench;
1691 
1692  $ilBench->clearData();
1693  $this->saveBenchSettingsObject();
1694 
1695  }
1696 
1697  // get tabs
1698  function getAdminTabs(&$tabs_gui)
1699  {
1700  global $rbacsystem;
1701 
1702  $this->ctrl->setParameter($this,"ref_id",$this->object->getRefId());
1703 
1704 /* if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1705  {
1706  $tabs_gui->addTarget("settings",
1707  $this->ctrl->getLinkTarget($this, "view"), array("view", "saveSettings"), get_class($this));
1708  }*/
1709 
1710  // server info
1711  if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1712  {
1713  $tabs_gui->addTarget("server_data",
1714  $this->ctrl->getLinkTarget($this, "showServerInfo"),
1715  array("showServerInfo", "view"), get_class($this));
1716  }
1717 
1718  // general settings
1719  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
1720  {
1721  $tabs_gui->addTarget("general_settings",
1722  $this->ctrl->getLinkTarget($this, "showBasicSettings"),
1723  array("showBasicSettings", "saveBasicSettings"), get_class($this));
1724  }
1725 
1726  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
1727  {
1728  //$tabs_gui->addTarget("edit_properties",
1729  // $this->ctrl->getLinkTarget($this, "edit"), "edit", get_class($this));
1730 
1731  $tabs_gui->addTarget("system_check",
1732  $this->ctrl->getLinkTarget($this, "check"), array("check","viewScanLog","saveCheckParams","saveCheckCron"), get_class($this));
1733 
1734  $tabs_gui->addTarget("benchmarks",
1735  $this->ctrl->getLinkTarget($this, "benchmark"), "benchmark", get_class($this));
1736  }
1737 
1738  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
1739  {
1740  $tabs_gui->addTarget("perm_settings",
1741  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
1742  }
1743  }
1744 
1749  {
1750  phpinfo();
1751  exit;
1752  }
1753 
1754  //
1755  //
1756  // Server Info
1757  //
1758  //
1759 
1764  {
1765  global $tpl, $ilCtrl, $ilToolbar;
1766 
1767  $this->initServerInfoForm();
1768 
1769  $btpl = new ilTemplate("tpl.server_data.html", true, true, "Modules/SystemFolder");
1770  $btpl->setVariable("FORM", $this->form->getHTML());
1771  $btpl->setVariable("PHP_INFO_TARGET", $ilCtrl->getLinkTarget($this, "showPHPInfo"));
1772  $tpl->setContent($btpl->get());
1773  }
1774 
1780  public function initServerInfoForm()
1781  {
1782  global $lng, $ilClientIniFile, $ilSetting;
1783 
1784  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1785  $this->form = new ilPropertyFormGUI();
1786 
1787  // installation name
1788  $ne = new ilNonEditableValueGUI($lng->txt("inst_name"), "");
1789  $ne->setValue($ilClientIniFile->readVariable("client","name"));
1790  $ne->setInfo($ilClientIniFile->readVariable("client","description"));
1791  $this->form->addItem($ne);
1792 
1793  // client id
1794  $ne = new ilNonEditableValueGUI($lng->txt("client_id"), "");
1795  $ne->setValue(CLIENT_ID);
1796  $this->form->addItem($ne);
1797 
1798  // installation id
1799  $ne = new ilNonEditableValueGUI($lng->txt("inst_id"), "");
1800  $ne->setValue($ilSetting->get("inst_id"));
1801  $this->form->addItem($ne);
1802 
1803  // database version
1804  $ne = new ilNonEditableValueGUI($lng->txt("db_version"), "");
1805  $ne->setValue($ilSetting->get("db_version"));
1806  include_once ("./Services/Database/classes/class.ilDBUpdate.php");
1807  $dbupdate = new ilDBUpdate($this->ilias->db,true);
1808  if (!$dbupdate->getDBVersionStatus())
1809  {
1810  ilUtil::sendFailure($this->lng->txt("db_need_update"));
1811  }
1812  else if ($dbupdate->hotfixAvailable())
1813  {
1814  ilUtil::sendFailure($this->lng->txt("db_need_hotfix"));
1815  }
1816  $this->form->addItem($ne);
1817 
1818  // ilias version
1819  $ne = new ilNonEditableValueGUI($lng->txt("ilias_version"), "");
1820  $ne->setValue($ilSetting->get("ilias_version"));
1821  $this->form->addItem($ne);
1822 
1823  // host
1824  $ne = new ilNonEditableValueGUI($lng->txt("host"), "");
1825  $ne->setValue($_SERVER["SERVER_NAME"]);
1826  $this->form->addItem($ne);
1827 
1828  // ip & port
1829  $ne = new ilNonEditableValueGUI($lng->txt("ip_address")." & ".$this->lng->txt("port"), "");
1830  $ne->setValue($_SERVER["SERVER_ADDR"].":".$_SERVER["SERVER_PORT"]);
1831  $this->form->addItem($ne);
1832 
1833  // server
1834  $ne = new ilNonEditableValueGUI($lng->txt("server_software"), "");
1835  $ne->setValue($_SERVER["SERVER_SOFTWARE"]);
1836  $this->form->addItem($ne);
1837 
1838  // http path
1839  $ne = new ilNonEditableValueGUI($lng->txt("http_path"), "");
1840  $ne->setValue(ILIAS_HTTP_PATH);
1841  $this->form->addItem($ne);
1842 
1843  // absolute path
1844  $ne = new ilNonEditableValueGUI($lng->txt("absolute_path"), "");
1846  $this->form->addItem($ne);
1847 
1848  $not_set = $lng->txt("path_not_set");
1849 
1850  // convert
1851  $ne = new ilNonEditableValueGUI($lng->txt("path_to_convert"), "");
1852  $ne->setValue((PATH_TO_CONVERT) ? PATH_TO_CONVERT : $not_set);
1853  $this->form->addItem($ne);
1854 
1855  // zip
1856  $ne = new ilNonEditableValueGUI($lng->txt("path_to_zip"), "");
1857  $ne->setValue((PATH_TO_ZIP) ? PATH_TO_ZIP : $not_set);
1858  $this->form->addItem($ne);
1859 
1860  // unzip
1861  $ne = new ilNonEditableValueGUI($lng->txt("path_to_unzip"), "");
1862  $ne->setValue((PATH_TO_UNZIP) ? PATH_TO_UNZIP : $not_set);
1863  $this->form->addItem($ne);
1864 
1865  // java
1866  $ne = new ilNonEditableValueGUI($lng->txt("path_to_java"), "");
1867  $ne->setValue((PATH_TO_JAVA) ? PATH_TO_JAVA : $not_set);
1868  $this->form->addItem($ne);
1869 
1870  // htmldoc
1871  $ne = new ilNonEditableValueGUI($lng->txt("path_to_htmldoc"), "");
1872  $ne->setValue((PATH_TO_HTMLDOC) ? PATH_TO_HTMLDOC : $not_set);
1873  $this->form->addItem($ne);
1874 
1875  // mkisofs
1876  $ne = new ilNonEditableValueGUI($lng->txt("path_to_mkisofs"), "");
1877  $ne->setValue((PATH_TO_MKISOFS) ? PATH_TO_MKISOFS : $not_set);
1878  $this->form->addItem($ne);
1879 
1880  // latex
1881  $ne = new ilNonEditableValueGUI($lng->txt("url_to_latex"), "");
1882  $ne->setValue((URL_TO_LATEX) ? URL_TO_LATEX : $not_set);
1883  $this->form->addItem($ne);
1884 
1885 
1886  $this->form->setTitle($lng->txt("server_data"));
1887  $this->form->setFormAction($this->ctrl->getFormAction($this));
1888 
1889  }
1890 
1891  //
1892  //
1893  // General Settings
1894  //
1895  //
1896 
1900  function setGeneralSettingsSubTabs($a_activate)
1901  {
1902  global $ilTabs, $ilCtrl;
1903 
1904  $ilTabs->addSubTabTarget("basic_settings", $ilCtrl->getLinkTarget($this, "showBasicSettings"));
1905  $ilTabs->addSubTabTarget("header_title", $ilCtrl->getLinkTarget($this, "showHeaderTitle"));
1906  $ilTabs->addSubTabTarget("cron_jobs", $ilCtrl->getLinkTarget($this, "showCronJobs"));
1907  $ilTabs->addSubTabTarget("contact_data", $ilCtrl->getLinkTarget($this, "showContactInformation"));
1908  $ilTabs->addSubTabTarget("webservices", $ilCtrl->getLinkTarget($this, "showWebServices"));
1909  $ilTabs->addSubTabTarget("java_server", $ilCtrl->getLinkTarget($this, "showJavaServer"));
1910  $ilTabs->addSubTabTarget("proxy", $ilCtrl->getLinkTarget($this, "showProxy"));
1911 
1912  $ilTabs->setSubTabActive($a_activate);
1913  $ilTabs->setTabActive("general_settings");
1914  }
1915 
1916  //
1917  //
1918  // Basic Settings
1919  //
1920  //
1921 
1926  {
1927  global $tpl;
1928 
1929  $this->initBasicSettingsForm();
1930  $this->setGeneralSettingsSubTabs("basic_settings");
1931 
1932  $tpl->setContent($this->form->getHTML());
1933  }
1934 
1935 
1939  public function initBasicSettingsForm()
1940  {
1941  global $lng, $ilSetting, $ilClientIniFile;
1942 
1943  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1944  $this->form = new ilPropertyFormGUI();
1945  $lng->loadLanguageModule("pd");
1946 
1947  // installation short title
1948  $ti = new ilTextInputGUI($this->lng->txt("short_inst_name"), "short_inst_name");
1949  $ti->setMaxLength(200);
1950  $ti->setSize(40);
1951  $ti->setValue($ilSetting->get("short_inst_name"));
1952  $ti->setInfo($this->lng->txt("short_inst_name_info"));
1953  $this->form->addItem($ti);
1954 
1955  // public section
1956  $cb = new ilCheckboxInputGUI($this->lng->txt("pub_section"), "pub_section");
1957  $cb->setInfo($lng->txt("pub_section_info"));
1958  if ($ilSetting->get("pub_section"))
1959  {
1960  $cb->setChecked(true);
1961  }
1962  // search engine
1963  include_once('Services/PrivacySecurity/classes/class.ilRobotSettings.php');
1964  $robot_settings = ilRobotSettings::_getInstance();
1965  $cb2 = new ilCheckboxInputGUI($this->lng->txt("search_engine"), "open_google");
1966  $cb2->setInfo($this->lng->txt("enable_search_engine"));
1967  $cb->addSubItem($cb2);
1968  if(!$robot_settings->checkModRewrite())
1969  {
1970  $cb2->setAlert($lng->txt("mod_rewrite_disabled"));
1971  $cb2->setChecked(false);
1972  $cb2->setDisabled(true);
1973  }
1974  elseif(!$robot_settings->checkRewrite())
1975  {
1976  $cb2->setAlert($lng->txt("allow_override_alert"));
1977  $cb2->setChecked(false);
1978  $cb2->setDisabled(true);
1979  }
1980  else
1981  {
1982  if ($ilSetting->get("open_google"))
1983  {
1984  $cb2->setChecked(true);
1985  }
1986  }
1987 
1988  // Enable Global Profiles
1989  $cb_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_global_profiles'), 'enable_global_profiles');
1990  $cb_prop->setInfo($lng->txt('pd_enable_global_profiles_info'));
1991  $cb_prop->setChecked($ilSetting->get('enable_global_profiles'));
1992  $cb->addSubItem($cb_prop);
1993 
1994  $this->form->addItem($cb);
1995 
1996  // default repository view
1997  $options = array(
1998  "flat" => $lng->txt("flatview"),
1999  "tree" => $lng->txt("treeview")
2000  );
2001  $si = new ilSelectInputGUI($this->lng->txt("def_repository_view"), "default_rep_view");
2002  $si->setOptions($options);
2003  $si->setInfo($this->lng->txt(""));
2004  if ($ilSetting->get("default_repository_view") == "tree")
2005  {
2006  $si->setValue("tree");
2007  }
2008  else
2009  {
2010  $si->setValue("flat");
2011  }
2012  $this->form->addItem($si);
2013 
2014  //
2015  $options = array(
2016  "" => $lng->txt("adm_rep_tree_only_container"),
2017  "tree" => $lng->txt("adm_all_resource_types")
2018  );
2019 
2020  // repository tree
2021  $radg = new ilRadioGroupInputGUI($lng->txt("adm_rep_tree_presentation"), "tree_pres");
2022  $radg->setValue($ilSetting->get("repository_tree_pres"));
2023  $op1 = new ilRadioOption($lng->txt("adm_rep_tree_only_cntr"), "",
2024  $lng->txt("adm_rep_tree_only_cntr_info"));
2025  $radg->addOption($op1);
2026 
2027  $op2 = new ilRadioOption($lng->txt("adm_rep_tree_all_types"), "all_types",
2028  $lng->txt("adm_rep_tree_all_types_info"));
2029 
2030  // limit tree in courses and groups
2031  $cb = new ilCheckboxInputGUI($lng->txt("adm_rep_tree_limit_grp_crs"), "rep_tree_limit_grp_crs");
2032  $cb->setChecked($ilSetting->get("rep_tree_limit_grp_crs"));
2033  $cb->setInfo($lng->txt("adm_rep_tree_limit_grp_crs_info"));
2034  $op2->addSubItem($cb);
2035 
2036  $radg->addOption($op2);
2037 
2038  $this->form->addItem($radg);
2039 
2040  // synchronize repository tree with main view
2041  $cb = new ilCheckboxInputGUI($lng->txt("adm_synchronize_rep_tree"), "rep_tree_synchronize");
2042  $cb->setInfo($lng->txt("adm_synchronize_rep_tree_info"));
2043  $cb->setChecked($ilSetting->get("rep_tree_synchronize"));
2044  $this->form->addItem($cb);
2045 
2046  // repository access check
2047  $options = array(
2048  0 => "0",
2049  10 => "10",
2050  30 => "30",
2051  60 => "60",
2052  120 => "120"
2053  );
2054  $si = new ilSelectInputGUI($this->lng->txt("adm_repository_cache_time"), "rep_cache");
2055  $si->setOptions($options);
2056  $si->setValue($ilSetting->get("rep_cache"));
2057  $si->setInfo($this->lng->txt("adm_repository_cache_time_info"));
2058  $this->form->addItem($si);
2059 
2060  // load action commands asynchronously
2061  $cb = new ilCheckboxInputGUI($this->lng->txt("adm_item_cmd_asynch"), "item_cmd_asynch");
2062  $cb->setInfo($this->lng->txt("adm_item_cmd_asynch_info"));
2063  $cb->setChecked($ilSetting->get("item_cmd_asynch"));
2064  $this->form->addItem($cb);
2065 
2066  // locale
2067  $ti = new ilTextInputGUI($this->lng->txt("adm_locale"), "locale");
2068  $ti->setMaxLength(80);
2069  $ti->setSize(40);
2070  $ti->setInfo($this->lng->txt("adm_locale_info"));
2071  $ti->setValue($ilSetting->get("locale"));
2072  $this->form->addItem($ti);
2073 
2074 
2075  // trash
2076  $cb = new ilCheckboxInputGUI($this->lng->txt("enable_trash"), "enable_trash");
2077  $cb->setInfo($this->lng->txt("enable_trash_info"));
2078  if ($ilSetting->get("enable_trash"))
2079  {
2080  $cb->setChecked(true);
2081  }
2082  $this->form->addItem($cb);
2083 
2084  // BEGIN SESSION SETTINGS
2085  // create session handling radio group
2086  $ssettings = new ilRadioGroupInputGUI($this->lng->txt('sess_mode'), 'session_handling_type');
2087  $ssettings->setValue($ilSetting->get('session_handling_type', 0));
2088 
2089  // first option, fixed session duration
2090  $fixed = new ilRadioOption($this->lng->txt('sess_fixed_duration'), 0);
2091 
2092  // create session reminder subform
2093  $cb = new ilCheckboxInputGUI($this->lng->txt("session_reminder"), "session_reminder_enabled");
2094  $expires = $ilClientIniFile->readVariable("session", "expire");
2095  $time = ilFormat::_secondsToString($expires, true);
2096  $cb->setInfo($this->lng->txt("session_reminder_info")."<br />".
2097  sprintf($this->lng->txt('session_reminder_session_duration'), $time));
2098  if((int)$ilSetting->get("session_reminder_enabled"))
2099  {
2100  $cb->setChecked(true);
2101  }
2102  $fixed->addSubItem($cb);
2103 
2104  // add session handling to radio group
2105  $ssettings->addOption($fixed);
2106 
2107  // second option, session control
2108  $ldsh = new ilRadioOption($this->lng->txt('sess_load_dependent_session_handling'), 1);
2109 
2110  // add session control subform
2111  $ti = new ilNonEditableValueGUI($this->lng->txt('session_config'), "session_config");
2112 
2113  require_once('Services/Authentication/classes/class.ilSessionControl.php');
2114  if( $ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE) )
2115  {
2116  // just shows the status wether the session
2117  //setting maintenance is allowed by setup
2118  $ti->setValue(sprintf($this->lng->txt('session_config_maintenance_enabled'), CLIENT_ID));
2119  }
2120  else
2121  {
2122  // just shows the status wether the session
2123  //setting maintenance is allowed by setup
2124  $ti->setValue($this->lng->txt('session_config_maintenance_disabled'));
2125  }
2126  $ldsh->addSubItem($ti);
2127 
2128  // this is the max count of active sessions
2129  // that are getting started simlutanously
2130  $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_count'), 'session_max_count');
2131  $sub_ti->setMaxLength(5);
2132  $sub_ti->setSize(5);
2133  $sub_ti->setInfo($this->lng->txt('session_max_count_info'));
2134  $sub_ti->setValue($ilSetting->get(
2135  "session_max_count", ilSessionControl::DEFAULT_MAX_COUNT
2136  ));
2137  if( !$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE) )
2138  $sub_ti->setDisabled(true);
2139  $ldsh->addSubItem($sub_ti);
2140 
2141  // after this (min) idle time the session can be deleted,
2142  // if there are further requests for new sessions,
2143  // but max session count is reached yet
2144  $sub_ti = new ilTextInputGUI($this->lng->txt('session_min_idle'), 'session_min_idle');
2145  $sub_ti->setMaxLength(5);
2146  $sub_ti->setSize(5);
2147  $sub_ti->setInfo($this->lng->txt('session_min_idle_info'));
2148  $sub_ti->setValue($ilSetting->get(
2149  "session_min_idle", ilSessionControl::DEFAULT_MIN_IDLE
2150  ));
2151  if( !$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE) )
2152  $sub_ti->setDisabled(true);
2153  $ldsh->addSubItem($sub_ti);
2154 
2155  // after this (max) idle timeout the session expires
2156  // and become invalid, so it is not considered anymore
2157  // when calculating current count of active sessions
2158  $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_idle'), 'session_max_idle');
2159  $sub_ti->setMaxLength(5);
2160  $sub_ti->setSize(5);
2161  $sub_ti->setInfo($this->lng->txt('session_max_idle_info'));
2162  $sub_ti->setValue($ilSetting->get(
2163  "session_max_idle", ilSessionControl::DEFAULT_MAX_IDLE
2164  ));
2165  if( !$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE) )
2166  $sub_ti->setDisabled(true);
2167  $ldsh->addSubItem($sub_ti);
2168 
2169  // this is the max duration that can elapse between the first and the secnd
2170  // request to the system before the session is immidietly deleted
2171  $sub_ti = new ilTextInputGUI(
2172  $this->lng->txt('session_max_idle_after_first_request'),
2173  'session_max_idle_after_first_request'
2174  );
2175  $sub_ti->setMaxLength(5);
2176  $sub_ti->setSize(5);
2177  $sub_ti->setInfo($this->lng->txt('session_max_idle_after_first_request_info'));
2178  $sub_ti->setValue($ilSetting->get(
2179  "session_max_idle_after_first_request",
2181  ));
2182  if( !$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE) )
2183  $sub_ti->setDisabled(true);
2184  $ldsh->addSubItem($sub_ti);
2185 
2186  // add session control to radio group
2187  $ssettings->addOption($ldsh);
2188 
2189  // add radio group to form
2190  $this->form->addItem($ssettings);
2191  // END SESSION SETTINGS
2192 
2193  // password assistance
2194  $cb = new ilCheckboxInputGUI($this->lng->txt("enable_password_assistance"), "password_assistance");
2195  if ($ilSetting->get("password_assistance"))
2196  {
2197  $cb->setChecked(true);
2198  }
2199  $cb->setInfo($this->lng->txt("password_assistance_info"));
2200  $this->form->addItem($cb);
2201 
2202  // password generation
2203  $cb = new ilCheckboxInputGUI($this->lng->txt("passwd_generation"), "passwd_auto_generate");
2204  if ($ilSetting->get("passwd_auto_generate"))
2205  {
2206  $cb->setChecked(true);
2207  }
2208  $cb->setInfo($this->lng->txt("passwd_generation_info"));
2209  $this->form->addItem($cb);
2210 
2211  // dynamic web links
2212  $cb = new ilCheckboxInputGUI($this->lng->txt("links_dynamic"), "links_dynamic");
2213  $cb->setInfo($this->lng->txt("links_dynamic_info"));
2214  if ($ilSetting->get("links_dynamic"))
2215  {
2216  $cb->setChecked(true);
2217  }
2218  $this->form->addItem($cb);
2219 
2220  // Learners View
2221  $pl = new ilCheckboxInputGUI($this->lng->txt('preview_learner'),'preview_learner');
2222  $pl->setValue(1);
2223  $pl->setInfo($this->lng->txt('preview_learner_info'));
2224  $pl->setChecked($ilSetting->get('preview_learner'));
2225  $this->form->addItem($pl);
2226 
2227  // save and cancel commands
2228  $this->form->addCommandButton("saveBasicSettings", $lng->txt("save"));
2229 
2230  $this->form->setTitle($lng->txt("basic_settings"));
2231  $this->form->setFormAction($this->ctrl->getFormAction($this));
2232 
2233  }
2234 
2239  public function saveBasicSettingsObject()
2240  {
2241  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
2242 
2243  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
2244  {
2245  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
2246  }
2247 
2248  $this->initBasicSettingsForm();
2249  if ($this->form->checkInput())
2250  {
2251  $ilSetting->set("short_inst_name", $_POST["short_inst_name"]);
2252  $ilSetting->set("pub_section", $_POST["pub_section"]);
2253  $ilSetting->set("open_google", $_POST["open_google"]);
2254  $ilSetting->set("default_repository_view", $_POST["default_rep_view"]);
2255  $ilSetting->set("links_dynamic", $_POST["links_dynamic"]);
2256  $ilSetting->set("enable_trash", $_POST["enable_trash"]);
2257  $ilSetting->set("password_assistance", $_POST["password_assistance"]);
2258  $ilSetting->set("passwd_auto_generate", $_POST["passwd_auto_generate"]);
2259  $ilSetting->set("locale", $_POST["locale"]);
2260  $ilSetting->set('preview_learner',(int) $_POST['preview_learner']);
2261  $ilSetting->set('rep_cache',(int) $_POST['rep_cache']);
2262  $ilSetting->set('item_cmd_asynch',(int) $_POST['item_cmd_asynch']);
2263  $ilSetting->set("repository_tree_pres", $_POST["tree_pres"]);
2264  if ($_POST["tree_pres"] == "")
2265  {
2266  $_POST["rep_tree_limit_grp_crs"] = "";
2267  }
2268  if ($_POST["rep_tree_limit_grp_crs"] && !$ilSetting->get("rep_tree_limit_grp_crs"))
2269  {
2270  $_POST["rep_tree_synchronize"] = true;
2271  }
2272  else if (!$_POST["rep_tree_synchronize"] && $ilSetting->get("rep_tree_synchronize"))
2273  {
2274  $_POST["rep_tree_limit_grp_crs"] = false;
2275  }
2276 
2277  $ilSetting->set("rep_tree_limit_grp_crs", $_POST["rep_tree_limit_grp_crs"]);
2278  $ilSetting->set("rep_tree_synchronize", $_POST["rep_tree_synchronize"]);
2279 
2280  // BEGIN SESSION SETTINGS
2281  $ilSetting->set('session_handling_type',
2282  (int)$this->form->getInput('session_handling_type'));
2283 
2284  if( $this->form->getInput('session_handling_type') == 0 )
2285  {
2286  $ilSetting->set('session_reminder_enabled',
2287  $this->form->getInput('session_reminder_enabled'));
2288  }
2289  else if( $this->form->getInput('session_handling_type') == 1 )
2290  {
2291  require_once 'Services/Authentication/classes/class.ilSessionControl.php';
2292  if(
2293  $ilSetting->get('session_allow_client_maintenance',
2295  )
2296  {
2297  $ilSetting->set('session_max_count',
2298  (int)$this->form->getInput('session_max_count'));
2299  $ilSetting->set('session_min_idle',
2300  (int)$this->form->getInput('session_min_idle'));
2301  $ilSetting->set('session_max_idle',
2302  (int)$this->form->getInput('session_max_idle'));
2303  $ilSetting->set('session_max_idle_after_first_request',
2304  (int)$this->form->getInput('session_max_idle_after_first_request'));
2305  }
2306  }
2307  // END SESSION SETTINGS
2308 
2309  $global_profiles = ($_POST["pub_section"])
2310  ? (int)$_POST['enable_global_profiles']
2311  : 0;
2312 
2313  $ilSetting->set('enable_global_profiles', $global_profiles);
2314 
2315  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2316  $ilCtrl->redirect($this, "showBasicSettings");
2317  }
2318  $this->setGeneralSettingsSubTabs("basic_settings");
2319  $this->form->setValuesByPost();
2320  $tpl->setContent($this->form->getHtml());
2321  }
2322 
2323  //
2324  //
2325  // Header title
2326  //
2327  //
2328 
2332  function showHeaderTitleObject($a_get_post_values = false)
2333  {
2334  global $tpl;
2335 
2336  $this->setGeneralSettingsSubTabs("header_title");
2337  include_once("./Services/Object/classes/class.ilObjectTranslationTableGUI.php");
2338  $table = new ilObjectTranslationTableGUI($this, "showHeaderTitle", false);
2339  if ($a_get_post_values)
2340  {
2341  $vals = array();
2342  foreach($_POST["title"] as $k => $v)
2343  {
2344  $vals[] = array("title" => $v,
2345  "desc" => $_POST["desc"][$k],
2346  "lang" => $_POST["lang"][$k],
2347  "default" => ($_POST["default"] == $k));
2348  }
2349  $table->setData($vals);
2350  }
2351  else
2352  {
2353  $data = $this->object->getHeaderTitleTranslations();
2354  if (is_array($data["Fobject"]))
2355  {
2356  foreach($data["Fobject"] as $k => $v)
2357  {
2358  if ($k == $data["default_language"])
2359  {
2360  $data["Fobject"][$k]["default"] = true;
2361  }
2362  else
2363  {
2364  $data["Fobject"][$k]["default"] = false;
2365  }
2366  }
2367  }
2368  else
2369  {
2370  $data["Fobject"] = array();
2371  }
2372  $table->setData($data["Fobject"]);
2373  }
2374  $tpl->setContent($table->getHTML());
2375  }
2376 
2381  {
2382  global $ilCtrl, $lng, $rbacsystem;
2383 
2384  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
2385  {
2386  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
2387  }
2388 
2389 // var_dump($_POST);
2390 
2391  // default language set?
2392  if (!isset($_POST["default"]) && count($_POST["lang"]) > 0)
2393  {
2394  ilUtil::sendFailure($lng->txt("msg_no_default_language"));
2395  return $this->showHeaderTitleObject(true);
2396  }
2397 
2398  // all languages set?
2399  if (array_key_exists("",$_POST["lang"]))
2400  {
2401  ilUtil::sendFailure($lng->txt("msg_no_language_selected"));
2402  return $this->showHeaderTitleObject(true);
2403  }
2404 
2405  // no single language is selected more than once?
2406  if (count(array_unique($_POST["lang"])) < count($_POST["lang"]))
2407  {
2408  ilUtil::sendFailure($lng->txt("msg_multi_language_selected"));
2409  return $this->showHeaderTitleObject(true);
2410  }
2411 
2412  // save the stuff
2413  $this->object->removeHeaderTitleTranslations();
2414  foreach($_POST["title"] as $k => $v)
2415  {
2416  $this->object->addHeaderTitleTranslation(
2418  ilUtil::stripSlashes($_POST["desc"][$k]),
2419  ilUtil::stripSlashes($_POST["lang"][$k]),
2420  ($_POST["default"] == $k));
2421  }
2422 
2423  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2424  $ilCtrl->redirect($this, "showHeaderTitle");
2425  }
2426 
2431  {
2432  global $ilCtrl, $lng;
2433 
2434  if (is_array($_POST["title"]))
2435  {
2436  foreach($_POST["title"] as $k => $v) {}
2437  }
2438  $k++;
2439  $_POST["title"][$k] = "";
2440  $this->showHeaderTitleObject(true);
2441  }
2442 
2447  {
2448  global $ilCtrl, $lng;
2449 //var_dump($_POST);
2450  foreach($_POST["title"] as $k => $v)
2451  {
2452  if ($_POST["check"][$k])
2453  {
2454  unset($_POST["title"][$k]);
2455  unset($_POST["desc"][$k]);
2456  unset($_POST["lang"][$k]);
2457  if ($k == $_POST["default"])
2458  {
2459  unset($_POST["default"]);
2460  }
2461  }
2462  }
2463  $this->saveHeaderTitlesObject();
2464  }
2465 
2466 
2467  //
2468  //
2469  // Cron Jobs
2470  //
2471  //
2472 
2477  {
2478  global $tpl;
2479 
2480  $this->initCronJobsForm();
2481  $this->setGeneralSettingsSubTabs("cron_jobs");
2482  $tpl->setContent($this->form->getHTML());
2483  }
2484 
2488  public function initCronJobsForm()
2489  {
2490  global $lng, $ilSetting, $rbacreview, $ilObjDataCache;
2491 
2492  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2493  $this->form = new ilPropertyFormGUI();
2494 
2495  $cls = new ilNonEditableValueGUI($this->lng->txt('cronjob_last_start'), 'cronjob_last_start');
2496  if($ilSetting->get('last_cronjob_start_ts'))
2497  {
2498  include_once('./Services/Calendar/classes/class.ilDatePresentation.php');
2499  $cls->setInfo(ilDatePresentation::formatDate(new ilDateTime($ilSetting->get('last_cronjob_start_ts'), IL_CAL_UNIX)));
2500  }
2501  else
2502  {
2503  $cls->setInfo($this->lng->txt('cronjob_last_start_unknown'));
2504  }
2505 
2506  $this->form->addItem($cls);
2507 
2508  // check user accounts
2509  $cb = new ilCheckboxInputGUI($this->lng->txt("check_user_accounts"), "cron_user_check");
2510  $cb->setInfo($this->lng->txt("check_user_accounts_desc"));
2511  if ($ilSetting->get("cron_user_check"))
2512  {
2513  $cb->setChecked(true);
2514  }
2515  $this->form->addItem($cb);
2516 
2517 
2518  // delete inactive user accounts
2519  require_once('Services/User/classes/class.ilCronDeleteInactiveUserAccounts.php');
2520  $cb = new ilCheckboxInputGUI($this->lng->txt("delete_inactive_user_accounts"), "cron_inactive_user_delete");
2521  $cb->setInfo($this->lng->txt("delete_inactive_user_accounts_desc"));
2522  if($ilSetting->get("cron_inactive_user_delete", false)) $cb->setChecked(true);
2523 
2524  $sub_list = new ilSelectInputGUI(
2525  $this->lng->txt('delete_inactive_user_accounts_interval'),
2526  'cron_inactive_user_delete_interval'
2527  );
2528  $sub_list->setInfo($this->lng->txt('delete_inactive_user_accounts_interval_desc'));
2529  $sub_list->setOptions(
2531  );
2532  $sub_list->setValue($ilSetting->get(
2533  'cron_inactive_user_delete_interval',
2535  ));
2536  $cb->addSubItem($sub_list);
2537 
2538  include_once('Services/Form/classes/class.ilMultiSelectInputGUI.php');
2539  $sub_mlist = new ilMultiSelectInputGUI(
2540  $this->lng->txt('delete_inactive_user_accounts_include_roles'),
2541  'cron_inactive_user_delete_include_roles'
2542  );
2543  $sub_mlist->setInfo($this->lng->txt('delete_inactive_user_accounts_include_roles_desc'));
2544  $roles = array();
2545  foreach($rbacreview->getGlobalRoles() as $role_id)
2546  {
2547  if( $role_id != ANONYMOUS_ROLE_ID )
2548  $roles[$role_id] = $ilObjDataCache->lookupTitle($role_id);
2549  }
2550  $sub_mlist->setOptions($roles);
2551  $setting = $ilSetting->get('cron_inactive_user_delete_include_roles', null);
2552  if($setting === null) $setting = array();
2553  else $setting = explode(',', $setting);
2554  $sub_mlist->setValue($setting);
2555  $sub_mlist->setWidth(300);
2556  #$sub_mlist->setHeight(100);
2557  $cb->addSubItem($sub_mlist);
2558 
2560  $sub_text = new ilTextInputGUI(
2561  $this->lng->txt('delete_inactive_user_accounts_period'),
2562  'cron_inactive_user_delete_period'
2563  );
2564  $sub_text->setInfo($this->lng->txt('delete_inactive_user_accounts_period_desc'));
2565  $sub_text->setValue($ilSetting->get("cron_inactive_user_delete_period", $default_setting));
2566  $sub_text->setSize(2);
2567  $sub_text->setMaxLength(3);
2568  $cb->addSubItem($sub_text);
2569 
2570  /* $default_setting = ilCronDeleteInactiveUserAccounts::DEFAULT_SETTING_INCLUDE_ADMINS;
2571  $sub_cb = new ilCheckboxInputGUI($this->lng->txt('delete_inactive_user_accounts_include_admins'),'cron_inactive_user_delete_include_admins');
2572  $sub_cb->setChecked($ilSetting->get("cron_inactive_user_delete_include_admins", $default_setting) ? 1 : 0 );
2573  //$sub_cb->setOptionTitle($this->lng->txt('delete_inactive_user_accounts_include_admins'));
2574  $sub_cb->setInfo($this->lng->txt('delete_inactive_user_accounts_include_admins_desc'));
2575  $cb->addSubItem($sub_cb);
2576  */
2577 
2578  $this->form->addItem($cb);
2579 
2580 
2581  // link check
2582  $cb = new ilCheckboxInputGUI($this->lng->txt("check_link"), "cron_link_check");
2583  $cb->setInfo($this->lng->txt("check_link_desc"));
2584  if ($ilSetting->get("cron_link_check"))
2585  {
2586  $cb->setChecked(true);
2587  }
2588  $this->form->addItem($cb);
2589 
2590  // check web resources
2591  $options = array(
2592  "0" => $lng->txt("never"),
2593  "1" => $lng->txt("daily"),
2594  "2" => $lng->txt("weekly"),
2595  "3" => $lng->txt("monthly"),
2596  "4" => $lng->txt("quarterly")
2597  );
2598  $si = new ilSelectInputGUI($this->lng->txt("check_web_resources"), "cron_web_resource_check");
2599  $si->setOptions($options);
2600  $si->setInfo($this->lng->txt("check_web_resources_desc"));
2601  $si->setValue($ilSetting->get("cron_web_resource_check"));
2602  $this->form->addItem($si);
2603 
2604  // update lucene
2605  $cb = new ilCheckboxInputGUI($this->lng->txt("cron_lucene_index"), "cron_lucene_index");
2606  $cb->setInfo($this->lng->txt("cron_lucene_index_info"));
2607  if ($ilSetting->get("cron_lucene_index"))
2608  {
2609  $cb->setChecked(true);
2610  }
2611  $this->form->addItem($cb);
2612 
2613  // mail notifications
2614  $options = array(
2615  "0" => $lng->txt("cron_mail_notification_never"),
2616  "1" => $lng->txt("cron_mail_notification_cron")
2617  );
2618  $si = new ilSelectInputGUI($this->lng->txt("cron_mail_notification"), "mail_notification");
2619  $si->setOptions($options);
2620  $si->setInfo($this->lng->txt("cron_mail_notification_desc"));
2621  $si->setValue($ilSetting->get("mail_notification"));
2622  $this->form->addItem($si);
2623 
2624  if($ilSetting->get("mail_notification") == '1')
2625  {
2626  $cb = new ilCheckboxInputGUI($this->lng->txt("cron_mail_notification_message"), "mail_notification_message");
2627  $cb->setInfo($this->lng->txt("cron_mail_notification_message_info"));
2628  if ($ilSetting->get("mail_notification_message"))
2629  {
2630  $cb->setChecked(true);
2631  }
2632  $this->form->addItem($cb);
2633  }
2634 
2635  // disk quota and disk quota reminder mail
2636  $dq_settings = new ilSetting('disk_quota');
2637  $cb = new ilCheckboxInputGUI($this->lng->txt("enable_disk_quota"), "enable_disk_quota");
2638  $cb->setInfo($this->lng->txt("enable_disk_quota_info"));
2639  if ($dq_settings->get('enabled'))
2640  {
2641  $cb->setChecked(true);
2642  }
2643  $this->form->addItem($cb);
2644 
2645  $cb_reminder = new ilCheckboxInputGUI($this->lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail");
2646  $cb_reminder->setInfo($this->lng->txt("disk_quota_reminder_mail_desc"));
2647  if ($dq_settings->get('reminder_mail_enabled'))
2648  {
2649  $cb_reminder->setChecked(true);
2650  }
2651  $cb->addSubItem($cb_reminder);
2652 
2653  // Enable summary mail for certain users
2654  $cb_prop_summary= new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail");
2655  $cb_prop_summary->setValue(1);
2656  $cb_prop_summary->setChecked((int)$dq_settings->get('summary_mail_enabled', 0) == 1);
2657  $cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc'));
2658  $cb->addSubItem($cb_prop_summary);
2659 
2660  // Edit disk quota recipients
2661  $summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp");
2662  $summary_rcpt->setValue($dq_settings->get('summary_rcpt', ''));
2663  $summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc'));
2664  $cb_prop_summary->addSubItem($summary_rcpt);
2665 
2666  $this->form->addCommandButton("saveCronJobs", $lng->txt("save"));
2667 
2668  $this->form->setTitle($lng->txt("cron_jobs"));
2669  $this->form->setDescription($lng->txt("cron_jobs_desc"));
2670  $this->form->setFormAction($this->ctrl->getFormAction($this));
2671 
2672  }
2673 
2678  public function saveCronJobsObject()
2679  {
2680  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
2681 
2682  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
2683  {
2684  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
2685  }
2686 
2687  $this->initCronJobsForm();
2688  if ($this->form->checkInput())
2689  {
2690  $ilSetting->set("cron_user_check", $_POST["cron_user_check"]);
2691  $ilSetting->set("cron_link_check", $_POST["cron_link_check"]);
2692  $ilSetting->set("cron_web_resource_check", $_POST["cron_web_resource_check"]);
2693  $ilSetting->set("cron_lucene_index", $_POST["cron_lucene_index"]);
2694  $ilSetting->set("mail_notification", $_POST["mail_notification"]);
2695  $ilSetting->set('mail_notification_message', $_POST['mail_notification_message'] ? 1 : 0);
2696 
2697  $ilSetting->set('cron_inactive_user_delete', $_POST['cron_inactive_user_delete']);
2698  $ilSetting->set('cron_inactive_user_delete_interval', $_POST['cron_inactive_user_delete_interval']);
2699  $setting = implode(',', $_POST['cron_inactive_user_delete_include_roles']);
2700  if( !strlen($setting) ) $setting = null;
2701  $ilSetting->set('cron_inactive_user_delete_include_roles', $setting);
2702  $ilSetting->set('cron_inactive_user_delete_period', $_POST['cron_inactive_user_delete_period']);
2703 
2704  // disk quota and disk quota reminder mail
2705  $dq_settings = new ilSetting('disk_quota');
2706  $dq_settings->set('enabled', $_POST['enable_disk_quota'] ? 1 : 0);
2707  $dq_settings->set('reminder_mail_enabled', $_POST['enable_disk_quota_reminder_mail'] ? 1 : 0);
2708 
2709  // disk quota summary mail
2710  $dq_settings->set('summary_mail_enabled', $_POST['enable_disk_quota_summary_mail'] ? 1 : 0);
2711  $dq_settings->set('summary_rcpt', ilUtil::stripSlashes($_POST['disk_quota_summary_rctp']));
2712 
2713  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2714  $ilCtrl->redirect($this, "showCronJobs");
2715  }
2716  else
2717  {
2718  $this->setGeneralSettingsSubTabs("cron_jobs");
2719  $this->form->setValuesByPost();
2720  $tpl->setContent($this->form->getHtml());
2721  }
2722  }
2723 
2724  //
2725  //
2726  // Contact Information
2727  //
2728  //
2729 
2734  {
2735  global $tpl;
2736 
2737  $this->initContactInformationForm();
2738  $this->setGeneralSettingsSubTabs("contact_data");
2739  $tpl->setContent($this->form->getHTML());
2740  }
2741 
2745  public function initContactInformationForm()
2746  {
2747  global $lng, $ilSetting;
2748 
2749  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2750  $this->form = new ilPropertyFormGUI();
2751 
2752  // first name
2753  $ti = new ilTextInputGUI($this->lng->txt("firstname"), "admin_firstname");
2754  $ti->setMaxLength(64);
2755  $ti->setSize(40);
2756  $ti->setRequired(true);
2757  $ti->setValue($ilSetting->get("admin_firstname"));
2758  $this->form->addItem($ti);
2759 
2760  // last name
2761  $ti = new ilTextInputGUI($this->lng->txt("lastname"), "admin_lastname");
2762  $ti->setMaxLength(64);
2763  $ti->setSize(40);
2764  $ti->setRequired(true);
2765  $ti->setValue($ilSetting->get("admin_lastname"));
2766  $this->form->addItem($ti);
2767 
2768  // title
2769  $ti = new ilTextInputGUI($this->lng->txt("title"), "admin_title");
2770  $ti->setMaxLength(64);
2771  $ti->setSize(40);
2772  $ti->setValue($ilSetting->get("admin_title"));
2773  $this->form->addItem($ti);
2774 
2775  // position
2776  $ti = new ilTextInputGUI($this->lng->txt("position"), "admin_position");
2777  $ti->setMaxLength(64);
2778  $ti->setSize(40);
2779  $ti->setValue($ilSetting->get("admin_position"));
2780  $this->form->addItem($ti);
2781 
2782  // institution
2783  $ti = new ilTextInputGUI($this->lng->txt("institution"), "admin_institution");
2784  $ti->setMaxLength(200);
2785  $ti->setSize(40);
2786  $ti->setValue($ilSetting->get("admin_institution"));
2787  $this->form->addItem($ti);
2788 
2789  // street
2790  $ti = new ilTextInputGUI($this->lng->txt("street"), "admin_street");
2791  $ti->setMaxLength(64);
2792  $ti->setSize(40);
2793  //$ti->setRequired(true);
2794  $ti->setValue($ilSetting->get("admin_street"));
2795  $this->form->addItem($ti);
2796 
2797  // zip code
2798  $ti = new ilTextInputGUI($this->lng->txt("zipcode"), "admin_zipcode");
2799  $ti->setMaxLength(10);
2800  $ti->setSize(5);
2801  //$ti->setRequired(true);
2802  $ti->setValue($ilSetting->get("admin_zipcode"));
2803  $this->form->addItem($ti);
2804 
2805  // city
2806  $ti = new ilTextInputGUI($this->lng->txt("city"), "admin_city");
2807  $ti->setMaxLength(64);
2808  $ti->setSize(40);
2809  //$ti->setRequired(true);
2810  $ti->setValue($ilSetting->get("admin_city"));
2811  $this->form->addItem($ti);
2812 
2813  // country
2814  $ti = new ilTextInputGUI($this->lng->txt("country"), "admin_country");
2815  $ti->setMaxLength(64);
2816  $ti->setSize(40);
2817  //$ti->setRequired(true);
2818  $ti->setValue($ilSetting->get("admin_country"));
2819  $this->form->addItem($ti);
2820 
2821  // phone
2822  $ti = new ilTextInputGUI($this->lng->txt("phone"), "admin_phone");
2823  $ti->setMaxLength(64);
2824  $ti->setSize(40);
2825  //$ti->setRequired(true);
2826  $ti->setValue($ilSetting->get("admin_phone"));
2827  $this->form->addItem($ti);
2828 
2829  // email
2830  $ti = new ilTextInputGUI($this->lng->txt("email"), "admin_email");
2831  $ti->setMaxLength(64);
2832  $ti->setSize(40);
2833  $ti->setRequired(true);
2834  $ti->setValue($ilSetting->get("admin_email"));
2835  $this->form->addItem($ti);
2836 
2837  // feedback recipient
2838  $ti = new ilEmailInputGUI($this->lng->txt("feedback_recipient"), "feedback_recipient");
2839  $ti->setValue($ilSetting->get("feedback_recipient"));
2840  $this->form->addItem($ti);
2841 
2842  // error recipient
2843  $ti = new ilEmailInputGUI($this->lng->txt("error_recipient"), "error_recipient");
2844  $ti->setValue($ilSetting->get("error_recipient"));
2845  $this->form->addItem($ti);
2846 
2847  $this->form->addCommandButton("saveContactInformation", $lng->txt("save"));
2848 
2849  $this->form->setTitle($lng->txt("contact_data"));
2850  $this->form->setFormAction($this->ctrl->getFormAction($this));
2851 
2852  }
2853 
2859  {
2860  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
2861 
2862  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
2863  {
2864  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
2865  }
2866 
2867  $this->initContactInformationForm();
2868  if ($this->form->checkInput())
2869  {
2870  $fs = array("admin_firstname", "admin_lastname", "admin_title", "admin_position",
2871  "admin_institution", "admin_street", "admin_zipcode", "admin_city",
2872  "admin_country", "admin_phone", "admin_email",
2873  "feedback_recipient", "error_recipient");
2874  foreach ($fs as $f)
2875  {
2876  $ilSetting->set($f, $_POST[$f]);
2877  }
2878  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2879  $ilCtrl->redirect($this, "showContactInformation");
2880  }
2881  else
2882  {
2883  $this->setGeneralSettingsSubTabs("contact_data");
2884  $this->form->setValuesByPost();
2885  $tpl->setContent($this->form->getHtml());
2886  }
2887  }
2888 
2889  //
2890  //
2891  // Web Services
2892  //
2893  //
2894 
2899  {
2900  global $tpl;
2901 
2902  $this->initWebServicesForm();
2903  $this->setGeneralSettingsSubTabs("webservices");
2904  $tpl->setContent($this->form->getHTML());
2905  }
2906 
2910  public function initWebServicesForm()
2911  {
2912  global $lng, $ilSetting;
2913 
2914  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2915  $this->form = new ilPropertyFormGUI();
2916 
2917  // soap administration
2918  $cb = new ilCheckboxInputGUI($this->lng->txt("soap_user_administration"), "soap_user_administration");
2919  $cb->setInfo($this->lng->txt("soap_user_administration_desc"));
2920  if ($ilSetting->get("soap_user_administration"))
2921  {
2922  $cb->setChecked(true);
2923  }
2924  $this->form->addItem($cb);
2925 
2926  // wsdl path
2927  $wsdl = new ilTextInputGUI($this->lng->txt('soap_wsdl_path'), 'soap_wsdl_path');
2928  $wsdl->setInfo(sprintf($this->lng->txt('soap_wsdl_path_info'), "<br />'".ILIAS_HTTP_PATH."/webservice/soap/server.php?wsdl'"));
2929  $wsdl->setValue((string)$ilSetting->get('soap_wsdl_path'));
2930  $wsdl->setSize(60);
2931  $wsdl->setMaxLength(255);
2932  $this->form->addItem($wsdl);
2933 
2934  $this->form->addCommandButton("saveWebServices", $lng->txt("save"));
2935 
2936  $this->form->setTitle($lng->txt("webservices"));
2937  $this->form->setFormAction($this->ctrl->getFormAction($this));
2938 
2939  }
2940 
2945  public function saveWebServicesObject()
2946  {
2947  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
2948 
2949  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
2950  {
2951  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
2952  }
2953 
2954  $this->initWebServicesForm();
2955  if ($this->form->checkInput())
2956  {
2957  $ilSetting->set('soap_user_administration', $this->form->getInput('soap_user_administration'));
2958  $ilSetting->set('soap_wsdl_path', trim($this->form->getInput('soap_wsdl_path')));
2959 
2960  ilUtil::sendSuccess($lng->txt('msg_obj_modified'), true);
2961  $ilCtrl->redirect($this, 'showWebServices');
2962  }
2963  else
2964  {
2965  $this->setGeneralSettingsSubTabs("webservices");
2966  $this->form->setValuesByPost();
2967  $tpl->setContent($this->form->getHtml());
2968  }
2969  }
2970 
2971  //
2972  //
2973  // Java Server
2974  //
2975  //
2976 
2981  {
2982  global $tpl;
2983 
2984  $tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.java_settings.html','Modules/SystemFolder');
2985 
2986  $GLOBALS['lng']->loadLanguageModule('search');
2987 
2988  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
2989  $toolbar = new ilToolbarGUI();
2990  $toolbar->addButton($this->lng->txt('lucene_create_ini'),
2991  $this->ctrl->getLinkTarget($this,'createJavaServerIni'));
2992  $tpl->setVariable('ACTION_BUTTONS',$toolbar->getHTML());
2993 
2994  $this->initJavaServerForm();
2995  $this->setGeneralSettingsSubTabs("java_server");
2996  $tpl->setVariable('SETTINGS_TABLE',$this->form->getHTML());
2997  }
2998 
3003  public function createJavaServerIniObject()
3004  {
3005  #include_once './Services/WebServices/RPC/classes/classs.ilRPCServerSettings.php';
3006  #$ini = ilRPCServerSettings::createServerIni();
3007  #ilUtil::deliverData($ini, 'ilServer.ini','text/plain');
3008 
3009  $this->setGeneralSettingsSubTabs('java_server');
3010  $this->initJavaServerIniForm();
3011  $this->tpl->setContent($this->form->getHTML());
3012  }
3013 
3014  protected function initJavaServerIniForm()
3015  {
3016  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
3017 
3018  $this->form = new ilPropertyFormGUI();
3019 
3020  $GLOBALS['lng']->loadLanguageModule('search');
3021 
3022  $this->form->setTitle($this->lng->txt('lucene_tbl_create_ini'));
3023  $this->form->setFormAction($this->ctrl->getFormAction($this,'createJavaServerIni'));
3024  $this->form->addCommandButton('downloadJavaServerIni',$this->lng->txt('lucene_download_ini'));
3025  $this->form->addCommandButton('showJavaServer', $this->lng->txt('cancel'));
3026 
3027  // Host
3028  $ip = new ilTextInputGUI($this->lng->txt('lucene_host'),'ho');
3029  $ip->setInfo($this->lng->txt('lucene_host_info'));
3030  $ip->setMaxLength(128);
3031  $ip->setSize(32);
3032  $ip->setRequired(true);
3033  $this->form->addItem($ip);
3034 
3035  // Port
3036  $port = new ilNumberInputGUI($this->lng->txt('lucene_port'),'po');
3037  $port->setSize(5);
3038  $port->setMinValue(1);
3039  $port->setMaxValue(65535);
3040  $port->setRequired(true);
3041  $this->form->addItem($port);
3042 
3043  // Index Path
3044  $path = new ilTextInputGUI($this->lng->txt('lucene_index_path'),'in');
3045  $path->setSize(80);
3046  $path->setMaxLength(1024);
3047  $path->setInfo($this->lng->txt('lucene_index_path_info'));
3048  $path->setRequired(true);
3049  $this->form->addItem($path);
3050 
3051  // Logging
3052  $log = new ilTextInputGUI($this->lng->txt('lucene_log'),'lo');
3053  $log->setSize(80);
3054  $log->setMaxLength(1024);
3055  $log->setInfo($this->lng->txt('lucene_log_info'));
3056  $log->setRequired(true);
3057  $this->form->addItem($log);
3058 
3059  // Level
3060  $lev = new ilSelectInputGUI($this->lng->txt('lucene_level'),'le');
3061  $lev->setOptions(array(
3062  'DEBUG' => 'DEBUG',
3063  'INFO' => 'INFO',
3064  'WARN' => 'WARN',
3065  'ERROR' => 'ERROR',
3066  'FATAL' => 'FATAL'));
3067  $lev->setValue('INFO');
3068  $lev->setRequired(true);
3069  $this->form->addItem($lev);
3070 
3071  // CPU
3072  $cpu = new ilNumberInputGUI($this->lng->txt('lucene_cpu'),'cp');
3073  $cpu->setValue(1);
3074  $cpu->setSize(1);
3075  $cpu->setMaxLength(2);
3076  $cpu->setMinValue(1);
3077  $cpu->setRequired(true);
3078  $this->form->addItem($cpu);
3079 
3080  // Max file size
3081  $fs = new ilNumberInputGUI($this->lng->txt('lucene_max_fs'), 'fs');
3082  $fs->setInfo($this->lng->txt('lucene_max_fs_info'));
3083  $fs->setValue(500);
3084  $fs->setSize(4);
3085  $fs->setMaxLength(4);
3086  $fs->setMinValue(1);
3087  $fs->setRequired(true);
3088  $this->form->addItem($fs);
3089 
3090  return true;
3091  }
3092 
3097  protected function downloadJavaServerIniObject()
3098  {
3099  $this->initJavaServerIniForm();
3100  if($this->form->checkInput())
3101  {
3102  include_once './Services/WebServices/RPC/classes/class.ilRpcIniFileWriter.php';
3103  $ini = new ilRpcIniFileWriter();
3104  $ini->setHost($this->form->getInput('ho'));
3105  $ini->setPort($this->form->getInput('po'));
3106  $ini->setIndexPath($this->form->getInput('in'));
3107  $ini->setLogPath($this->form->getInput('lo'));
3108  $ini->setLogLevel($this->form->getInput('le'));
3109  $ini->setNumThreads($this->form->getInput('cp'));
3110  $ini->setMaxFileSize($this->form->getInput('fs'));
3111 
3112  $ini->write();
3113  ilUtil::deliverData($ini->getIniString(),'ilServer.ini','text/plain','utf-8');
3114  return true;
3115  }
3116 
3117  $this->form->setValuesByPost();
3118  ilUtil::sendFailure($this->lng->txt('err_check_input'));
3119  $this->setGeneralSettingsSubTabs('java_server');
3120  $this->tpl->setContent($this->form->getHTML());
3121  return true;
3122  }
3123 
3127  public function initJavaServerForm()
3128  {
3129  global $lng, $ilSetting;
3130 
3131  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
3132  $this->form = new ilPropertyFormGUI();
3133 
3134  // host
3135  $ti = new ilTextInputGUI($this->lng->txt("java_server_host"), "rpc_server_host");
3136  $ti->setMaxLength(64);
3137  $ti->setSize(32);
3138  $ti->setValue($ilSetting->get("rpc_server_host"));
3139  $this->form->addItem($ti);
3140 
3141  // port
3142  $ti = new ilNumberInputGUI($this->lng->txt("java_server_port"), "rpc_server_port");
3143  $ti->setMaxLength(5);
3144  $ti->setSize(5);
3145  $ti->setValue($ilSetting->get("rpc_server_port"));
3146  $this->form->addItem($ti);
3147 
3148 
3149  // save and cancel commands
3150  $this->form->addCommandButton("saveJavaServer", $lng->txt("save"));
3151 
3152  $this->form->setTitle($lng->txt("java_server"));
3153  $this->form->setDescription($lng->txt("java_server_info").
3154  '<br /><a href="Services/WebServices/RPC/lib/README.txt" target="_blank">'.
3155  $lng->txt("java_server_readme").'</a>');
3156  $this->form->setFormAction($this->ctrl->getFormAction($this));
3157 
3158  }
3159 
3164  public function saveJavaServerObject()
3165  {
3166  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
3167 
3168  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
3169  {
3170  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
3171  }
3172 
3173  $this->initJavaServerForm();
3174  if ($this->form->checkInput())
3175  {
3176  $ilSetting->set("rpc_server_host", trim($_POST["rpc_server_host"]));
3177  $ilSetting->set("rpc_server_port", trim($_POST["rpc_server_port"]));
3178  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
3179  $ilCtrl->redirect($this, "showJavaServer");
3180 
3181  // TODO check settings, ping server
3182  }
3183  else
3184  {
3185  $this->setGeneralSettingsSubTabs("java_server");
3186  $this->form->setValuesByPost();
3187  $tpl->setContent($this->form->getHtml());
3188  }
3189  }
3190 
3198  public function showProxyObject()
3199  {
3200  global $tpl, $ilAccess, $ilSetting;
3201 
3202  if(!$ilAccess->checkAccess('write', '', $this->object->getRefId()))
3203  {
3204  $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
3205  }
3206 
3207  require_once 'classes/class.ilProxySettings.php';
3208 
3209  $this->initProxyForm();
3210  $this->form->setValuesByArray(array(
3211  'proxy_status' => ilProxySettings::_getInstance()->isActive(),
3212  'proxy_host' => ilProxySettings::_getInstance()->getHost(),
3213  'proxy_port' => ilProxySettings::_getInstance()->getPort()
3214  ));
3215  if(ilProxySettings::_getInstance()->isActive())
3216  {
3217  $this->printProxyStatus();
3218  }
3219 
3220  $tpl->setContent($this->form->getHTML());
3221  }
3222 
3230  private function printProxyStatus()
3231  {
3232  try
3233  {
3234  ilProxySettings::_getInstance()->checkConnection();
3235  $this->form->getItemByPostVar('proxy_availability')->setHTML(
3236  '<img src="'.ilUtil::getImagePath('icon_ok.gif').'" /> '.
3237  $this->lng->txt('proxy_connectable')
3238  );
3239  }
3240  catch(ilProxyException $e)
3241  {
3242  $this->form->getItemByPostVar('proxy_availability')->setHTML(
3243  '<img src="'.ilUtil::getImagePath('icon_not_ok.gif').'" /> '.
3244  $this->lng->txt('proxy_not_connectable')
3245  );
3246  ilUtil::sendFailure($this->lng->txt('proxy_pear_net_socket_error').': '.$e->getMessage());
3247  }
3248  }
3249 
3257  public function saveProxyObject()
3258  {
3259  global $tpl, $ilAccess, $ilSetting, $lng;
3260 
3261  if(!$ilAccess->checkAccess('write', '', $this->object->getRefId()))
3262  {
3263  $this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
3264  }
3265 
3266  require_once 'classes/class.ilProxySettings.php';
3267 
3268  $this->initProxyForm();
3269  $isFormValid = $this->form->checkInput();
3270  ilProxySettings::_getInstance()->isActive((int)$this->form->getInput('proxy_status'))
3271  ->setHost(trim($this->form->getInput('proxy_host')))
3272  ->setPort(trim($this->form->getInput('proxy_port')));
3273  if($isFormValid)
3274  {
3275  if(ilProxySettings::_getInstance()->isActive())
3276  {
3277  if(!strlen(ilProxySettings::_getInstance()->getHost()))
3278  {
3279  $isFormValid = false;
3280  $this->form->getItemByPostVar('proxy_host')->setAlert($lng->txt('msg_input_is_required'));
3281  }
3282  if(!strlen(ilProxySettings::_getInstance()->getPort()))
3283  {
3284  $isFormValid = false;
3285  $this->form->getItemByPostVar('proxy_port')->setAlert($lng->txt('msg_input_is_required'));
3286  }
3287  if(!preg_match('/[0-9]{1,}/', ilProxySettings::_getInstance()->getPort()) ||
3288  ilProxySettings::_getInstance()->getPort() < 0 ||
3289  ilProxySettings::_getInstance()->getPort() > 65535)
3290  {
3291  $isFormValid = false;
3292  $this->form->getItemByPostVar('proxy_port')->setAlert($lng->txt('proxy_port_numeric'));
3293  }
3294  }
3295 
3296  if($isFormValid)
3297  {
3299  ilUtil::sendSuccess($lng->txt('saved_successfully'));
3300  if(ilProxySettings::_getInstance()->isActive())
3301  {
3302  $this->printProxyStatus();
3303  }
3304  }
3305  else
3306  {
3307  ilUtil::sendFailure($lng->txt('form_input_not_valid'));
3308  }
3309  }
3310 
3311  $this->form->setValuesByPost();
3312  $tpl->setContent($this->form->getHTML());
3313  }
3314 
3322  private function initProxyForm()
3323  {
3324  global $lng, $ilCtrl;
3325 
3326  $this->setGeneralSettingsSubTabs('proxy');
3327 
3328  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
3329  $this->form = new ilPropertyFormGUI();
3330  $this->form->setFormAction($ilCtrl->getFormAction($this, 'saveProxy'));
3331 
3332  // Proxy status
3333  $proxs = new ilCheckboxInputGUI($lng->txt('proxy_status'), 'proxy_status');
3334  $proxs->setInfo($lng->txt('proxy_status_info'));
3335  $proxs->setValue(1);
3336  $this->form->addItem($proxs);
3337 
3338  // Proxy availability
3339  $proxa = new ilCustomInputGUI('', 'proxy_availability');
3340  $proxs->addSubItem($proxa);
3341 
3342  // Proxy
3343  $prox = new ilTextInputGUI($lng->txt('proxy_host'), 'proxy_host');
3344  $prox->setInfo($lng->txt('proxy_host_info'));
3345  $proxs->addSubItem($prox);
3346 
3347  // Proxy Port
3348  $proxp = new ilTextInputGUI($lng->txt('proxy_port'), 'proxy_port');
3349  $proxp->setInfo($lng->txt('proxy_port_info'));
3350  $proxp->setSize(10);
3351  $proxp->setMaxLength(10);
3352  $proxs->addSubItem($proxp);
3353 
3354  // save and cancel commands
3355  $this->form->addCommandButton('saveProxy', $lng->txt('save'));
3356  }
3357 
3361  function _goto()
3362  {
3363  global $ilAccess, $ilErr, $lng;
3364 
3365  $a_target = SYSTEM_FOLDER_ID;
3366 
3367  if ($ilAccess->checkAccess("read", "", $a_target))
3368  {
3369  ilUtil::redirect("ilias.php?baseClass=ilAdministrationGUI");
3370  exit;
3371  }
3372  else
3373  {
3374  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
3375  {
3376  $_GET["cmd"] = "frameset";
3377  $_GET["target"] = "";
3378  $_GET["ref_id"] = ROOT_FOLDER_ID;
3379  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
3380  ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
3381  include("repository.php");
3382  exit;
3383  }
3384  }
3385  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
3386  }
3387 
3388 }
3389 ?>