ILIAS  Release_4_0_x_branch Revision 61816
 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  // contact
443  $settings["admin_firstname"] = $_POST["admin_firstname"];
444  $settings["admin_lastname"] = $_POST["admin_lastname"];
445  $settings["admin_title"] = $_POST["admin_title"];
446  $settings["admin_position"] = $_POST["admin_position"];
447  $settings["admin_institution"] = $_POST["admin_institution"];
448  $settings["admin_street"] = $_POST["admin_street"];
449  $settings["admin_zipcode"] = $_POST["admin_zipcode"];
450  $settings["admin_city"] = $_POST["admin_city"];
451  $settings["admin_country"] = $_POST["admin_country"];
452  $settings["admin_phone"] = $_POST["admin_phone"];
453  $settings["admin_email"] = $_POST["admin_email"];
454 
455  // cron
456  $settings["cron_user_check"] = $_POST["cron_user_check"];
457  $settings["cron_link_check"] = $_POST["cron_link_check"];
458  $settings["cron_web_resource_check"] = $_POST["cron_web_resource_check"];
459  $settings["cron_lucene_index"] = $_POST["cron_lucene_index"];
460  $settings["forum_notification"] = $_POST["forum_notification"];
461  $settings["mail_notification"] = $_POST["mail_notification"];
462 
463  // forums
464  $settings['frm_store_new'] = $_POST['frm_store_new'];
465 
466  // soap
467  $settings["soap_user_administration"] = $_POST["soap_user_administration"];
468 
469  // data privacy
470  /* $settings["enable_fora_statistics"] = $_POST["enable_fora_statistics"]; */
471 
472  $settings["suffix_repl_additional"] = $_POST["suffix_repl_additional"];
473 
474  // dynamic links
475  $settings["links_dynamic"] = $_POST["links_dynamic"];
476  }
477  else // all required fields ok
478  {
479 
481  // write new settings
482 
483  // basic data
484  $this->ilias->setSetting("feedback_recipient",$_POST["feedback_recipient"]);
485  $this->ilias->setSetting("error_recipient",$_POST["error_recipient"]);
486  //$this->ilias->ini->setVariable("language","default",$_POST["default_language"]);
487 
488  //set default skin and style
489  /*
490  if ($_POST["default_skin_style"] != "")
491  {
492  $sknst = explode(":", $_POST["default_skin_style"]);
493 
494  if ($this->ilias->ini->readVariable("layout","style") != $sknst[1] ||
495  $this->ilias->ini->readVariable("layout","skin") != $sknst[0])
496  {
497  $this->ilias->ini->setVariable("layout","skin", $sknst[0]);
498  $this->ilias->ini->setVariable("layout","style",$sknst[1]);
499  }
500  }*/
501  // set default view target
502  /*
503  if ($_POST["open_views_inside_frameset"] == "1")
504  {
505  $this->ilias->ini->setVariable("layout","view_target","frame");
506  }
507  else
508  {
509  $this->ilias->ini->setVariable("layout","view_target","window");
510  }*/
511 
512  // modules
513  $this->ilias->setSetting("pub_section",$_POST["pub_section"]);
514  $this->ilias->setSetting('open_google',$_POST['open_google']);
515  $this->ilias->setSetting("default_repository_view",$_POST["default_rep_view"]);
516  //$this->ilias->setSetting('https',$_POST['https']);
517  $this->ilias->setSetting('password_assistance',$_POST['password_assistance']);
518  $this->ilias->setSetting('passwd_auto_generate',$_POST['password_auto_generate']);
519 
520  //$this->ilias->setSetting('enable_js_edit',$_POST['js_edit']);
521  $this->ilias->setSetting('short_inst_name',$_POST['short_inst_name']);
522  $this->ilias->setSetting('enable_trash',$_POST['enable_trash']);
523 
524  //session_reminder
525  $this->ilias->setSetting('session_reminder_enabled', (int)$_POST['session_reminder_enabled']);
526 
527  // contact
528  $this->ilias->setSetting("admin_firstname",$_POST["admin_firstname"]);
529  $this->ilias->setSetting("admin_lastname",$_POST["admin_lastname"]);
530  $this->ilias->setSetting("admin_title",$_POST["admin_title"]);
531  $this->ilias->setSetting("admin_position",$_POST["admin_position"]);
532  $this->ilias->setSetting("admin_institution",$_POST["admin_institution"]);
533  $this->ilias->setSetting("admin_street",$_POST["admin_street"]);
534  $this->ilias->setSetting("admin_zipcode",$_POST["admin_zipcode"]);
535  $this->ilias->setSetting("admin_city",$_POST["admin_city"]);
536  $this->ilias->setSetting("admin_country",$_POST["admin_country"]);
537  $this->ilias->setSetting("admin_phone",$_POST["admin_phone"]);
538  $this->ilias->setSetting("admin_email",$_POST["admin_email"]);
539 
540  // cron
541  $this->ilias->setSetting("cron_user_check",$_POST["cron_user_check"]);
542  $this->ilias->setSetting("cron_link_check",$_POST["cron_link_check"]);
543  $this->ilias->setSetting("cron_web_resource_check",$_POST["cron_web_resource_check"]);
544  $this->ilias->setSetting("cron_lucene_index",$_POST["cron_lucene_index"]);
545  $this->ilias->setSetting("forum_notification",$_POST["forum_notification"]);
546  if ($_POST["forum_notification"] == 2)
547  {
548  $this->ilias->setSetting("cron_forum_notification_last_date",date("Y-m-d H:i:s"));
549  }
550  $this->ilias->setSetting("mail_notification", $_POST["mail_notification"]);
551 
552 
553  // webservice
554  $this->ilias->setSetting("soap_user_administration",$_POST["soap_user_administration"]);
555  $this->ilias->setSetting("rpc_server_host",trim($_POST["rpc_server_host"]));
556  $this->ilias->setSetting("rpc_server_port",trim($_POST["rpc_server_port"]));
557 
558  // data privacy
559  // $this->ilias->setSetting("enable_fora_statistics",$_POST["enable_fora_statistics"]);
560 
561  // forums
562  $this->ilias->setSetting('frm_store_new',$_POST['frm_store_new']);
563 
564  // write ini settings
565  $this->ilias->ini->write();
566 
567  // links dynamic
568  $this->ilias->setSetting('links_dynamic',$_POST['links_dynamic']);
569 
570  $this->ilias->setSetting("suffix_repl_additional",
571  ilUtil::stripSlashes($_POST["suffix_repl_additional"]));
572 
573  $settings = $this->ilias->getAllSettings();
574 
575  // feedback
576  $feedback = $this->lng->txt("saved_successfully");
577  if (trim($_POST["rpc_server_host"]) != "" ||
578  trim($_POST["rpc_server_port"]) != "")
579  {
580  include_once 'Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
581  $rpc_settings = ilRPCServerSettings::getInstance();
582  if(!$rpc_settings->pingServer())
583  {
584  $feedback .= "<br />\n".$this->lng->txt('java_server_no_connection');
585  }
586  }
587  ilUtil::sendInfo($feedback);
588  }
589 
590  $ilCtrl->redirect($this, "view");
591  //$this->displayBasicSettings();
592  }
593 
595  {
596  include_once("./Modules/Wiki/classes/class.ilWikiDBCreator.php");
598  $this->viewObject();
599  }
600 
607  {
608  global $rbacsystem, $ilCtrl, $ilClientIniFile;
609 
610  $this->tpl->addBlockFile("SYSTEMSETTINGS", "systemsettings", "tpl.adm_basicdata.html",
611  "Modules/SystemFolder");
612 
613  $settings = $this->ilias->getAllSettings();
614 
615  // temp wiki stuff
616  $this->tpl->setVariable("HREF_CREATE_WIKI_TABLE",
617  $ilCtrl->getLinkTarget($this, "createWikiTables"));
618 
619 
620 
621  $this->tpl->setVariable("TXT_BASIC_DATA", $this->lng->txt("basic_data"));
622 
624  // setting language vars
625 
626  // basic data
627  $this->tpl->setVariable("TXT_ILIAS_VERSION", $this->lng->txt("ilias_version"));
628  $this->tpl->setVariable("TXT_DB_VERSION", $this->lng->txt("db_version"));
629  $this->tpl->setVariable("TXT_CLIENT_ID", $this->lng->txt("client_id"));
630  $this->tpl->setVariable("TXT_INST_ID", $this->lng->txt("inst_id"));
631  $this->tpl->setVariable("TXT_ACTIVATE_HTTPS",$this->lng->txt('activate_https'));
632  $this->tpl->setVariable("TXT_HOSTNAME", $this->lng->txt("host"));
633  $this->tpl->setVariable("TXT_IP_ADDRESS", $this->lng->txt("ip_address"));
634  $this->tpl->setVariable("TXT_SERVER_DATA", $this->lng->txt("server_data"));
635  $this->tpl->setVariable("TXT_SERVER_PORT", $this->lng->txt("port"));
636  $this->tpl->setVariable("TXT_SERVER_SOFTWARE", $this->lng->txt("server_software"));
637  $this->tpl->setVariable("TXT_HTTP_PATH", $this->lng->txt("http_path"));
638  $this->tpl->setVariable("TXT_ABSOLUTE_PATH", $this->lng->txt("absolute_path"));
639  $this->tpl->setVariable("TXT_INST_NAME", $this->lng->txt("inst_name"));
640  $this->tpl->setVariable("TXT_INST_INFO", $this->lng->txt("inst_info"));
641  //$this->tpl->setVariable("TXT_OPEN_VIEWS_INSIDE_FRAMESET", $this->lng->txt("open_views_inside_frameset"));
642  $this->tpl->setVariable("TXT_FEEDBACK_RECIPIENT", $this->lng->txt("feedback_recipient"));
643  $this->tpl->setVariable("TXT_ERROR_RECIPIENT", $this->lng->txt("error_recipient"));
644  $this->tpl->setVariable("TXT_HEADER_TITLE", $this->lng->txt("header_title"));
645  $this->tpl->setVariable("TXT_SHORT_NAME", $this->lng->txt("short_inst_name"));
646  $this->tpl->setVariable("TXT_SHORT_NAME_INFO", $this->lng->txt("short_inst_name_info"));
647 
648  $this->tpl->setVariable("VAL_SHORT_INST_NAME", $settings['short_inst_name']);
649  $this->tpl->setVariable("TXT_CHANGE", $this->lng->txt("change"));
650  $this->tpl->setVariable("LINK_HEADER_TITLE",
651  $this->ctrl->getLinkTarget($this, "changeHeaderTitle"));
652  $this->tpl->setVariable("VAL_HEADER_TITLE",
654 
655  include_once ("./Services/Database/classes/class.ilDBUpdate.php");
656  $dbupdate = new ilDBUpdate($this->ilias->db,true);
657 
658  if (!$dbupdate->getDBVersionStatus())
659  {
660  $this->tpl->setVariable("TXT_DB_UPDATE", "&nbsp;(<span class=\"warning\">".$this->lng->txt("db_need_update")."</span>)");
661  }
662 
663  //$this->tpl->setVariable("TXT_MODULES", $this->lng->txt("modules"));
664  $this->tpl->setVariable("TXT_PUB_SECTION", $this->lng->txt("pub_section"));
665 
666 
667  $this->tpl->setVariable('TXT_SEARCH_ENGINE',$this->lng->txt('search_engine'));
668  $this->tpl->setVariable('TXT_ENABLE_SEARCH_ENGINE',$this->lng->txt('enable_search_engine'));
669  include_once('Services/PrivacySecurity/classes/class.ilRobotSettings.php');
670  $robot_settings = ilRobotSettings::_getInstance();
671 
672  $error_se = false;
673  if(!$robot_settings->checkModRewrite())
674  {
675  $error_se = true;
676  $this->tpl->setVariable('OPEN_GOOGLE_CHECKED','disabled="disabled"');
677 
678  $this->tpl->setCurrentBlock('search_engine_alert');
679  $this->tpl->setVariable('SE_ALERT_IMG',ilUtil::getImagePath('icon_alert_s.gif'));
680  $this->tpl->setVariable('SE_ALT_ALERT',$this->lng->txt('alert'));
681  $this->tpl->setVariable('TXT_SE_ALERT',$this->lng->txt('mod_rewrite_disabled'));
682  $this->tpl->parseCurrentBlock();
683  }
684  elseif(!$robot_settings->checkRewrite())
685  {
686  $error_se = true;
687  $this->tpl->setVariable('OPEN_GOOGLE_CHECKED','disabled="disabled"');
688 
689  $this->tpl->setCurrentBlock('search_engine_alert');
690  $this->tpl->setVariable('SE_ALERT_IMG',ilUtil::getImagePath('icon_alert_s.gif'));
691  $this->tpl->setVariable('SE_ALT_ALERT',$this->lng->txt('alert'));
692  $this->tpl->setVariable('TXT_SE_ALERT',$this->lng->txt('allow_override_alert'));
693  $this->tpl->parseCurrentBlock();
694  }
695  if($settings['open_google'] and !$error_se)
696  {
697  $this->tpl->setVariable('OPEN_GOOGLE_CHECKED','checked="checked"');
698  }
699 
700  $this->tpl->setVariable("TXT_DEFAULT_REPOSITORY_VIEW", $this->lng->txt("def_repository_view"));
701  $this->tpl->setVariable("TXT_FLAT", $this->lng->txt("flatview"));
702  $this->tpl->setVariable("TXT_TREE", $this->lng->txt("treeview"));
703 
704  $this->tpl->setVariable("TXT_ENABLE_PASSWORD_ASSISTANCE", $this->lng->txt("enable_password_assistance"));
705  $this->tpl->setVariable("TXT_PASSWORD_AUTO_GENERATE_INFO",$this->lng->txt('passwd_generation_info'));
706  //rku: password assistent should be availabe always, even in mixed mode.
707  /* if (AUTH_DEFAULT != AUTH_LOCAL)
708  {
709  $this->tpl->setVariable("DISABLE_PASSWORD_ASSISTANCE", 'disabled=\"disabled\"');
710  $this->tpl->setVariable("TXT_PASSWORD_ASSISTANCE_DISABLED", $this->lng->txt("password_assistance_disabled"));
711  }*/
712 
713  $this->tpl->setVariable("TXT_PASSWORD_ASSISTANCE_INFO", $this->lng->txt("password_assistance_info"));
714 
715  $this->tpl->setVariable("TXT_ENABLE_PASSWORD_GENERATION",$this->lng->txt('passwd_generation'));
716 
717  // File Suffix Replacements
718  $this->tpl->setVariable("TXT_FILE_SUFFIX_REPL", $this->lng->txt("file_suffix_repl"));
719  $this->tpl->setVariable("INFO_FILE_SUFFIX_REPL",
720  $this->lng->txt("file_suffix_repl_info")." ".SUFFIX_REPL_DEFAULT);
721 
722  $this->tpl->setVariable("TXT_DYNAMIC_LINKS",$this->lng->txt('links_dynamic'));
723  $this->tpl->setVariable("INFO_DYNAMIC_LINKS",$this->lng->txt('links_dynamic_info'));
724 
725  $this->tpl->setVariable("TXT_ENABLE_TRASH",$this->lng->txt('enable_trash'));
726  $this->tpl->setVariable("INFO_ENABLE_TRASH",$this->lng->txt('enable_trash_info'));
727 
728  $this->tpl->setVariable('TXT_SESSION_REMINDER', $this->lng->txt('session_reminder'));
729  $this->tpl->setVariable('INFO_SESSION_REMINDER', $this->lng->txt('session_reminder_info'));
730  $expires = $ilClientIniFile->readVariable("session", "expire");
731  $time = ilFormat::_secondsToString($expires, true);
732  $this->tpl->setVariable('SESSION_REMINDER_SESSION_DURATION',
733  sprintf($this->lng->txt('session_reminder_session_duration'), $time));
734 
735 
736  // paths
737  $this->tpl->setVariable("TXT_SOFTWARE", $this->lng->txt("3rd_party_software"));
738  $this->tpl->setVariable("TXT_CONVERT_PATH", $this->lng->txt("path_to_convert"));
739  $this->tpl->setVariable("TXT_ZIP_PATH", $this->lng->txt("path_to_zip"));
740  $this->tpl->setVariable("TXT_UNZIP_PATH", $this->lng->txt("path_to_unzip"));
741  $this->tpl->setVariable("TXT_JAVA_PATH", $this->lng->txt("path_to_java"));
742  $this->tpl->setVariable("TXT_HTMLDOC_PATH", $this->lng->txt("path_to_htmldoc"));
743  $this->tpl->setVariable("TXT_MKISOFS_PATH", $this->lng->txt("path_to_mkisofs"));
744  $this->tpl->setVariable("TXT_LATEX_URL", $this->lng->txt("url_to_latex"));
745 
746  // Cron
747  $this->tpl->setVariable("TXT_CRON",$this->lng->txt('cron_jobs'));
748  $this->tpl->setVariable("TXT_CRON_DESC",$this->lng->txt('cron_jobs_desc'));
749  $this->tpl->setVariable("TXT_CRON_USER_ACCOUNTS",$this->lng->txt('check_user_accounts'));
750  $this->tpl->setVariable("CRON_USER_ACCOUNTS_DESC",$this->lng->txt('check_user_accounts_desc'));
751  $this->tpl->setVariable("TXT_CRON_LINK_CHECK",$this->lng->txt('check_link'));
752  $this->tpl->setVariable("CRON_LINK_CHECK_DESC",$this->lng->txt('check_link_desc'));
753  $this->tpl->setVariable("TXT_CRON_WEB_RESOURCE_CHECK",$this->lng->txt('check_web_resources'));
754  $this->tpl->setVariable("CRON_WEB_RESOURCE_CHECK_DESC",$this->lng->txt('check_web_resources_desc'));
755 
756  $this->tpl->setVariable("TXT_CRON_LUCENE_INDEX",$this->lng->txt('cron_lucene_index'));
757  $this->tpl->setVariable("TXT_CRON_LUCENE_INDEX_INFO",$this->lng->txt('cron_lucene_index_info'));
758 
759  $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION",$this->lng->txt('cron_forum_notification'));
760  $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION_NEVER",$this->lng->txt('cron_forum_notification_never'));
761  $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION_DIRECTLY",$this->lng->txt('cron_forum_notification_directly'));
762  $this->tpl->setVariable("TXT_CRON_FORUM_NOTIFICATION_CRON",$this->lng->txt('cron_forum_notification_cron'));
763  $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_DESC",$this->lng->txt('cron_forum_notification_desc'));
764 
765  $this->tpl->setVariable("TXT_CRON_MAIL_NOTIFICATION",$this->lng->txt('cron_mail_notification'));
766  $this->tpl->setVariable("TXT_CRON_MAIL_NOTIFICATION_NEVER",$this->lng->txt('cron_mail_notification_never'));
767  $this->tpl->setVariable("TXT_CRON_MAIL_NOTIFICATION_CRON",$this->lng->txt('cron_mail_notification_cron'));
768  $this->tpl->setVariable("CRON_MAIL_NOTIFICATION_DESC",$this->lng->txt('cron_mail_notification_desc'));
769 
770  $this->tpl->setVariable("TXT_NEVER",$this->lng->txt('never'));
771  $this->tpl->setVariable("TXT_DAILY",$this->lng->txt('daily'));
772  $this->tpl->setVariable("TXT_WEEKLY",$this->lng->txt('weekly'));
773  $this->tpl->setVariable("TXT_MONTHLY",$this->lng->txt('monthly'));
774  $this->tpl->setVariable("TXT_QUARTERLY",$this->lng->txt('quarterly'));
775 
776  $this->tpl->setVariable("TXT_WEBSERVICES",$this->lng->txt('webservices'));
777  $this->tpl->setVariable("TXT_SOAP_USER_ADMINISTRATION",$this->lng->txt('soap_user_administration'));
778  $this->tpl->setVariable("TXT_SOAP_USER_ADMINISTRATION_DESC",$this->lng->txt('soap_user_administration_desc'));
779 
780  $this->tpl->setVariable("TXT_JAVA_SERVER",$this->lng->txt('java_server'));
781  $this->tpl->setVariable("TXT_JAVA_SERVER_HOST",$this->lng->txt('java_server_host'));
782  $this->tpl->setVariable("TXT_JAVA_SERVER_PORT",$this->lng->txt('java_server_port'));
783  $this->tpl->setVariable("TXT_JAVA_SERVER_INFO",$this->lng->txt('java_server_info'));
784  $this->tpl->setVariable("TXT_JAVA_SERVER_README",$this->lng->txt('java_server_readme'));
785 
786 /* $this->tpl->setVariable("TXT_DATA_PRIVACY",$this->lng->txt('data_privacy'));
787  $this->tpl->setVariable("TXT_ENABLE_FORA_STATISTICS",$this->lng->txt('enable_fora_statistics'));
788  $this->tpl->setVariable("TXT_ENABLE_FORA_STATISTICS_DESC",$this->lng->txt('enable_fora_statistics_desc')); */
789 
790 
791  // forums
792  $this->tpl->setVariable("TXT_FORUMS",$this->lng->txt('obj_frm'));
793  $this->tpl->setVariable("TXT_STATUS_NEW",$this->lng->txt('frm_status_new'));
794  $this->tpl->setVariable("TXT_STATUS_NEW_DESC",$this->lng->txt('frm_status_new_desc'));
795 
796  $this->tpl->setVariable("TXT_ONE_WEEK","1 ". $this->lng->txt('week'));
797  $this->tpl->setVariable("TXT_TWO_WEEKS","2 ". $this->lng->txt('weeks'));
798  $this->tpl->setVariable("TXT_FOUR_WEEKS","4 ". $this->lng->txt('weeks'));
799  $this->tpl->setVariable("TXT_EIGHT_WEEKS","8 ". $this->lng->txt('weeks'));
800 
801  // contact
802  $this->tpl->setVariable("TXT_CONTACT_DATA", $this->lng->txt("contact_data"));
803  $this->tpl->setVariable("TXT_REQUIRED_FIELDS", $this->lng->txt("required_field"));
804  $this->tpl->setVariable("TXT_ADMIN", $this->lng->txt("administrator"));
805  $this->tpl->setVariable("TXT_FIRSTNAME", $this->lng->txt("firstname"));
806  $this->tpl->setVariable("TXT_LASTNAME", $this->lng->txt("lastname"));
807  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
808  $this->tpl->setVariable("TXT_POSITION", $this->lng->txt("position"));
809  $this->tpl->setVariable("TXT_INSTITUTION", $this->lng->txt("institution"));
810  $this->tpl->setVariable("TXT_STREET", $this->lng->txt("street"));
811  $this->tpl->setVariable("TXT_ZIPCODE", $this->lng->txt("zipcode"));
812  $this->tpl->setVariable("TXT_CITY", $this->lng->txt("city"));
813  $this->tpl->setVariable("TXT_COUNTRY", $this->lng->txt("country"));
814  $this->tpl->setVariable("TXT_PHONE", $this->lng->txt("phone"));
815  $this->tpl->setVariable("TXT_EMAIL", $this->lng->txt("email"));
816  $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
817 
818 
820  // display formula data
821 
822  // basic data
823  $this->tpl->setVariable("FORMACTION_BASICDATA", $this->ctrl->getFormAction($this));
824  $this->tpl->setVariable("HTTP_PATH",ILIAS_HTTP_PATH);
825  $this->tpl->setVariable("ABSOLUTE_PATH",ILIAS_ABSOLUTE_PATH);
826  $this->tpl->setVariable("HOSTNAME", $_SERVER["SERVER_NAME"]);
827  $this->tpl->setVariable("SERVER_PORT", $_SERVER["SERVER_PORT"]);
828  $this->tpl->setVariable("SERVER_ADMIN", $_SERVER["SERVER_ADMIN"]); // not used
829  $this->tpl->setVariable("SERVER_SOFTWARE", $_SERVER["SERVER_SOFTWARE"]);
830  $this->tpl->setVariable("IP_ADDRESS", $_SERVER["SERVER_ADDR"]);
831  $this->tpl->setVariable("DB_VERSION",$settings["db_version"]);
832  $this->tpl->setVariable("ILIAS_VERSION",$settings["ilias_version"]);
833  $this->tpl->setVariable("INST_ID",$settings["inst_id"]);
834  $this->tpl->setVariable("CLIENT_ID",CLIENT_ID);
835  $this->tpl->setVariable("INST_NAME",$this->ilias->ini->readVariable("client","name"));
836  $this->tpl->setVariable("INST_INFO",$this->ilias->ini->readVariable("client","description"));
837  $this->tpl->setVariable("FEEDBACK_RECIPIENT",$settings["feedback_recipient"]);
838  $this->tpl->setVariable("ERROR_RECIPIENT",$settings["error_recipient"]);
839 
840  $this->tpl->setVariable("PHP_INFO_LINK",
841  $this->ctrl->getLinkTarget($this, "showPHPInfo"));
842 
843  // get all templates
844  if ($settings["pub_section"])
845  {
846  $this->tpl->setVariable("PUB_SECTION","checked=\"checked\"");
847  }
848 
849  if ($settings["default_repository_view"] == "tree")
850  {
851  $this->tpl->setVariable("TREESELECTED","selected=\"1\"");
852  }
853  else
854  {
855  $this->tpl->setVariable("FLATSELECTED","selected=\"1\"");
856  }
857 
858  if($settings['password_assistance'])
859  {
860  $this->tpl->setVariable("PASSWORD_ASSISTANCE","checked=\"checked\"");
861  }
862  $this->tpl->setVariable("VAL_SHORT_NAME", $settings['short_inst_title']);
863  if($settings['passwd_auto_generate'])
864  {
865  $this->tpl->setVariable("PASSWORD_AUTO_GENERATE","checked=\"checked\"");
866  }
867 
868  // js editing
869  /*
870  if($settings['enable_js_edit'])
871  {
872  $this->tpl->setVariable("JS_EDIT","checked=\"checked\"");
873  }*/
874 
875  $this->tpl->setVariable("SUFFIX_REPL_ADDITIONAL", ilUtil::prepareFormOutput($settings['suffix_repl_additional']));
876 
877  if($settings['links_dynamic'])
878  {
879  $this->tpl->setVariable("LINKS_DYNAMIC_CHECKED","checked=\"checked\"");
880  }
881 
882  if($settings['enable_trash'])
883  {
884  $this->tpl->setVariable("ENABLE_TRASH_CHECKED","checked=\"checked\"");
885  }
886 
887  if($settings['session_reminder_enabled'])
888  {
889  $this->tpl->setVariable('SESSION_REMINDER_ENABLED','checked=checked');
890  }
891 
892  if ($settings["require_login"])
893  {
894  $this->tpl->setVariable("REQUIRE_LOGIN","checked=\"checked\"");
895  }
896  if ($settings["require_passwd"])
897  {
898  $this->tpl->setVariable("REQUIRE_PASSWD","checked=\"checked\"");
899  }
900  if ($settings["require_passwd2"])
901  {
902  $this->tpl->setVariable("REQUIRE_PASSWD2","checked=\"checked\"");
903  }
904  if ($settings["require_firstname"])
905  {
906  $this->tpl->setVariable("REQUIRE_FIRSTNAME","checked=\"checked\"");
907  }
908  if ($settings["require_gender"])
909  {
910  $this->tpl->setVariable("REQUIRE_GENDER","checked=\"checked\"");
911  }
912  if ($settings["require_lastname"])
913  {
914  $this->tpl->setVariable("REQUIRE_LASTNAME","checked=\"checked\"");
915  }
916  if ($settings["require_institution"])
917  {
918  $this->tpl->setVariable("REQUIRE_INSTITUTION","checked=\"checked\"");
919  }
920  if ($settings["require_department"])
921  {
922  $this->tpl->setVariable("REQUIRE_DEPARTMENT","checked=\"checked\"");
923  }
924  if ($settings["require_street"])
925  {
926  $this->tpl->setVariable("REQUIRE_STREET","checked=\"checked\"");
927  }
928  if ($settings["require_city"])
929  {
930  $this->tpl->setVariable("REQUIRE_CITY","checked=\"checked\"");
931  }
932  if ($settings["require_zipcode"])
933  {
934  $this->tpl->setVariable("REQUIRE_ZIPCODE","checked=\"checked\"");
935  }
936  if ($settings["require_country"])
937  {
938  $this->tpl->setVariable("REQUIRE_COUNTRY","checked=\"checked\"");
939  }
940  if ($settings["require_phone_office"])
941  {
942  $this->tpl->setVariable("REQUIRE_PHONE_OFFICE","checked=\"checked\"");
943  }
944  if ($settings["require_phone_home"])
945  {
946  $this->tpl->setVariable("REQUIRE_PHONE_HOME","checked=\"checked\"");
947  }
948  if ($settings["require_phone_mobile"])
949  {
950  $this->tpl->setVariable("REQUIRE_PHONE_MOBILE","checked=\"checked\"");
951  }
952  if ($settings["require_fax"])
953  {
954  $this->tpl->setVariable("REQUIRE_FAX","checked=\"checked\"");
955  }
956  if ($settings["require_email"])
957  {
958  $this->tpl->setVariable("REQUIRE_EMAIL","checked=\"checked\"");
959  }
960  if ($settings["require_hobby"])
961  {
962  $this->tpl->setVariable("REQUIRE_HOBBY","checked=\"checked\"");
963  }
964  if ($settings["require_default_role"])
965  {
966  $this->tpl->setVariable("REQUIRE_DEFAULT_ROLE","checked=\"checked\"");
967  }
968  if ($settings["require_referral_comment"])
969  {
970  $this->tpl->setVariable("REQUIRE_REFERRAL_COMMENT","checked=\"checked\"");
971  }
972  if ($settings["require_matriculation"])
973  {
974  $this->tpl->setVariable("REQUIRE_MATRICULATION","checked=\"checked\"");
975  }
976  if ($settings["cron_user_check"])
977  {
978  $this->tpl->setVariable("CRON_USER_CHECK","checked=\"checked\"");
979  }
980  if ($settings["cron_link_check"])
981  {
982  $this->tpl->setVariable("CRON_LINK_CHECK","checked=\"checked\"");
983  }
984  if($settings["cron_lucene_index"])
985  {
986  $this->tpl->setVariable("CRON_LUCENE_INDEX","checked=\"checked\"");
987  }
988  if ($settings["forum_notification"] == 0)
989  {
990  $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_NEVER_SELECTED"," selected");
991  }
992  else if ($settings["forum_notification"] == 1)
993  {
994  $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_DIRECTLY_SELECTED"," selected");
995  }
996  else if ($settings["forum_notification"] == 2)
997  {
998  $this->tpl->setVariable("CRON_FORUM_NOTIFICATION_CRON_SELECTED"," selected");
999  }
1000  if ($settings["mail_notification"] == 0)
1001  {
1002  $this->tpl->setVariable("CRON_MAIL_NOTIFICATION_NEVER_SELECTED"," selected=\"selected\"");
1003  }
1004  else if ($settings["mail_notification"] == 1)
1005  {
1006  $this->tpl->setVariable("CRON_MAIL_NOTIFICATION_CRON_SELECTED"," selected=\"selected\"");
1007  }
1008  if ($val = $settings["cron_web_resource_check"])
1009  {
1010  switch($val)
1011  {
1012  case 1:
1013  $this->tpl->setVariable("D_SELECT",'selected="selected"');
1014  break;
1015  case 2:
1016  $this->tpl->setVariable("W_SELECT",'selected="selected"');
1017  break;
1018  case 3:
1019  $this->tpl->setVariable("M_SELECT",'selected="selected"');
1020  break;
1021  case 4:
1022  $this->tpl->setVariable("Q_SELECT",'selected="selected"');
1023  break;
1024 
1025  }
1026  }
1027  switch($settings['frm_store_new'])
1028  {
1029  case 1:
1030  $this->tpl->setVariable("ONE_SELECT",'selected="selected"');
1031  break;
1032 
1033  case 2:
1034  $this->tpl->setVariable("TWO_SELECT",'selected="selected"');
1035  break;
1036 
1037  case 4:
1038  $this->tpl->setVariable("FOUR_SELECT",'selected="selected"');
1039  break;
1040 
1041  case 8:
1042  default:
1043  $this->tpl->setVariable("EIGHT_SELECT",'selected="selected"');
1044  break;
1045  }
1046  if ($settings["soap_user_administration"])
1047  {
1048  $this->tpl->setVariable("SOAP_USER_ADMINISTRATION_CHECK","checked=\"checked\"");
1049  }
1050 
1051  $this->tpl->setVariable("JAVA_SERVER_HOST",$settings["rpc_server_host"]);
1052  $this->tpl->setVariable("JAVA_SERVER_PORT",$settings["rpc_server_port"]);
1053 
1054  /* if ($settings["enable_fora_statistics"])
1055  {
1056  $this->tpl->setVariable("ENABLE_FORA_STATISTICS_CHECK","checked=\"checked\"");
1057  }*/
1058 
1059 
1060  // paths to tools
1061  $not_set = $this->lng->txt("path_not_set");
1062 
1063  $this->tpl->setVariable("CONVERT_PATH",(PATH_TO_CONVERT) ? PATH_TO_CONVERT : $not_set);
1064  $this->tpl->setVariable("ZIP_PATH",(PATH_TO_ZIP) ? PATH_TO_ZIP : $not_set);
1065  $this->tpl->setVariable("UNZIP_PATH",(PATH_TO_UNZIP) ? PATH_TO_UNZIP : $not_set);
1066  $this->tpl->setVariable("JAVA_PATH",(PATH_TO_JAVA) ? PATH_TO_JAVA : $not_set);
1067  $this->tpl->setVariable("HTMLDOC_PATH",(PATH_TO_HTMLDOC) ? PATH_TO_HTMLDOC : $not_set);
1068  $this->tpl->setVariable("MKISOFS_PATH",(PATH_TO_MKISOFS) ? PATH_TO_MKISOFS : $not_set);
1069  $this->tpl->setVariable("LATEX_URL",(URL_TO_LATEX) ? URL_TO_LATEX : $not_set);
1070 
1071  // contact
1072  $this->tpl->setVariable("ADMIN_FIRSTNAME",$settings["admin_firstname"]);
1073  $this->tpl->setVariable("ADMIN_LASTNAME",$settings["admin_lastname"]);
1074  $this->tpl->setVariable("ADMIN_TITLE",$settings["admin_title"]);
1075  $this->tpl->setVariable("ADMIN_POSITION",$settings["admin_position"]);
1076  $this->tpl->setVariable("ADMIN_INSTITUTION",$settings["admin_institution"]);
1077  $this->tpl->setVariable("ADMIN_STREET",$settings["admin_street"]);
1078  $this->tpl->setVariable("ADMIN_ZIPCODE",$settings["admin_zipcode"]);
1079  $this->tpl->setVariable("ADMIN_CITY",$settings["admin_city"]);
1080  $this->tpl->setVariable("ADMIN_COUNTRY",$settings["admin_country"]);
1081  $this->tpl->setVariable("ADMIN_PHONE",$settings["admin_phone"]);
1082  $this->tpl->setVariable("ADMIN_EMAIL",$settings["admin_email"]);
1083 
1084  $this->tpl->parseCurrentBlock();
1085  }
1086 
1088  {
1089  return $this->viewScanLog();
1090  }
1091 
1097  function checkObject()
1098  {
1099  global $rbacsystem, $ilias, $objDefinition, $ilSetting;
1100 
1101  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1102  {
1103  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1104  }
1105 //echo "1";
1106 
1107  if ($_POST['count_limit'] !== null || $_POST['age_limit'] !== null || $_POST['type_limit'] !== null)
1108  {
1109  $ilias->account->writePref('systemcheck_count_limit',
1110  (is_numeric($_POST['count_limit']) && $_POST['count_limit'] > 0) ? $_POST['count_limit'] : ''
1111  );
1112  $ilias->account->writePref('systemcheck_age_limit',
1113  (is_numeric($_POST['age_limit']) && $_POST['age_limit'] > 0) ? $_POST['age_limit'] : '');
1114  $ilias->account->writePref('systemcheck_type_limit', trim($_POST['type_limit']));
1115  }
1116 
1117  if ($_POST["mode"])
1118  {
1119 //echo "3";
1120  $this->writeCheckParams();
1121  $this->startValidator($_POST["mode"],$_POST["log_scan"]);
1122  }
1123  else
1124  {
1125 //echo "4";
1126  include_once "classes/class.ilValidator.php";
1127  $validator = new ilValidator();
1128  $hasScanLog = $validator->hasScanLog();
1129 
1130  $this->getTemplateFile("check");
1131 
1132  if ($hasScanLog)
1133  {
1134  $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_last_log"));
1135  }
1136 
1137  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1138  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("systemcheck"));
1139  $this->tpl->setVariable("COLSPAN", 3);
1140  $this->tpl->setVariable("TXT_ANALYZE_TITLE", $this->lng->txt("analyze_data"));
1141  $this->tpl->setVariable("TXT_ANALYSIS_OPTIONS", $this->lng->txt("analysis_options"));
1142  $this->tpl->setVariable("TXT_REPAIR_OPTIONS", $this->lng->txt("repair_options"));
1143  $this->tpl->setVariable("TXT_OUTPUT_OPTIONS", $this->lng->txt("output_options"));
1144  $this->tpl->setVariable("TXT_SCAN", $this->lng->txt("scan"));
1145  $this->tpl->setVariable("TXT_SCAN_DESC", $this->lng->txt("scan_desc"));
1146  $this->tpl->setVariable("TXT_DUMP_TREE", $this->lng->txt("dump_tree"));
1147  $this->tpl->setVariable("TXT_DUMP_TREE_DESC", $this->lng->txt("dump_tree_desc"));
1148  $this->tpl->setVariable("TXT_CLEAN", $this->lng->txt("clean"));
1149  $this->tpl->setVariable("TXT_CLEAN_DESC", $this->lng->txt("clean_desc"));
1150  $this->tpl->setVariable("TXT_RESTORE", $this->lng->txt("restore_missing"));
1151  $this->tpl->setVariable("TXT_RESTORE_DESC", $this->lng->txt("restore_missing_desc"));
1152  $this->tpl->setVariable("TXT_PURGE", $this->lng->txt("purge_missing"));
1153  $this->tpl->setVariable("TXT_PURGE_DESC", $this->lng->txt("purge_missing_desc"));
1154  $this->tpl->setVariable("TXT_RESTORE_TRASH", $this->lng->txt("restore_trash"));
1155  $this->tpl->setVariable("TXT_RESTORE_TRASH_DESC", $this->lng->txt("restore_trash_desc"));
1156  $this->tpl->setVariable("TXT_PURGE_TRASH", $this->lng->txt("purge_trash"));
1157  $this->tpl->setVariable("TXT_PURGE_TRASH_DESC", $this->lng->txt("purge_trash_desc"));
1158  $this->tpl->setVariable("TXT_COUNT_LIMIT", $this->lng->txt("purge_count_limit"));
1159  $this->tpl->setVariable("TXT_COUNT_LIMIT_DESC", $this->lng->txt("purge_count_limit_desc"));
1160  $this->tpl->setVariable("COUNT_LIMIT_VALUE", $ilias->account->getPref("systemcheck_count_limit"));
1161  $this->tpl->setVariable("TXT_AGE_LIMIT", $this->lng->txt("purge_age_limit"));
1162  $this->tpl->setVariable("TXT_AGE_LIMIT_DESC", $this->lng->txt("purge_age_limit_desc"));
1163  $this->tpl->setVariable("AGE_LIMIT_VALUE", $ilias->account->getPref("systemcheck_age_limit"));
1164  $this->tpl->setVariable("TXT_TYPE_LIMIT", $this->lng->txt("purge_type_limit"));
1165  $this->tpl->setVariable("TXT_TYPE_LIMIT_DESC", $this->lng->txt("purge_type_limit_desc"));
1166 
1167  if($ilias->account->getPref('systemcheck_mode_scan'))
1168  $this->tpl->touchBlock('mode_scan_checked');
1169  if($ilias->account->getPref('systemcheck_mode_dump_tree'))
1170  $this->tpl->touchBlock('mode_dump_tree_checked');
1171  if($ilias->account->getPref('systemcheck_mode_clean'))
1172  $this->tpl->touchBlock('mode_clean_checked');
1173  if($ilias->account->getPref('systemcheck_mode_restore'))
1174  {
1175  $this->tpl->touchBlock('mode_restore_checked');
1176  $this->tpl->touchBlock('mode_purge_disabled');
1177  }
1178  elseif($ilias->account->getPref('systemcheck_mode_purge'))
1179  {
1180  $this->tpl->touchBlock('mode_purge_checked');
1181  $this->tpl->touchBlock('mode_restore_disabled');
1182  }
1183  if($ilias->account->getPref('systemcheck_mode_restore_trash'))
1184  {
1185  $this->tpl->touchBlock('mode_restore_trash_checked');
1186  $this->tpl->touchBlock('mode_purge_trash_disabled');
1187  }
1188  elseif($ilias->account->getPref('systemcheck_mode_purge_trash'))
1189  {
1190  $this->tpl->touchBlock('mode_purge_trash_checked');
1191  $this->tpl->touchBlock('mode_restore_trash_disabled');
1192  }
1193  if($ilias->account->getPref('systemcheck_log_scan'))
1194  $this->tpl->touchBlock('log_scan_checked');
1195 
1196  $types = $objDefinition->getAllObjects();
1197  $ts = array("" => "");
1198  foreach ($types as $t)
1199  {
1200  if ($t != "" && !$objDefinition->isSystemObject($t) && $t != "root")
1201  {
1202  if ($objDefinition->isPlugin($t))
1203  {
1204  $ts[$t] = ilPlugin::lookupTxt("rep_robj", $t, "obj_".$t);
1205  }
1206  else
1207  {
1208  $ts[$t] = $this->lng->txt("obj_".$t);
1209  }
1210  }
1211  }
1212  $this->tpl->setVariable("TYPE_LIMIT_CHOICE",
1214  $ilias->account->getPref("systemcheck_type_limit"),
1215  'type_limit',
1216  $ts, false, true
1217  )
1218  );
1219  $this->tpl->setVariable("TXT_LOG_SCAN", $this->lng->txt("log_scan"));
1220  $this->tpl->setVariable("TXT_LOG_SCAN_DESC", $this->lng->txt("log_scan_desc"));
1221  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("start_scan"));
1222 
1223  $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save_params_for_cron"));
1224 
1225  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1226 
1227  $cron_form = new ilPropertyFormGUI();
1228  $cron_form->setFormAction($this->ctrl->getFormAction($this));
1229  $cron_form->setTitle($this->lng->txt('systemcheck_cronform'));
1230 
1231  $radio_group = new ilRadioGroupInputGUI($this->lng->txt('systemcheck_cron'), 'cronjob' );
1232  $radio_group->setValue( $ilSetting->get('systemcheck_cron') );
1233 
1234  $radio_opt = new ilRadioOption($this->lng->txt('disabled'),0);
1235  $radio_group->addOption($radio_opt);
1236 
1237  $radio_opt = new ilRadioOption($this->lng->txt('enabled'),1);
1238  $radio_group->addOption($radio_opt);
1239 
1240  $cron_form->addItem($radio_group);
1241 
1242  $cron_form->addCommandButton('saveCheckCron',$this->lng->txt('save'));
1243 
1244  $this->tpl->setVariable('CRON_FORM',$cron_form->getHTML());
1245  }
1246  }
1247 
1248  private function saveCheckParamsObject()
1249  {
1250  $this->writeCheckParams();
1251  unset($_POST['mode']);
1252  return $this->checkObject();
1253  }
1254 
1255  private function writeCheckParams()
1256  {
1257  include_once "classes/class.ilValidator.php";
1258  $validator = new ilValidator();
1259  $modes = $validator->getPossibleModes();
1260 
1261  $prefs = array();
1262  foreach($modes as $mode)
1263  {
1264  if( isset($_POST['mode'][$mode]) ) $value = (int)$_POST['mode'][$mode];
1265  else $value = 0;
1266  $prefs[ 'systemcheck_mode_'.$mode ] = $value;
1267  }
1268 
1269  if( isset($_POST['log_scan']) ) $value = (int)$_POST['log_scan'];
1270  else $value = 0;
1271  $prefs['systemcheck_log_scan'] = $value;
1272 
1273  global $ilUser;
1274  foreach($prefs as $key => $val)
1275  {
1276  $ilUser->writePref($key,$val);
1277  }
1278  }
1279 
1280  private function saveCheckCronObject()
1281  {
1282  global $ilSetting;
1283 
1284  $systemcheck_cron = ($_POST['cronjob'] ? 1 : 0);
1285  $ilSetting->set('systemcheck_cron',$systemcheck_cron);
1286 
1287  unset($_POST['mode']);
1288  return $this->checkObject();
1289  }
1290 
1297  {
1298  global $rbacsystem, $styleDefinition;
1299 
1300  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.header_title_edit.html");
1301 
1302  $array_push = true;
1303 
1304  if ($_SESSION["error_post_vars"])
1305  {
1306  $_SESSION["translation_post"] = $_SESSION["error_post_vars"];
1307  $_GET["mode"] = "session";
1308  $array_push = false;
1309  }
1310 
1311  // load from db if edit category is called the first time
1312  if (($_GET["mode"] != "session"))
1313  {
1314  $data = $this->object->getHeaderTitleTranslations();
1315  $_SESSION["translation_post"] = $data;
1316  $array_push = false;
1317  } // remove a translation from session
1318  elseif ($_GET["entry"] != 0)
1319  {
1320  array_splice($_SESSION["translation_post"]["Fobject"],$_GET["entry"],1,array());
1321 
1322  if ($_GET["entry"] == $_SESSION["translation_post"]["default_language"])
1323  {
1324  $_SESSION["translation_post"]["default_language"] = "";
1325  }
1326  }
1327 
1328  $data = $_SESSION["translation_post"];
1329 
1330  // add additional translation form
1331  if (!$_GET["entry"] and $array_push)
1332  {
1333  $count = array_push($data["Fobject"],array("title" => "","desc" => ""));
1334  }
1335  else
1336  {
1337  $count = count($data["Fobject"]);
1338  }
1339 
1340  // stripslashes in form?
1341  $strip = isset($_SESSION["translation_post"]) ? true : false;
1342 
1343  foreach ($data["Fobject"] as $key => $val)
1344  {
1345  // add translation button
1346  if ($key == $count -1)
1347  {
1348  $this->tpl->setCurrentBlock("addTranslation");
1349  $this->tpl->setVariable("TXT_ADD_TRANSLATION",$this->lng->txt("add_translation")." >>");
1350  $this->tpl->parseCurrentBlock();
1351  }
1352 
1353  // remove translation button
1354  if ($key != 0)
1355  {
1356  $this->tpl->setCurrentBlock("removeTranslation");
1357  $this->tpl->setVariable("TXT_REMOVE_TRANSLATION",$this->lng->txt("remove_translation"));
1358  $this->ctrl->setParameter($this, "entry", $key);
1359  $this->ctrl->setParameter($this, "mode", "edit");
1360  $this->tpl->setVariable("LINK_REMOVE_TRANSLATION",
1361  $this->ctrl->getLinkTarget($this, "removeTranslation"));
1362  $this->tpl->parseCurrentBlock();
1363  }
1364 
1365  // lang selection
1366  $this->tpl->addBlockFile("SEL_LANGUAGE", "sel_language", "tpl.lang_selection.html", false);
1367  $this->tpl->setVariable("SEL_NAME", "Fobject[".$key."][lang]");
1368 
1369  include_once('Services/MetaData/classes/class.ilMDLanguageItem.php');
1370 
1371  $languages = ilMDLanguageItem::_getLanguages();
1372 
1373  foreach ($languages as $code => $language)
1374  {
1375  $this->tpl->setCurrentBlock("lg_option");
1376  $this->tpl->setVariable("VAL_LG", $code);
1377  $this->tpl->setVariable("TXT_LG", $language);
1378 
1379  if ($code == $val["lang"])
1380  {
1381  $this->tpl->setVariable("SELECTED", "selected=\"selected\"");
1382  }
1383 
1384  $this->tpl->parseCurrentBlock();
1385  }
1386 
1387  // object data
1388  $this->tpl->setCurrentBlock("obj_form");
1389 
1390  if ($key == 0)
1391  {
1392  $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("change_header_title"));
1393  }
1394  else
1395  {
1396  $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("translation")." ".$key);
1397  }
1398 
1399  if ($key == $data["default_language"])
1400  {
1401  $this->tpl->setVariable("CHECKED", "checked=\"checked\"");
1402  }
1403 
1404  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
1405  $this->tpl->setVariable("TXT_DESC", $this->lng->txt("desc"));
1406  $this->tpl->setVariable("TXT_DEFAULT", $this->lng->txt("default"));
1407  $this->tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language"));
1408  $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($val["title"],$strip));
1409  $this->tpl->setVariable("DESC", ilUtil::stripSlashes($val["desc"]));
1410  $this->tpl->setVariable("NUM", $key);
1411  $this->tpl->parseCurrentBlock();
1412  }
1413 
1414  // global
1415  $this->tpl->setCurrentBlock("adm_content");
1416 
1417  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1418  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
1419  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
1420  $this->tpl->setVariable("CMD_SUBMIT", "saveHeaderTitle");
1421  $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
1422  }
1423 
1428  {
1429  $data = $_POST;
1430 
1431  // default language set?
1432  if (!isset($data["default_language"]))
1433  {
1434  $this->ilias->raiseError($this->lng->txt("msg_no_default_language"),$this->ilias->error_obj->MESSAGE);
1435  }
1436 
1437  // prepare array fro further checks
1438  foreach ($data["Fobject"] as $key => $val)
1439  {
1440  $langs[$key] = $val["lang"];
1441  }
1442 
1443  $langs = array_count_values($langs);
1444 
1445  // all languages set?
1446  if (array_key_exists("",$langs))
1447  {
1448  $this->ilias->raiseError($this->lng->txt("msg_no_language_selected"),$this->ilias->error_obj->MESSAGE);
1449  }
1450 
1451  // no single language is selected more than once?
1452  if (array_sum($langs) > count($langs))
1453  {
1454  $this->ilias->raiseError($this->lng->txt("msg_multi_language_selected"),$this->ilias->error_obj->MESSAGE);
1455  }
1456 
1457  // copy default translation to variable for object data entry
1458  $_POST["Fobject"]["title"] = $_POST["Fobject"][$_POST["default_language"]]["title"];
1459  $_POST["Fobject"]["desc"] = $_POST["Fobject"][$_POST["default_language"]]["desc"];
1460 
1461  // first delete all translation entries...
1462  $this->object->removeHeaderTitleTranslations();
1463 
1464  // ...and write new translations to object_translation
1465  foreach ($data["Fobject"] as $key => $val)
1466  {
1467  if ($key == $data["default_language"])
1468  {
1469  $default = 1;
1470  }
1471  else
1472  {
1473  $default = 0;
1474  }
1475 
1476  $this->object->addHeaderTitleTranslation(ilUtil::stripSlashes($val["title"]),ilUtil::stripSlashes($val["desc"]),$val["lang"],$default);
1477  }
1478 
1479  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
1480 
1481  $this->ctrl->redirect($this);
1482  }
1483 
1484  function cancelObject()
1485  {
1486  $this->ctrl->redirect($this, "view");
1487  }
1488 
1495  {
1496  $_SESSION["translation_post"] = $_POST;
1497 
1498  $this->ctrl->setParameter($this, "mode", "session");
1499  $this->ctrl->setParameter($this, "entry", "0");
1500  $this->ctrl->redirect($this, "changeHeaderTitle");
1501  }
1502 
1509  {
1510  $this->ctrl->setParameter($this, "entry", $_GET["entry"]);
1511  $this->ctrl->setParameter($this, "mode", "session");
1512  $this->ctrl->redirect($this, "changeHeaderTitle");
1513  }
1514 
1515 
1516  function startValidator($a_mode,$a_log)
1517  {
1518  global $rbacsystem;
1519 
1520  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1521  {
1522  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1523  }
1524 
1525  $logging = ($a_log) ? true : false;
1526  include_once "classes/class.ilValidator.php";
1527  $validator = new ilValidator($logging);
1528  $validator->setMode("all",false);
1529 
1530  $modes = array();
1531  foreach ($a_mode as $mode => $value)
1532  {
1533  $validator->setMode($mode,(bool) $value);
1534  $modes[] = $mode.'='.$value;
1535  }
1536 
1537  $scan_log = $validator->validate();
1538 
1539  $mode = $this->lng->txt("scan_modes").": ".implode(', ',$modes);
1540 
1541  // output
1542  $this->getTemplateFile("scan");
1543 
1544  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1545  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scanning_system"));
1546  $this->tpl->setVariable("COLSPAN", 3);
1547  $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
1548  $this->tpl->setVariable("TXT_MODE", $mode);
1549 
1550  if ($logging === true)
1551  {
1552  $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_log"));
1553  }
1554 
1555  $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
1556 
1557  $validator->writeScanLogLine($mode);
1558  }
1559 
1560  function viewScanLog()
1561  {
1562  include_once "classes/class.ilValidator.php";
1563  $validator = new IlValidator();
1564  $scan_log =& $validator->readScanLog();
1565 
1566  if (is_array($scan_log))
1567  {
1568  $scan_log = '<pre>'.implode("",$scan_log).'</pre>';
1569  $this->tpl->setVariable("ADM_CONTENT", $scan_log);
1570  }
1571  else
1572  {
1573  $scan_log = "no scanlog found.";
1574  }
1575 
1576  // output
1577  $this->getTemplateFile("scan");
1578  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scan_details"));
1579  $this->tpl->setVariable("COLSPAN", 3);
1580  $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
1581  $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
1582  }
1583 
1584 
1588  function benchmarkObject()
1589  {
1590  global $ilBench, $rbacsystem;
1591 
1592  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1593  {
1594  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
1595  }
1596 
1597  $this->getTemplateFile("bench");
1598  $this->ctrl->setParameter($this,'cur_mode',$_GET['cur_mod']);
1599  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1600  $this->tpl->setVariable("TXT_BENCH_SETTINGS", $this->lng->txt("benchmark_settings"));
1601  $this->tpl->setVariable("TXT_ACTIVATION", $this->lng->txt("activation"));
1602  $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save_settings"));
1603  $this->tpl->setVariable("TXT_CUR_RECORDS", $this->lng->txt("cur_number_rec"));
1604  $this->tpl->setVariable("VAL_CUR_RECORDS", $ilBench->getCurrentRecordNumber());
1605  $this->tpl->setVariable("TXT_MAX_RECORDS", $this->lng->txt("max_number_rec"));
1606  $this->tpl->setVariable("VAL_MAX_RECORDS", $ilBench->getMaximumRecords());
1607  $this->tpl->setVariable("TXT_CLEAR", $this->lng->txt("delete_all_rec"));
1608  if($ilBench->isEnabled())
1609  {
1610  $this->tpl->setVariable("ACT_CHECKED", " checked=\"1\" ");
1611  }
1612 
1613  $modules = $ilBench->getMeasuredModules();
1614 
1615  if (count($modules) > 0)
1616  {
1617  $this->tpl->setCurrentBlock("eval_table");
1618 
1619  $cur_module = ($_GET["cur_mod"] != "" &&
1620  in_array($_GET["cur_mod"], $modules))
1621  ? $_GET["cur_mod"]
1622  : current($modules);
1623 
1624  $benchs = $ilBench->getEvaluation($cur_module);
1625 
1626  $i=0;
1627  foreach($benchs as $bench)
1628  {
1629  $this->tpl->setCurrentBlock("eval_row");
1630  $this->tpl->setVariable("ROWCOL",
1631  ilUtil::switchColor($i++, "tblrow2", "tblrow1"));
1632 
1633  $this->tpl->setVariable("VAL_BENCH", $bench["benchmark"]);
1634  $this->tpl->setVariable("VAL_NUMBER_RECORDS", $bench["cnt"]);
1635  $this->tpl->setVariable("VAL_AVG_TIME", $bench["duration"]);
1636  $this->tpl->setVariable("VAL_MIN_TIME", $bench["min"]);
1637  $this->tpl->setVariable("VAL_MAX_TIME", $bench["max"]);
1638  $this->tpl->setVariable("VAL_CUM_TIME", $bench["duration"] * $bench["cnt"]);
1639  $this->tpl->parseCurrentBlock();
1640  }
1641 
1642  $this->tpl->setVariable("SELECT_MODULE",
1643  ilUtil::formSelect($cur_module, "module",$modules, false, true));
1644 
1645  $this->tpl->setVariable("TXT_SHOW", $this->lng->txt("show"));
1646  $this->tpl->setVariable("TXT_BENCH", $this->lng->txt("benchmark"));
1647  $this->tpl->setVariable("TXT_NUMBER_RECORDS", $this->lng->txt("number_of_records"));
1648  $this->tpl->setVariable("TXT_AVG_TIME", $this->lng->txt("average_time"));
1649  $this->tpl->setVariable("TXT_MIN_TIME", $this->lng->txt("min_time"));
1650  $this->tpl->setVariable("TXT_MAX_TIME", $this->lng->txt("max_time"));
1651  $this->tpl->setVariable("TXT_CUM_TIME", $this->lng->txt("cumulative_time"));
1652 
1653  $this->tpl->parseCurrentBlock();
1654  }
1655  }
1656 
1657 
1662  {
1663  global $ilBench;
1664 
1665  if ($_POST["activate"] == "y")
1666  {
1667  $ilBench->enable(true);
1668  }
1669  else
1670  {
1671  $ilBench->enable(false);
1672  }
1673 //echo ":".$_POST["max_records"].":<br>"; exit;
1674  $ilBench->setMaximumRecords($_POST["max_records"]);
1675 
1676  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1677 
1678  $this->ctrl->redirect($this, "benchmark");
1679  }
1680 
1681 
1686  {
1687  global $ilBench;
1688 
1689  $this->ctrl->setParameter($this,'cur_mod',$_POST['module']);
1690  $this->ctrl->redirect($this, "benchmark");
1691  }
1692 
1693 
1697  function clearBenchObject()
1698  {
1699  global $ilBench;
1700 
1701  $ilBench->clearData();
1702  $this->saveBenchSettingsObject();
1703 
1704  }
1705 
1706  // get tabs
1707  function getAdminTabs(&$tabs_gui)
1708  {
1709  global $rbacsystem;
1710 
1711  $this->ctrl->setParameter($this,"ref_id",$this->object->getRefId());
1712 
1713 /* if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1714  {
1715  $tabs_gui->addTarget("settings",
1716  $this->ctrl->getLinkTarget($this, "view"), array("view", "saveSettings"), get_class($this));
1717  }*/
1718 
1719  // server info
1720  if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1721  {
1722  $tabs_gui->addTarget("server_data",
1723  $this->ctrl->getLinkTarget($this, "showServerInfo"),
1724  array("showServerInfo", "view"), get_class($this));
1725  }
1726 
1727  // general settings
1728  if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
1729  {
1730  $tabs_gui->addTarget("general_settings",
1731  $this->ctrl->getLinkTarget($this, "showBasicSettings"),
1732  array("showBasicSettings", "saveBasicSettings"), get_class($this));
1733  }
1734 
1735  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
1736  {
1737  //$tabs_gui->addTarget("edit_properties",
1738  // $this->ctrl->getLinkTarget($this, "edit"), "edit", get_class($this));
1739 
1740  $tabs_gui->addTarget("system_check",
1741  $this->ctrl->getLinkTarget($this, "check"), array("check","viewScanLog","saveCheckParams","saveCheckCron"), get_class($this));
1742 
1743 // $tabs_gui->addTarget("benchmarks",
1744 // $this->ctrl->getLinkTarget($this, "benchmark"), "benchmark", get_class($this));
1745  }
1746 
1747  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
1748  {
1749  $tabs_gui->addTarget("perm_settings",
1750  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
1751  }
1752  }
1753 
1758  {
1759  phpinfo();
1760  exit;
1761  }
1762 
1763  //
1764  //
1765  // Server Info
1766  //
1767  //
1768 
1773  {
1774  global $tpl, $ilCtrl;
1775 
1776  $this->initServerInfoForm();
1777 
1778  $btpl = new ilTemplate("tpl.server_data.html", true, true, "Modules/SystemFolder");
1779  $btpl->setVariable("FORM", $this->form->getHTML());
1780  $btpl->setVariable("PHP_INFO_TARGET", $ilCtrl->getLinkTarget($this, "showPHPInfo"));
1781  $tpl->setContent($btpl->get());
1782  }
1783 
1789  public function initServerInfoForm()
1790  {
1791  global $lng, $ilClientIniFile, $ilSetting;
1792 
1793  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1794  $this->form = new ilPropertyFormGUI();
1795 
1796  // installation name
1797  $ne = new ilNonEditableValueGUI($lng->txt("inst_name"), "");
1798  $ne->setValue($ilClientIniFile->readVariable("client","name"));
1799  $ne->setInfo($ilClientIniFile->readVariable("client","description"));
1800  $this->form->addItem($ne);
1801 
1802  // client id
1803  $ne = new ilNonEditableValueGUI($lng->txt("client_id"), "");
1804  $ne->setValue(CLIENT_ID);
1805  $this->form->addItem($ne);
1806 
1807  // installation id
1808  $ne = new ilNonEditableValueGUI($lng->txt("inst_id"), "");
1809  $ne->setValue($ilSetting->get("inst_id"));
1810  $this->form->addItem($ne);
1811 
1812  // database version
1813  $ne = new ilNonEditableValueGUI($lng->txt("db_version"), "");
1814  $ne->setValue($ilSetting->get("db_version"));
1815  include_once ("./Services/Database/classes/class.ilDBUpdate.php");
1816  $dbupdate = new ilDBUpdate($this->ilias->db,true);
1817  if (!$dbupdate->getDBVersionStatus())
1818  {
1819  ilUtil::sendFailure($this->lng->txt("db_need_update"));
1820  }
1821  else if ($dbupdate->hotfixAvailable())
1822  {
1823  ilUtil::sendFailure($this->lng->txt("db_need_hotfix"));
1824  }
1825  $this->form->addItem($ne);
1826 
1827  // ilias version
1828  $ne = new ilNonEditableValueGUI($lng->txt("ilias_version"), "");
1829  $ne->setValue($ilSetting->get("ilias_version"));
1830  $this->form->addItem($ne);
1831 
1832  // host
1833  $ne = new ilNonEditableValueGUI($lng->txt("host"), "");
1834  $ne->setValue($_SERVER["SERVER_NAME"]);
1835  $this->form->addItem($ne);
1836 
1837  // ip & port
1838  $ne = new ilNonEditableValueGUI($lng->txt("ip_address")." & ".$this->lng->txt("port"), "");
1839  $ne->setValue($_SERVER["SERVER_ADDR"].":".$_SERVER["SERVER_PORT"]);
1840  $this->form->addItem($ne);
1841 
1842  // server
1843  $ne = new ilNonEditableValueGUI($lng->txt("server_software"), "");
1844  $ne->setValue($_SERVER["SERVER_SOFTWARE"]);
1845  $this->form->addItem($ne);
1846 
1847  // http path
1848  $ne = new ilNonEditableValueGUI($lng->txt("http_path"), "");
1849  $ne->setValue(ILIAS_HTTP_PATH);
1850  $this->form->addItem($ne);
1851 
1852  // absolute path
1853  $ne = new ilNonEditableValueGUI($lng->txt("absolute_path"), "");
1855  $this->form->addItem($ne);
1856 
1857  $not_set = $lng->txt("path_not_set");
1858 
1859  // convert
1860  $ne = new ilNonEditableValueGUI($lng->txt("path_to_convert"), "");
1861  $ne->setValue((PATH_TO_CONVERT) ? PATH_TO_CONVERT : $not_set);
1862  $this->form->addItem($ne);
1863 
1864  // zip
1865  $ne = new ilNonEditableValueGUI($lng->txt("path_to_zip"), "");
1866  $ne->setValue((PATH_TO_ZIP) ? PATH_TO_ZIP : $not_set);
1867  $this->form->addItem($ne);
1868 
1869  // unzip
1870  $ne = new ilNonEditableValueGUI($lng->txt("path_to_unzip"), "");
1871  $ne->setValue((PATH_TO_UNZIP) ? PATH_TO_UNZIP : $not_set);
1872  $this->form->addItem($ne);
1873 
1874  // java
1875  $ne = new ilNonEditableValueGUI($lng->txt("path_to_java"), "");
1876  $ne->setValue((PATH_TO_JAVA) ? PATH_TO_JAVA : $not_set);
1877  $this->form->addItem($ne);
1878 
1879  // htmldoc
1880  $ne = new ilNonEditableValueGUI($lng->txt("path_to_htmldoc"), "");
1881  $ne->setValue((PATH_TO_HTMLDOC) ? PATH_TO_HTMLDOC : $not_set);
1882  $this->form->addItem($ne);
1883 
1884  // mkisofs
1885  $ne = new ilNonEditableValueGUI($lng->txt("path_to_mkisofs"), "");
1886  $ne->setValue((PATH_TO_MKISOFS) ? PATH_TO_MKISOFS : $not_set);
1887  $this->form->addItem($ne);
1888 
1889  // latex
1890  $ne = new ilNonEditableValueGUI($lng->txt("url_to_latex"), "");
1891  $ne->setValue((URL_TO_LATEX) ? URL_TO_LATEX : $not_set);
1892  $this->form->addItem($ne);
1893 
1894 
1895  $this->form->setTitle($lng->txt("server_data"));
1896  $this->form->setFormAction($this->ctrl->getFormAction($this));
1897 
1898  }
1899 
1900  //
1901  //
1902  // General Settings
1903  //
1904  //
1905 
1909  function setGeneralSettingsSubTabs($a_activate)
1910  {
1911  global $ilTabs, $ilCtrl;
1912 
1913  $ilTabs->addSubTabTarget("basic_settings", $ilCtrl->getLinkTarget($this, "showBasicSettings"));
1914  $ilTabs->addSubTabTarget("header_title", $ilCtrl->getLinkTarget($this, "showHeaderTitle"));
1915  $ilTabs->addSubTabTarget("cron_jobs", $ilCtrl->getLinkTarget($this, "showCronJobs"));
1916  $ilTabs->addSubTabTarget("contact_data", $ilCtrl->getLinkTarget($this, "showContactInformation"));
1917  $ilTabs->addSubTabTarget("webservices", $ilCtrl->getLinkTarget($this, "showWebServices"));
1918  $ilTabs->addSubTabTarget("java_server", $ilCtrl->getLinkTarget($this, "showJavaServer"));
1919 
1920  $ilTabs->setSubTabActive($a_activate);
1921  $ilTabs->setTabActive("general_settings");
1922  }
1923 
1924  //
1925  //
1926  // Basic Settings
1927  //
1928  //
1929 
1934  {
1935  global $tpl;
1936 
1937  $this->initBasicSettingsForm();
1938  $this->setGeneralSettingsSubTabs("basic_settings");
1939 
1940  $tpl->setContent($this->form->getHTML());
1941  }
1942 
1943 
1947  public function initBasicSettingsForm()
1948  {
1949  global $lng, $ilSetting, $ilClientIniFile;
1950 
1951  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1952  $this->form = new ilPropertyFormGUI();
1953  $lng->loadLanguageModule("pd");
1954 
1955  // installation short title
1956  $ti = new ilTextInputGUI($this->lng->txt("short_inst_name"), "short_inst_name");
1957  $ti->setMaxLength(200);
1958  $ti->setSize(40);
1959  $ti->setValue($ilSetting->get("short_inst_name"));
1960  $ti->setInfo($this->lng->txt("short_inst_name_info"));
1961  $this->form->addItem($ti);
1962 
1963  // public section
1964  $cb = new ilCheckboxInputGUI($this->lng->txt("pub_section"), "pub_section");
1965  $cb->setInfo($lng->txt("pub_section_info"));
1966  if ($ilSetting->get("pub_section"))
1967  {
1968  $cb->setChecked(true);
1969  }
1970  // search engine
1971  include_once('Services/PrivacySecurity/classes/class.ilRobotSettings.php');
1972  $robot_settings = ilRobotSettings::_getInstance();
1973  $cb2 = new ilCheckboxInputGUI($this->lng->txt("search_engine"), "open_google");
1974  $cb2->setInfo($this->lng->txt("enable_search_engine"));
1975  $cb->addSubItem($cb2);
1976  if(!$robot_settings->checkModRewrite())
1977  {
1978  $cb2->setAlert($lng->txt("mod_rewrite_disabled"));
1979  $cb2->setChecked(false);
1980  $cb2->setDisabled(true);
1981  }
1982  elseif(!$robot_settings->checkRewrite())
1983  {
1984  $cb2->setAlert($lng->txt("allow_override_alert"));
1985  $cb2->setChecked(false);
1986  $cb2->setDisabled(true);
1987  }
1988  else
1989  {
1990  if ($ilSetting->get("open_google"))
1991  {
1992  $cb2->setChecked(true);
1993  }
1994  }
1995 
1996  // Enable Global Profiles
1997  $cb_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_global_profiles'), 'enable_global_profiles');
1998  $cb_prop->setInfo($lng->txt('pd_enable_global_profiles_info'));
1999  $cb_prop->setChecked($ilSetting->get('enable_global_profiles'));
2000  $cb->addSubItem($cb_prop);
2001 
2002  $this->form->addItem($cb);
2003 
2004  // default repository view
2005  $options = array(
2006  "flat" => $lng->txt("flatview"),
2007  "tree" => $lng->txt("treeview")
2008  );
2009  $si = new ilSelectInputGUI($this->lng->txt("def_repository_view"), "default_rep_view");
2010  $si->setOptions($options);
2011  $si->setInfo($this->lng->txt(""));
2012  if ($ilSetting->get("default_repository_view") == "tree")
2013  {
2014  $si->setValue("tree");
2015  }
2016  else
2017  {
2018  $si->setValue("flat");
2019  }
2020  $this->form->addItem($si);
2021 
2022  // repository access check
2023  $options = array(
2024  0 => "0",
2025  10 => "10",
2026  30 => "30",
2027  60 => "60",
2028  120 => "120"
2029  );
2030  $si = new ilSelectInputGUI($this->lng->txt("adm_repository_cache_time"), "rep_cache");
2031  $si->setOptions($options);
2032  $si->setValue($ilSetting->get("rep_cache"));
2033  $si->setInfo($this->lng->txt("adm_repository_cache_time_info"));
2034  $this->form->addItem($si);
2035 
2036  // load action commands asynchronously
2037  $cb = new ilCheckboxInputGUI($this->lng->txt("adm_item_cmd_asynch"), "item_cmd_asynch");
2038  $cb->setInfo($this->lng->txt("adm_item_cmd_asynch_info"));
2039  $cb->setChecked($ilSetting->get("item_cmd_asynch"));
2040  $this->form->addItem($cb);
2041 
2042  // locale
2043  $ti = new ilTextInputGUI($this->lng->txt("adm_locale"), "locale");
2044  $ti->setMaxLength(80);
2045  $ti->setSize(40);
2046  $ti->setInfo($this->lng->txt("adm_locale_info"));
2047  $ti->setValue($ilSetting->get("locale"));
2048  $this->form->addItem($ti);
2049 
2050 
2051  // trash
2052  $cb = new ilCheckboxInputGUI($this->lng->txt("enable_trash"), "enable_trash");
2053  $cb->setInfo($this->lng->txt("enable_trash_info"));
2054  if ($ilSetting->get("enable_trash"))
2055  {
2056  $cb->setChecked(true);
2057  }
2058  $this->form->addItem($cb);
2059 
2060  // session reminder
2061  $cb = new ilCheckboxInputGUI($this->lng->txt("session_reminder"), "session_reminder_enabled");
2062  $expires = $ilClientIniFile->readVariable("session", "expire");
2063  $time = ilFormat::_secondsToString($expires, true);
2064  $cb->setInfo($this->lng->txt("session_reminder_info")."<br />".
2065  sprintf($this->lng->txt('session_reminder_session_duration'), $time));
2066  if((int)$ilSetting->get("session_reminder_enabled"))
2067  {
2068  $cb->setChecked(true);
2069  }
2070  $this->form->addItem($cb);
2071 
2072  // password assistance
2073  $cb = new ilCheckboxInputGUI($this->lng->txt("enable_password_assistance"), "password_assistance");
2074  if ($ilSetting->get("password_assistance"))
2075  {
2076  $cb->setChecked(true);
2077  }
2078  $cb->setInfo($this->lng->txt("password_assistance_info"));
2079  $this->form->addItem($cb);
2080 
2081  // password generation
2082  $cb = new ilCheckboxInputGUI($this->lng->txt("passwd_generation"), "passwd_auto_generate");
2083  if ($ilSetting->get("passwd_auto_generate"))
2084  {
2085  $cb->setChecked(true);
2086  }
2087  $cb->setInfo($this->lng->txt("passwd_generation_info"));
2088  $this->form->addItem($cb);
2089 
2090  // dynamic web links
2091  $cb = new ilCheckboxInputGUI($this->lng->txt("links_dynamic"), "links_dynamic");
2092  $cb->setInfo($this->lng->txt("links_dynamic_info"));
2093  if ($ilSetting->get("links_dynamic"))
2094  {
2095  $cb->setChecked(true);
2096  }
2097  $this->form->addItem($cb);
2098 
2099  // Learners View
2100  $pl = new ilCheckboxInputGUI($this->lng->txt('preview_learner'),'preview_learner');
2101  $pl->setValue(1);
2102  $pl->setInfo($this->lng->txt('preview_learner_info'));
2103  $pl->setChecked($ilSetting->get('preview_learner'));
2104  $this->form->addItem($pl);
2105 
2106  // save and cancel commands
2107  $this->form->addCommandButton("saveBasicSettings", $lng->txt("save"));
2108 
2109  $this->form->setTitle($lng->txt("basic_settings"));
2110  $this->form->setFormAction($this->ctrl->getFormAction($this));
2111 
2112  }
2113 
2118  public function saveBasicSettingsObject()
2119  {
2120  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
2121 
2122  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
2123  {
2124  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
2125  }
2126 
2127  $this->initBasicSettingsForm();
2128  if ($this->form->checkInput())
2129  {
2130  $ilSetting->set("short_inst_name", $_POST["short_inst_name"]);
2131  $ilSetting->set("pub_section", $_POST["pub_section"]);
2132  $ilSetting->set("open_google", $_POST["open_google"]);
2133  $ilSetting->set("default_repository_view", $_POST["default_rep_view"]);
2134  $ilSetting->set("links_dynamic", $_POST["links_dynamic"]);
2135  $ilSetting->set("enable_trash", $_POST["enable_trash"]);
2136  $ilSetting->set("session_reminder_enabled", $_POST["session_reminder_enabled"]);
2137  $ilSetting->set("password_assistance", $_POST["password_assistance"]);
2138  $ilSetting->set("passwd_auto_generate", $_POST["passwd_auto_generate"]);
2139  $ilSetting->set("locale", $_POST["locale"]);
2140  $ilSetting->set('preview_learner',(int) $_POST['preview_learner']);
2141  $ilSetting->set('rep_cache',(int) $_POST['rep_cache']);
2142  $ilSetting->set('item_cmd_asynch',(int) $_POST['item_cmd_asynch']);
2143 
2144  $global_profiles = ($_POST["pub_section"])
2145  ? (int)$_POST['enable_global_profiles']
2146  : 0;
2147 
2148  $ilSetting->set('enable_global_profiles', $global_profiles);
2149 
2150  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2151  $ilCtrl->redirect($this, "showBasicSettings");
2152  }
2153  $this->setGeneralSettingsSubTabs("basic_settings");
2154  $this->form->setValuesByPost();
2155  $tpl->setContent($this->form->getHtml());
2156  }
2157 
2158  //
2159  //
2160  // Header title
2161  //
2162  //
2163 
2167  function showHeaderTitleObject($a_get_post_values = false)
2168  {
2169  global $tpl;
2170 
2171  $this->setGeneralSettingsSubTabs("header_title");
2172  include_once("./Services/Object/classes/class.ilObjectTranslationTableGUI.php");
2173  $table = new ilObjectTranslationTableGUI($this, "showHeaderTitle", false);
2174  if ($a_get_post_values)
2175  {
2176  $vals = array();
2177  foreach($_POST["title"] as $k => $v)
2178  {
2179  $vals[] = array("title" => $v,
2180  "desc" => $_POST["desc"][$k],
2181  "lang" => $_POST["lang"][$k],
2182  "default" => ($_POST["default"] == $k));
2183  }
2184  $table->setData($vals);
2185  }
2186  else
2187  {
2188  $data = $this->object->getHeaderTitleTranslations();
2189  if (is_array($data["Fobject"]))
2190  {
2191  foreach($data["Fobject"] as $k => $v)
2192  {
2193  if ($k == $data["default_language"])
2194  {
2195  $data["Fobject"][$k]["default"] = true;
2196  }
2197  else
2198  {
2199  $data["Fobject"][$k]["default"] = false;
2200  }
2201  }
2202  }
2203  else
2204  {
2205  $data["Fobject"] = array();
2206  }
2207  $table->setData($data["Fobject"]);
2208  }
2209  $tpl->setContent($table->getHTML());
2210  }
2211 
2216  {
2217  global $ilCtrl, $lng, $rbacsystem;
2218 
2219  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
2220  {
2221  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
2222  }
2223 
2224 // var_dump($_POST);
2225 
2226  // default language set?
2227  if (!isset($_POST["default"]) && count($_POST["lang"]) > 0)
2228  {
2229  ilUtil::sendFailure($lng->txt("msg_no_default_language"));
2230  return $this->showHeaderTitleObject(true);
2231  }
2232 
2233  // all languages set?
2234  if (array_key_exists("",$_POST["lang"]))
2235  {
2236  ilUtil::sendFailure($lng->txt("msg_no_language_selected"));
2237  return $this->showHeaderTitleObject(true);
2238  }
2239 
2240  // no single language is selected more than once?
2241  if (count(array_unique($_POST["lang"])) < count($_POST["lang"]))
2242  {
2243  ilUtil::sendFailure($lng->txt("msg_multi_language_selected"));
2244  return $this->showHeaderTitleObject(true);
2245  }
2246 
2247  // save the stuff
2248  $this->object->removeHeaderTitleTranslations();
2249  foreach($_POST["title"] as $k => $v)
2250  {
2251  $this->object->addHeaderTitleTranslation(
2253  ilUtil::stripSlashes($_POST["desc"][$k]),
2254  ilUtil::stripSlashes($_POST["lang"][$k]),
2255  ($_POST["default"] == $k));
2256  }
2257 
2258  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2259  $ilCtrl->redirect($this, "showHeaderTitle");
2260  }
2261 
2266  {
2267  global $ilCtrl, $lng;
2268 
2269  if (is_array($_POST["title"]))
2270  {
2271  foreach($_POST["title"] as $k => $v) {}
2272  }
2273  $k++;
2274  $_POST["title"][$k] = "";
2275  $this->showHeaderTitleObject(true);
2276  }
2277 
2282  {
2283  global $ilCtrl, $lng;
2284 //var_dump($_POST);
2285  foreach($_POST["title"] as $k => $v)
2286  {
2287  if ($_POST["check"][$k])
2288  {
2289  unset($_POST["title"][$k]);
2290  unset($_POST["desc"][$k]);
2291  unset($_POST["lang"][$k]);
2292  if ($k == $_POST["default"])
2293  {
2294  unset($_POST["default"]);
2295  }
2296  }
2297  }
2298  $this->saveHeaderTitlesObject();
2299  }
2300 
2301 
2302  //
2303  //
2304  // Cron Jobs
2305  //
2306  //
2307 
2312  {
2313  global $tpl;
2314 
2315  $this->initCronJobsForm();
2316  $this->setGeneralSettingsSubTabs("cron_jobs");
2317  $tpl->setContent($this->form->getHTML());
2318  }
2319 
2323  public function initCronJobsForm()
2324  {
2325  global $lng, $ilSetting;
2326 
2327  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2328  $this->form = new ilPropertyFormGUI();
2329 
2330  // check user accounts
2331  $cb = new ilCheckboxInputGUI($this->lng->txt("check_user_accounts"), "cron_user_check");
2332  $cb->setInfo($this->lng->txt("check_user_accounts_desc"));
2333  if ($ilSetting->get("cron_user_check"))
2334  {
2335  $cb->setChecked(true);
2336  }
2337  $this->form->addItem($cb);
2338 
2339  // link check
2340  $cb = new ilCheckboxInputGUI($this->lng->txt("check_link"), "cron_link_check");
2341  $cb->setInfo($this->lng->txt("check_link_desc"));
2342  if ($ilSetting->get("cron_link_check"))
2343  {
2344  $cb->setChecked(true);
2345  }
2346  $this->form->addItem($cb);
2347 
2348  // check web resources
2349  $options = array(
2350  "0" => $lng->txt("never"),
2351  "1" => $lng->txt("daily"),
2352  "2" => $lng->txt("weekly"),
2353  "3" => $lng->txt("monthly"),
2354  "4" => $lng->txt("quarterly")
2355  );
2356  $si = new ilSelectInputGUI($this->lng->txt("check_web_resources"), "cron_web_resource_check");
2357  $si->setOptions($options);
2358  $si->setInfo($this->lng->txt("check_web_resources_desc"));
2359  $si->setValue($ilSetting->get("cron_web_resource_check"));
2360  $this->form->addItem($si);
2361 
2362  // update lucene
2363  $cb = new ilCheckboxInputGUI($this->lng->txt("cron_lucene_index"), "cron_lucene_index");
2364  $cb->setInfo($this->lng->txt("cron_lucene_index_info"));
2365  if ($ilSetting->get("cron_lucene_index"))
2366  {
2367  $cb->setChecked(true);
2368  }
2369  $this->form->addItem($cb);
2370 
2371  // forum notifications
2372  $options = array(
2373  "0" => $lng->txt("cron_forum_notification_never"),
2374  "1" => $lng->txt("cron_forum_notification_directly"),
2375  "2" => $lng->txt("cron_forum_notification_cron"),
2376  );
2377  $si = new ilSelectInputGUI($this->lng->txt("cron_forum_notification"), "forum_notification");
2378  $si->setOptions($options);
2379  $si->setInfo($this->lng->txt("cron_forum_notification_desc"));
2380  $si->setValue($ilSetting->get("forum_notification"));
2381  $this->form->addItem($si);
2382 
2383  // mail notifications
2384  $options = array(
2385  "0" => $lng->txt("cron_mail_notification_never"),
2386  "1" => $lng->txt("cron_mail_notification_cron")
2387  );
2388  $si = new ilSelectInputGUI($this->lng->txt("cron_mail_notification"), "mail_notification");
2389  $si->setOptions($options);
2390  $si->setInfo($this->lng->txt("cron_mail_notification_desc"));
2391  $si->setValue($ilSetting->get("mail_notification"));
2392  $this->form->addItem($si);
2393 
2394  // disk quota and disk quota reminder mail
2395  $dq_settings = new ilSetting('disk_quota');
2396  $cb = new ilCheckboxInputGUI($this->lng->txt("enable_disk_quota"), "enable_disk_quota");
2397  $cb->setInfo($this->lng->txt("enable_disk_quota_info"));
2398  if ($dq_settings->get('enabled'))
2399  {
2400  $cb->setChecked(true);
2401  }
2402  $this->form->addItem($cb);
2403  $cb = new ilCheckboxInputGUI($this->lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail");
2404  $cb->setInfo($this->lng->txt("disk_quota_reminder_mail_desc"));
2405  if ($dq_settings->get('reminder_mail_enabled'))
2406  {
2407  $cb->setChecked(true);
2408  }
2409  $this->form->addItem($cb);
2410 
2411  $this->form->addCommandButton("saveCronJobs", $lng->txt("save"));
2412 
2413  $this->form->setTitle($lng->txt("cron_jobs"));
2414  $this->form->setDescription($lng->txt("cron_jobs_desc"));
2415  $this->form->setFormAction($this->ctrl->getFormAction($this));
2416 
2417  }
2418 
2423  public function saveCronJobsObject()
2424  {
2425  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
2426 
2427  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
2428  {
2429  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
2430  }
2431 
2432  $this->initCronJobsForm();
2433  if ($this->form->checkInput())
2434  {
2435  $ilSetting->set("cron_user_check", $_POST["cron_user_check"]);
2436  $ilSetting->set("cron_link_check", $_POST["cron_link_check"]);
2437  $ilSetting->set("cron_web_resource_check", $_POST["cron_web_resource_check"]);
2438  $ilSetting->set("cron_lucene_index", $_POST["cron_lucene_index"]);
2439  $ilSetting->set("forum_notification", $_POST["forum_notification"]);
2440  $ilSetting->set("mail_notification", $_POST["mail_notification"]);
2441 
2442  // disk quota and disk quota reminder mail
2443  $dq_settings = new ilSetting('disk_quota');
2444  $dq_settings->set('enabled', $_POST['enable_disk_quota'] ? 1 : 0);
2445  $dq_settings->set('reminder_mail_enabled', $_POST['enable_disk_quota_reminder_mail'] ? 1 : 0);
2446 
2447  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2448  $ilCtrl->redirect($this, "showCronJobs");
2449  }
2450  else
2451  {
2452  $this->setGeneralSettingsSubTabs("cron_jobs");
2453  $this->form->setValuesByPost();
2454  $tpl->setContent($this->form->getHtml());
2455  }
2456  }
2457 
2458  //
2459  //
2460  // Contact Information
2461  //
2462  //
2463 
2468  {
2469  global $tpl;
2470 
2471  $this->initContactInformationForm();
2472  $this->setGeneralSettingsSubTabs("contact_data");
2473  $tpl->setContent($this->form->getHTML());
2474  }
2475 
2479  public function initContactInformationForm()
2480  {
2481  global $lng, $ilSetting;
2482 
2483  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2484  $this->form = new ilPropertyFormGUI();
2485 
2486  // first name
2487  $ti = new ilTextInputGUI($this->lng->txt("firstname"), "admin_firstname");
2488  $ti->setMaxLength(64);
2489  $ti->setSize(40);
2490  $ti->setRequired(true);
2491  $ti->setValue($ilSetting->get("admin_firstname"));
2492  $this->form->addItem($ti);
2493 
2494  // last name
2495  $ti = new ilTextInputGUI($this->lng->txt("lastname"), "admin_lastname");
2496  $ti->setMaxLength(64);
2497  $ti->setSize(40);
2498  $ti->setRequired(true);
2499  $ti->setValue($ilSetting->get("admin_lastname"));
2500  $this->form->addItem($ti);
2501 
2502  // title
2503  $ti = new ilTextInputGUI($this->lng->txt("title"), "admin_title");
2504  $ti->setMaxLength(64);
2505  $ti->setSize(40);
2506  $ti->setValue($ilSetting->get("admin_title"));
2507  $this->form->addItem($ti);
2508 
2509  // position
2510  $ti = new ilTextInputGUI($this->lng->txt("position"), "admin_position");
2511  $ti->setMaxLength(64);
2512  $ti->setSize(40);
2513  $ti->setValue($ilSetting->get("admin_position"));
2514  $this->form->addItem($ti);
2515 
2516  // institution
2517  $ti = new ilTextInputGUI($this->lng->txt("institution"), "admin_institution");
2518  $ti->setMaxLength(200);
2519  $ti->setSize(40);
2520  $ti->setValue($ilSetting->get("admin_institution"));
2521  $this->form->addItem($ti);
2522 
2523  // street
2524  $ti = new ilTextInputGUI($this->lng->txt("street"), "admin_street");
2525  $ti->setMaxLength(64);
2526  $ti->setSize(40);
2527  //$ti->setRequired(true);
2528  $ti->setValue($ilSetting->get("admin_street"));
2529  $this->form->addItem($ti);
2530 
2531  // zip code
2532  $ti = new ilTextInputGUI($this->lng->txt("zipcode"), "admin_zipcode");
2533  $ti->setMaxLength(10);
2534  $ti->setSize(5);
2535  //$ti->setRequired(true);
2536  $ti->setValue($ilSetting->get("admin_zipcode"));
2537  $this->form->addItem($ti);
2538 
2539  // city
2540  $ti = new ilTextInputGUI($this->lng->txt("city"), "admin_city");
2541  $ti->setMaxLength(64);
2542  $ti->setSize(40);
2543  //$ti->setRequired(true);
2544  $ti->setValue($ilSetting->get("admin_city"));
2545  $this->form->addItem($ti);
2546 
2547  // country
2548  $ti = new ilTextInputGUI($this->lng->txt("country"), "admin_country");
2549  $ti->setMaxLength(64);
2550  $ti->setSize(40);
2551  //$ti->setRequired(true);
2552  $ti->setValue($ilSetting->get("admin_country"));
2553  $this->form->addItem($ti);
2554 
2555  // phone
2556  $ti = new ilTextInputGUI($this->lng->txt("phone"), "admin_phone");
2557  $ti->setMaxLength(64);
2558  $ti->setSize(40);
2559  //$ti->setRequired(true);
2560  $ti->setValue($ilSetting->get("admin_phone"));
2561  $this->form->addItem($ti);
2562 
2563  // email
2564  $ti = new ilTextInputGUI($this->lng->txt("email"), "admin_email");
2565  $ti->setMaxLength(64);
2566  $ti->setSize(40);
2567  $ti->setRequired(true);
2568  $ti->setValue($ilSetting->get("admin_email"));
2569  $this->form->addItem($ti);
2570 
2571  // feedback recipient
2572  $ti = new ilEmailInputGUI($this->lng->txt("feedback_recipient"), "feedback_recipient");
2573  $ti->setValue($ilSetting->get("feedback_recipient"));
2574  $this->form->addItem($ti);
2575 
2576  // error recipient
2577  $ti = new ilEmailInputGUI($this->lng->txt("error_recipient"), "error_recipient");
2578  $ti->setValue($ilSetting->get("error_recipient"));
2579  $this->form->addItem($ti);
2580 
2581  $this->form->addCommandButton("saveContactInformation", $lng->txt("save"));
2582 
2583  $this->form->setTitle($lng->txt("contact_data"));
2584  $this->form->setFormAction($this->ctrl->getFormAction($this));
2585 
2586  }
2587 
2593  {
2594  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
2595 
2596  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
2597  {
2598  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
2599  }
2600 
2601  $this->initContactInformationForm();
2602  if ($this->form->checkInput())
2603  {
2604  $fs = array("admin_firstname", "admin_lastname", "admin_title", "admin_position",
2605  "admin_institution", "admin_street", "admin_zipcode", "admin_city",
2606  "admin_country", "admin_phone", "admin_email",
2607  "feedback_recipient", "error_recipient");
2608  foreach ($fs as $f)
2609  {
2610  $ilSetting->set($f, $_POST[$f]);
2611  }
2612  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2613  $ilCtrl->redirect($this, "showContactInformation");
2614  }
2615  else
2616  {
2617  $this->setGeneralSettingsSubTabs("contact_data");
2618  $this->form->setValuesByPost();
2619  $tpl->setContent($this->form->getHtml());
2620  }
2621  }
2622 
2623  //
2624  //
2625  // Web Services
2626  //
2627  //
2628 
2633  {
2634  global $tpl;
2635 
2636  $this->initWebServicesForm();
2637  $this->setGeneralSettingsSubTabs("webservices");
2638  $tpl->setContent($this->form->getHTML());
2639  }
2640 
2644  public function initWebServicesForm()
2645  {
2646  global $lng, $ilSetting;
2647 
2648  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2649  $this->form = new ilPropertyFormGUI();
2650 
2651  // soap administration
2652  $cb = new ilCheckboxInputGUI($this->lng->txt("soap_user_administration"), "soap_user_administration");
2653  $cb->setInfo($this->lng->txt("soap_user_administration_desc"));
2654  if ($ilSetting->get("soap_user_administration"))
2655  {
2656  $cb->setChecked(true);
2657  }
2658  $this->form->addItem($cb);
2659 
2660  // wsdl path
2661  $wsdl = new ilTextInputGUI($this->lng->txt('soap_wsdl_path'), 'soap_wsdl_path');
2662  $wsdl->setInfo(sprintf($this->lng->txt('soap_wsdl_path_info'), "<br />'".ILIAS_HTTP_PATH."/webservice/soap/server.php?wsdl'"));
2663  $wsdl->setValue((string)$ilSetting->get('soap_wsdl_path'));
2664  $wsdl->setSize(60);
2665  $wsdl->setMaxLength(255);
2666  $this->form->addItem($wsdl);
2667 
2668  $this->form->addCommandButton("saveWebServices", $lng->txt("save"));
2669 
2670  $this->form->setTitle($lng->txt("webservices"));
2671  $this->form->setFormAction($this->ctrl->getFormAction($this));
2672 
2673  }
2674 
2679  public function saveWebServicesObject()
2680  {
2681  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
2682 
2683  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
2684  {
2685  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
2686  }
2687 
2688  $this->initWebServicesForm();
2689  if ($this->form->checkInput())
2690  {
2691  $ilSetting->set('soap_user_administration', $this->form->getInput('soap_user_administration'));
2692  $ilSetting->set('soap_wsdl_path', trim($this->form->getInput('soap_wsdl_path')));
2693 
2694  ilUtil::sendSuccess($lng->txt('msg_obj_modified'), true);
2695  $ilCtrl->redirect($this, 'showWebServices');
2696  }
2697  else
2698  {
2699  $this->setGeneralSettingsSubTabs("webservices");
2700  $this->form->setValuesByPost();
2701  $tpl->setContent($this->form->getHtml());
2702  }
2703  }
2704 
2705  //
2706  //
2707  // Java Server
2708  //
2709  //
2710 
2715  {
2716  global $tpl;
2717 
2718  $tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.java_settings.html','Modules/SystemFolder');
2719 
2720  $GLOBALS['lng']->loadLanguageModule('search');
2721 
2722  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
2723  $toolbar = new ilToolbarGUI();
2724  $toolbar->addButton($this->lng->txt('lucene_create_ini'),
2725  $this->ctrl->getLinkTarget($this,'createJavaServerIni'));
2726  $tpl->setVariable('ACTION_BUTTONS',$toolbar->getHTML());
2727 
2728  $this->initJavaServerForm();
2729  $this->setGeneralSettingsSubTabs("java_server");
2730  $tpl->setVariable('SETTINGS_TABLE',$this->form->getHTML());
2731  }
2732 
2737  public function createJavaServerIniObject()
2738  {
2739  #include_once './Services/WebServices/RPC/classes/classs.ilRPCServerSettings.php';
2740  #$ini = ilRPCServerSettings::createServerIni();
2741  #ilUtil::deliverData($ini, 'ilServer.ini','text/plain');
2742 
2743  $this->setGeneralSettingsSubTabs('java_server');
2744  $this->initJavaServerIniForm();
2745  $this->tpl->setContent($this->form->getHTML());
2746  }
2747 
2748  protected function initJavaServerIniForm()
2749  {
2750  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
2751 
2752  $this->form = new ilPropertyFormGUI();
2753 
2754  $GLOBALS['lng']->loadLanguageModule('search');
2755 
2756  $this->form->setTitle($this->lng->txt('lucene_tbl_create_ini'));
2757  $this->form->setFormAction($this->ctrl->getFormAction($this,'createJavaServerIni'));
2758  $this->form->addCommandButton('downloadJavaServerIni',$this->lng->txt('lucene_download_ini'));
2759  $this->form->addCommandButton('showJavaServer', $this->lng->txt('cancel'));
2760 
2761  // Host
2762  $ip = new ilTextInputGUI($this->lng->txt('lucene_host'),'ho');
2763  $ip->setInfo($this->lng->txt('lucene_host_info'));
2764  $ip->setMaxLength(128);
2765  $ip->setSize(32);
2766  $ip->setRequired(true);
2767  $this->form->addItem($ip);
2768 
2769  // Port
2770  $port = new ilNumberInputGUI($this->lng->txt('lucene_port'),'po');
2771  $port->setSize(5);
2772  $port->setMinValue(1);
2773  $port->setMaxValue(65535);
2774  $port->setRequired(true);
2775  $this->form->addItem($port);
2776 
2777  // Index Path
2778  $path = new ilTextInputGUI($this->lng->txt('lucene_index_path'),'in');
2779  $path->setSize(80);
2780  $path->setMaxLength(1024);
2781  $path->setInfo($this->lng->txt('lucene_index_path_info'));
2782  $path->setRequired(true);
2783  $this->form->addItem($path);
2784 
2785  // Logging
2786  $log = new ilTextInputGUI($this->lng->txt('lucene_log'),'lo');
2787  $log->setSize(80);
2788  $log->setMaxLength(1024);
2789  $log->setInfo($this->lng->txt('lucene_log_info'));
2790  $log->setRequired(true);
2791  $this->form->addItem($log);
2792 
2793  // Level
2794  $lev = new ilSelectInputGUI($this->lng->txt('lucene_level'),'le');
2795  $lev->setOptions(array(
2796  'DEBUG' => 'DEBUG',
2797  'INFO' => 'INFO',
2798  'WARN' => 'WARN',
2799  'ERROR' => 'ERROR',
2800  'FATAL' => 'FATAL'));
2801  $lev->setValue('INFO');
2802  $lev->setRequired(true);
2803  $this->form->addItem($lev);
2804 
2805  // CPU
2806  $cpu = new ilNumberInputGUI($this->lng->txt('lucene_cpu'),'cp');
2807  $cpu->setValue(1);
2808  $cpu->setSize(1);
2809  $cpu->setMaxLength(2);
2810  $cpu->setMinValue(1);
2811  $cpu->setRequired(true);
2812  $this->form->addItem($cpu);
2813 
2814  return true;
2815  }
2816 
2821  protected function downloadJavaServerIniObject()
2822  {
2823  $this->initJavaServerIniForm();
2824  if($this->form->checkInput())
2825  {
2826  include_once './Services/WebServices/RPC/classes/class.ilRpcIniFileWriter.php';
2827  $ini = new ilRpcIniFileWriter();
2828  $ini->setHost($this->form->getInput('ho'));
2829  $ini->setPort($this->form->getInput('po'));
2830  $ini->setIndexPath($this->form->getInput('in'));
2831  $ini->setLogPath($this->form->getInput('lo'));
2832  $ini->setLogLevel($this->form->getInput('le'));
2833  $ini->setNumThreads($this->form->getInput('cp'));
2834 
2835  $ini->write();
2836  ilUtil::deliverData($ini->getIniString(),'ilServer.ini','text/plain','utf-8');
2837  return true;
2838  }
2839 
2840  $this->form->setValuesByPost();
2841  ilUtil::sendFailure($this->lng->txt('err_check_input'));
2842  $this->setGeneralSettingsSubTabs('java_server');
2843  $this->tpl->setContent($this->form->getHTML());
2844  return true;
2845  }
2846 
2850  public function initJavaServerForm()
2851  {
2852  global $lng, $ilSetting;
2853 
2854  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2855  $this->form = new ilPropertyFormGUI();
2856 
2857  // host
2858  $ti = new ilTextInputGUI($this->lng->txt("java_server_host"), "rpc_server_host");
2859  $ti->setMaxLength(64);
2860  $ti->setSize(32);
2861  $ti->setValue($ilSetting->get("rpc_server_host"));
2862  $this->form->addItem($ti);
2863 
2864  // port
2865  $ti = new ilNumberInputGUI($this->lng->txt("java_server_port"), "rpc_server_port");
2866  $ti->setMaxLength(5);
2867  $ti->setSize(5);
2868  $ti->setValue($ilSetting->get("rpc_server_port"));
2869  $this->form->addItem($ti);
2870 
2871 
2872  // save and cancel commands
2873  $this->form->addCommandButton("saveJavaServer", $lng->txt("save"));
2874 
2875  $this->form->setTitle($lng->txt("java_server"));
2876  $this->form->setDescription($lng->txt("java_server_info").
2877  '<br /><a href="Services/WebServices/RPC/lib/README.txt" target="_blank">'.
2878  $lng->txt("java_server_readme").'</a>');
2879  $this->form->setFormAction($this->ctrl->getFormAction($this));
2880 
2881  }
2882 
2887  public function saveJavaServerObject()
2888  {
2889  global $tpl, $lng, $ilCtrl, $ilSetting, $rbacsystem;
2890 
2891  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
2892  {
2893  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
2894  }
2895 
2896  $this->initJavaServerForm();
2897  if ($this->form->checkInput())
2898  {
2899  $ilSetting->set("rpc_server_host", trim($_POST["rpc_server_host"]));
2900  $ilSetting->set("rpc_server_port", trim($_POST["rpc_server_port"]));
2901  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2902  $ilCtrl->redirect($this, "showJavaServer");
2903 
2904  // TODO check settings, ping server
2905  }
2906  else
2907  {
2908  $this->setGeneralSettingsSubTabs("java_server");
2909  $this->form->setValuesByPost();
2910  $tpl->setContent($this->form->getHtml());
2911  }
2912  }
2913 }
2914 ?>