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