ILIAS  Release_4_1_x_branch Revision 61804
 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["forum_notification"] = $_POST["forum_notification"];
464  $settings["mail_notification"] = $_POST["mail_notification"];
465  $settings["mail_notification_message"] = $_POST["mail_notification_message"];
466 
467  // forums
468  $settings['frm_store_new'] = $_POST['frm_store_new'];
469 
470  // soap
471  $settings["soap_user_administration"] = $_POST["soap_user_administration"];
472 
473  // data privacy
474  /* $settings["enable_fora_statistics"] = $_POST["enable_fora_statistics"]; */
475 
476  $settings["suffix_repl_additional"] = $_POST["suffix_repl_additional"];
477 
478  // dynamic links
479  $settings["links_dynamic"] = $_POST["links_dynamic"];
480  }
481  else // all required fields ok
482  {
483 
485  // write new settings
486 
487  // basic data
488  $this->ilias->setSetting("feedback_recipient",$_POST["feedback_recipient"]);
489  $this->ilias->setSetting("error_recipient",$_POST["error_recipient"]);
490  //$this->ilias->ini->setVariable("language","default",$_POST["default_language"]);
491 
492  //set default skin and style
493  /*
494  if ($_POST["default_skin_style"] != "")
495  {
496  $sknst = explode(":", $_POST["default_skin_style"]);
497 
498  if ($this->ilias->ini->readVariable("layout","style") != $sknst[1] ||
499  $this->ilias->ini->readVariable("layout","skin") != $sknst[0])
500  {
501  $this->ilias->ini->setVariable("layout","skin", $sknst[0]);
502  $this->ilias->ini->setVariable("layout","style",$sknst[1]);
503  }
504  }*/
505  // set default view target
506  /*
507  if ($_POST["open_views_inside_frameset"] == "1")
508  {
509  $this->ilias->ini->setVariable("layout","view_target","frame");
510  }
511  else
512  {
513  $this->ilias->ini->setVariable("layout","view_target","window");
514  }*/
515 
516  // modules
517  $this->ilias->setSetting("pub_section",$_POST["pub_section"]);
518  $this->ilias->setSetting('open_google',$_POST['open_google']);
519  $this->ilias->setSetting("default_repository_view",$_POST["default_rep_view"]);
520  //$this->ilias->setSetting('https',$_POST['https']);
521  $this->ilias->setSetting('password_assistance',$_POST['password_assistance']);
522  $this->ilias->setSetting('passwd_auto_generate',$_POST['password_auto_generate']);
523 
524  //$this->ilias->setSetting('enable_js_edit',$_POST['js_edit']);
525  $this->ilias->setSetting('short_inst_name',$_POST['short_inst_name']);
526  $this->ilias->setSetting('enable_trash',$_POST['enable_trash']);
527 
528  //session_reminder
529  $this->ilias->setSetting('session_reminder_enabled', (int)$_POST['session_reminder_enabled']);
530 
531  // contact
532  $this->ilias->setSetting("admin_firstname",$_POST["admin_firstname"]);
533  $this->ilias->setSetting("admin_lastname",$_POST["admin_lastname"]);
534  $this->ilias->setSetting("admin_title",$_POST["admin_title"]);
535  $this->ilias->setSetting("admin_position",$_POST["admin_position"]);
536  $this->ilias->setSetting("admin_institution",$_POST["admin_institution"]);
537  $this->ilias->setSetting("admin_street",$_POST["admin_street"]);
538  $this->ilias->setSetting("admin_zipcode",$_POST["admin_zipcode"]);
539  $this->ilias->setSetting("admin_city",$_POST["admin_city"]);
540  $this->ilias->setSetting("admin_country",$_POST["admin_country"]);
541  $this->ilias->setSetting("admin_phone",$_POST["admin_phone"]);
542  $this->ilias->setSetting("admin_email",$_POST["admin_email"]);
543 
544  // cron
545  $this->ilias->setSetting("cron_user_check",$_POST["cron_user_check"]);
546  $this->ilias->setSetting("cron_link_check",$_POST["cron_link_check"]);
547  $this->ilias->setSetting("cron_web_resource_check",$_POST["cron_web_resource_check"]);
548  $this->ilias->setSetting("cron_lucene_index",$_POST["cron_lucene_index"]);
549  $this->ilias->setSetting("forum_notification",$_POST["forum_notification"]);
550  if ($_POST["forum_notification"] == 2)
551  {
552  $this->ilias->setSetting("cron_forum_notification_last_date",date("Y-m-d H:i:s"));
553  }
554  $this->ilias->setSetting("mail_notification", $_POST["mail_notification"]);
555  $this->ilias->setSetting("mail_notification_message", $_POST["mail_notification_message"]);
556 
557 
558  // webservice
559  $this->ilias->setSetting("soap_user_administration",$_POST["soap_user_administration"]);
560  $this->ilias->setSetting("rpc_server_host",trim($_POST["rpc_server_host"]));
561  $this->ilias->setSetting("rpc_server_port",trim($_POST["rpc_server_port"]));
562 
563  // data privacy
564  // $this->ilias->setSetting("enable_fora_statistics",$_POST["enable_fora_statistics"]);
565 
566  // forums
567  $this->ilias->setSetting('frm_store_new',$_POST['frm_store_new']);
568 
569  // write ini settings
570  $this->ilias->ini->write();
571 
572  // links dynamic
573  $this->ilias->setSetting('links_dynamic',$_POST['links_dynamic']);
574 
575  $this->ilias->setSetting("suffix_repl_additional",
576  ilUtil::stripSlashes($_POST["suffix_repl_additional"]));
577 
578  $settings = $this->ilias->getAllSettings();
579 
580  // feedback
581  $feedback = $this->lng->txt("saved_successfully");
582  if (trim($_POST["rpc_server_host"]) != "" ||
583  trim($_POST["rpc_server_port"]) != "")
584  {
585  include_once 'Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
586  $rpc_settings = ilRPCServerSettings::getInstance();
587  if(!$rpc_settings->pingServer())
588  {
589  $feedback .= "<br />\n".$this->lng->txt('java_server_no_connection');
590  }
591  }
592  ilUtil::sendInfo($feedback);
593  }
594 
595  $ilCtrl->redirect($this, "view");
596  //$this->displayBasicSettings();
597  }
598 
600  {
601  include_once("./Modules/Scorm2004/classes/class.ilScormEditorDBCreator.php");
602  $db_creator = new ilScormEditorDBCreator();
603  $db_creator->createTables();
604 
605  ilUtil::sendSuccess("Tables are updated.", true);
606  $this->viewObject();
607  }
608 
615  {
616  global $rbacsystem, $ilCtrl, $ilClientIniFile;
617 
618  $this->tpl->addBlockFile("SYSTEMSETTINGS", "systemsettings", "tpl.adm_basicdata.html",
619  "Modules/SystemFolder");
620 
621  $settings = $this->ilias->getAllSettings();
622 
623  // temp wiki stuff
624  $this->tpl->setVariable("HREF_CREATE_WIKI_TABLE",
625  $ilCtrl->getLinkTarget($this, "createWikiTables"));
626 
627 
628 
629  $this->tpl->setVariable("TXT_BASIC_DATA", $this->lng->txt("basic_data"));
630 
632  // setting language vars
633 
634  // basic data
635  $this->tpl->setVariable("TXT_ILIAS_VERSION", $this->lng->txt("ilias_version"));
636  $this->tpl->setVariable("TXT_DB_VERSION", $this->lng->txt("db_version"));
637  $this->tpl->setVariable("TXT_CLIENT_ID", $this->lng->txt("client_id"));
638  $this->tpl->setVariable("TXT_INST_ID", $this->lng->txt("inst_id"));
639  $this->tpl->setVariable("TXT_ACTIVATE_HTTPS",$this->lng->txt('activate_https'));
640  $this->tpl->setVariable("TXT_HOSTNAME", $this->lng->txt("host"));
641  $this->tpl->setVariable("TXT_IP_ADDRESS", $this->lng->txt("ip_address"));
642  $this->tpl->setVariable("TXT_SERVER_DATA", $this->lng->txt("server_data"));
643  $this->tpl->setVariable("TXT_SERVER_PORT", $this->lng->txt("port"));
644  $this->tpl->setVariable("TXT_SERVER_SOFTWARE", $this->lng->txt("server_software"));
645  $this->tpl->setVariable("TXT_HTTP_PATH", $this->lng->txt("http_path"));
646  $this->tpl->setVariable("TXT_ABSOLUTE_PATH", $this->lng->txt("absolute_path"));
647  $this->tpl->setVariable("TXT_INST_NAME", $this->lng->txt("inst_name"));
648  $this->tpl->setVariable("TXT_INST_INFO", $this->lng->txt("inst_info"));
649  //$this->tpl->setVariable("TXT_OPEN_VIEWS_INSIDE_FRAMESET", $this->lng->txt("open_views_inside_frameset"));
650  $this->tpl->setVariable("TXT_FEEDBACK_RECIPIENT", $this->lng->txt("feedback_recipient"));
651  $this->tpl->setVariable("TXT_ERROR_RECIPIENT", $this->lng->txt("error_recipient"));
652  $this->tpl->setVariable("TXT_HEADER_TITLE", $this->lng->txt("header_title"));
653  $this->tpl->setVariable("TXT_SHORT_NAME", $this->lng->txt("short_inst_name"));
654  $this->tpl->setVariable("TXT_SHORT_NAME_INFO", $this->lng->txt("short_inst_name_info"));
655 
656  $this->tpl->setVariable("VAL_SHORT_INST_NAME", $settings['short_inst_name']);
657  $this->tpl->setVariable("TXT_CHANGE", $this->lng->txt("change"));
658  $this->tpl->setVariable("LINK_HEADER_TITLE",
659  $this->ctrl->getLinkTarget($this, "changeHeaderTitle"));
660  $this->tpl->setVariable("VAL_HEADER_TITLE",
662 
663  include_once ("./Services/Database/classes/class.ilDBUpdate.php");
664  $dbupdate = new ilDBUpdate($this->ilias->db,true);
665 
666  if (!$dbupdate->getDBVersionStatus())
667  {
668  $this->tpl->setVariable("TXT_DB_UPDATE", "&nbsp;(<span class=\"warning\">".$this->lng->txt("db_need_update")."</span>)");
669  }
670 
671  //$this->tpl->setVariable("TXT_MODULES", $this->lng->txt("modules"));
672  $this->tpl->setVariable("TXT_PUB_SECTION", $this->lng->txt("pub_section"));
673 
674 
675  $this->tpl->setVariable('TXT_SEARCH_ENGINE',$this->lng->txt('search_engine'));
676  $this->tpl->setVariable('TXT_ENABLE_SEARCH_ENGINE',$this->lng->txt('enable_search_engine'));
677  include_once('Services/PrivacySecurity/classes/class.ilRobotSettings.php');
678  $robot_settings = ilRobotSettings::_getInstance();
679 
680  $error_se = false;
681  if(!$robot_settings->checkModRewrite())
682  {
683  $error_se = true;
684  $this->tpl->setVariable('OPEN_GOOGLE_CHECKED','disabled="disabled"');
685 
686  $this->tpl->setCurrentBlock('search_engine_alert');
687  $this->tpl->setVariable('SE_ALERT_IMG',ilUtil::getImagePath('icon_alert_s.gif'));
688  $this->tpl->setVariable('SE_ALT_ALERT',$this->lng->txt('alert'));
689  $this->tpl->setVariable('TXT_SE_ALERT',$this->lng->txt('mod_rewrite_disabled'));
690  $this->tpl->parseCurrentBlock();
691  }
692  elseif(!$robot_settings->checkRewrite())
693  {
694  $error_se = true;
695  $this->tpl->setVariable('OPEN_GOOGLE_CHECKED','disabled="disabled"');
696 
697  $this->tpl->setCurrentBlock('search_engine_alert');
698  $this->tpl->setVariable('SE_ALERT_IMG',ilUtil::getImagePath('icon_alert_s.gif'));
699  $this->tpl->setVariable('SE_ALT_ALERT',$this->lng->txt('alert'));
700  $this->tpl->setVariable('TXT_SE_ALERT',$this->lng->txt('allow_override_alert'));
701  $this->tpl->parseCurrentBlock();
702  }
703  if($settings['open_google'] and !$error_se)
704  {
705  $this->tpl->setVariable('OPEN_GOOGLE_CHECKED','checked="checked"');
706  }
707 
708  $this->tpl->setVariable("TXT_DEFAULT_REPOSITORY_VIEW", $this->lng->txt("def_repository_view"));
709  $this->tpl->setVariable("TXT_FLAT", $this->lng->txt("flatview"));
710  $this->tpl->setVariable("TXT_TREE", $this->lng->txt("treeview"));
711 
712  $this->tpl->setVariable("TXT_ENABLE_PASSWORD_ASSISTANCE", $this->lng->txt("enable_password_assistance"));
713  $this->tpl->setVariable("TXT_PASSWORD_AUTO_GENERATE_INFO",$this->lng->txt('passwd_generation_info'));
714  //rku: password assistent should be availabe always, even in mixed mode.
715  /* if (AUTH_DEFAULT != AUTH_LOCAL)
716  {
717  $this->tpl->setVariable("DISABLE_PASSWORD_ASSISTANCE", 'disabled=\"disabled\"');
718  $this->tpl->setVariable("TXT_PASSWORD_ASSISTANCE_DISABLED", $this->lng->txt("password_assistance_disabled"));
719  }*/
720 
721  $this->tpl->setVariable("TXT_PASSWORD_ASSISTANCE_INFO", $this->lng->txt("password_assistance_info"));
722 
723  $this->tpl->setVariable("TXT_ENABLE_PASSWORD_GENERATION",$this->lng->txt('passwd_generation'));
724 
725  // File Suffix Replacements
726  $this->tpl->setVariable("TXT_FILE_SUFFIX_REPL", $this->lng->txt("file_suffix_repl"));
727  $this->tpl->setVariable("INFO_FILE_SUFFIX_REPL",
728  $this->lng->txt("file_suffix_repl_info")." ".SUFFIX_REPL_DEFAULT);
729 
730  $this->tpl->setVariable("TXT_DYNAMIC_LINKS",$this->lng->txt('links_dynamic'));
731  $this->tpl->setVariable("INFO_DYNAMIC_LINKS",$this->lng->txt('links_dynamic_info'));
732 
733  $this->tpl->setVariable("TXT_ENABLE_TRASH",$this->lng->txt('enable_trash'));
734  $this->tpl->setVariable("INFO_ENABLE_TRASH",$this->lng->txt('enable_trash_info'));
735 
736  $this->tpl->setVariable('TXT_SESSION_REMINDER', $this->lng->txt('session_reminder'));
737  $this->tpl->setVariable('INFO_SESSION_REMINDER', $this->lng->txt('session_reminder_info'));
738  $expires = $ilClientIniFile->readVariable("session", "expire");
739  $time = ilFormat::_secondsToString($expires, true);
740  $this->tpl->setVariable('SESSION_REMINDER_SESSION_DURATION',
741  sprintf($this->lng->txt('session_reminder_session_duration'), $time));
742 
743 
744  // paths
745  $this->tpl->setVariable("TXT_SOFTWARE", $this->lng->txt("3rd_party_software"));
746  $this->tpl->setVariable("TXT_CONVERT_PATH", $this->lng->txt("path_to_convert"));
747  $this->tpl->setVariable("TXT_ZIP_PATH", $this->lng->txt("path_to_zip"));
748  $this->tpl->setVariable("TXT_UNZIP_PATH", $this->lng->txt("path_to_unzip"));
749  $this->tpl->setVariable("TXT_JAVA_PATH", $this->lng->txt("path_to_java"));
750  $this->tpl->setVariable("TXT_HTMLDOC_PATH", $this->lng->txt("path_to_htmldoc"));
751  $this->tpl->setVariable("TXT_MKISOFS_PATH", $this->lng->txt("path_to_mkisofs"));
752  $this->tpl->setVariable("TXT_LATEX_URL", $this->lng->txt("url_to_latex"));
753 
754  // Cron
755  $this->tpl->setVariable("TXT_CRON",$this->lng->txt('cron_jobs'));
756  $this->tpl->setVariable("TXT_CRON_DESC",$this->lng->txt('cron_jobs_desc'));
757  $this->tpl->setVariable("TXT_CRON_USER_ACCOUNTS",$this->lng->txt('check_user_accounts'));
758  $this->tpl->setVariable("CRON_USER_ACCOUNTS_DESC",$this->lng->txt('check_user_accounts_desc'));
759  $this->tpl->setVariable("TXT_CRON_LINK_CHECK",$this->lng->txt('check_link'));
760  $this->tpl->setVariable("CRON_LINK_CHECK_DESC",$this->lng->txt('check_link_desc'));
761  $this->tpl->setVariable("TXT_CRON_WEB_RESOURCE_CHECK",$this->lng->txt('check_web_resources'));
762  $this->tpl->setVariable("CRON_WEB_RESOURCE_CHECK_DESC",$this->lng->txt('check_web_resources_desc'));
763 
764  $this->tpl->setVariable("TXT_CRON_LUCENE_INDEX",$this->lng->txt('cron_lucene_index'));
765  $this->tpl->setVariable("TXT_CRON_LUCENE_INDEX_INFO",$this->lng->txt('cron_lucene_index_info'));
766 
767  $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION",$this->lng->txt('cron_forum_notification'));
768  $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION_NEVER",$this->lng->txt('cron_forum_notification_never'));
769  $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION_DIRECTLY",$this->lng->txt('cron_forum_notification_directly'));
770  $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION_CRON",$this->lng->txt('cron_forum_notification_cron'));
771  $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_DESC",$this->lng->txt('cron_forum_notification_desc'));
772 
773  $this->tpl->setVariable("TXT_CRON_MAIL_NOTIFICATION",$this->lng->txt('cron_mail_notification'));
774  $this->tpl->setVariable("TXT_CRON_MAIL_NOTIFICATION_NEVER",$this->lng->txt('cron_mail_notification_never'));
775  $this->tpl->setVariable("TXT_CRON_MAIL_NOTIFICATION_CRON",$this->lng->txt('cron_mail_notification_cron'));
776  $this->tpl->setVariable("CRON_MAIL_NOTIFICATION_DESC",$this->lng->txt('cron_mail_notification_desc'));
777 
778  $this->tpl->setVariable("TXT_CRON_MAIL_MESSAGE_CHECK", $this->lng->txt('cron_mail_notification_message'));
779  $this->tpl->setVariable("CRON_MAIL_MESSAGE_CHECK", $this->lng->txt('cron_mail_notification_message_enabled'));
780  $this->tpl->setVariable("CRON_MAIL_MESSAGE_CHECK_DESC", $this->lng->txt('cron_mail_notification_message_desc'));
781 
782  $this->tpl->setVariable("TXT_NEVER",$this->lng->txt('never'));
783  $this->tpl->setVariable("TXT_DAILY",$this->lng->txt('daily'));
784  $this->tpl->setVariable("TXT_WEEKLY",$this->lng->txt('weekly'));
785  $this->tpl->setVariable("TXT_MONTHLY",$this->lng->txt('monthly'));
786  $this->tpl->setVariable("TXT_QUARTERLY",$this->lng->txt('quarterly'));
787 
788  $this->tpl->setVariable("TXT_WEBSERVICES",$this->lng->txt('webservices'));
789  $this->tpl->setVariable("TXT_SOAP_USER_ADMINISTRATION",$this->lng->txt('soap_user_administration'));
790  $this->tpl->setVariable("TXT_SOAP_USER_ADMINISTRATION_DESC",$this->lng->txt('soap_user_administration_desc'));
791 
792  $this->tpl->setVariable("TXT_JAVA_SERVER",$this->lng->txt('java_server'));
793  $this->tpl->setVariable("TXT_JAVA_SERVER_HOST",$this->lng->txt('java_server_host'));
794  $this->tpl->setVariable("TXT_JAVA_SERVER_PORT",$this->lng->txt('java_server_port'));
795  $this->tpl->setVariable("TXT_JAVA_SERVER_INFO",$this->lng->txt('java_server_info'));
796  $this->tpl->setVariable("TXT_JAVA_SERVER_README",$this->lng->txt('java_server_readme'));
797 
798 /* $this->tpl->setVariable("TXT_DATA_PRIVACY",$this->lng->txt('data_privacy'));
799  $this->tpl->setVariable("TXT_ENABLE_FORA_STATISTICS",$this->lng->txt('enable_fora_statistics'));
800  $this->tpl->setVariable("TXT_ENABLE_FORA_STATISTICS_DESC",$this->lng->txt('enable_fora_statistics_desc')); */
801 
802 
803  // forums
804  $this->tpl->setVariable("TXT_FORUMS",$this->lng->txt('obj_frm'));
805  $this->tpl->setVariable("TXT_STATUS_NEW",$this->lng->txt('frm_status_new'));
806  $this->tpl->setVariable("TXT_STATUS_NEW_DESC",$this->lng->txt('frm_status_new_desc'));
807 
808  $this->tpl->setVariable("TXT_ONE_WEEK","1 ". $this->lng->txt('week'));
809  $this->tpl->setVariable("TXT_TWO_WEEKS","2 ". $this->lng->txt('weeks'));
810  $this->tpl->setVariable("TXT_FOUR_WEEKS","4 ". $this->lng->txt('weeks'));
811  $this->tpl->setVariable("TXT_EIGHT_WEEKS","8 ". $this->lng->txt('weeks'));
812 
813  // contact
814  $this->tpl->setVariable("TXT_CONTACT_DATA", $this->lng->txt("contact_data"));
815  $this->tpl->setVariable("TXT_REQUIRED_FIELDS", $this->lng->txt("required_field"));
816  $this->tpl->setVariable("TXT_ADMIN", $this->lng->txt("administrator"));
817  $this->tpl->setVariable("TXT_FIRSTNAME", $this->lng->txt("firstname"));
818  $this->tpl->setVariable("TXT_LASTNAME", $this->lng->txt("lastname"));
819  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
820  $this->tpl->setVariable("TXT_POSITION", $this->lng->txt("position"));
821  $this->tpl->setVariable("TXT_INSTITUTION", $this->lng->txt("institution"));
822  $this->tpl->setVariable("TXT_STREET", $this->lng->txt("street"));
823  $this->tpl->setVariable("TXT_ZIPCODE", $this->lng->txt("zipcode"));
824  $this->tpl->setVariable("TXT_CITY", $this->lng->txt("city"));
825  $this->tpl->setVariable("TXT_COUNTRY", $this->lng->txt("country"));
826  $this->tpl->setVariable("TXT_PHONE", $this->lng->txt("phone"));
827  $this->tpl->setVariable("TXT_EMAIL", $this->lng->txt("email"));
828  $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
829 
830 
832  // display formula data
833 
834  // basic data
835  $this->tpl->setVariable("FORMACTION_BASICDATA", $this->ctrl->getFormAction($this));
836  $this->tpl->setVariable("HTTP_PATH",ILIAS_HTTP_PATH);
837  $this->tpl->setVariable("ABSOLUTE_PATH",ILIAS_ABSOLUTE_PATH);
838  $this->tpl->setVariable("HOSTNAME", $_SERVER["SERVER_NAME"]);
839  $this->tpl->setVariable("SERVER_PORT", $_SERVER["SERVER_PORT"]);
840  $this->tpl->setVariable("SERVER_ADMIN", $_SERVER["SERVER_ADMIN"]); // not used
841  $this->tpl->setVariable("SERVER_SOFTWARE", $_SERVER["SERVER_SOFTWARE"]);
842  $this->tpl->setVariable("IP_ADDRESS", $_SERVER["SERVER_ADDR"]);
843  $this->tpl->setVariable("DB_VERSION",$settings["db_version"]);
844  $this->tpl->setVariable("ILIAS_VERSION",$settings["ilias_version"]);
845  $this->tpl->setVariable("INST_ID",$settings["inst_id"]);
846  $this->tpl->setVariable("CLIENT_ID",CLIENT_ID);
847  $this->tpl->setVariable("INST_NAME",$this->ilias->ini->readVariable("client","name"));
848  $this->tpl->setVariable("INST_INFO",$this->ilias->ini->readVariable("client","description"));
849  $this->tpl->setVariable("FEEDBACK_RECIPIENT",$settings["feedback_recipient"]);
850  $this->tpl->setVariable("ERROR_RECIPIENT",$settings["error_recipient"]);
851 
852  $this->tpl->setVariable("PHP_INFO_LINK",
853  $this->ctrl->getLinkTarget($this, "showPHPInfo"));
854 
855  // get all templates
856  if ($settings["pub_section"])
857  {
858  $this->tpl->setVariable("PUB_SECTION","checked=\"checked\"");
859  }
860 
861  if ($settings["default_repository_view"] == "tree")
862  {
863  $this->tpl->setVariable("TREESELECTED","selected=\"1\"");
864  }
865  else
866  {
867  $this->tpl->setVariable("FLATSELECTED","selected=\"1\"");
868  }
869 
870  if($settings['password_assistance'])
871  {
872  $this->tpl->setVariable("PASSWORD_ASSISTANCE","checked=\"checked\"");
873  }
874  $this->tpl->setVariable("VAL_SHORT_NAME", $settings['short_inst_title']);
875  if($settings['passwd_auto_generate'])
876  {
877  $this->tpl->setVariable("PASSWORD_AUTO_GENERATE","checked=\"checked\"");
878  }
879 
880  // js editing
881  /*
882  if($settings['enable_js_edit'])
883  {
884  $this->tpl->setVariable("JS_EDIT","checked=\"checked\"");
885  }*/
886 
887  $this->tpl->setVariable("SUFFIX_REPL_ADDITIONAL", ilUtil::prepareFormOutput($settings['suffix_repl_additional']));
888 
889  if($settings['links_dynamic'])
890  {
891  $this->tpl->setVariable("LINKS_DYNAMIC_CHECKED","checked=\"checked\"");
892  }
893 
894  if($settings['enable_trash'])
895  {
896  $this->tpl->setVariable("ENABLE_TRASH_CHECKED","checked=\"checked\"");
897  }
898 
899  if($settings['session_reminder_enabled'])
900  {
901  $this->tpl->setVariable('SESSION_REMINDER_ENABLED','checked=checked');
902  }
903 
904  if ($settings["require_login"])
905  {
906  $this->tpl->setVariable("REQUIRE_LOGIN","checked=\"checked\"");
907  }
908  if ($settings["require_passwd"])
909  {
910  $this->tpl->setVariable("REQUIRE_PASSWD","checked=\"checked\"");
911  }
912  if ($settings["require_passwd2"])
913  {
914  $this->tpl->setVariable("REQUIRE_PASSWD2","checked=\"checked\"");
915  }
916  if ($settings["require_firstname"])
917  {
918  $this->tpl->setVariable("REQUIRE_FIRSTNAME","checked=\"checked\"");
919  }
920  if ($settings["require_gender"])
921  {
922  $this->tpl->setVariable("REQUIRE_GENDER","checked=\"checked\"");
923  }
924  if ($settings["require_lastname"])
925  {
926  $this->tpl->setVariable("REQUIRE_LASTNAME","checked=\"checked\"");
927  }
928  if ($settings["require_institution"])
929  {
930  $this->tpl->setVariable("REQUIRE_INSTITUTION","checked=\"checked\"");
931  }
932  if ($settings["require_department"])
933  {
934  $this->tpl->setVariable("REQUIRE_DEPARTMENT","checked=\"checked\"");
935  }
936  if ($settings["require_street"])
937  {
938  $this->tpl->setVariable("REQUIRE_STREET","checked=\"checked\"");
939  }
940  if ($settings["require_city"])
941  {
942  $this->tpl->setVariable("REQUIRE_CITY","checked=\"checked\"");
943  }
944  if ($settings["require_zipcode"])
945  {
946  $this->tpl->setVariable("REQUIRE_ZIPCODE","checked=\"checked\"");
947  }
948  if ($settings["require_country"])
949  {
950  $this->tpl->setVariable("REQUIRE_COUNTRY","checked=\"checked\"");
951  }
952  if ($settings["require_phone_office"])
953  {
954  $this->tpl->setVariable("REQUIRE_PHONE_OFFICE","checked=\"checked\"");
955  }
956  if ($settings["require_phone_home"])
957  {
958  $this->tpl->setVariable("REQUIRE_PHONE_HOME","checked=\"checked\"");
959  }
960  if ($settings["require_phone_mobile"])
961  {
962  $this->tpl->setVariable("REQUIRE_PHONE_MOBILE","checked=\"checked\"");
963  }
964  if ($settings["require_fax"])
965  {
966  $this->tpl->setVariable("REQUIRE_FAX","checked=\"checked\"");
967  }
968  if ($settings["require_email"])
969  {
970  $this->tpl->setVariable("REQUIRE_EMAIL","checked=\"checked\"");
971  }
972  if ($settings["require_hobby"])
973  {
974  $this->tpl->setVariable("REQUIRE_HOBBY","checked=\"checked\"");
975  }
976  if ($settings["require_default_role"])
977  {
978  $this->tpl->setVariable("REQUIRE_DEFAULT_ROLE","checked=\"checked\"");
979  }
980  if ($settings["require_referral_comment"])
981  {
982  $this->tpl->setVariable("REQUIRE_REFERRAL_COMMENT","checked=\"checked\"");
983  }
984  if ($settings["require_matriculation"])
985  {
986  $this->tpl->setVariable("REQUIRE_MATRICULATION","checked=\"checked\"");
987  }
988  if ($settings["cron_user_check"])
989  {
990  $this->tpl->setVariable("CRON_USER_CHECK","checked=\"checked\"");
991  }
992  if ($settings["cron_link_check"])
993  {
994  $this->tpl->setVariable("CRON_LINK_CHECK","checked=\"checked\"");
995  }
996  if($settings["cron_lucene_index"])
997  {
998  $this->tpl->setVariable("CRON_LUCENE_INDEX","checked=\"checked\"");
999  }
1000  if ($settings["forum_notification"] == 0)
1001  {
1002  $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_NEVER_SELECTED"," selected");
1003  }
1004  else if ($settings["forum_notification"] == 1)
1005  {
1006  $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_DIRECTLY_SELECTED"," selected");
1007  }
1008  else if ($settings["forum_notification"] == 2)
1009  {
1010  $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_CRON_SELECTED"," selected");
1011  }
1012  if ($settings["mail_notification"] == 0)
1013  {
1014  $this->tpl->setVariable("CRON_MAIL_NOTIFICATION_NEVER_SELECTED"," selected=\"selected\"");
1015  }
1016  else if ($settings["mail_notification"] == 1)
1017  {
1018  $this->tpl->setVariable("CRON_MAIL_NOTIFICATION_CRON_SELECTED"," selected=\"selected\"");
1019  if($settings["mail_notification_message"] == 1)
1020  {
1021  $this->tpl->setVariable("CRON_MAIL_MESSAGE_CHECK","checked=\"checked\"");
1022  }
1023  else
1024  {
1025  $this->tpl->setVariable("CRON_MAIL_MESSAGE_CHECK_DISABLED","DISABLED");
1026  }
1027  }
1028  if ($val = $settings["cron_web_resource_check"])
1029  {
1030  switch($val)
1031  {
1032  case 1:
1033  $this->tpl->setVariable("D_SELECT",'selected="selected"');
1034  break;
1035  case 2:
1036  $this->tpl->setVariable("W_SELECT",'selected="selected"');
1037  break;
1038  case 3:
1039  $this->tpl->setVariable("M_SELECT",'selected="selected"');
1040  break;
1041  case 4:
1042  $this->tpl->setVariable("Q_SELECT",'selected="selected"');
1043  break;
1044 
1045  }
1046  }
1047  switch($settings['frm_store_new'])
1048  {
1049  case 1:
1050  $this->tpl->setVariable("ONE_SELECT",'selected="selected"');
1051  break;
1052 
1053  case 2:
1054  $this->tpl->setVariable("TWO_SELECT",'selected="selected"');
1055  break;
1056 
1057  case 4:
1058  $this->tpl->setVariable("FOUR_SELECT",'selected="selected"');
1059  break;
1060 
1061  case 8:
1062  default:
1063  $this->tpl->setVariable("EIGHT_SELECT",'selected="selected"');
1064  break;
1065  }
1066  if ($settings["soap_user_administration"])
1067  {
1068  $this->tpl->setVariable("SOAP_USER_ADMINISTRATION_CHECK","checked=\"checked\"");
1069  }
1070 
1071  $this->tpl->setVariable("JAVA_SERVER_HOST",$settings["rpc_server_host"]);
1072  $this->tpl->setVariable("JAVA_SERVER_PORT",$settings["rpc_server_port"]);
1073 
1074  /* if ($settings["enable_fora_statistics"])
1075  {
1076  $this->tpl->setVariable("ENABLE_FORA_STATISTICS_CHECK","checked=\"checked\"");
1077  }*/
1078 
1079 
1080  // paths to tools
1081  $not_set = $this->lng->txt("path_not_set");
1082 
1083  $this->tpl->setVariable("CONVERT_PATH",(PATH_TO_CONVERT) ? PATH_TO_CONVERT : $not_set);
1084  $this->tpl->setVariable("ZIP_PATH",(PATH_TO_ZIP) ? PATH_TO_ZIP : $not_set);
1085  $this->tpl->setVariable("UNZIP_PATH",(PATH_TO_UNZIP) ? PATH_TO_UNZIP : $not_set);
1086  $this->tpl->setVariable("JAVA_PATH",(PATH_TO_JAVA) ? PATH_TO_JAVA : $not_set);
1087  $this->tpl->setVariable("HTMLDOC_PATH",(PATH_TO_HTMLDOC) ? PATH_TO_HTMLDOC : $not_set);
1088  $this->tpl->setVariable("MKISOFS_PATH",(PATH_TO_MKISOFS) ? PATH_TO_MKISOFS : $not_set);
1089  $this->tpl->setVariable("LATEX_URL",(URL_TO_LATEX) ? URL_TO_LATEX : $not_set);
1090 
1091  // contact
1092  $this->tpl->setVariable("ADMIN_FIRSTNAME",$settings["admin_firstname"]);
1093  $this->tpl->setVariable("ADMIN_LASTNAME",$settings["admin_lastname"]);
1094  $this->tpl->setVariable("ADMIN_TITLE",$settings["admin_title"]);
1095  $this->tpl->setVariable("ADMIN_POSITION",$settings["admin_position"]);
1096  $this->tpl->setVariable("ADMIN_INSTITUTION",$settings["admin_institution"]);
1097  $this->tpl->setVariable("ADMIN_STREET",$settings["admin_street"]);
1098  $this->tpl->setVariable("ADMIN_ZIPCODE",$settings["admin_zipcode"]);
1099  $this->tpl->setVariable("ADMIN_CITY",$settings["admin_city"]);
1100  $this->tpl->setVariable("ADMIN_COUNTRY",$settings["admin_country"]);
1101  $this->tpl->setVariable("ADMIN_PHONE",$settings["admin_phone"]);
1102  $this->tpl->setVariable("ADMIN_EMAIL",$settings["admin_email"]);
1103 
1104  $this->tpl->parseCurrentBlock();
1105  }
1106 
1108  {
1109  return $this->viewScanLog();
1110  }
1111 
1117  function checkObject()
1118  {
1119  global $rbacsystem, $ilias, $objDefinition, $ilSetting;
1120 
1121  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1122  {
1123  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1124  }
1125 //echo "1";
1126 
1127  if ($_POST['count_limit'] !== null || $_POST['age_limit'] !== null || $_POST['type_limit'] !== null)
1128  {
1129  $ilias->account->writePref('systemcheck_count_limit',
1130  (is_numeric($_POST['count_limit']) && $_POST['count_limit'] > 0) ? $_POST['count_limit'] : ''
1131  );
1132  $ilias->account->writePref('systemcheck_age_limit',
1133  (is_numeric($_POST['age_limit']) && $_POST['age_limit'] > 0) ? $_POST['age_limit'] : '');
1134  $ilias->account->writePref('systemcheck_type_limit', trim($_POST['type_limit']));
1135  }
1136 
1137  if ($_POST["mode"])
1138  {
1139 //echo "3";
1140  $this->writeCheckParams();
1141  $this->startValidator($_POST["mode"],$_POST["log_scan"]);
1142  }
1143  else
1144  {
1145 //echo "4";
1146  include_once "classes/class.ilValidator.php";
1147  $validator = new ilValidator();
1148  $hasScanLog = $validator->hasScanLog();
1149 
1150  $this->getTemplateFile("check");
1151 
1152  if ($hasScanLog)
1153  {
1154  $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_last_log"));
1155  }
1156 
1157  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1158  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("systemcheck"));
1159  $this->tpl->setVariable("COLSPAN", 3);
1160  $this->tpl->setVariable("TXT_ANALYZE_TITLE", $this->lng->txt("analyze_data"));
1161  $this->tpl->setVariable("TXT_ANALYSIS_OPTIONS", $this->lng->txt("analysis_options"));
1162  $this->tpl->setVariable("TXT_REPAIR_OPTIONS", $this->lng->txt("repair_options"));
1163  $this->tpl->setVariable("TXT_OUTPUT_OPTIONS", $this->lng->txt("output_options"));
1164  $this->tpl->setVariable("TXT_SCAN", $this->lng->txt("scan"));
1165  $this->tpl->setVariable("TXT_SCAN_DESC", $this->lng->txt("scan_desc"));
1166  $this->tpl->setVariable("TXT_DUMP_TREE", $this->lng->txt("dump_tree"));
1167  $this->tpl->setVariable("TXT_DUMP_TREE_DESC", $this->lng->txt("dump_tree_desc"));
1168  $this->tpl->setVariable("TXT_CLEAN", $this->lng->txt("clean"));
1169  $this->tpl->setVariable("TXT_CLEAN_DESC", $this->lng->txt("clean_desc"));
1170  $this->tpl->setVariable("TXT_RESTORE", $this->lng->txt("restore_missing"));
1171  $this->tpl->setVariable("TXT_RESTORE_DESC", $this->lng->txt("restore_missing_desc"));
1172  $this->tpl->setVariable("TXT_PURGE", $this->lng->txt("purge_missing"));
1173  $this->tpl->setVariable("TXT_PURGE_DESC", $this->lng->txt("purge_missing_desc"));
1174  $this->tpl->setVariable("TXT_RESTORE_TRASH", $this->lng->txt("restore_trash"));
1175  $this->tpl->setVariable("TXT_RESTORE_TRASH_DESC", $this->lng->txt("restore_trash_desc"));
1176  $this->tpl->setVariable("TXT_PURGE_TRASH", $this->lng->txt("purge_trash"));
1177  $this->tpl->setVariable("TXT_PURGE_TRASH_DESC", $this->lng->txt("purge_trash_desc"));
1178  $this->tpl->setVariable("TXT_COUNT_LIMIT", $this->lng->txt("purge_count_limit"));
1179  $this->tpl->setVariable("TXT_COUNT_LIMIT_DESC", $this->lng->txt("purge_count_limit_desc"));
1180  $this->tpl->setVariable("COUNT_LIMIT_VALUE", $ilias->account->getPref("systemcheck_count_limit"));
1181  $this->tpl->setVariable("TXT_AGE_LIMIT", $this->lng->txt("purge_age_limit"));
1182  $this->tpl->setVariable("TXT_AGE_LIMIT_DESC", $this->lng->txt("purge_age_limit_desc"));
1183  $this->tpl->setVariable("AGE_LIMIT_VALUE", $ilias->account->getPref("systemcheck_age_limit"));
1184  $this->tpl->setVariable("TXT_TYPE_LIMIT", $this->lng->txt("purge_type_limit"));
1185  $this->tpl->setVariable("TXT_TYPE_LIMIT_DESC", $this->lng->txt("purge_type_limit_desc"));
1186 
1187  if($ilias->account->getPref('systemcheck_mode_scan'))
1188  $this->tpl->touchBlock('mode_scan_checked');
1189  if($ilias->account->getPref('systemcheck_mode_dump_tree'))
1190  $this->tpl->touchBlock('mode_dump_tree_checked');
1191  if($ilias->account->getPref('systemcheck_mode_clean'))
1192  $this->tpl->touchBlock('mode_clean_checked');
1193  if($ilias->account->getPref('systemcheck_mode_restore'))
1194  {
1195  $this->tpl->touchBlock('mode_restore_checked');
1196  $this->tpl->touchBlock('mode_purge_disabled');
1197  }
1198  elseif($ilias->account->getPref('systemcheck_mode_purge'))
1199  {
1200  $this->tpl->touchBlock('mode_purge_checked');
1201  $this->tpl->touchBlock('mode_restore_disabled');
1202  }
1203  if($ilias->account->getPref('systemcheck_mode_restore_trash'))
1204  {
1205  $this->tpl->touchBlock('mode_restore_trash_checked');
1206  $this->tpl->touchBlock('mode_purge_trash_disabled');
1207  }
1208  elseif($ilias->account->getPref('systemcheck_mode_purge_trash'))
1209  {
1210  $this->tpl->touchBlock('mode_purge_trash_checked');
1211  $this->tpl->touchBlock('mode_restore_trash_disabled');
1212  }
1213  if($ilias->account->getPref('systemcheck_log_scan'))
1214  $this->tpl->touchBlock('log_scan_checked');
1215 
1216  $types = $objDefinition->getAllObjects();
1217  $ts = array("" => "");
1218  foreach ($types as $t)
1219  {
1220  if ($t != "" && !$objDefinition->isSystemObject($t) && $t != "root")
1221  {
1222  if ($objDefinition->isPlugin($t))
1223  {
1224  $ts[$t] = ilPlugin::lookupTxt("rep_robj", $t, "obj_".$t);
1225  }
1226  else
1227  {
1228  $ts[$t] = $this->lng->txt("obj_".$t);
1229  }
1230  }
1231  }
1232  $this->tpl->setVariable("TYPE_LIMIT_CHOICE",
1234  $ilias->account->getPref("systemcheck_type_limit"),
1235  'type_limit',
1236  $ts, false, true
1237  )
1238  );
1239  $this->tpl->setVariable("TXT_LOG_SCAN", $this->lng->txt("log_scan"));
1240  $this->tpl->setVariable("TXT_LOG_SCAN_DESC", $this->lng->txt("log_scan_desc"));
1241  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("start_scan"));
1242 
1243  $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save_params_for_cron"));
1244 
1245  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1246 
1247  $cron_form = new ilPropertyFormGUI();
1248  $cron_form->setFormAction($this->ctrl->getFormAction($this));
1249  $cron_form->setTitle($this->lng->txt('systemcheck_cronform'));
1250 
1251  $radio_group = new ilRadioGroupInputGUI($this->lng->txt('systemcheck_cron'), 'cronjob' );
1252  $radio_group->setValue( $ilSetting->get('systemcheck_cron') );
1253 
1254  $radio_opt = new ilRadioOption($this->lng->txt('disabled'),0);
1255  $radio_group->addOption($radio_opt);
1256 
1257  $radio_opt = new ilRadioOption($this->lng->txt('enabled'),1);
1258  $radio_group->addOption($radio_opt);
1259 
1260  $cron_form->addItem($radio_group);
1261 
1262  $cron_form->addCommandButton('saveCheckCron',$this->lng->txt('save'));
1263 
1264  $this->tpl->setVariable('CRON_FORM',$cron_form->getHTML());
1265  }
1266  }
1267 
1268  private function saveCheckParamsObject()
1269  {
1270  $this->writeCheckParams();
1271  unset($_POST['mode']);
1272  return $this->checkObject();
1273  }
1274 
1275  private function writeCheckParams()
1276  {
1277  include_once "classes/class.ilValidator.php";
1278  $validator = new ilValidator();
1279  $modes = $validator->getPossibleModes();
1280 
1281  $prefs = array();
1282  foreach($modes as $mode)
1283  {
1284  if( isset($_POST['mode'][$mode]) ) $value = (int)$_POST['mode'][$mode];
1285  else $value = 0;
1286  $prefs[ 'systemcheck_mode_'.$mode ] = $value;
1287  }
1288 
1289  if( isset($_POST['log_scan']) ) $value = (int)$_POST['log_scan'];
1290  else $value = 0;
1291  $prefs['systemcheck_log_scan'] = $value;
1292 
1293  global $ilUser;
1294  foreach($prefs as $key => $val)
1295  {
1296  $ilUser->writePref($key,$val);
1297  }
1298  }
1299 
1300  private function saveCheckCronObject()
1301  {
1302  global $ilSetting;
1303 
1304  $systemcheck_cron = ($_POST['cronjob'] ? 1 : 0);
1305  $ilSetting->set('systemcheck_cron',$systemcheck_cron);
1306 
1307  unset($_POST['mode']);
1308  return $this->checkObject();
1309  }
1310 
1317  {
1318  global $rbacsystem, $styleDefinition;
1319 
1320  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.header_title_edit.html");
1321 
1322  $array_push = true;
1323 
1324  if ($_SESSION["error_post_vars"])
1325  {
1326  $_SESSION["translation_post"] = $_SESSION["error_post_vars"];
1327  $_GET["mode"] = "session";
1328  $array_push = false;
1329  }
1330 
1331  // load from db if edit category is called the first time
1332  if (($_GET["mode"] != "session"))
1333  {
1334  $data = $this->object->getHeaderTitleTranslations();
1335  $_SESSION["translation_post"] = $data;
1336  $array_push = false;
1337  } // remove a translation from session
1338  elseif ($_GET["entry"] != 0)
1339  {
1340  array_splice($_SESSION["translation_post"]["Fobject"],$_GET["entry"],1,array());
1341 
1342  if ($_GET["entry"] == $_SESSION["translation_post"]["default_language"])
1343  {
1344  $_SESSION["translation_post"]["default_language"] = "";
1345  }
1346  }
1347 
1348  $data = $_SESSION["translation_post"];
1349 
1350  // add additional translation form
1351  if (!$_GET["entry"] and $array_push)
1352  {
1353  $count = array_push($data["Fobject"],array("title" => "","desc" => ""));
1354  }
1355  else
1356  {
1357  $count = count($data["Fobject"]);
1358  }
1359 
1360  // stripslashes in form?
1361  $strip = isset($_SESSION["translation_post"]) ? true : false;
1362 
1363  foreach ($data["Fobject"] as $key => $val)
1364  {
1365  // add translation button
1366  if ($key == $count -1)
1367  {
1368  $this->tpl->setCurrentBlock("addTranslation");
1369  $this->tpl->setVariable("TXT_ADD_TRANSLATION",$this->lng->txt("add_translation")." >>");
1370  $this->tpl->parseCurrentBlock();
1371  }
1372 
1373  // remove translation button
1374  if ($key != 0)
1375  {
1376  $this->tpl->setCurrentBlock("removeTranslation");
1377  $this->tpl->setVariable("TXT_REMOVE_TRANSLATION",$this->lng->txt("remove_translation"));
1378  $this->ctrl->setParameter($this, "entry", $key);
1379  $this->ctrl->setParameter($this, "mode", "edit");
1380  $this->tpl->setVariable("LINK_REMOVE_TRANSLATION",
1381  $this->ctrl->getLinkTarget($this, "removeTranslation"));
1382  $this->tpl->parseCurrentBlock();
1383  }
1384 
1385  // lang selection
1386  $this->tpl->addBlockFile("SEL_LANGUAGE", "sel_language", "tpl.lang_selection.html", false);
1387  $this->tpl->setVariable("SEL_NAME", "Fobject[".$key."][lang]");
1388 
1389  include_once('Services/MetaData/classes/class.ilMDLanguageItem.php');
1390 
1391  $languages = ilMDLanguageItem::_getLanguages();
1392 
1393  foreach ($languages as $code => $language)
1394  {
1395  $this->tpl->setCurrentBlock("lg_option");
1396  $this->tpl->setVariable("VAL_LG", $code);
1397  $this->tpl->setVariable("TXT_LG", $language);
1398 
1399  if ($code == $val["lang"])
1400  {
1401  $this->tpl->setVariable("SELECTED", "selected=\"selected\"");
1402  }
1403 
1404  $this->tpl->parseCurrentBlock();
1405  }
1406 
1407  // object data
1408  $this->tpl->setCurrentBlock("obj_form");
1409 
1410  if ($key == 0)
1411  {
1412  $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("change_header_title"));
1413  }
1414  else
1415  {
1416  $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("translation")." ".$key);
1417  }
1418 
1419  if ($key == $data["default_language"])
1420  {
1421  $this->tpl->setVariable("CHECKED", "checked=\"checked\"");
1422  }
1423 
1424  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
1425  $this->tpl->setVariable("TXT_DESC", $this->lng->txt("desc"));
1426  $this->tpl->setVariable("TXT_DEFAULT", $this->lng->txt("default"));
1427  $this->tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language"));
1428  $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($val["title"],$strip));
1429  $this->tpl->setVariable("DESC", ilUtil::stripSlashes($val["desc"]));
1430  $this->tpl->setVariable("NUM", $key);
1431  $this->tpl->parseCurrentBlock();
1432  }
1433 
1434  // global
1435  $this->tpl->setCurrentBlock("adm_content");
1436 
1437  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1438  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
1439  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
1440  $this->tpl->setVariable("CMD_SUBMIT", "saveHeaderTitle");
1441  $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
1442  }
1443 
1448  {
1449  $data = $_POST;
1450 
1451  // default language set?
1452  if (!isset($data["default_language"]))
1453  {
1454  $this->ilias->raiseError($this->lng->txt("msg_no_default_language"),$this->ilias->error_obj->MESSAGE);
1455  }
1456 
1457  // prepare array fro further checks
1458  foreach ($data["Fobject"] as $key => $val)
1459  {
1460  $langs[$key] = $val["lang"];
1461  }
1462 
1463  $langs = array_count_values($langs);
1464 
1465  // all languages set?
1466  if (array_key_exists("",$langs))
1467  {
1468  $this->ilias->raiseError($this->lng->txt("msg_no_language_selected"),$this->ilias->error_obj->MESSAGE);
1469  }
1470 
1471  // no single language is selected more than once?
1472  if (array_sum($langs) > count($langs))
1473  {
1474  $this->ilias->raiseError($this->lng->txt("msg_multi_language_selected"),$this->ilias->error_obj->MESSAGE);
1475  }
1476 
1477  // copy default translation to variable for object data entry
1478  $_POST["Fobject"]["title"] = $_POST["Fobject"][$_POST["default_language"]]["title"];
1479  $_POST["Fobject"]["desc"] = $_POST["Fobject"][$_POST["default_language"]]["desc"];
1480 
1481  // first delete all translation entries...
1482  $this->object->removeHeaderTitleTranslations();
1483 
1484  // ...and write new translations to object_translation
1485  foreach ($data["Fobject"] as $key => $val)
1486  {
1487  if ($key == $data["default_language"])
1488  {
1489  $default = 1;
1490  }
1491  else
1492  {
1493  $default = 0;
1494  }
1495 
1496  $this->object->addHeaderTitleTranslation(ilUtil::stripSlashes($val["title"]),ilUtil::stripSlashes($val["desc"]),$val["lang"],$default);
1497  }
1498 
1499  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
1500 
1501  $this->ctrl->redirect($this);
1502  }
1503 
1504  function cancelObject()
1505  {
1506  $this->ctrl->redirect($this, "view");
1507  }
1508 
1515  {
1516  $_SESSION["translation_post"] = $_POST;
1517 
1518  $this->ctrl->setParameter($this, "mode", "session");
1519  $this->ctrl->setParameter($this, "entry", "0");
1520  $this->ctrl->redirect($this, "changeHeaderTitle");
1521  }
1522 
1529  {
1530  $this->ctrl->setParameter($this, "entry", $_GET["entry"]);
1531  $this->ctrl->setParameter($this, "mode", "session");
1532  $this->ctrl->redirect($this, "changeHeaderTitle");
1533  }
1534 
1535 
1536  function startValidator($a_mode,$a_log)
1537  {
1538  global $rbacsystem;
1539 
1540  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1541  {
1542  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1543  }
1544 
1545  $logging = ($a_log) ? true : false;
1546  include_once "classes/class.ilValidator.php";
1547  $validator = new ilValidator($logging);
1548  $validator->setMode("all",false);
1549 
1550  $modes = array();
1551  foreach ($a_mode as $mode => $value)
1552  {
1553  $validator->setMode($mode,(bool) $value);
1554  $modes[] = $mode.'='.$value;
1555  }
1556 
1557  $scan_log = $validator->validate();
1558 
1559  $mode = $this->lng->txt("scan_modes").": ".implode(', ',$modes);
1560 
1561  // output
1562  $this->getTemplateFile("scan");
1563 
1564  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1565  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scanning_system"));
1566  $this->tpl->setVariable("COLSPAN", 3);
1567  $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
1568  $this->tpl->setVariable("TXT_MODE", $mode);
1569 
1570  if ($logging === true)
1571  {
1572  $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_log"));
1573  }
1574 
1575  $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
1576 
1577  $validator->writeScanLogLine($mode);
1578  }
1579 
1580  function viewScanLog()
1581  {
1582  include_once "classes/class.ilValidator.php";
1583  $validator = new IlValidator();
1584  $scan_log =& $validator->readScanLog();
1585 
1586  if (is_array($scan_log))
1587  {
1588  $scan_log = '<pre>'.implode("",$scan_log).'</pre>';
1589  $this->tpl->setVariable("ADM_CONTENT", $scan_log);
1590  }
1591  else
1592  {
1593  $scan_log = "no scanlog found.";
1594  }
1595 
1596  // output
1597  $this->getTemplateFile("scan");
1598  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scan_details"));
1599  $this->tpl->setVariable("COLSPAN", 3);
1600  $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
1601  $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
1602  }
1603 
1604 
1608  function benchmarkObject()
1609  {
1610  global $ilBench, $rbacsystem, $lng, $ilCtrl, $ilSetting, $tpl;
1611 
1612  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1613  {
1614  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1615  }
1616 
1617  $this->benchmarkSubTabs("settings");
1618 
1619  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1620  $this->form = new ilPropertyFormGUI();
1621 
1622  // Activate DB Benchmark
1623  $cb = new ilCheckboxInputGUI($lng->txt("adm_activate_db_benchmark"), "enable_db_bench");
1624  $cb->setChecked($ilSetting->get("enable_db_bench"));
1625  $cb->setInfo($lng->txt("adm_activate_db_benchmark_desc"));
1626  $this->form->addItem($cb);
1627 
1628  // DB Benchmark User
1629  $ti = new ilTextInputGUI($lng->txt("adm_db_benchmark_user"), "db_bench_user");
1630  $ti->setValue($ilSetting->get("db_bench_user"));
1631  $ti->setInfo($lng->txt("adm_db_benchmark_user_desc"));
1632  $this->form->addItem($ti);
1633 
1634  $this->form->addCommandButton("saveBenchSettings", $lng->txt("save"));
1635 
1636  $this->form->setTitle($lng->txt("adm_db_benchmark"));
1637  $this->form->setFormAction($ilCtrl->getFormAction($this));
1638 
1639  $tpl->setContent($this->form->getHTML());
1640  }
1641 
1646  {
1647  $this->benchmarkSubTabs("chronological");
1648  $this->showDbBenchResults("chronological");
1649  }
1650 
1655  {
1656  $this->benchmarkSubTabs("slowest_first");
1657  $this->showDbBenchResults("slowest_first");
1658  }
1659 
1664  {
1665  $this->benchmarkSubTabs("sorted_by_sql");
1666  $this->showDbBenchResults("sorted_by_sql");
1667  }
1668 
1673  {
1674  $this->benchmarkSubTabs("by_first_table");
1675  $this->showDbBenchResults("by_first_table");
1676  }
1677 
1683  function showDbBenchResults($a_mode)
1684  {
1685  global $ilBench, $lng, $tpl;
1686 
1687  $rec = $ilBench->getDbBenchRecords();
1688 
1689  include_once("./Modules/SystemFolder/classes/class.ilBenchmarkTableGUI.php");
1690  $table = new ilBenchmarkTableGUI($this, "benchmark", $rec, $a_mode);
1691  $tpl->setContent($table->getHTML());
1692  }
1693 
1700  function benchmarkSubTabs($a_current)
1701  {
1702  global $ilTabs, $lng, $ilCtrl, $ilBench;
1703 
1704  $ilTabs->addSubtab("settings",
1705  $lng->txt("settings"),
1706  $ilCtrl->getLinkTarget($this, "benchmark"));
1707 
1708  $rec = $ilBench->getDbBenchRecords();
1709  if (count($rec) > 0)
1710  {
1711  $ilTabs->addSubtab("chronological",
1712  $lng->txt("adm_db_bench_chronological"),
1713  $ilCtrl->getLinkTarget($this, "showDbBenchChronological"));
1714  $ilTabs->addSubtab("slowest_first",
1715  $lng->txt("adm_db_bench_slowest_first"),
1716  $ilCtrl->getLinkTarget($this, "showDbBenchSlowestFirst"));
1717  $ilTabs->addSubtab("sorted_by_sql",
1718  $lng->txt("adm_db_bench_sorted_by_sql"),
1719  $ilCtrl->getLinkTarget($this, "showDbBenchSortedBySql"));
1720  $ilTabs->addSubtab("by_first_table",
1721  $lng->txt("adm_db_bench_by_first_table"),
1722  $ilCtrl->getLinkTarget($this, "showDbBenchByFirstTable"));
1723  }
1724 
1725  $ilTabs->activateSubTab($a_current);
1726  }
1727 
1728 
1733  {
1734  global $ilBench;
1735 
1736  if ($_POST["enable_db_bench"])
1737  {
1738  $ilBench->enableDbBench(true, ilUtil::stripSlashes($_POST["db_bench_user"]));
1739  }
1740  else
1741  {
1742  $ilBench->enableDbBench(false);
1743  }
1744 
1745  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1746 
1747  $this->ctrl->redirect($this, "benchmark");
1748  }
1749 
1750 
1755  {
1756  global $ilBench;
1757 
1758  $this->ctrl->setParameter($this,'cur_mod',$_POST['module']);
1759  $this->ctrl->redirect($this, "benchmark");
1760  }
1761 
1762 
1766  function clearBenchObject()
1767  {
1768  global $ilBench;
1769 
1770  $ilBench->clearData();
1771  $this->saveBenchSettingsObject();
1772 
1773  }
1774 
1775  // get tabs
1776  function getAdminTabs(&$tabs_gui)
1777  {
1778  global $rbacsystem;
1779 
1780  $this->ctrl->setParameter($this,"ref_id",$this->object->getRefId());
1781 
1782 /* if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1783  {
1784  $tabs_gui->addTarget("settings",
1785  $this->ctrl->getLinkTarget($this, "view"), array("view", "saveSettings"), get_class($this));
1786  }*/
1787 
1788  // server info
1789  if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1790  {
1791  $tabs_gui->addTarget("server_data",
1792  $this->ctrl->getLinkTarget($this, "showServerInfo"),
1793  array("showServerInfo", "view"), get_class($this));
1794  }
1795 
1796  // general settings
1797  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
1798  {
1799  $tabs_gui->addTarget("general_settings",
1800  $this->ctrl->getLinkTarget($this, "showBasicSettings"),
1801  array("showBasicSettings", "saveBasicSettings"), get_class($this));
1802  }
1803 
1804  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
1805  {
1806  //$tabs_gui->addTarget("edit_properties",
1807  // $this->ctrl->getLinkTarget($this, "edit"), "edit", get_class($this));
1808 
1809  $tabs_gui->addTarget("system_check",
1810  $this->ctrl->getLinkTarget($this, "check"), array("check","viewScanLog","saveCheckParams","saveCheckCron"), get_class($this));
1811 
1812  $tabs_gui->addTarget("benchmarks",
1813  $this->ctrl->getLinkTarget($this, "benchmark"), "benchmark", get_class($this));
1814  }
1815 
1816  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
1817  {
1818  $tabs_gui->addTarget("perm_settings",
1819  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
1820  }
1821  }
1822 
1827  {
1828  phpinfo();
1829  exit;
1830  }
1831 
1832  //
1833  //
1834  // Server Info
1835  //
1836  //
1837 
1842  {
1843  global $tpl, $ilCtrl, $ilToolbar;
1844 
1845  $this->initServerInfoForm();
1846 
1847  $btpl = new ilTemplate("tpl.server_data.html", true, true, "Modules/SystemFolder");
1848  $btpl->setVariable("FORM", $this->form->getHTML());
1849  $btpl->setVariable("PHP_INFO_TARGET", $ilCtrl->getLinkTarget($this, "showPHPInfo"));
1850  $tpl->setContent($btpl->get());
1851  }
1852 
1858  public function initServerInfoForm()
1859  {
1860  global $lng, $ilClientIniFile, $ilSetting;
1861 
1862  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1863  $this->form = new ilPropertyFormGUI();
1864 
1865  // installation name
1866  $ne = new ilNonEditableValueGUI($lng->txt("inst_name"), "");
1867  $ne->setValue($ilClientIniFile->readVariable("client","name"));
1868  $ne->setInfo($ilClientIniFile->readVariable("client","description"));
1869  $this->form->addItem($ne);
1870 
1871  // client id
1872  $ne = new ilNonEditableValueGUI($lng->txt("client_id"), "");
1873  $ne->setValue(CLIENT_ID);
1874  $this->form->addItem($ne);
1875 
1876  // installation id
1877  $ne = new ilNonEditableValueGUI($lng->txt("inst_id"), "");
1878  $ne->setValue($ilSetting->get("inst_id"));
1879  $this->form->addItem($ne);
1880 
1881  // database version
1882  $ne = new ilNonEditableValueGUI($lng->txt("db_version"), "");
1883  $ne->setValue($ilSetting->get("db_version"));
1884  include_once ("./Services/Database/classes/class.ilDBUpdate.php");
1885  $dbupdate = new ilDBUpdate($this->ilias->db,true);
1886  if (!$dbupdate->getDBVersionStatus())
1887  {
1888  ilUtil::sendFailure($this->lng->txt("db_need_update"));
1889  }
1890  else if ($dbupdate->hotfixAvailable())
1891  {
1892  ilUtil::sendFailure($this->lng->txt("db_need_hotfix"));
1893  }
1894  $this->form->addItem($ne);
1895 
1896  // ilias version
1897  $ne = new ilNonEditableValueGUI($lng->txt("ilias_version"), "");
1898  $ne->setValue($ilSetting->get("ilias_version"));
1899  $this->form->addItem($ne);
1900 
1901  // host
1902  $ne = new ilNonEditableValueGUI($lng->txt("host"), "");
1903  $ne->setValue($_SERVER["SERVER_NAME"]);
1904  $this->form->addItem($ne);
1905 
1906  // ip & port
1907  $ne = new ilNonEditableValueGUI($lng->txt("ip_address")." & ".$this->lng->txt("port"), "");
1908  $ne->setValue($_SERVER["SERVER_ADDR"].":".$_SERVER["SERVER_PORT"]);
1909  $this->form->addItem($ne);
1910 
1911  // server
1912  $ne = new ilNonEditableValueGUI($lng->txt("server_software"), "");
1913  $ne->setValue($_SERVER["SERVER_SOFTWARE"]);
1914  $this->form->addItem($ne);
1915 
1916  // http path
1917  $ne = new ilNonEditableValueGUI($lng->txt("http_path"), "");
1918  $ne->setValue(ILIAS_HTTP_PATH);
1919  $this->form->addItem($ne);
1920 
1921  // absolute path
1922  $ne = new ilNonEditableValueGUI($lng->txt("absolute_path"), "");
1924  $this->form->addItem($ne);
1925 
1926  $not_set = $lng->txt("path_not_set");
1927 
1928  // convert
1929  $ne = new ilNonEditableValueGUI($lng->txt("path_to_convert"), "");
1930  $ne->setValue((PATH_TO_CONVERT) ? PATH_TO_CONVERT : $not_set);
1931  $this->form->addItem($ne);
1932 
1933  // zip
1934  $ne = new ilNonEditableValueGUI($lng->txt("path_to_zip"), "");
1935  $ne->setValue((PATH_TO_ZIP) ? PATH_TO_ZIP : $not_set);
1936  $this->form->addItem($ne);
1937 
1938  // unzip
1939  $ne = new ilNonEditableValueGUI($lng->txt("path_to_unzip"), "");
1940  $ne->setValue((PATH_TO_UNZIP) ? PATH_TO_UNZIP : $not_set);
1941  $this->form->addItem($ne);
1942 
1943  // java
1944  $ne = new ilNonEditableValueGUI($lng->txt("path_to_java"), "");
1945  $ne->setValue((PATH_TO_JAVA) ? PATH_TO_JAVA : $not_set);
1946  $this->form->addItem($ne);
1947 
1948  // htmldoc
1949  $ne = new ilNonEditableValueGUI($lng->txt("path_to_htmldoc"), "");
1950  $ne->setValue((PATH_TO_HTMLDOC) ? PATH_TO_HTMLDOC : $not_set);
1951  $this->form->addItem($ne);
1952 
1953  // mkisofs
1954  $ne = new ilNonEditableValueGUI($lng->txt("path_to_mkisofs"), "");
1955  $ne->setValue((PATH_TO_MKISOFS) ? PATH_TO_MKISOFS : $not_set);
1956  $this->form->addItem($ne);
1957 
1958  // latex
1959  $ne = new ilNonEditableValueGUI($lng->txt("url_to_latex"), "");
1960  $ne->setValue((URL_TO_LATEX) ? URL_TO_LATEX : $not_set);
1961  $this->form->addItem($ne);
1962 
1963 
1964  $this->form->setTitle($lng->txt("server_data"));
1965  $this->form->setFormAction($this->ctrl->getFormAction($this));
1966 
1967  }
1968 
1969  //
1970  //
1971  // General Settings
1972  //
1973  //
1974 
1978  function setGeneralSettingsSubTabs($a_activate)
1979  {
1980  global $ilTabs, $ilCtrl;
1981 
1982  $ilTabs->addSubTabTarget("basic_settings", $ilCtrl->getLinkTarget($this, "showBasicSettings"));
1983  $ilTabs->addSubTabTarget("header_title", $ilCtrl->getLinkTarget($this, "showHeaderTitle"));
1984  $ilTabs->addSubTabTarget("cron_jobs", $ilCtrl->getLinkTarget($this, "showCronJobs"));
1985  $ilTabs->addSubTabTarget("contact_data", $ilCtrl->getLinkTarget($this, "showContactInformation"));
1986  $ilTabs->addSubTabTarget("webservices", $ilCtrl->getLinkTarget($this, "showWebServices"));
1987  $ilTabs->addSubTabTarget("java_server", $ilCtrl->getLinkTarget($this, "showJavaServer"));
1988  $ilTabs->addSubTabTarget("proxy", $ilCtrl->getLinkTarget($this, "showProxy"));
1989 
1990  $ilTabs->setSubTabActive($a_activate);
1991  $ilTabs->setTabActive("general_settings");
1992  }
1993 
1994  //
1995  //
1996  // Basic Settings
1997  //
1998  //
1999 
2004  {
2005  global $tpl;
2006 
2007  $this->initBasicSettingsForm();
2008  $this->setGeneralSettingsSubTabs("basic_settings");
2009 
2010  $tpl->setContent($this->form->getHTML());
2011  }
2012 
2013 
2017  public function initBasicSettingsForm()
2018  {
2019  global $lng, $ilSetting, $ilClientIniFile;
2020 
2021  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2022  $this->form = new ilPropertyFormGUI();
2023  $lng->loadLanguageModule("pd");
2024 
2025  // installation short title
2026  $ti = new ilTextInputGUI($this->lng->txt("short_inst_name"), "short_inst_name");
2027  $ti->setMaxLength(200);
2028  $ti->setSize(40);
2029  $ti->setValue($ilSetting->get("short_inst_name"));
2030  $ti->setInfo($this->lng->txt("short_inst_name_info"));
2031  $this->form->addItem($ti);
2032 
2033  // public section
2034  $cb = new ilCheckboxInputGUI($this->lng->txt("pub_section"), "pub_section");
2035  $cb->setInfo($lng->txt("pub_section_info"));
2036  if ($ilSetting->get("pub_section"))
2037  {
2038  $cb->setChecked(true);
2039  }
2040  // search engine
2041  include_once('Services/PrivacySecurity/classes/class.ilRobotSettings.php');
2042  $robot_settings = ilRobotSettings::_getInstance();
2043  $cb2 = new ilCheckboxInputGUI($this->lng->txt("search_engine"), "open_google");
2044  $cb2->setInfo($this->lng->txt("enable_search_engine"));
2045  $cb->addSubItem($cb2);
2046  if(!$robot_settings->checkModRewrite())
2047  {
2048  $cb2->setAlert($lng->txt("mod_rewrite_disabled"));
2049  $cb2->setChecked(false);
2050  $cb2->setDisabled(true);
2051  }
2052  elseif(!$robot_settings->checkRewrite())
2053  {
2054  $cb2->setAlert($lng->txt("allow_override_alert"));
2055  $cb2->setChecked(false);
2056  $cb2->setDisabled(true);
2057  }
2058  else
2059  {
2060  if ($ilSetting->get("open_google"))
2061  {
2062  $cb2->setChecked(true);
2063  }
2064  }
2065 
2066  // Enable Global Profiles
2067  $cb_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_global_profiles'), 'enable_global_profiles');
2068  $cb_prop->setInfo($lng->txt('pd_enable_global_profiles_info'));
2069  $cb_prop->setChecked($ilSetting->get('enable_global_profiles'));
2070  $cb->addSubItem($cb_prop);
2071 
2072  $this->form->addItem($cb);
2073 
2074  // default repository view
2075  $options = array(
2076  "flat" => $lng->txt("flatview"),
2077  "tree" => $lng->txt("treeview")
2078  );
2079  $si = new ilSelectInputGUI($this->lng->txt("def_repository_view"), "default_rep_view");
2080  $si->setOptions($options);
2081  $si->setInfo($this->lng->txt(""));
2082  if ($ilSetting->get("default_repository_view") == "tree")
2083  {
2084  $si->setValue("tree");
2085  }
2086  else
2087  {
2088  $si->setValue("flat");
2089  }
2090  $this->form->addItem($si);
2091 
2092  //
2093  $options = array(
2094  "" => $lng->txt("adm_rep_tree_only_container"),
2095  "tree" => $lng->txt("adm_all_resource_types")
2096  );
2097 
2098  // repository tree
2099  $radg = new ilRadioGroupInputGUI($lng->txt("adm_rep_tree_presentation"), "tree_pres");
2100  $radg->setValue($ilSetting->get("repository_tree_pres"));
2101  $op1 = new ilRadioOption($lng->txt("adm_rep_tree_only_cntr"), "",
2102  $lng->txt("adm_rep_tree_only_cntr_info"));
2103  $radg->addOption($op1);
2104 
2105  $op2 = new ilRadioOption($lng->txt("adm_rep_tree_all_types"), "all_types",
2106  $lng->txt("adm_rep_tree_all_types_info"));
2107 
2108  // limit tree in courses and groups
2109  $cb = new ilCheckboxInputGUI($lng->txt("adm_rep_tree_limit_grp_crs"), "rep_tree_limit_grp_crs");
2110  $cb->setChecked($ilSetting->get("rep_tree_limit_grp_crs"));
2111  $cb->setInfo($lng->txt("adm_rep_tree_limit_grp_crs_info"));
2112  $op2->addSubItem($cb);
2113 
2114  $radg->addOption($op2);
2115 
2116  $this->form->addItem($radg);
2117 
2118  // synchronize repository tree with main view
2119  $cb = new ilCheckboxInputGUI($lng->txt("adm_synchronize_rep_tree"), "rep_tree_synchronize");
2120  $cb->setInfo($lng->txt("adm_synchronize_rep_tree_info"));
2121  $cb->setChecked($ilSetting->get("rep_tree_synchronize"));
2122  $this->form->addItem($cb);
2123 
2124  // repository access check
2125  $options = array(
2126  0 => "0",
2127  10 => "10",
2128  30 => "30",
2129  60 => "60",
2130  120 => "120"
2131  );
2132  $si = new ilSelectInputGUI($this->lng->txt("adm_repository_cache_time"), "rep_cache");
2133  $si->setOptions($options);
2134  $si->setValue($ilSetting->get("rep_cache"));
2135  $si->setInfo($this->lng->txt("adm_repository_cache_time_info")." ".
2136  $this->lng->txt("adm_repository_cache_time_info2"));
2137  $this->form->addItem($si);
2138 
2139  // load action commands asynchronously
2140  $cb = new ilCheckboxInputGUI($this->lng->txt("adm_item_cmd_asynch"), "item_cmd_asynch");
2141  $cb->setInfo($this->lng->txt("adm_item_cmd_asynch_info"));
2142  $cb->setChecked($ilSetting->get("item_cmd_asynch"));
2143  $this->form->addItem($cb);
2144 
2145  // locale
2146  $ti = new ilTextInputGUI($this->lng->txt("adm_locale"), "locale");
2147  $ti->setMaxLength(80);
2148  $ti->setSize(40);
2149  $ti->setInfo($this->lng->txt("adm_locale_info"));
2150  $ti->setValue($ilSetting->get("locale"));
2151  $this->form->addItem($ti);
2152 
2153 
2154  // trash
2155  $cb = new ilCheckboxInputGUI($this->lng->txt("enable_trash"), "enable_trash");
2156  $cb->setInfo($this->lng->txt("enable_trash_info"));
2157  if ($ilSetting->get("enable_trash"))
2158  {
2159  $cb->setChecked(true);
2160  }
2161  $this->form->addItem($cb);
2162 
2163  // BEGIN SESSION SETTINGS
2164  // create session handling radio group
2165  $ssettings = new ilRadioGroupInputGUI($this->lng->txt('sess_mode'), 'session_handling_type');
2166  $ssettings->setValue($ilSetting->get('session_handling_type', 0));
2167 
2168  // first option, fixed session duration
2169  $fixed = new ilRadioOption($this->lng->txt('sess_fixed_duration'), 0);
2170 
2171  // create session reminder subform
2172  $cb = new ilCheckboxInputGUI($this->lng->txt("session_reminder"), "session_reminder_enabled");
2173  $expires = $ilClientIniFile->readVariable("session", "expire");
2174  $time = ilFormat::_secondsToString($expires, true);
2175  $cb->setInfo($this->lng->txt("session_reminder_info")."<br />".
2176  sprintf($this->lng->txt('session_reminder_session_duration'), $time));
2177  if((int)$ilSetting->get("session_reminder_enabled"))
2178  {
2179  $cb->setChecked(true);
2180  }
2181  $fixed->addSubItem($cb);
2182 
2183  // add session handling to radio group
2184  $ssettings->addOption($fixed);
2185 
2186  // second option, session control
2187  $ldsh = new ilRadioOption($this->lng->txt('sess_load_dependent_session_handling'), 1);
2188 
2189  // add session control subform
2190  $ti = new ilNonEditableValueGUI($this->lng->txt('session_config'), "session_config");
2191 
2192  require_once('Services/Authentication/classes/class.ilSessionControl.php');
2193  if( $ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE) )
2194  {
2195  // just shows the status wether the session
2196  //setting maintenance is allowed by setup
2197  $ti->setValue(sprintf($this->lng->txt('session_config_maintenance_enabled'), CLIENT_ID));
2198  }
2199  else
2200  {
2201  // just shows the status wether the session
2202  //setting maintenance is allowed by setup
2203  $ti->setValue($this->lng->txt('session_config_maintenance_disabled'));
2204  }
2205  $ldsh->addSubItem($ti);
2206 
2207  // this is the max count of active sessions
2208  // that are getting started simlutanously
2209  $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_count'), 'session_max_count');
2210  $sub_ti->setMaxLength(5);
2211  $sub_ti->setSize(5);
2212  $sub_ti->setInfo($this->lng->txt('session_max_count_info'));
2213  $sub_ti->setValue($ilSetting->get(
2214  "session_max_count", ilSessionControl::DEFAULT_MAX_COUNT
2215  ));
2216  if( !$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE) )
2217  $sub_ti->setDisabled(true);
2218  $ldsh->addSubItem($sub_ti);
2219 
2220  // after this (min) idle time the session can be deleted,
2221  // if there are further requests for new sessions,
2222  // but max session count is reached yet
2223  $sub_ti = new ilTextInputGUI($this->lng->txt('session_min_idle'), 'session_min_idle');
2224  $sub_ti->setMaxLength(5);
2225  $sub_ti->setSize(5);
2226  $sub_ti->setInfo($this->lng->txt('session_min_idle_info'));
2227  $sub_ti->setValue($ilSetting->get(
2228  "session_min_idle", ilSessionControl::DEFAULT_MIN_IDLE
2229  ));
2230  if( !$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE) )
2231  $sub_ti->setDisabled(true);
2232  $ldsh->addSubItem($sub_ti);
2233 
2234  // after this (max) idle timeout the session expires
2235  // and become invalid, so it is not considered anymore
2236  // when calculating current count of active sessions
2237  $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_idle'), 'session_max_idle');
2238  $sub_ti->setMaxLength(5);
2239  $sub_ti->setSize(5);
2240  $sub_ti->setInfo($this->lng->txt('session_max_idle_info'));
2241  $sub_ti->setValue($ilSetting->get(
2242  "session_max_idle", ilSessionControl::DEFAULT_MAX_IDLE
2243  ));
2244  if( !$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE) )
2245  $sub_ti->setDisabled(true);
2246  $ldsh->addSubItem($sub_ti);
2247 
2248  // this is the max duration that can elapse between the first and the secnd
2249  // request to the system before the session is immidietly deleted
2250  $sub_ti = new ilTextInputGUI(
2251  $this->lng->txt('session_max_idle_after_first_request'),
2252  'session_max_idle_after_first_request'
2253  );
2254  $sub_ti->setMaxLength(5);
2255  $sub_ti->setSize(5);
2256  $sub_ti->setInfo($this->lng->txt('session_max_idle_after_first_request_info'));
2257  $sub_ti->setValue($ilSetting->get(
2258  "session_max_idle_after_first_request",
2260  ));
2261  if( !$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE) )
2262  $sub_ti->setDisabled(true);
2263  $ldsh->addSubItem($sub_ti);
2264 
2265  // add session control to radio group
2266  $ssettings->addOption($ldsh);
2267 
2268  // add radio group to form
2269  $this->form->addItem($ssettings);
2270  // END SESSION SETTINGS
2271 
2272  // password assistance
2273  $cb = new ilCheckboxInputGUI($this->lng->txt("enable_password_assistance"), "password_assistance");
2274  if ($ilSetting->get("password_assistance"))
2275  {
2276  $cb->setChecked(true);
2277  }
2278  $cb->setInfo($this->lng->txt("password_assistance_info"));
2279  $this->form->addItem($cb);
2280 
2281  // password generation
2282  $cb = new ilCheckboxInputGUI($this->lng->txt("passwd_generation"), "passwd_auto_generate");
2283  if ($ilSetting->get("passwd_auto_generate"))
2284  {
2285  $cb->setChecked(true);
2286  }
2287  $cb->setInfo($this->lng->txt("passwd_generation_info"));
2288  $this->form->addItem($cb);
2289 
2290  // dynamic web links
2291  $cb = new ilCheckboxInputGUI($this->lng->txt("links_dynamic"), "links_dynamic");
2292  $cb->setInfo($this->lng->txt("links_dynamic_info"));
2293  if ($ilSetting->get("links_dynamic"))
2294  {
2295  $cb->setChecked(true);
2296  }
2297  $this->form->addItem($cb);
2298 
2299  // Learners View
2300  $pl = new ilCheckboxInputGUI($this->lng->txt('preview_learner'),'preview_learner');
2301  $pl->setValue(1);
2302  $pl->setInfo($this->lng->txt('preview_learner_info'));
2303  $pl->setChecked($ilSetting->get('preview_learner'));
2304  $this->form->addItem($pl);
2305 
2306  // save and cancel commands
2307  $this->form->addCommandButton("saveBasicSettings", $lng->txt("save"));
2308 
2309  $this->form->setTitle($lng->txt("basic_settings"));
2310  $this->form->setFormAction($this->ctrl->getFormAction($this));
2311 
2312  }
2313 
2318  public function saveBasicSettingsObject()
2319  {
2320  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
2321 
2322  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
2323  {
2324  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
2325  }
2326 
2327  $this->initBasicSettingsForm();
2328  if ($this->form->checkInput())
2329  {
2330  $ilSetting->set("short_inst_name", $_POST["short_inst_name"]);
2331  $ilSetting->set("pub_section", $_POST["pub_section"]);
2332  $ilSetting->set("open_google", $_POST["open_google"]);
2333  $ilSetting->set("default_repository_view", $_POST["default_rep_view"]);
2334  $ilSetting->set("links_dynamic", $_POST["links_dynamic"]);
2335  $ilSetting->set("enable_trash", $_POST["enable_trash"]);
2336  $ilSetting->set("password_assistance", $_POST["password_assistance"]);
2337  $ilSetting->set("passwd_auto_generate", $_POST["passwd_auto_generate"]);
2338  $ilSetting->set("locale", $_POST["locale"]);
2339  $ilSetting->set('preview_learner',(int) $_POST['preview_learner']);
2340  $ilSetting->set('rep_cache',(int) $_POST['rep_cache']);
2341  $ilSetting->set('item_cmd_asynch',(int) $_POST['item_cmd_asynch']);
2342  $ilSetting->set("repository_tree_pres", $_POST["tree_pres"]);
2343  if ($_POST["tree_pres"] == "")
2344  {
2345  $_POST["rep_tree_limit_grp_crs"] = "";
2346  }
2347  if ($_POST["rep_tree_limit_grp_crs"] && !$ilSetting->get("rep_tree_limit_grp_crs"))
2348  {
2349  $_POST["rep_tree_synchronize"] = true;
2350  }
2351  else if (!$_POST["rep_tree_synchronize"] && $ilSetting->get("rep_tree_synchronize"))
2352  {
2353  $_POST["rep_tree_limit_grp_crs"] = false;
2354  }
2355 
2356  $ilSetting->set("rep_tree_limit_grp_crs", $_POST["rep_tree_limit_grp_crs"]);
2357  $ilSetting->set("rep_tree_synchronize", $_POST["rep_tree_synchronize"]);
2358 
2359  // BEGIN SESSION SETTINGS
2360  $ilSetting->set('session_handling_type',
2361  (int)$this->form->getInput('session_handling_type'));
2362 
2363  if( $this->form->getInput('session_handling_type') == 0 )
2364  {
2365  $ilSetting->set('session_reminder_enabled',
2366  $this->form->getInput('session_reminder_enabled'));
2367  }
2368  else if( $this->form->getInput('session_handling_type') == 1 )
2369  {
2370  require_once 'Services/Authentication/classes/class.ilSessionControl.php';
2371  if(
2372  $ilSetting->get('session_allow_client_maintenance',
2374  )
2375  {
2376  $ilSetting->set('session_max_count',
2377  (int)$this->form->getInput('session_max_count'));
2378  $ilSetting->set('session_min_idle',
2379  (int)$this->form->getInput('session_min_idle'));
2380  $ilSetting->set('session_max_idle',
2381  (int)$this->form->getInput('session_max_idle'));
2382  $ilSetting->set('session_max_idle_after_first_request',
2383  (int)$this->form->getInput('session_max_idle_after_first_request'));
2384  }
2385  }
2386  // END SESSION SETTINGS
2387 
2388  $global_profiles = ($_POST["pub_section"])
2389  ? (int)$_POST['enable_global_profiles']
2390  : 0;
2391 
2392  $ilSetting->set('enable_global_profiles', $global_profiles);
2393 
2394  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2395  $ilCtrl->redirect($this, "showBasicSettings");
2396  }
2397  $this->setGeneralSettingsSubTabs("basic_settings");
2398  $this->form->setValuesByPost();
2399  $tpl->setContent($this->form->getHtml());
2400  }
2401 
2402  //
2403  //
2404  // Header title
2405  //
2406  //
2407 
2411  function showHeaderTitleObject($a_get_post_values = false)
2412  {
2413  global $tpl;
2414 
2415  $this->setGeneralSettingsSubTabs("header_title");
2416  include_once("./Services/Object/classes/class.ilObjectTranslationTableGUI.php");
2417  $table = new ilObjectTranslationTableGUI($this, "showHeaderTitle", false);
2418  if ($a_get_post_values)
2419  {
2420  $vals = array();
2421  foreach($_POST["title"] as $k => $v)
2422  {
2423  $vals[] = array("title" => $v,
2424  "desc" => $_POST["desc"][$k],
2425  "lang" => $_POST["lang"][$k],
2426  "default" => ($_POST["default"] == $k));
2427  }
2428  $table->setData($vals);
2429  }
2430  else
2431  {
2432  $data = $this->object->getHeaderTitleTranslations();
2433  if (is_array($data["Fobject"]))
2434  {
2435  foreach($data["Fobject"] as $k => $v)
2436  {
2437  if ($k == $data["default_language"])
2438  {
2439  $data["Fobject"][$k]["default"] = true;
2440  }
2441  else
2442  {
2443  $data["Fobject"][$k]["default"] = false;
2444  }
2445  }
2446  }
2447  else
2448  {
2449  $data["Fobject"] = array();
2450  }
2451  $table->setData($data["Fobject"]);
2452  }
2453  $tpl->setContent($table->getHTML());
2454  }
2455 
2460  {
2461  global $ilCtrl, $lng, $rbacsystem;
2462 
2463  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
2464  {
2465  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
2466  }
2467 
2468 // var_dump($_POST);
2469 
2470  // default language set?
2471  if (!isset($_POST["default"]) && count($_POST["lang"]) > 0)
2472  {
2473  ilUtil::sendFailure($lng->txt("msg_no_default_language"));
2474  return $this->showHeaderTitleObject(true);
2475  }
2476 
2477  // all languages set?
2478  if (array_key_exists("",$_POST["lang"]))
2479  {
2480  ilUtil::sendFailure($lng->txt("msg_no_language_selected"));
2481  return $this->showHeaderTitleObject(true);
2482  }
2483 
2484  // no single language is selected more than once?
2485  if (count(array_unique($_POST["lang"])) < count($_POST["lang"]))
2486  {
2487  ilUtil::sendFailure($lng->txt("msg_multi_language_selected"));
2488  return $this->showHeaderTitleObject(true);
2489  }
2490 
2491  // save the stuff
2492  $this->object->removeHeaderTitleTranslations();
2493  foreach($_POST["title"] as $k => $v)
2494  {
2495  $this->object->addHeaderTitleTranslation(
2497  ilUtil::stripSlashes($_POST["desc"][$k]),
2498  ilUtil::stripSlashes($_POST["lang"][$k]),
2499  ($_POST["default"] == $k));
2500  }
2501 
2502  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2503  $ilCtrl->redirect($this, "showHeaderTitle");
2504  }
2505 
2510  {
2511  global $ilCtrl, $lng;
2512 
2513  if (is_array($_POST["title"]))
2514  {
2515  foreach($_POST["title"] as $k => $v) {}
2516  }
2517  $k++;
2518  $_POST["title"][$k] = "";
2519  $this->showHeaderTitleObject(true);
2520  }
2521 
2526  {
2527  global $ilCtrl, $lng;
2528 //var_dump($_POST);
2529  foreach($_POST["title"] as $k => $v)
2530  {
2531  if ($_POST["check"][$k])
2532  {
2533  unset($_POST["title"][$k]);
2534  unset($_POST["desc"][$k]);
2535  unset($_POST["lang"][$k]);
2536  if ($k == $_POST["default"])
2537  {
2538  unset($_POST["default"]);
2539  }
2540  }
2541  }
2542  $this->saveHeaderTitlesObject();
2543  }
2544 
2545 
2546  //
2547  //
2548  // Cron Jobs
2549  //
2550  //
2551 
2556  {
2557  global $tpl;
2558 
2559  $this->initCronJobsForm();
2560  $this->setGeneralSettingsSubTabs("cron_jobs");
2561  $tpl->setContent($this->form->getHTML());
2562  }
2563 
2567  public function initCronJobsForm()
2568  {
2569  global $lng, $ilSetting, $rbacreview, $ilObjDataCache;
2570 
2571  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2572  $this->form = new ilPropertyFormGUI();
2573 
2574  $cls = new ilNonEditableValueGUI($this->lng->txt('cronjob_last_start'), 'cronjob_last_start');
2575  if($ilSetting->get('last_cronjob_start_ts'))
2576  {
2577  include_once('./Services/Calendar/classes/class.ilDatePresentation.php');
2578  $cls->setInfo(ilDatePresentation::formatDate(new ilDateTime($ilSetting->get('last_cronjob_start_ts'), IL_CAL_UNIX)));
2579  }
2580  else
2581  {
2582  $cls->setInfo($this->lng->txt('cronjob_last_start_unknown'));
2583  }
2584 
2585  $this->form->addItem($cls);
2586 
2587  // check user accounts
2588  $cb = new ilCheckboxInputGUI($this->lng->txt("check_user_accounts"), "cron_user_check");
2589  $cb->setInfo($this->lng->txt("check_user_accounts_desc"));
2590  if ($ilSetting->get("cron_user_check"))
2591  {
2592  $cb->setChecked(true);
2593  }
2594  $this->form->addItem($cb);
2595 
2596 
2597  // delete inactive user accounts
2598  require_once('Services/User/classes/class.ilCronDeleteInactiveUserAccounts.php');
2599  $cb = new ilCheckboxInputGUI($this->lng->txt("delete_inactive_user_accounts"), "cron_inactive_user_delete");
2600  $cb->setInfo($this->lng->txt("delete_inactive_user_accounts_desc"));
2601  if($ilSetting->get("cron_inactive_user_delete", false)) $cb->setChecked(true);
2602 
2603  $sub_list = new ilSelectInputGUI(
2604  $this->lng->txt('delete_inactive_user_accounts_interval'),
2605  'cron_inactive_user_delete_interval'
2606  );
2607  $sub_list->setInfo($this->lng->txt('delete_inactive_user_accounts_interval_desc'));
2608  $sub_list->setOptions(
2610  );
2611  $sub_list->setValue($ilSetting->get(
2612  'cron_inactive_user_delete_interval',
2614  ));
2615  $cb->addSubItem($sub_list);
2616 
2617  include_once('Services/Form/classes/class.ilMultiSelectInputGUI.php');
2618  $sub_mlist = new ilMultiSelectInputGUI(
2619  $this->lng->txt('delete_inactive_user_accounts_include_roles'),
2620  'cron_inactive_user_delete_include_roles'
2621  );
2622  $sub_mlist->setInfo($this->lng->txt('delete_inactive_user_accounts_include_roles_desc'));
2623  $roles = array();
2624  foreach($rbacreview->getGlobalRoles() as $role_id)
2625  {
2626  if( $role_id != ANONYMOUS_ROLE_ID )
2627  $roles[$role_id] = $ilObjDataCache->lookupTitle($role_id);
2628  }
2629  $sub_mlist->setOptions($roles);
2630  $setting = $ilSetting->get('cron_inactive_user_delete_include_roles', null);
2631  if($setting === null) $setting = array();
2632  else $setting = explode(',', $setting);
2633  $sub_mlist->setValue($setting);
2634  $sub_mlist->setWidth(300);
2635  #$sub_mlist->setHeight(100);
2636  $cb->addSubItem($sub_mlist);
2637 
2639  $sub_text = new ilTextInputGUI(
2640  $this->lng->txt('delete_inactive_user_accounts_period'),
2641  'cron_inactive_user_delete_period'
2642  );
2643  $sub_text->setInfo($this->lng->txt('delete_inactive_user_accounts_period_desc'));
2644  $sub_text->setValue($ilSetting->get("cron_inactive_user_delete_period", $default_setting));
2645  $sub_text->setSize(2);
2646  $sub_text->setMaxLength(3);
2647  $cb->addSubItem($sub_text);
2648 
2649  /* $default_setting = ilCronDeleteInactiveUserAccounts::DEFAULT_SETTING_INCLUDE_ADMINS;
2650  $sub_cb = new ilCheckboxInputGUI($this->lng->txt('delete_inactive_user_accounts_include_admins'),'cron_inactive_user_delete_include_admins');
2651  $sub_cb->setChecked($ilSetting->get("cron_inactive_user_delete_include_admins", $default_setting) ? 1 : 0 );
2652  //$sub_cb->setOptionTitle($this->lng->txt('delete_inactive_user_accounts_include_admins'));
2653  $sub_cb->setInfo($this->lng->txt('delete_inactive_user_accounts_include_admins_desc'));
2654  $cb->addSubItem($sub_cb);
2655  */
2656 
2657  $this->form->addItem($cb);
2658 
2659 
2660  // link check
2661  $cb = new ilCheckboxInputGUI($this->lng->txt("check_link"), "cron_link_check");
2662  $cb->setInfo($this->lng->txt("check_link_desc"));
2663  if ($ilSetting->get("cron_link_check"))
2664  {
2665  $cb->setChecked(true);
2666  }
2667  $this->form->addItem($cb);
2668 
2669  // check web resources
2670  $options = array(
2671  "0" => $lng->txt("never"),
2672  "1" => $lng->txt("daily"),
2673  "2" => $lng->txt("weekly"),
2674  "3" => $lng->txt("monthly"),
2675  "4" => $lng->txt("quarterly")
2676  );
2677  $si = new ilSelectInputGUI($this->lng->txt("check_web_resources"), "cron_web_resource_check");
2678  $si->setOptions($options);
2679  $si->setInfo($this->lng->txt("check_web_resources_desc"));
2680  $si->setValue($ilSetting->get("cron_web_resource_check"));
2681  $this->form->addItem($si);
2682 
2683  // update lucene
2684  $cb = new ilCheckboxInputGUI($this->lng->txt("cron_lucene_index"), "cron_lucene_index");
2685  $cb->setInfo($this->lng->txt("cron_lucene_index_info"));
2686  if ($ilSetting->get("cron_lucene_index"))
2687  {
2688  $cb->setChecked(true);
2689  }
2690  $this->form->addItem($cb);
2691 
2692  // forum notifications
2693  $options = array(
2694  "0" => $lng->txt("cron_forum_notification_never"),
2695  "1" => $lng->txt("cron_forum_notification_directly"),
2696  "2" => $lng->txt("cron_forum_notification_cron"),
2697  );
2698  $si = new ilSelectInputGUI($this->lng->txt("cron_forum_notification"), "forum_notification");
2699  $si->setOptions($options);
2700  $si->setInfo($this->lng->txt("cron_forum_notification_desc"));
2701  $si->setValue($ilSetting->get("forum_notification"));
2702  $this->form->addItem($si);
2703 
2704  // mail notifications
2705  $options = array(
2706  "0" => $lng->txt("cron_mail_notification_never"),
2707  "1" => $lng->txt("cron_mail_notification_cron")
2708  );
2709  $si = new ilSelectInputGUI($this->lng->txt("cron_mail_notification"), "mail_notification");
2710  $si->setOptions($options);
2711  $si->setInfo($this->lng->txt("cron_mail_notification_desc"));
2712  $si->setValue($ilSetting->get("mail_notification"));
2713  $this->form->addItem($si);
2714 
2715  if($ilSetting->get("mail_notification") == '1')
2716  {
2717  $cb = new ilCheckboxInputGUI($this->lng->txt("cron_mail_notification_message"), "mail_notification_message");
2718  $cb->setInfo($this->lng->txt("cron_mail_notification_message_info"));
2719  if ($ilSetting->get("mail_notification_message"))
2720  {
2721  $cb->setChecked(true);
2722  }
2723  $this->form->addItem($cb);
2724  }
2725 
2726  // disk quota and disk quota reminder mail
2727  $dq_settings = new ilSetting('disk_quota');
2728  $cb = new ilCheckboxInputGUI($this->lng->txt("enable_disk_quota"), "enable_disk_quota");
2729  $cb->setInfo($this->lng->txt("enable_disk_quota_info"));
2730  if ($dq_settings->get('enabled'))
2731  {
2732  $cb->setChecked(true);
2733  }
2734  $this->form->addItem($cb);
2735 
2736  $cb_reminder = new ilCheckboxInputGUI($this->lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail");
2737  $cb_reminder->setInfo($this->lng->txt("disk_quota_reminder_mail_desc"));
2738  if ($dq_settings->get('reminder_mail_enabled'))
2739  {
2740  $cb_reminder->setChecked(true);
2741  }
2742  $cb->addSubItem($cb_reminder);
2743 
2744  // Enable summary mail for certain users
2745  $cb_prop_summary= new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail");
2746  $cb_prop_summary->setValue(1);
2747  $cb_prop_summary->setChecked((int)$dq_settings->get('summary_mail_enabled', 0) == 1);
2748  $cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc'));
2749  $cb->addSubItem($cb_prop_summary);
2750 
2751  // Edit disk quota recipients
2752  $summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp");
2753  $summary_rcpt->setValue($dq_settings->get('summary_rcpt', ''));
2754  $summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc'));
2755  $cb_prop_summary->addSubItem($summary_rcpt);
2756 
2757  $this->form->addCommandButton("saveCronJobs", $lng->txt("save"));
2758 
2759  $this->form->setTitle($lng->txt("cron_jobs"));
2760  $this->form->setDescription($lng->txt("cron_jobs_desc"));
2761  $this->form->setFormAction($this->ctrl->getFormAction($this));
2762 
2763  }
2764 
2769  public function saveCronJobsObject()
2770  {
2771  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
2772 
2773  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
2774  {
2775  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
2776  }
2777 
2778  $this->initCronJobsForm();
2779  if ($this->form->checkInput())
2780  {
2781  $ilSetting->set("cron_user_check", $_POST["cron_user_check"]);
2782  $ilSetting->set("cron_link_check", $_POST["cron_link_check"]);
2783  $ilSetting->set("cron_web_resource_check", $_POST["cron_web_resource_check"]);
2784  $ilSetting->set("cron_lucene_index", $_POST["cron_lucene_index"]);
2785  $ilSetting->set("forum_notification", $_POST["forum_notification"]);
2786  $ilSetting->set("mail_notification", $_POST["mail_notification"]);
2787  $ilSetting->set('mail_notification_message', $_POST['mail_notification_message'] ? 1 : 0);
2788 
2789  $ilSetting->set('cron_inactive_user_delete', $_POST['cron_inactive_user_delete']);
2790  $ilSetting->set('cron_inactive_user_delete_interval', $_POST['cron_inactive_user_delete_interval']);
2791  $setting = implode(',', $_POST['cron_inactive_user_delete_include_roles']);
2792  if( !strlen($setting) ) $setting = null;
2793  $ilSetting->set('cron_inactive_user_delete_include_roles', $setting);
2794  $ilSetting->set('cron_inactive_user_delete_period', $_POST['cron_inactive_user_delete_period']);
2795 
2796  // disk quota and disk quota reminder mail
2797  $dq_settings = new ilSetting('disk_quota');
2798  $dq_settings->set('enabled', $_POST['enable_disk_quota'] ? 1 : 0);
2799  $dq_settings->set('reminder_mail_enabled', $_POST['enable_disk_quota_reminder_mail'] ? 1 : 0);
2800 
2801  // disk quota summary mail
2802  $dq_settings->set('summary_mail_enabled', $_POST['enable_disk_quota_summary_mail'] ? 1 : 0);
2803  $dq_settings->set('summary_rcpt', ilUtil::stripSlashes($_POST['disk_quota_summary_rctp']));
2804 
2805  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2806  $ilCtrl->redirect($this, "showCronJobs");
2807  }
2808  else
2809  {
2810  $this->setGeneralSettingsSubTabs("cron_jobs");
2811  $this->form->setValuesByPost();
2812  $tpl->setContent($this->form->getHtml());
2813  }
2814  }
2815 
2816  //
2817  //
2818  // Contact Information
2819  //
2820  //
2821 
2826  {
2827  global $tpl;
2828 
2829  $this->initContactInformationForm();
2830  $this->setGeneralSettingsSubTabs("contact_data");
2831  $tpl->setContent($this->form->getHTML());
2832  }
2833 
2837  public function initContactInformationForm()
2838  {
2839  global $lng, $ilSetting;
2840 
2841  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2842  $this->form = new ilPropertyFormGUI();
2843 
2844  // first name
2845  $ti = new ilTextInputGUI($this->lng->txt("firstname"), "admin_firstname");
2846  $ti->setMaxLength(64);
2847  $ti->setSize(40);
2848  $ti->setRequired(true);
2849  $ti->setValue($ilSetting->get("admin_firstname"));
2850  $this->form->addItem($ti);
2851 
2852  // last name
2853  $ti = new ilTextInputGUI($this->lng->txt("lastname"), "admin_lastname");
2854  $ti->setMaxLength(64);
2855  $ti->setSize(40);
2856  $ti->setRequired(true);
2857  $ti->setValue($ilSetting->get("admin_lastname"));
2858  $this->form->addItem($ti);
2859 
2860  // title
2861  $ti = new ilTextInputGUI($this->lng->txt("title"), "admin_title");
2862  $ti->setMaxLength(64);
2863  $ti->setSize(40);
2864  $ti->setValue($ilSetting->get("admin_title"));
2865  $this->form->addItem($ti);
2866 
2867  // position
2868  $ti = new ilTextInputGUI($this->lng->txt("position"), "admin_position");
2869  $ti->setMaxLength(64);
2870  $ti->setSize(40);
2871  $ti->setValue($ilSetting->get("admin_position"));
2872  $this->form->addItem($ti);
2873 
2874  // institution
2875  $ti = new ilTextInputGUI($this->lng->txt("institution"), "admin_institution");
2876  $ti->setMaxLength(200);
2877  $ti->setSize(40);
2878  $ti->setValue($ilSetting->get("admin_institution"));
2879  $this->form->addItem($ti);
2880 
2881  // street
2882  $ti = new ilTextInputGUI($this->lng->txt("street"), "admin_street");
2883  $ti->setMaxLength(64);
2884  $ti->setSize(40);
2885  //$ti->setRequired(true);
2886  $ti->setValue($ilSetting->get("admin_street"));
2887  $this->form->addItem($ti);
2888 
2889  // zip code
2890  $ti = new ilTextInputGUI($this->lng->txt("zipcode"), "admin_zipcode");
2891  $ti->setMaxLength(10);
2892  $ti->setSize(5);
2893  //$ti->setRequired(true);
2894  $ti->setValue($ilSetting->get("admin_zipcode"));
2895  $this->form->addItem($ti);
2896 
2897  // city
2898  $ti = new ilTextInputGUI($this->lng->txt("city"), "admin_city");
2899  $ti->setMaxLength(64);
2900  $ti->setSize(40);
2901  //$ti->setRequired(true);
2902  $ti->setValue($ilSetting->get("admin_city"));
2903  $this->form->addItem($ti);
2904 
2905  // country
2906  $ti = new ilTextInputGUI($this->lng->txt("country"), "admin_country");
2907  $ti->setMaxLength(64);
2908  $ti->setSize(40);
2909  //$ti->setRequired(true);
2910  $ti->setValue($ilSetting->get("admin_country"));
2911  $this->form->addItem($ti);
2912 
2913  // phone
2914  $ti = new ilTextInputGUI($this->lng->txt("phone"), "admin_phone");
2915  $ti->setMaxLength(64);
2916  $ti->setSize(40);
2917  //$ti->setRequired(true);
2918  $ti->setValue($ilSetting->get("admin_phone"));
2919  $this->form->addItem($ti);
2920 
2921  // email
2922  $ti = new ilTextInputGUI($this->lng->txt("email"), "admin_email");
2923  $ti->setMaxLength(64);
2924  $ti->setSize(40);
2925  $ti->setRequired(true);
2926  $ti->setValue($ilSetting->get("admin_email"));
2927  $this->form->addItem($ti);
2928 
2929  // feedback recipient
2930  $ti = new ilEmailInputGUI($this->lng->txt("feedback_recipient"), "feedback_recipient");
2931  $ti->setValue($ilSetting->get("feedback_recipient"));
2932  $this->form->addItem($ti);
2933 
2934  // error recipient
2935  $ti = new ilEmailInputGUI($this->lng->txt("error_recipient"), "error_recipient");
2936  $ti->setValue($ilSetting->get("error_recipient"));
2937  $this->form->addItem($ti);
2938 
2939  $this->form->addCommandButton("saveContactInformation", $lng->txt("save"));
2940 
2941  $this->form->setTitle($lng->txt("contact_data"));
2942  $this->form->setFormAction($this->ctrl->getFormAction($this));
2943 
2944  }
2945 
2951  {
2952  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
2953 
2954  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
2955  {
2956  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
2957  }
2958 
2959  $this->initContactInformationForm();
2960  if ($this->form->checkInput())
2961  {
2962  $fs = array("admin_firstname", "admin_lastname", "admin_title", "admin_position",
2963  "admin_institution", "admin_street", "admin_zipcode", "admin_city",
2964  "admin_country", "admin_phone", "admin_email",
2965  "feedback_recipient", "error_recipient");
2966  foreach ($fs as $f)
2967  {
2968  $ilSetting->set($f, $_POST[$f]);
2969  }
2970  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2971  $ilCtrl->redirect($this, "showContactInformation");
2972  }
2973  else
2974  {
2975  $this->setGeneralSettingsSubTabs("contact_data");
2976  $this->form->setValuesByPost();
2977  $tpl->setContent($this->form->getHtml());
2978  }
2979  }
2980 
2981  //
2982  //
2983  // Web Services
2984  //
2985  //
2986 
2991  {
2992  global $tpl;
2993 
2994  $this->initWebServicesForm();
2995  $this->setGeneralSettingsSubTabs("webservices");
2996  $tpl->setContent($this->form->getHTML());
2997  }
2998 
3002  public function initWebServicesForm()
3003  {
3004  global $lng, $ilSetting;
3005 
3006  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
3007  $this->form = new ilPropertyFormGUI();
3008 
3009  // soap administration
3010  $cb = new ilCheckboxInputGUI($this->lng->txt("soap_user_administration"), "soap_user_administration");
3011  $cb->setInfo($this->lng->txt("soap_user_administration_desc"));
3012  if ($ilSetting->get("soap_user_administration"))
3013  {
3014  $cb->setChecked(true);
3015  }
3016  $this->form->addItem($cb);
3017 
3018  // wsdl path
3019  $wsdl = new ilTextInputGUI($this->lng->txt('soap_wsdl_path'), 'soap_wsdl_path');
3020  $wsdl->setInfo(sprintf($this->lng->txt('soap_wsdl_path_info'), "<br />'".ILIAS_HTTP_PATH."/webservice/soap/server.php?wsdl'"));
3021  $wsdl->setValue((string)$ilSetting->get('soap_wsdl_path'));
3022  $wsdl->setSize(60);
3023  $wsdl->setMaxLength(255);
3024  $this->form->addItem($wsdl);
3025 
3026  $this->form->addCommandButton("saveWebServices", $lng->txt("save"));
3027 
3028  $this->form->setTitle($lng->txt("webservices"));
3029  $this->form->setFormAction($this->ctrl->getFormAction($this));
3030 
3031  }
3032 
3037  public function saveWebServicesObject()
3038  {
3039  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
3040 
3041  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
3042  {
3043  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
3044  }
3045 
3046  $this->initWebServicesForm();
3047  if ($this->form->checkInput())
3048  {
3049  $ilSetting->set('soap_user_administration', $this->form->getInput('soap_user_administration'));
3050  $ilSetting->set('soap_wsdl_path', trim($this->form->getInput('soap_wsdl_path')));
3051 
3052  ilUtil::sendSuccess($lng->txt('msg_obj_modified'), true);
3053  $ilCtrl->redirect($this, 'showWebServices');
3054  }
3055  else
3056  {
3057  $this->setGeneralSettingsSubTabs("webservices");
3058  $this->form->setValuesByPost();
3059  $tpl->setContent($this->form->getHtml());
3060  }
3061  }
3062 
3063  //
3064  //
3065  // Java Server
3066  //
3067  //
3068 
3073  {
3074  global $tpl;
3075 
3076  $tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.java_settings.html','Modules/SystemFolder');
3077 
3078  $GLOBALS['lng']->loadLanguageModule('search');
3079 
3080  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
3081  $toolbar = new ilToolbarGUI();
3082  $toolbar->addButton($this->lng->txt('lucene_create_ini'),
3083  $this->ctrl->getLinkTarget($this,'createJavaServerIni'));
3084  $tpl->setVariable('ACTION_BUTTONS',$toolbar->getHTML());
3085 
3086  $this->initJavaServerForm();
3087  $this->setGeneralSettingsSubTabs("java_server");
3088  $tpl->setVariable('SETTINGS_TABLE',$this->form->getHTML());
3089  }
3090 
3095  public function createJavaServerIniObject()
3096  {
3097  #include_once './Services/WebServices/RPC/classes/classs.ilRPCServerSettings.php';
3098  #$ini = ilRPCServerSettings::createServerIni();
3099  #ilUtil::deliverData($ini, 'ilServer.ini','text/plain');
3100 
3101  $this->setGeneralSettingsSubTabs('java_server');
3102  $this->initJavaServerIniForm();
3103  $this->tpl->setContent($this->form->getHTML());
3104  }
3105 
3106  protected function initJavaServerIniForm()
3107  {
3108  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
3109 
3110  $this->form = new ilPropertyFormGUI();
3111 
3112  $GLOBALS['lng']->loadLanguageModule('search');
3113 
3114  $this->form->setTitle($this->lng->txt('lucene_tbl_create_ini'));
3115  $this->form->setFormAction($this->ctrl->getFormAction($this,'createJavaServerIni'));
3116  $this->form->addCommandButton('downloadJavaServerIni',$this->lng->txt('lucene_download_ini'));
3117  $this->form->addCommandButton('showJavaServer', $this->lng->txt('cancel'));
3118 
3119  // Host
3120  $ip = new ilTextInputGUI($this->lng->txt('lucene_host'),'ho');
3121  $ip->setInfo($this->lng->txt('lucene_host_info'));
3122  $ip->setMaxLength(128);
3123  $ip->setSize(32);
3124  $ip->setRequired(true);
3125  $this->form->addItem($ip);
3126 
3127  // Port
3128  $port = new ilNumberInputGUI($this->lng->txt('lucene_port'),'po');
3129  $port->setSize(5);
3130  $port->setMinValue(1);
3131  $port->setMaxValue(65535);
3132  $port->setRequired(true);
3133  $this->form->addItem($port);
3134 
3135  // Index Path
3136  $path = new ilTextInputGUI($this->lng->txt('lucene_index_path'),'in');
3137  $path->setSize(80);
3138  $path->setMaxLength(1024);
3139  $path->setInfo($this->lng->txt('lucene_index_path_info'));
3140  $path->setRequired(true);
3141  $this->form->addItem($path);
3142 
3143  // Logging
3144  $log = new ilTextInputGUI($this->lng->txt('lucene_log'),'lo');
3145  $log->setSize(80);
3146  $log->setMaxLength(1024);
3147  $log->setInfo($this->lng->txt('lucene_log_info'));
3148  $log->setRequired(true);
3149  $this->form->addItem($log);
3150 
3151  // Level
3152  $lev = new ilSelectInputGUI($this->lng->txt('lucene_level'),'le');
3153  $lev->setOptions(array(
3154  'DEBUG' => 'DEBUG',
3155  'INFO' => 'INFO',
3156  'WARN' => 'WARN',
3157  'ERROR' => 'ERROR',
3158  'FATAL' => 'FATAL'));
3159  $lev->setValue('INFO');
3160  $lev->setRequired(true);
3161  $this->form->addItem($lev);
3162 
3163  // CPU
3164  $cpu = new ilNumberInputGUI($this->lng->txt('lucene_cpu'),'cp');
3165  $cpu->setValue(1);
3166  $cpu->setSize(1);
3167  $cpu->setMaxLength(2);
3168  $cpu->setMinValue(1);
3169  $cpu->setRequired(true);
3170  $this->form->addItem($cpu);
3171 
3172  // Max file size
3173  $fs = new ilNumberInputGUI($this->lng->txt('lucene_max_fs'), 'fs');
3174  $fs->setInfo($this->lng->txt('lucene_max_fs_info'));
3175  $fs->setValue(500);
3176  $fs->setSize(4);
3177  $fs->setMaxLength(4);
3178  $fs->setMinValue(1);
3179  $fs->setRequired(true);
3180  $this->form->addItem($fs);
3181 
3182  return true;
3183  }
3184 
3189  protected function downloadJavaServerIniObject()
3190  {
3191  $this->initJavaServerIniForm();
3192  if($this->form->checkInput())
3193  {
3194  include_once './Services/WebServices/RPC/classes/class.ilRpcIniFileWriter.php';
3195  $ini = new ilRpcIniFileWriter();
3196  $ini->setHost($this->form->getInput('ho'));
3197  $ini->setPort($this->form->getInput('po'));
3198  $ini->setIndexPath($this->form->getInput('in'));
3199  $ini->setLogPath($this->form->getInput('lo'));
3200  $ini->setLogLevel($this->form->getInput('le'));
3201  $ini->setNumThreads($this->form->getInput('cp'));
3202  $ini->setMaxFileSize($this->form->getInput('fs'));
3203 
3204  $ini->write();
3205  ilUtil::deliverData($ini->getIniString(),'ilServer.ini','text/plain','utf-8');
3206  return true;
3207  }
3208 
3209  $this->form->setValuesByPost();
3210  ilUtil::sendFailure($this->lng->txt('err_check_input'));
3211  $this->setGeneralSettingsSubTabs('java_server');
3212  $this->tpl->setContent($this->form->getHTML());
3213  return true;
3214  }
3215 
3219  public function initJavaServerForm()
3220  {
3221  global $lng, $ilSetting;
3222 
3223  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
3224  $this->form = new ilPropertyFormGUI();
3225 
3226  // host
3227  $ti = new ilTextInputGUI($this->lng->txt("java_server_host"), "rpc_server_host");
3228  $ti->setMaxLength(64);
3229  $ti->setSize(32);
3230  $ti->setValue($ilSetting->get("rpc_server_host"));
3231  $this->form->addItem($ti);
3232 
3233  // port
3234  $ti = new ilNumberInputGUI($this->lng->txt("java_server_port"), "rpc_server_port");
3235  $ti->setMaxLength(5);
3236  $ti->setSize(5);
3237  $ti->setValue($ilSetting->get("rpc_server_port"));
3238  $this->form->addItem($ti);
3239 
3240 
3241  // save and cancel commands
3242  $this->form->addCommandButton("saveJavaServer", $lng->txt("save"));
3243 
3244  $this->form->setTitle($lng->txt("java_server"));
3245  $this->form->setDescription($lng->txt("java_server_info").
3246  '<br /><a href="Services/WebServices/RPC/lib/README.txt" target="_blank">'.
3247  $lng->txt("java_server_readme").'</a>');
3248  $this->form->setFormAction($this->ctrl->getFormAction($this));
3249 
3250  }
3251 
3256  public function saveJavaServerObject()
3257  {
3258  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
3259 
3260  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
3261  {
3262  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
3263  }
3264 
3265  $this->initJavaServerForm();
3266  if ($this->form->checkInput())
3267  {
3268  $ilSetting->set("rpc_server_host", trim($_POST["rpc_server_host"]));
3269  $ilSetting->set("rpc_server_port", trim($_POST["rpc_server_port"]));
3270  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
3271  $ilCtrl->redirect($this, "showJavaServer");
3272 
3273  // TODO check settings, ping server
3274  }
3275  else
3276  {
3277  $this->setGeneralSettingsSubTabs("java_server");
3278  $this->form->setValuesByPost();
3279  $tpl->setContent($this->form->getHtml());
3280  }
3281  }
3282 
3290  public function showProxyObject()
3291  {
3292  global $tpl, $ilAccess, $ilSetting;
3293 
3294  if(!$ilAccess->checkAccess('write', '', $this->object->getRefId()))
3295  {
3296  $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
3297  }
3298 
3299  require_once 'classes/class.ilProxySettings.php';
3300 
3301  $this->initProxyForm();
3302  $this->form->setValuesByArray(array(
3303  'proxy_status' => ilProxySettings::_getInstance()->isActive(),
3304  'proxy_host' => ilProxySettings::_getInstance()->getHost(),
3305  'proxy_port' => ilProxySettings::_getInstance()->getPort()
3306  ));
3307  if(ilProxySettings::_getInstance()->isActive())
3308  {
3309  $this->printProxyStatus();
3310  }
3311 
3312  $tpl->setContent($this->form->getHTML());
3313  }
3314 
3322  private function printProxyStatus()
3323  {
3324  try
3325  {
3326  ilProxySettings::_getInstance()->checkConnection();
3327  $this->form->getItemByPostVar('proxy_availability')->setHTML(
3328  '<img src="'.ilUtil::getImagePath('icon_ok.gif').'" /> '.
3329  $this->lng->txt('proxy_connectable')
3330  );
3331  }
3332  catch(ilProxyException $e)
3333  {
3334  $this->form->getItemByPostVar('proxy_availability')->setHTML(
3335  '<img src="'.ilUtil::getImagePath('icon_not_ok.gif').'" /> '.
3336  $this->lng->txt('proxy_not_connectable')
3337  );
3338  ilUtil::sendFailure($this->lng->txt('proxy_pear_net_socket_error').': '.$e->getMessage());
3339  }
3340  }
3341 
3349  public function saveProxyObject()
3350  {
3351  global $tpl, $ilAccess, $ilSetting, $lng;
3352 
3353  if(!$ilAccess->checkAccess('write', '', $this->object->getRefId()))
3354  {
3355  $this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
3356  }
3357 
3358  require_once 'classes/class.ilProxySettings.php';
3359 
3360  $this->initProxyForm();
3361  $isFormValid = $this->form->checkInput();
3362  ilProxySettings::_getInstance()->isActive((int)$this->form->getInput('proxy_status'))
3363  ->setHost(trim($this->form->getInput('proxy_host')))
3364  ->setPort(trim($this->form->getInput('proxy_port')));
3365  if($isFormValid)
3366  {
3367  if(ilProxySettings::_getInstance()->isActive())
3368  {
3369  if(!strlen(ilProxySettings::_getInstance()->getHost()))
3370  {
3371  $isFormValid = false;
3372  $this->form->getItemByPostVar('proxy_host')->setAlert($lng->txt('msg_input_is_required'));
3373  }
3374  if(!strlen(ilProxySettings::_getInstance()->getPort()))
3375  {
3376  $isFormValid = false;
3377  $this->form->getItemByPostVar('proxy_port')->setAlert($lng->txt('msg_input_is_required'));
3378  }
3379  if(!preg_match('/[0-9]{1,}/', ilProxySettings::_getInstance()->getPort()) ||
3380  ilProxySettings::_getInstance()->getPort() < 0 ||
3381  ilProxySettings::_getInstance()->getPort() > 65535)
3382  {
3383  $isFormValid = false;
3384  $this->form->getItemByPostVar('proxy_port')->setAlert($lng->txt('proxy_port_numeric'));
3385  }
3386  }
3387 
3388  if($isFormValid)
3389  {
3391  ilUtil::sendSuccess($lng->txt('saved_successfully'));
3392  if(ilProxySettings::_getInstance()->isActive())
3393  {
3394  $this->printProxyStatus();
3395  }
3396  }
3397  else
3398  {
3399  ilUtil::sendFailure($lng->txt('form_input_not_valid'));
3400  }
3401  }
3402 
3403  $this->form->setValuesByPost();
3404  $tpl->setContent($this->form->getHTML());
3405  }
3406 
3414  private function initProxyForm()
3415  {
3416  global $lng, $ilCtrl;
3417 
3418  $this->setGeneralSettingsSubTabs('proxy');
3419 
3420  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
3421  $this->form = new ilPropertyFormGUI();
3422  $this->form->setFormAction($ilCtrl->getFormAction($this, 'saveProxy'));
3423 
3424  // Proxy status
3425  $proxs = new ilCheckboxInputGUI($lng->txt('proxy_status'), 'proxy_status');
3426  $proxs->setInfo($lng->txt('proxy_status_info'));
3427  $proxs->setValue(1);
3428  $this->form->addItem($proxs);
3429 
3430  // Proxy availability
3431  $proxa = new ilCustomInputGUI('', 'proxy_availability');
3432  $proxs->addSubItem($proxa);
3433 
3434  // Proxy
3435  $prox = new ilTextInputGUI($lng->txt('proxy_host'), 'proxy_host');
3436  $prox->setInfo($lng->txt('proxy_host_info'));
3437  $proxs->addSubItem($prox);
3438 
3439  // Proxy Port
3440  $proxp = new ilTextInputGUI($lng->txt('proxy_port'), 'proxy_port');
3441  $proxp->setInfo($lng->txt('proxy_port_info'));
3442  $proxp->setSize(10);
3443  $proxp->setMaxLength(10);
3444  $proxs->addSubItem($proxp);
3445 
3446  // save and cancel commands
3447  $this->form->addCommandButton('saveProxy', $lng->txt('save'));
3448  }
3449 
3453  function _goto()
3454  {
3455  global $ilAccess, $ilErr, $lng;
3456 
3457  $a_target = SYSTEM_FOLDER_ID;
3458 
3459  if ($ilAccess->checkAccess("read", "", $a_target))
3460  {
3461  ilUtil::redirect("ilias.php?baseClass=ilAdministrationGUI");
3462  exit;
3463  }
3464  else
3465  {
3466  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
3467  {
3468  $_GET["cmd"] = "frameset";
3469  $_GET["target"] = "";
3470  $_GET["ref_id"] = ROOT_FOLDER_ID;
3471  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
3472  ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
3473  include("repository.php");
3474  exit;
3475  }
3476  }
3477  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
3478  }
3479 
3480 }
3481 ?>