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