ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
class.ilSetupGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once "./setup/classes/class.ilSetup.php";
5
15{
16 var $tpl; // template object
17 var $lng; // language objet
18 var $log; // log object
19
20 var $btn_prev_on = false; // toggle previous button on/off
21 var $btn_prev_cmd; // command processed when previous button was clicked
22 var $btn_prev_lng; // previous button label
23
24 var $btn_next_on = false; // toggle NEXT button on/off
25 var $btn_next_cmd; // command processed when next button was clicked
26 var $btn_next_lng; // next button label
27
28 var $revision; // cvs revision of this script
29 var $version; // cvs version of this script
30 var $lang; // current language (lang_key)
31
32 var $cmd; // command variable
33 var $display_mode = "view"; // view mode (setup or details)
34
39 function ilSetupGUI()
40 {
41 global $tpl, $lng;
42
43 $this->tpl = $tpl;
44 $this->lng = $lng;
45
46 // note: this is currently only used for subtabs, alex 8.1.2012
47 include_once("./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php");
48 $this->tabs = new ilTabsGUI();
49 $this->tabs->setSetupMode(true);
50
51 include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
52 iljQueryUtil::initjQuery($this->tpl);
53 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
55
56 $tpl->addJavaScript("./Services/JavaScript/js/Basic.js", 0);
57
58 include_once("./Services/UICore/classes/class.ilUIFramework.php");
59 ilUIFramework::init($this->tpl);
60
61 // CVS - REVISION - DO NOT MODIFY
62 $this->revision = '$Revision$';
63 $this->version = "2 ".substr(substr($this->revision,1),0,-2);
64 $this->lang = $this->lng->lang_key;
65
66 // init setup
67 $this->setup = new ilSetup($_SESSION["auth"],$_SESSION["access_mode"]);
68
69 // init client object if exists
70 $client_id = ($_GET["client_id"]) ? $_GET["client_id"] : $_SESSION["ClientId"];
71 if ($_POST["client_id"] != "")
72 {
73 $client_id = $_POST["client_id"];
74 }
75
76/*if ($_POST["client_id"] == "")
77{
78echo "<br>+".$_GET["client_id"];
79echo "<br>+".$_POST["client_id"];
80echo "<br>+".$_SESSION["ClientId"];
81echo "<br>+".$client_id;
82}*/
83 // for security
84 if (!$this->setup->isAdmin() and $client_id != $_SESSION["ClientId"])
85 {
86 $client_id = $_SESSION["ClientId"];
87 }
88
89 $this->client_id = $client_id;
90
91 $this->setup->ini_client_exists = $this->setup->newClient($client_id);
92 if (is_object($this->setup->getClient()))
93 {
94 $this->setup->getClient()->status = $this->setup->getStatus($client_id);
95 }
96
97 // determine command
98 if (($this->cmd = $_GET["cmd"]) == "gateway")
99 {
100 // surpress warning if POST is not set
101 @$this->cmd = key($_POST["cmd"]);
102 }
103
104 // determine display mode here
105 // TODO: depending on previous setting (session)
106 // OR switch to 'setup'-mode if someone logs in as client and client's setup wasn't finished (-> entry in settings table does not exist)
107 if ($this->setup->isAuthenticated() and !$this->setup->getClient()->status["finish"]["status"] and $this->cmd != "clientlist" and $this->cmd != "")
108 {
109 $this->setDisplayMode("setup");
110 }
111 else
112 {
113 $this->setDisplayMode($_SESSION["display_mode"]);
114 }
115
116 // output starts here
117
118
119 // main cmd handling
120 if (!$this->setup->isAuthenticated() or !$this->setup->isInstalled())
121 {
122 // check for first time installation or migrate an old one first
123 if (!$this->setup->isInstalled() or !($this->setup->ini->readVariable("clients","path")))
124 {
125 $this->cmdInstall();
126 }
127 else
128 {
129 if ($this->cmd == "performLogin" || $this->cmd == "performMLogin")
130 {
132 $this->$cmd();
133 }
134 else
135 {
136 $this->displayLogin();
137 }
138 }
139 }
140 else
141 {
142 if ($this->setup->isAdmin())
143 {
144 $this->cmdAdmin();
145 }
146 else
147 {
148 $this->cmdClient();
149 }
150 }
151
152 // display header
153 $this->displayHeader();
154
155 if (DEBUG)
156 {
157 echo "cmd: ".$this->cmd." | access: ".$this->setup->access_mode." | display: ".$this->display_mode;
158 var_dump($this->setup->getClient()->status);
159 }
160
161 // display footer
162 $this->displayFooter();
163
164 // end output
165
166 } // end constructor
167
168 // cmd subsets
169
173 function cmdInstall()
174 {
175 $cmd = $this->cmd;
176 switch ($this->cmd)
177 {
178 case NULL:
179 case "preliminaries":
180 $this->setup->checkPreliminaries();
181 $this->displayPreliminaries();
182 break;
183
184 case "install":
185 $this->displayMasterSetup();
186 break;
187
188 case "determineToolsPathInstall":
190 break;
191
192 case "saveBasicSettings":
193 $this->$cmd();
194 break;
195
196 default:
197 $this->displayError($this->lng->txt("unknown_command"));
198 break;
199 }
200 }
201
205 function cmdAdmin()
206 {
208
209 switch ($this->cmd)
210 {
211 case NULL:
212 case "clientlist":
213 $this->setDisplayMode("view");
214 $this->displayClientList();
215 $this->active_tab = "clientlist";
216 break;
217
218 case "changepassword":
219 $this->setDisplayMode("view");
220 $this->changeMasterPassword();
221 $this->active_tab = "password";
222 break;
223
224 case "mastersettings":
225 $this->setDisplayMode("view");
226 $this->changeMasterSettings();
227 $this->active_tab = "basicsettings";
228 break;
229
230 case "determineToolsPath":
231 $this->setDisplayMode("view");
232 $this->determineToolsPath();
233 break;
234
235 case "changedefault":
236 $this->changeDefaultClient();
237 break;
238
239 case "newclient":
240 $this->cmd = "selectdb";
241 $this->setDisplayMode("setup");
242 $this->setup->ini_client_exists = $this->setup->newClient();
243 $this->selectDBType();
244 break;
245
246 case "selectdbtype":
247 case "displayIni":
248 $this->cmd = "ini";
249 $this->setDisplayMode("setup");
250 //$this->setup->ini_client_exists = $this->setup->newClient($this->client_id);
251 $this->displayIni();
252 break;
253
254 case "startup":
255 $this->setDisplayMode("setup");
256 $this->setup->ini_client_exists = $this->setup->newClient();
257 $this->displayStartup();
258 break;
259
260 case "delete":
261 $this->setDisplayMode("view");
263 break;
264
265 case "togglelist":
266 $this->setDisplayMode("view");
267 $this->toggleClientList();
268 break;
269
270 case "preliminaries":
271 $this->setup->checkPreliminaries();
272 $this->displayPreliminaries();
273 $this->active_tab = "preliminaries";
274 break;
275
276 case "updateBasicSettings":
277 case "performLogin":
278 case "performMLogin":
279 $this->$cmd();
280 break;
281
282 default:
283 $this->cmdClient();
284 break;
285 }
286 }
287
291 function cmdClient()
292 {
293 $cmd = $this->cmd;
294 switch ($this->cmd)
295 {
296 case NULL:
297 case "view":
298 if ($this->setup->getClient()->db_installed)
299 {
300 $this->setDisplayMode("view");
301 $this->displayClientOverview();
302 }
303 else
304 {
305 $this->cmd = "db";
306 $this->displayDatabase();
307 }
308 break;
309
310 case "ini":
311 // only allow access to ini if db does not exist yet
312 //if ($this->setup->getClient()->db_installed)
313 //{
314 // $this->cmd = "db";
315 // $this->displayDatabase();
316 //}
317 //else
318 //{
319 $this->displayIni();
320 //}
321 break;
322
323 case "db":
324 $this->displayDatabase();
325 break;
326
327 case "dbslave":
328 $this->displayDatabaseSlave();
329 break;
330
331 case "sess":
332 if (!isset($_GET["lang"]) and !$this->setup->getClient()->status["finish"]["status"] and $_GET["cmd"] == "sess" and $this->setup->error === true)
333 {
335 }
336 else
337 {
338 $this->displaySessions();
339 }
340 break;
341
342 case "lang":
343 if (!isset($_GET["lang"]) and !$this->setup->getClient()->status["finish"]["status"] and $_GET["cmd"] == "lang" and $this->setup->error === true)
344 {
346 }
347 else
348 {
349 $this->displayLanguages();
350 }
351 break;
352
353 case "contact":
354 if (!isset($_GET["lang"]) and !$this->setup->getClient()->status["finish"]["status"] and $_GET["cmd"] == "contact")
355 {
357 }
358 else
359 {
360 $this->displayContactData();
361 }
362 break;
363
364 case "proxy":
365 if (!isset($_GET["lang"]) and !$this->setup->getClient()->status["finish"]["status"] and $_GET["cmd"] == "proxy")
366 {
368 }
369 else
370 {
371 $this->displayProxy();
372 }
373 break;
374
375 case "cache":
376 $this->displayCache();
377 break;
378
379
380 case "nic":
381 if (!isset($_GET["lang"]) and !$this->setup->getClient()->status["finish"]["status"] and $_GET["cmd"] == "nic")
382 {
384 }
385 else
386 {
387 $this->displayNIC();
388 }
389 break;
390
391 case "finish":
392 if (!isset($_GET["lang"]) and !$this->setup->getClient()->status["finish"]["status"] and $_GET["cmd"] == "finish")
393 {
395 }
396 else
397 {
398 $this->displayFinishSetup();
399 }
400 break;
401
402 case "changeaccess":
403 $this->changeAccessMode($_GET["back"]);
404 break;
405
406 case "logout":
407 $this->displayLogout();
408 break;
409
410 case "login":
411 session_destroy();
412 ilUtil::redirect(ILIAS_HTTP_PATH."/login.php?client_id=".$this->setup->getClient()->getId());
413 break;
414
415 case "login_new":
416 if ($this->setup->getClient()->ini->readVariable("client","access") != "1")
417 {
418 $this->setup->getClient()->ini->setVariable("client","access","1");
419 $this->setup->getClient()->ini->write();
420 }
421
422 session_destroy();
423 ilUtil::redirect(ILIAS_HTTP_PATH."/login.php?client_id=".$this->setup->getClient()->getId());
424 break;
425
426 case "tools":
427 $this->displayTools();
428 break;
429
430 case "reloadStructure":
431 $this->reloadControlStructure();
432 break;
433
434 case 'switchTree':
435 $this->switchTree();
436 break;
437
438 case "saveClientIni":
439 case "installDatabase":
440 case "displayDatabase":
441 case "updateDatabase":
442 case "showUpdateSteps":
443 case "saveLanguages":
444 case "saveContact":
445 case "displayContactData":
446 case "displayNIC":
447 case "saveRegistration":
448 case "applyHotfix":
449 case "showHotfixSteps":
450 case "applyCustomUpdates":
451 case "changeSettingsType":
452 case "showLongerSettings":
453 case "cloneSelectSource":
454 case "cloneSaveSource":
455 case "saveProxy":
456 case "displayPassword":
457 case "savePassword":
458 case "saveDbSlave":
459 case "saveCache":
460 $this->$cmd();
461 break;
462
463 default:
464 $this->displayError($this->lng->txt("unknown_command"));
465 break;
466 }
467 }
468
469 // end cmd subsets
470
474
483 function setDisplayMode($a_mode)
484 {
485 // security
486 if ($a_mode != "view" and $a_mode != "setup")
487 {
488 return false;
489 }
490
491 $this->display_mode = $a_mode;
492 $_SESSION["display_mode"] = $this->display_mode;
493
494 return true;
495 }
496
500 function displayHeader()
501 {
502 $languages = $this->lng->getLanguages();
503
504 $count = (int) round(count($languages) / 2);
505 $num = 1;
506
507 foreach ($languages as $lang_key)
508 {
509 /*
510 if ($num === $count)
511 {
512 $this->tpl->touchBlock("lng_new_row");
513 }
514 */
515 $this->tpl->setCurrentBlock("languages");
516 $this->tpl->setVariable("LINK_LANG", "./setup.php?cmd=".$this->cmd."&amp;lang=".$lang_key);
517 $this->tpl->setVariable("LANG_NAME", $this->lng->txt("meta_l_".$lang_key));
518 $this->tpl->setVariable("LANG_ICON", $lang_key);
519 $this->tpl->setVariable("LANG_KEY", $lang_key);
520 $this->tpl->setVariable("BORDER", 0);
521 $this->tpl->setVariable("VSPACE", 0);
522 $this->tpl->parseCurrentBlock();
523
524 $num++;
525 }
526
527 if (count($languages) % 2)
528 {
529 $this->tpl->touchBlock("lng_empty_cell");
530 }
531
532 if ($this->cmd != "logout" and $this->setup->isInstalled() and $this->setup->isAuthenticated())
533 {
534 // add client link
535 if ($this->setup->isAdmin())
536 {
537 if ($this->display_mode == "view" or $this->cmd == "clientlist" or $this->cmd == "changepassword" or $this->cmd == "mastersettings")
538 {
539 $this->tpl->setCurrentBlock("add_client");
540 $this->tpl->setVariable("TXT_ADD_CLIENT",ucfirst($this->lng->txt("new_client")));
541 $this->tpl->parseCurrentBlock();
542 }
543
544 // client list link
545 $class = ($this->active_tab == "clientlist")
546 ? "ilSMActive"
547 : "ilSMInactive";
548 $this->tpl->setCurrentBlock("display_list");
549 $this->tpl->setVariable("TXT_LIST",ucfirst($this->lng->txt("list_clients")));
550 $this->tpl->setVariable("TAB_CLASS", $class);
551 $this->tpl->parseCurrentBlock();
552
553 // edit paths link
554 $class = ($this->active_tab == "basicsettings")
555 ? "ilSMActive"
556 : "ilSMInactive";
557 $this->tpl->setCurrentBlock("edit_pathes");
558 $this->tpl->setVariable("TXT_EDIT_PATHES",$this->lng->txt("basic_settings"));
559 $this->tpl->setVariable("TAB_CLASS", $class);
560 $this->tpl->parseCurrentBlock();
561
562 // preliminaries
563 $class = ($this->active_tab == "preliminaries")
564 ? "ilSMActive"
565 : "ilSMInactive";
566 $this->tpl->setCurrentBlock("preliminaries");
567 $this->tpl->setVariable("TXT_PRELIMINARIES",$this->lng->txt("preliminaries"));
568 $this->tpl->setVariable("TAB_CLASS", $class);
569 $this->tpl->parseCurrentBlock();
570
571 // change password link
572 $class = ($this->active_tab == "password")
573 ? "ilSMActive"
574 : "ilSMInactive";
575 $this->tpl->setCurrentBlock("change_password");
576 $this->tpl->setVariable("TXT_CHANGE_PASSWORD",ucfirst($this->lng->txt("password")));
577 $this->tpl->setVariable("TAB_CLASS", $class);
578 $this->tpl->parseCurrentBlock();
579 }
580
581 // logout link
582 if ($this->setup->isAuthenticated())
583 {
584 $this->tpl->setCurrentBlock("logout");
585 $this->tpl->setVariable("TXT_LOGOUT",$this->lng->txt("logout"));
586 $this->tpl->parseCurrentBlock();
587 }
588 }
589
590 $this->tpl->setVariable("VAL_CMD", $_GET["cmd"]);
591 $this->tpl->setVariable("TXT_OK",$this->lng->txt("change"));
592 $this->tpl->setVariable("TXT_CHOOSE_LANGUAGE",$this->lng->txt("choose_language"));
593 $this->tpl->setVariable("PAGETITLE","Setup");
594 //$this->tpl->setVariable("LOCATION_STYLESHEET","./templates/blueshadow.css");
595 $this->tpl->setVariable("LOCATION_STYLESHEET","../templates/default/delos.css");
596 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET","./css/setup.css");
597 $this->tpl->setVariable("TXT_ILIAS_VERSION", "ILIAS ".ILIAS_VERSION);
598 $this->tpl->setVariable("TXT_SETUP",$this->lng->txt("setup"));
599 $this->tpl->setVariable("VERSION", $this->version);
600 $this->tpl->setVariable("TXT_VERSION", $this->lng->txt("version"));
601 $this->tpl->setVariable("LANG", $this->lang);
602 }
603
607 function displayFooter()
608 {
609 // footer (not really)
610 if ($this->cmd != "logout")
611 {
612 if ($this->setup->ini_ilias_exists and $this->display_mode == "setup" and $this->setup->getClient()->getId() != "")
613 {
614 $this->tpl->setVariable("TXT_ACCESS_MODE","(".$this->lng->txt("client_id").": ".$this->setup->getClient()->getId().")");
615 }
616 elseif ($this->setup->isAdmin())
617 {
618 $this->tpl->setVariable("TXT_ACCESS_MODE","(".$this->lng->txt("root_access").")");
619 }
620
621 $this->displayNavButtons();
622 }
623
624 $this->tpl->show();
625 }
626
633 {
634 if (!$this->btn_prev_on and !$this->btn_next_on)
635 {
636 return false;
637 }
638
639 $ntpl = new ilTemplate("tpl.navbuttons.html", true, true, "setup");
640 //$this->tpl->addBlockFile("NAVBUTTONS","navbuttons","tpl.navbuttons.html", "setup");
641
642 $ntpl->setVariable("FORMACTION_BUTTONS","setup.php?cmd=gateway");
643
644 if ($this->btn_prev_on)
645 {
646 $ntpl->setCurrentBlock("btn_back");
647 $ntpl->setVariable("TXT_PREV", $this->btn_prev_lng);
648 $ntpl->setVariable("CMD_PREV", $this->btn_prev_cmd);
649 $ntpl->parseCurrentBlock();
650 }
651
652 if ($this->btn_next_on)
653 {
654 $ntpl->setCurrentBlock("btn_forward");
655 $ntpl->setVariable("TXT_NEXT", $this->btn_next_lng);
656 $ntpl->setVariable("CMD_NEXT", $this->btn_next_cmd);
657 $ntpl->parseCurrentBlock();
658 }
659
660 $nav_html = $ntpl->get();
661 $this->tpl->setVariable("NAVBUTTONS", $nav_html);
662 if (!$this->no_second_nav)
663 {
664 $this->tpl->setVariable("NAVBUTTONS2", $nav_html);
665 }
666 return true;
667 }
668
675 function SetButtonPrev($a_cmd = 0,$a_lng = 0)
676 {
677 $this->btn_prev_on = true;
678 $this->btn_prev_cmd = ($a_cmd) ? $a_cmd : "gateway";
679 $this->btn_prev_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt("prev");
680 }
681
688 function SetButtonNext($a_cmd,$a_lng = 0)
689 {
690 $this->btn_next_on = true;
691 $this->btn_next_cmd = ($a_cmd) ? $a_cmd : "gateway";
692 $this->btn_next_lng = ($a_lng) ? $this->lng->txt($a_lng) : $this->lng->txt("next");
693 }
694
698
703 {
704 $this->checkDisplayMode();
705
706 // disable/enable button
707 $btpl = new ilTemplate("tpl.buttons.html", true, true, "setup");
708 $btpl->setCurrentBlock("btn");
709 $btpl->setVariable("CMD", "changeaccess");
710 $access_button = ($this->setup->getClient()->status["access"]["status"]) ? "disable" : "enable";
711 $btpl->setVariable("TXT", $this->lng->txt($access_button));
712 $btpl->setVariable("FORMACTION", "setup.php?cmd=gateway");
713 $btpl->parseCurrentBlock();
714 $this->tpl->setVariable("BUTTONS", $btpl->get());
715
716 $this->initClientOverviewForm();
717 $this->tpl->setVariable("SETUP_CONTENT", $this->form->getHTML());
718
719 $this->displayStatusPanel();
720 }
721
725 public function initClientOverviewForm()
726 {
727 global $lng, $ilCtrl;
728
729 $settings = $this->setup->getClient()->getAllSettings();
730
731 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
732 $this->form = new ilPropertyFormGUI();
733
734 $this->form->setTitle($lng->txt("client_info"));
735
736 // installation name
737 $ne = new ilNonEditableValueGUI($lng->txt("inst_name"), "inst_name");
738 $ne->setValue(($this->setup->getClient()->getName())
739 ? $this->setup->getClient()->getName()
740 : "&lt;".$this->lng->txt("no_client_name")."&gt;");
741 $ne->setInfo($this->setup->getClient()->getDescription());
742 $this->form->addItem($ne);
743
744 // client id
745 $ne = new ilNonEditableValueGUI($lng->txt("client_id"), "client_id");
746 $ne->setValue($this->setup->getClient()->getId());
747 $this->form->addItem($ne);
748
749 // nic id
750 $ne = new ilNonEditableValueGUI($lng->txt("ilias_nic_id"), "nic_id");
751 $ne->setValue(($this->setup->getClient()->db_installed)
752 ? $settings["inst_id"]
753 : $txt_no_database);
754 $this->form->addItem($ne);
755
756 // database version
757 $ne = new ilNonEditableValueGUI($lng->txt("db_version"), "db_vers");
758 $ne->setValue(($this->setup->getClient()->db_installed)
759 ? $settings["db_version"]
760 : $txt_no_database);
761 $this->form->addItem($ne);
762
763 // access status
764 $ne = new ilNonEditableValueGUI($lng->txt("access_status"), "status");
765 //$access_link = "&nbsp;&nbsp;[<a href=\"setup.php?cmd=changeaccess&client_id=".$this->setup->getClient()->getId()."&back=view\">".$this->lng->txt($access_button)."</a>]";
766 $access_status = ($this->setup->getClient()->status["access"]["status"]) ? "online" : "disabled";
767 $ne->setValue($this->lng->txt($access_status).$access_link);
768 $this->form->addItem($ne);
769
770 // server information
771 $sh = new ilFormSectionHeaderGUI();
772 $sh->setTitle($this->lng->txt("server_info"));
773 $this->form->addItem($sh);
774
775 // ilias version
776 $ne = new ilNonEditableValueGUI($lng->txt("ilias_version"), "il_vers");
777 $ne->setValue(ILIAS_VERSION);
778 $this->form->addItem($ne);
779
780 // host
781 $ne = new ilNonEditableValueGUI($lng->txt("host"), "host");
782 $ne->setValue($_SERVER["SERVER_NAME"]);
783 $this->form->addItem($ne);
784
785 // ip address and port
786 $ne = new ilNonEditableValueGUI($lng->txt("ip_address")." & ".
787 $lng->txt("port"));
788 $ne->setValue($_SERVER["SERVER_ADDR"].":".$_SERVER["SERVER_PORT"]);
789 $this->form->addItem($ne);
790
791 // server software
792 $ne = new ilNonEditableValueGUI($lng->txt("server_software"), "server_softw");
793 $ne->setValue($_SERVER["SERVER_SOFTWARE"]);
794 $this->form->addItem($ne);
795
796 // http path
797 $ne = new ilNonEditableValueGUI($lng->txt("http_path"), "http_path");
798 $ne->setValue(ILIAS_HTTP_PATH);
799 $this->form->addItem($ne);
800
801 // absolute path
802 $ne = new ilNonEditableValueGUI($lng->txt("absolute_path"), "absolute_path");
803 $ne->setValue(ILIAS_ABSOLUTE_PATH);
804 $this->form->addItem($ne);
805
806 // third party tools
807 $sh = new ilFormSectionHeaderGUI();
808 $sh->setTitle($this->lng->txt("3rd_party_software"));
809 $this->form->addItem($sh);
810
811 $tools = array("convert", "zip", "unzip", "ghostscript", "java", "htmldoc", "ffmpeg");
812
813 foreach ($tools as $tool)
814 {
815 // tool
816 $ne = new ilNonEditableValueGUI($lng->txt($tool."_path"), $tool."_path");
817 $p = $this->setup->ini->readVariable("tools", $tool);
818 $ne->setValue($p ? $p : $this->lng->txt("not_configured"));
819 $this->form->addItem($ne);
820 }
821
822 // latex
823 $ne = new ilNonEditableValueGUI($lng->txt("url_to_latex"), "latex_url");
824 $p = $this->setup->ini->readVariable("tools", "latex"); // #13109
825 $ne->setValue($p ? $p : $this->lng->txt("not_configured"));
826 $this->form->addItem($ne);
827
828 // virus scanner
829 $ne = new ilNonEditableValueGUI($lng->txt("virus_scanner"), "vscan");
830 $ne->setValue($this->setup->ini->readVariable("tools","vscantype"));
831 $this->form->addItem($ne);
832
833 // scan command
834 $ne = new ilNonEditableValueGUI($lng->txt("scan_command"), "scan");
835 $p = $this->setup->ini->readVariable("tools","scancommand");
836 $ne->setValue($p ? $p : $this->lng->txt("not_configured"));
837 $this->form->addItem($ne);
838
839 // clean command
840 $ne = new ilNonEditableValueGUI($lng->txt("clean_command"), "clean");
841 $p = $this->setup->ini->readVariable("tools","cleancommand");
842 $ne->setValue($p ? $p : $this->lng->txt("not_configured"));
843 $this->form->addItem($ne);
844
845 $this->form->setFormAction("setup.php?cmd=gateway");
846 }
847
851
856 {
857 $OK = "<font color=\"green\"><strong>OK</strong></font>";
858 $FAILED = "<strong><font color=\"red\">FAILED</font></strong>";
859
860 $this->tpl->addBlockFile("CONTENT","content","tpl.preliminaries.html", "setup");
861
862 $this->tpl->setVariable("TXT_SETUP_TITLE",$this->lng->txt("ilias_setup"));
863 $this->tpl->setVariable("TXT_SETUP_WELCOME", $this->lng->txt("setup_welcome"));
864 $this->tpl->setVariable("TXT_SETUP_INIFILE_DESC", $this->lng->txt("setup_inifile_desc"));
865 $this->tpl->setVariable("TXT_SETUP_DATABASE_DESC", $this->lng->txt("setup_database_desc"));
866 $this->tpl->setVariable("TXT_SETUP_LANGUAGES_DESC", $this->lng->txt("setup_languages_desc"));
867 $this->tpl->setVariable("TXT_SETUP_PASSWORD_DESC", $this->lng->txt("setup_password_desc"));
868 $this->tpl->setVariable("TXT_SETUP_NIC_DESC", $this->lng->txt("setup_nic_desc"));
869
870 $server_os = php_uname();
871 $server_web = $_SERVER["SERVER_SOFTWARE"];
872 $environment = $this->lng->txt("env_using")." ".$server_os." <br/>".$this->lng->txt("with")." ".$server_web;
873
874 if ((stristr($server_os,"linux") || stristr($server_os,"windows")) && stristr($server_web,"apache"))
875 {
876 $env_comment = $this->lng->txt("env_ok");
877 }
878 else
879 {
880 $env_comment = "<font color=\"red\">".$this->lng->txt("env_warning")."</font>";
881 }
882
883 $this->tpl->setVariable("TXT_ENV_TITLE", $this->lng->txt("environment"));
884 $this->tpl->setVariable("TXT_ENV_INTRO", $environment);
885 $this->tpl->setVariable("TXT_ENV_COMMENT", $env_comment);
886
887 $this->tpl->setVariable("TXT_PRE_TITLE", $this->lng->txt("preliminaries"));
888 $this->tpl->setVariable("TXT_PRE_INTRO", $this->lng->txt("pre_intro"));
889
890 $preliminaries = array("php", "root", "folder_create",
891 "cookies_enabled", "dom", "xsl", "gd", "memory");
892 if ($this->setup->hasOpCacheEnabled()) {
893 $preliminaries[] = 'load_comments';
894 }
895
896 foreach ($preliminaries as $preliminary)
897 {
898 $this->tpl->setCurrentBlock("preliminary");
899 $this->tpl->setVariable("TXT_PRE", $this->lng->txt("pre_".$preliminary));
900 if ($this->setup->preliminaries_result[$preliminary]["status"] == true)
901 {
902 $this->tpl->setVariable("STATUS_PRE", $OK);
903 }
904 else
905 {
906 $this->tpl->setVariable("STATUS_PRE", $FAILED);
907 }
908 $this->tpl->setVariable("COMMENT_PRE", $this->setup->preliminaries_result[$preliminary]["comment"]);
909 $this->tpl->parseCurrentBlock();
910 }
911
912 // summary
913 if ($this->setup->preliminaries === true)
914 {
915 if ($this->setup->isInstalled())
916 {
917 $cmd = "mastersettings";
918 }
919 else
920 {
921 $cmd = "install";
922 }
923 $btn_text = ($this->cmd == "preliminaries") ? "" : "installation";
924//echo "-".$this->display_mode."-";
925 $this->setButtonNext($cmd,$btn_text);
926 }
927 else
928 {
929 $this->tpl->setCurrentBlock("premessage");
930 $this->tpl->setVariable("TXT_PRE_ERR", sprintf($this->lng->txt("pre_error"),
931 "http://www.ilias.de/docu/goto.php?target=pg_6531_367&client_id=docu"));
932 $this->tpl->parseCurrentBlock();
933 }
934 }
935
939
943 function displayMasterSetup($a_omit_init = false)
944 {
945 $this->tpl->addBlockFile("CONTENT","content","tpl.std_layout.html", "setup");
946 $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("basic_settings"));
947 $this->tpl->setVariable("TXT_INFO",
948 $this->lng->txt("info_text_first_install")."<br/>".$this->lng->txt("info_text_pathes"));
949
950 $this->setButtonPrev("preliminaries");
951
952 if ($this->setup->isInstalled())
953 {
954 $this->setButtonNext("list");
955 }
956
957 if (!$a_omit_init)
958 {
959 $this->initBasicSettingsForm(true);
960 }
961 $this->tpl->setVariable("SETUP_CONTENT", "<br>".$this->form->getHTML()."<br>");
962 }
963
967 function changeMasterSettings($a_omit_init = false)
968 {
969 $this->tpl->addBlockFile("CONTENT","content","tpl.std_layout.html", "setup");
970 $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("basic_settings"));
971 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_pathes"));
972
973 $this->btn_next_on = true;
974 $this->btn_next_lng = $this->lng->txt("create_new_client")."...";
975 $this->btn_next_cmd = "newclient";
976
977 if (!$a_omit_init)
978 {
979 $this->initBasicSettingsForm();
980 $this->getBasicSettingsValues();
981 }
982 $this->tpl->setVariable("SETUP_CONTENT", "<br>".$this->form->getHTML()."<br>");
983 }
984
988 public function initBasicSettingsForm($a_install = false)
989 {
990 global $lng, $ilCtrl;
991
992 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
993 $this->form = new ilPropertyFormGUI();
994
995 // webspace dir
996 $ne = new ilNonEditableValueGUI($lng->txt("data_directory_in_ws"), "webspace_dir");
997 if ($a_install)
998 {
999 $ne->setInfo($this->lng->txt("data_directory_in_ws_info"));
1000 }
1001 $cwd = ilUtil::isWindows()
1002 ? str_replace("\\", "/", getcwd())
1003 : getcwd();
1004
1005 $ne->setValue($cwd."/data");
1006 $this->form->addItem($ne);
1007
1008 // data dir
1009 if ($a_install)
1010 {
1011 $ti = new ilTextInputGUI($lng->txt("data_directory_outside_ws"), "datadir_path");
1012 $ti->setInfo($lng->txt("data_directory_info"));
1013 $ti->setRequired(true);
1014 $this->form->addItem($ti);
1015 }
1016 else
1017 {
1018 $ne = new ilNonEditableValueGUI($lng->txt("data_directory_outside_ws"), "data_dir");
1019 $this->form->addItem($ne);
1020 }
1021
1022 $lvext = (ilUtil::isWindows())
1023 ? "_win"
1024 : "";
1025
1026
1027 // logging
1028 $sh = new ilFormSectionHeaderGUI();
1029 $sh->setTitle($lng->txt("logging"));
1030 $this->form->addItem($sh);
1031
1032 // path to log file
1033 $ti = new ilTextInputGUI($lng->txt("log_path"), "log_path");
1034 $ti->setInfo($lng->txt("log_path_comment".$lvext));
1035 $this->form->addItem($ti);
1036
1037 // disable logging
1038 $cb = new ilCheckboxInputGUI($lng->txt("disable_logging"), "chk_log_status");
1039 $this->form->addItem($cb);
1040
1041 // server settings
1042 $sh = new ilFormSectionHeaderGUI();
1043 $sh->setTitle($lng->txt("server_settings"));
1044 $this->form->addItem($sh);
1045
1046 // time zone
1047 include_once("./Services/Calendar/classes/class.ilCalendarUtil.php");
1048 $si = new ilSelectInputGUI($lng->txt("time_zone"), "time_zone");
1049 $si->setOptions(array_merge(
1050 array("" => "-- ".$lng->txt("please_select")." --"),
1052 $si->setRequired(true);
1053 $this->form->addItem($si);
1054
1055 // https settings
1056 $sh = new ilFormSectionHeaderGUI();
1057 $sh->setTitle($lng->txt("https_settings"));
1058 $this->form->addItem($sh);
1059
1060 $check = new ilCheckboxInputGUI($lng->txt('ps_auto_https'),'auto_https_detect_enabled');
1061 $check->setOptionTitle($lng->txt('ps_auto_https_description'));
1062 $check->setValue(1);
1063
1064 $text = new ilTextInputGUI($lng->txt('ps_auto_https_header_name'),'auto_https_detect_header_name');
1065 $text->setSize(24);
1066 $text->setMaxLength(64);
1067 $text->setRequired(true);
1068 $check->addSubItem($text);
1069
1070 $text = new ilTextInputGUI($lng->txt('ps_auto_https_header_value'),'auto_https_detect_header_value');
1071 $text->setSize(24);
1072 $text->setMaxLength(64);
1073 $text->setRequired(true);
1074 $check->addSubItem($text);
1075
1076 $this->form->addItem($check);
1077
1078 // required 3rd party tools
1079 $sh = new ilFormSectionHeaderGUI();
1080 $sh->setTitle($lng->txt("3rd_party_software_req"));
1081 $this->form->addItem($sh);
1082
1083 // convert path
1084 $ti = new ilTextInputGUI($lng->txt("convert_path"), "convert_path");
1085 $ti->setInfo($lng->txt("convert_path_comment".$lvext));
1086 $ti->setRequired(true);
1087 $this->form->addItem($ti);
1088
1089 // zip path
1090 $ti = new ilTextInputGUI($lng->txt("zip_path"), "zip_path");
1091 $ti->setInfo($lng->txt("zip_path_comment".$lvext));
1092 $ti->setRequired(true);
1093 $this->form->addItem($ti);
1094
1095 // unzip path
1096 $ti = new ilTextInputGUI($lng->txt("unzip_path"), "unzip_path");
1097 $ti->setInfo($lng->txt("unzip_path_comment".$lvext));
1098 $ti->setRequired(true);
1099 $this->form->addItem($ti);
1100
1101 // optional 3rd party tools
1102 $sh = new ilFormSectionHeaderGUI();
1103 $sh->setTitle($lng->txt("3rd_party_software_opt"));
1104 $this->form->addItem($sh);
1105
1106 // ghostscript path
1107 $ti = new ilTextInputGUI($lng->txt("ghostscript_path"), "ghostscript_path");
1108 $ti->setInfo($lng->txt("ghostscript_path_comment".$lvext));
1109 $this->form->addItem($ti);
1110
1111 // java path
1112 $ti = new ilTextInputGUI($lng->txt("java_path"), "java_path");
1113 $ti->setInfo($lng->txt("java_path_comment".$lvext));
1114 $this->form->addItem($ti);
1115
1116 // htmldoc path
1117 $ti = new ilTextInputGUI($lng->txt("htmldoc_path"), "htmldoc_path");
1118 $ti->setInfo($lng->txt("htmldoc_path_comment".$lvext));
1119 $this->form->addItem($ti);
1120
1121 // ffmpeg path
1122 $ti = new ilTextInputGUI($lng->txt("ffmpeg_path"), "ffmpeg_path");
1123 $ti->setInfo($lng->txt("ffmpeg_path_comment"));
1124 $this->form->addItem($ti);
1125
1126 // latex
1127 $ti = new ilTextInputGUI($lng->txt("url_to_latex"), "latex_url");
1128 $ti->setInfo($lng->txt("latex_url_comment"));
1129 $this->form->addItem($ti);
1130
1131 // virus scanner
1132 $options = array(
1133 "none" => $lng->txt("none"),
1134 "sophos" => $lng->txt("sophos"),
1135 "antivir" => $lng->txt("antivir"),
1136 "clamav" => $lng->txt("clamav")
1137 );
1138 $si = new ilSelectInputGUI($lng->txt("virus_scanner"), "vscanner_type");
1139 $si->setOptions($options);
1140 $this->form->addItem($si);
1141
1142 // scan command
1143 $ti = new ilTextInputGUI($lng->txt("scan_command"), "scan_command");
1144 $this->form->addItem($ti);
1145
1146 // clean command
1147 $ti = new ilTextInputGUI($lng->txt("clean_command"), "clean_command");
1148 $this->form->addItem($ti);
1149
1150 if ($a_install)
1151 {
1152 $sh = new ilFormSectionHeaderGUI();
1153 $sh->setTitle($lng->txt("master_password"));
1154 $this->form->addItem($sh);
1155
1156 // password
1157 $pi = new ilPasswordInputGUI($lng->txt("password"), "password");
1158 $pi->setRequired(true);
1159 $pi->setSkipSyntaxCheck(true);
1160 $pi->setInfo($lng->txt("password_info"));
1161 $this->form->addItem($pi);
1162 }
1163
1164 if ($a_install)
1165 {
1166 $this->form->addCommandButton("saveBasicSettings", $lng->txt("save"));
1167 }
1168 else
1169 {
1170 $this->form->addCommandButton("updateBasicSettings", $lng->txt("save"));
1171 $this->form->addCommandButton("determineToolsPath", $lng->txt("determine_tools_paths"));
1172 }
1173
1174 $this->form->setTitle($lng->txt("data_directories"));
1175 $this->form->setFormAction("setup.php?cmd=gateway");
1176
1177 if ($a_install)
1178 {
1179 $det = $this->determineTools();
1180 $this->form->setValuesByArray($det);
1181 }
1182
1183 }
1184
1188 public function getBasicSettingsValues()
1189 {
1190 $values = array();
1191
1192 $values["webspace_dir"] = getcwd()."/data";
1193 $values["data_dir"] = $this->setup->ini->readVariable("clients","datadir");
1194 $values["convert_path"] = $this->setup->ini->readVariable("tools","convert");
1195 $values["zip_path"] = $this->setup->ini->readVariable("tools","zip");
1196 $values["unzip_path"] = $this->setup->ini->readVariable("tools","unzip");
1197 $values["ghostscript_path"] = $this->setup->ini->readVariable("tools","ghostscript");
1198 $values["java_path"] = $this->setup->ini->readVariable("tools","java");
1199 $values["htmldoc_path"] = $this->setup->ini->readVariable("tools","htmldoc");
1200 //$values["mkisofs_path"] = $this->setup->ini->readVariable("tools","mkisofs");
1201 $values["ffmpeg_path"] = $this->setup->ini->readVariable("tools","ffmpeg");
1202 $values["latex_url"] = $this->setup->ini->readVariable("tools","latex");
1203 $values["fop_path"] = $this->setup->ini->readVariable("tools","fop");
1204 $values["vscanner_type"] = $this->setup->ini->readVariable("tools", "vscantype");
1205 $values["scan_command"] = $this->setup->ini->readVariable("tools", "scancommand");
1206 $values["clean_command"] = $this->setup->ini->readVariable("tools", "cleancommand");
1207 $values["log_path"] = $this->setup->ini->readVariable("log","path")."/".
1208 $this->setup->ini->readVariable("log","file");
1209 $values["chk_log_status"] = !$this->setup->ini->readVariable("log","enabled");
1210 $values["time_zone"] = $this->setup->ini->readVariable("server", "timezone");
1211
1212 // https settings
1213 $values["auto_https_detect_enabled"] = $this->setup->ini->readVariable("https", "auto_https_detect_enabled");
1214 $values["auto_https_detect_header_name"] = $this->setup->ini->readVariable("https", "auto_https_detect_header_name");
1215 $values["auto_https_detect_header_value"] = $this->setup->ini->readVariable("https", "auto_https_detect_header_value");
1216
1217 $this->form->setValuesByArray($values);
1218 }
1219
1223 public function saveBasicSettings()
1224 {
1225 global $tpl, $lng, $ilCtrl;
1226
1227 $this->initBasicSettingsForm(true);
1228
1229 if ($this->form->checkInput())
1230 {
1231 // correct paths on windows
1232 if (ilUtil::isWindows())
1233 {
1234 $fs = array("datadir_path", "log_path", "convert_path", "zip_path",
1235 "unzip_path", "ghostscript_path", "java_path", "htmldoc_path", "ffmpeg_path");
1236 foreach ($fs as $f)
1237 {
1238 $_POST[$f] = str_replace("\\", "/", $_POST[$f]);
1239 }
1240 }
1241
1242 $_POST["setup_pass"] = $_POST["password"];
1243 $_POST["setup_pass2"] = $_POST["password_retype"];
1244 if (!$this->setup->checkDataDirSetup($_POST))
1245 {
1246 $i = $this->form->getItemByPostVar("datadir_path");
1247 $i->setAlert($this->lng->txt($this->setup->getError()));
1248 ilUtil::sendFailure($this->lng->txt("form_input_not_valid"),true);
1249 }
1250 else if (!$this->setup->checkLogSetup($_POST))
1251 {
1252 $i = $this->form->getItemByPostVar("log_path");
1253 $i->setAlert($this->lng->txt($this->setup->getError()));
1254 ilUtil::sendFailure($this->lng->txt("form_input_not_valid"),true);
1255 }
1256 else if (!$this->setup->checkPasswordSetup($_POST))
1257 {
1258 ilUtil::sendFailure($this->lng->txt($this->setup->getError()),true);
1259 }
1260 else if (!$this->setup->saveMasterSetup($_POST))
1261 {
1262 ilUtil::sendFailure($this->lng->txt($this->setup->getError()),true);
1263 }
1264 else
1265 {
1266 ilUtil::sendSuccess($this->lng->txt("settings_saved"),true);
1267 ilUtil::redirect("setup.php?cmd=mastersettings");
1268 }
1269 }
1270
1271 $this->form->setValuesByPost();
1272 $this->displayMasterSetup(true);
1273 }
1274
1278 public function updateBasicSettings()
1279 {
1280 global $tpl, $lng, $ilCtrl;
1281
1282 $this->initBasicSettingsForm();
1283
1284 if ($this->form->checkInput())
1285 {
1286 if (ilUtil::isWindows())
1287 {
1288 $fs = array("datadir_path", "log_path", "convert_path", "zip_path",
1289 "unzip_path", "ghostscript_path", "java_path", "htmldoc_path", "ffmpeg_path");
1290 foreach ($fs as $f)
1291 {
1292 $_POST[$f] = str_replace("\\", "/", $_POST[$f]);
1293 }
1294 }
1295
1296 if (!$this->setup->checkLogSetup($_POST))
1297 {
1298 $i = $this->form->getItemByPostVar("log_path");
1299 $i->setAlert($this->lng->txt($this->setup->getError()));
1300 ilUtil::sendFailure($this->lng->txt("form_input_not_valid"),true);
1301 }
1302 else if (!$this->setup->updateMasterSettings($_POST))
1303 {
1304 ilUtil::sendFailure($this->lng->txt($this->setup->getError()),true);
1305 }
1306 else
1307 {
1308 ilUtil::sendSuccess($this->lng->txt("settings_saved"),true);
1309 ilUtil::redirect("setup.php?cmd=mastersettings");
1310 }
1311 }
1312
1313 $this->form->setValuesByPost();
1314 $this->changeMasterSettings(true);
1315 }
1316
1320
1324 function loginClient()
1325 {
1326 session_destroy();
1327
1328 ilUtil::redirect(ILIAS_HTTP_PATH."/login.php?client_id=".$this->setup->getClient()->getId());
1329 }
1330
1334 function displayLogin($a_omit_minit = false, $a_omit_cinit = false)
1335 {
1336 global $lng;
1337 $this->tpl->setVariable("SETUP_LOGIN_CLASS", " ilSetupLogin");
1338 $this->tpl->addBlockFile("CONTENT","content","tpl.std_layout.html", "setup");
1339
1340 if ($a_omit_minit)
1341 {
1342 $m_form = $this->form->getHTML();
1343 }
1344 if (!$a_omit_cinit)
1345 {
1346 $this->initClientLoginForm();
1347 }
1348 $cl_form = $this->form->getHTML();
1349 if (!$a_omit_minit)
1350 {
1351 $this->initMasterLoginForm();
1352 $m_form = $this->form->getHTML();
1353 }
1354 $this->tpl->setVariable("SETUP_CONTENT", $cl_form."<br>".$m_form);
1355 $this->tpl->setVariable("TXT_HEADER", $lng->txt("login"));
1356 }
1357
1361 public function performMLogin()
1362 {
1363 $this->initMasterLoginForm();
1364 if ($this->form->checkInput())
1365 {
1366 $i = $this->form->getItemByPostVar("mpassword");
1367 if (!$this->setup->loginAsAdmin($_POST["mpassword"]))
1368 {
1369 $i->setAlert($this->lng->txt("login_invalid"));
1370 }
1371 else
1372 {
1373 // everything ok -> we are authenticated
1374 ilUtil::redirect("setup.php");
1375 }
1376 }
1377
1378 // something wrong -> display login again
1379 $this->form->setValuesByPost();
1380 $this->displayLogin(true);
1381 }
1382
1386 function performLogin()
1387 {
1388 $this->initClientLoginForm();
1389 if ($this->form->checkInput())
1390 {
1391 $i = $this->form->getItemByPostVar("password");
1392 if (!$this->setup->loginAsClient(
1393 array("client_id" => $_POST["client_id"],
1394 "username" => $_POST["username"], "password" => $_POST["password"])))
1395 {
1396 $i->setAlert($this->setup->getError());
1397 }
1398 else
1399 {
1400 // everything ok -> we are authenticated
1401 ilUtil::redirect("setup.php");
1402 }
1403 }
1404
1405 // something wrong -> display login again
1406 $this->form->setValuesByPost();
1407 $this->displayLogin(false, true);
1408 }
1409
1413 public function initClientLoginForm()
1414 {
1415 global $lng, $ilCtrl;
1416
1417 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1418 $this->form = new ilPropertyFormGUI();
1419 $this->form->setId("client_login");
1420
1421 // client id
1422 $ti = new ilTextInputGUI($lng->txt("client_id"), "client_id");
1423 $ti->setMaxLength(32);
1424 $ti->setSize(20);
1425 $this->form->addItem($ti);
1426
1427 // username
1428 $ti = new ilTextInputGUI($lng->txt("username"), "username");
1429 $ti->setSize(20);
1430 $this->form->addItem($ti);
1431
1432 // password
1433 $pi = new ilPasswordInputGUI($lng->txt("password"), "password");
1434 $pi->setSize(20);
1435 $pi->setRetype(false);
1436 $pi->setSkipSyntaxCheck(true);
1437 $this->form->addItem($pi);
1438
1439 $this->form->addCommandButton("performLogin", $lng->txt("login"));
1440
1441 $this->form->setTitle($lng->txt("client_login"));
1442 $this->form->setFormAction("setup.php?cmd=gateway");
1443 }
1444
1448 public function initMasterLoginForm()
1449 {
1450 global $lng, $ilCtrl;
1451
1452 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1453 $this->form = new ilPropertyFormGUI();
1454 $this->form->setId("master_login");
1455 // password
1456 $pi = new ilPasswordInputGUI($lng->txt("password"), "mpassword");
1457 $pi->setSize(20);
1458 $pi->setRetype(false);
1459 $pi->setSkipSyntaxCheck(true);
1460 $this->form->addItem($pi);
1461
1462 $this->form->addCommandButton("performMLogin", $lng->txt("login"));
1463
1464 $this->form->setTitle($lng->txt("admin_login"));
1465 $this->form->setFormAction("setup.php?cmd=gateway");
1466
1467 }
1468
1472
1477 {
1478 $_SESSION["ClientId"] = "";
1479
1480 $this->tpl->addBlockFile("CONTENT","content","tpl.clientlist.html", "setup");
1481 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_list"));
1483
1484 // common
1485 $this->tpl->setVariable("TXT_HEADER",$this->lng->txt("list_clients"));
1486 $this->tpl->setVariable("TXT_LISTSTATUS",($this->setup->ini->readVariable("clients","list")) ? $this->lng->txt("display_clientlist") : $this->lng->txt("hide_clientlist"));
1487 $this->tpl->setVariable("TXT_TOGGLELIST",($this->setup->ini->readVariable("clients","list")) ? $this->lng->txt("disable") : $this->lng->txt("enable"));
1488
1489 include_once("./setup/classes/class.ilClientListTableGUI.php");
1490 $tab = new ilClientListTableGUI($this->setup);
1491 $this->tpl->setVariable("CLIENT_LIST", $tab->getHTML());
1492
1493 // create new client button
1494 $this->btn_next_on = true;
1495 $this->btn_next_lng = $this->lng->txt("create_new_client")."...";
1496 $this->btn_next_cmd = "newclient";
1497 }
1498
1503 {
1504 $_POST = $this->determineTools($_POST);
1505 $this->updateBasicSettings();
1506 }
1507
1512 {
1513 $this->displayMasterSetup(true);
1514 }
1515
1519 function determineTools($a_tools = "")
1520 {
1521 $cwd = ilUtil::isWindows()
1522 ? str_replace("\\", "/", getcwd())
1523 : getcwd();
1524 if (!ilUtil::isWindows())
1525 {
1526 $tools = array("convert" => "convert",
1527 "zip" => "zip", "unzip" => "unzip", "ghostscript" => "gs",
1528 "java" => "java", "htmldoc" => "htmldoc", "ffmpeg" => "ffmpeg");
1529 $dirs = array("/usr/local", "/usr/local/bin", "/usr/bin", "/bin", "/sw/bin", "/usr/bin");
1530 }
1531 else
1532 {
1533 $tools = array("convert" => "convert.exe",
1534 "zip" => "zip.exe", "unzip" => "unzip.exe");
1535 $dirs = array($cwd."/Services/Windows/bin32/zip",
1536 $cwd."/Services/Windows/bin32/unzip",
1537 $cwd."/Services/Windows/bin32/convert");
1538 }
1539 foreach($tools as $k => $tool)
1540 {
1541 // try which command
1542 unset($ret);
1543 @exec("which ".$tool, $ret);
1544 if (substr($ret[0], 0, 3) != "no " && substr($ret[0], 0, 1) == "/")
1545 {
1546 $a_tools[$k."_path"] = $ret[0];
1547 continue;
1548 }
1549
1550 // try common directories
1551 foreach($dirs as $dir)
1552 {
1553 if (@is_file($dir."/".$tool))
1554 {
1555 $a_tools[$k."_path"] = $dir."/".$tool;
1556 continue;
1557 }
1558 }
1559 }
1560 return $a_tools;
1561 }
1562
1563
1567
1572 function selectDBType()
1573 {
1574 $this->checkDisplayMode("create_new_client");
1575
1576
1577if (true)
1578{
1579 $this->initDBSelectionForm();
1580 $this->tpl->setVariable("SETUP_CONTENT", $this->form->getHTML());
1581}
1582else
1583{
1584 // output
1585
1586 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.clientsetup_select_db.html", "setup");
1587
1588 $this->tpl->setVariable("FORMACTION", "setup.php?cmd=gateway");
1589 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
1590
1591 $this->tpl->setVariable("TXT_DB_TYPE", $this->lng->txt("db_type"));
1592 $this->tpl->setVariable("TXT_DB_SELECTION", $this->lng->txt("db_selection"));
1593}
1594 if ($this->setup->getClient()->status["ini"]["status"])
1595 {
1596 $this->setButtonNext("db");
1597 }
1598
1599 $this->checkPanelMode();
1600 }
1601
1605 public function initDBSelectionForm()
1606 {
1607 global $lng, $ilCtrl;
1608
1609 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1610 $this->form = new ilPropertyFormGUI();
1611
1612 // db type
1613 $options = array(
1614 "mysql" => "MySQL 5.0.x or higher (MyISAM engine)",
1615 "innodb" => "MySQL 5.0.x or higher (InnoDB engine)",
1616 "oracle" => "Oracle 10g or higher",
1617 "postgres" => "Postgres (experimental)"
1618 );
1619 $si = new ilSelectInputGUI($lng->txt("db_type"), "db_type");
1620 $si->setOptions($options);
1621 $si->setInfo($lng->txt(""));
1622 $this->form->addItem($si);
1623
1624 $this->form->addCommandButton("selectdbtype", $lng->txt("save"));
1625
1626 $this->form->setTitle($lng->txt("db_selection"));
1627 $this->form->setFormAction("setup.php?cmd=gateway");
1628 }
1629
1633
1637 function displayIni($a_omit_form_init = false)
1638 {
1639 $this->checkDisplayMode("create_new_client");
1640
1641 if ($_POST["db_type"] != "")
1642 {
1643 $_SESSION["db_type"] = $_POST["db_type"];
1644 }
1645 else
1646 {
1647 $_POST["db_type"] = $_SESSION["db_type"];
1648 }
1649
1650 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_ini"));
1651 if (!$a_omit_form_init)
1652 {
1653 $this->initClientIniForm();
1654 $this->getClientIniValues();
1655 }
1656 $this->tpl->setVariable("SETUP_CONTENT",
1657 $this->form->getHTML());
1658
1659 if ($this->setup->getClient()->status["ini"]["status"])
1660 {
1661 $this->setButtonNext("db");
1662 }
1663
1664 $this->checkPanelMode();
1665 }
1666
1670 public function initClientIniForm()
1671 {
1672 global $lng, $ilCtrl;
1673
1674 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1675 $this->form = new ilPropertyFormGUI();
1676
1677 // client id
1678 if ($this->setup->ini_client_exists)
1679 {
1680 $hi = new ilHiddenInputGUI("client_id");
1681 $hi->setValue($this->client_id);
1682 $this->form->addItem($hi);
1683
1684 $ne = new ilNonEditableValueGUI($lng->txt("client_id"), "hh");
1685 $ne->setValue($this->client_id);
1686 $this->form->addItem($ne);
1687 }
1688 else
1689 {
1690 $ti = new ilTextInputGUI($lng->txt("client_id"), "client_id");
1691 $ti->setMaxLength(32);
1692 $ti->setRequired(true);
1693 $this->form->addItem($ti);
1694 }
1695
1696 // database connection
1697 $sh = new ilFormSectionHeaderGUI();
1698 $sh->setTitle($lng->txt("db_conn"));
1699 $this->form->addItem($sh);
1700
1701 // db type
1702 $ne = new ilNonEditableValueGUI($lng->txt("db_type"), "dbt");
1703 $ne->setValue($lng->txt("db_".$_SESSION["db_type"]));
1704 $this->form->addItem($ne);
1705
1706 // db host
1707 $ti = new ilTextInputGUI($lng->txt("db_host"), "db_host");
1708 $ti->setMaxLength(120);
1709 $ti->setRequired(true);
1710 $this->form->addItem($ti);
1711
1712 // db name
1713 if (in_array($_SESSION["db_type"], array("mysql", "postgres", "innodb")))
1714 {
1715 $ti = new ilTextInputGUI($lng->txt("db_name"), "db_name");
1716 $ti->setRequired(true);
1717 }
1718 else
1719 {
1720 $ti = new ilTextInputGUI($lng->txt("db_service_name"), "db_name");
1721 }
1722 $ti->setMaxLength(40);
1723 $this->form->addItem($ti);
1724
1725 // db user
1726 $ti = new ilTextInputGUI($lng->txt("db_user"), "db_user");
1727 $ti->setMaxLength(40);
1728 $ti->setRequired(true);
1729 $this->form->addItem($ti);
1730
1731 // db port
1732 $ti = new ilTextInputGUI($lng->txt("db_port"), "db_port");
1733 $ti->setMaxLength(8);
1734 $this->form->addItem($ti);
1735
1736 // db password
1737 $ti = new ilTextInputGUI($lng->txt("db_pass"), "db_pass");
1738 $ti->setMaxLength(40);
1739 $this->form->addItem($ti);
1740
1741 $this->form->addCommandButton("saveClientIni", $lng->txt("save"));
1742
1743 $this->form->setTitle($lng->txt("inst_identification"));
1744 $this->form->setFormAction("setup.php?cmd=gateway");
1745 }
1746
1750 public function getClientIniValues()
1751 {
1752 $values = array();
1753
1754 $values["db_host"] = $this->setup->getClient()->getDbHost();
1755 $values["db_user"] = $this->setup->getClient()->getDbUser();
1756 $values["db_port"] = $this->setup->getClient()->getDbPort();
1757 $values["db_pass"] = $this->setup->getClient()->getDbPass();
1758 $values["db_name"] = $this->setup->getClient()->getDbName();
1759 $values["client_id"] = $this->setup->getClient()->getId();
1760
1761 $this->form->setValuesByArray($values);
1762 }
1763
1767 public function saveClientIni()
1768 {
1769 global $tpl, $lng, $ilCtrl;
1770
1771 $this->initClientIniForm();
1772 if ($this->form->checkInput())
1773 {
1774 if (strlen($_POST["client_id"]) != strlen(urlencode(($_POST["client_id"])))
1775 || is_int(strpos($_POST["client_id"], "_")))
1776 {
1777 $i = $this->form->getItemByPostVar("client_id");
1778 $i->setAlert($this->lng->txt("ini_client_id_invalid"));
1779 ilUtil::sendFailure($this->lng->txt("ini_client_id_invalid"),true);
1780 }
1781 else if (strlen($_POST["client_id"]) < 4)
1782 {
1783 $i = $this->form->getItemByPostVar("client_id");
1784 $i->setAlert($this->lng->txt("ini_client_id_too_short"));
1785 ilUtil::sendFailure($this->lng->txt("ini_client_id_too_short"),true);
1786 }
1787 else if (strlen($_POST["client_id"]) > 32)
1788 {
1789 $i = $this->form->getItemByPostVar("client_id");
1790 $i->setAlert($this->lng->txt("ini_client_id_too_long"));
1791 ilUtil::sendFailure($this->lng->txt("ini_client_id_too_long"),true);
1792 }
1793 else if (!$this->setup->ini_client_exists && file_exists(ILIAS_ABSOLUTE_PATH."/".ILIAS_WEB_DIR."/".$_POST["client_id"]))
1794 {
1795 $i = $this->form->getItemByPostVar("client_id");
1796 $i->setAlert($this->lng->txt("ini_client_id_exists"));
1797 ilUtil::sendFailure($this->lng->txt("ini_client_id_exists"),true);
1798 }
1799 else
1800 {
1801
1802 // save some old values
1803 $old_db_name = $this->setup->getClient()->getDbName();
1804 $old_db_type = $this->setup->getClient()->getDbType();
1805 $old_client_id = $this->setup->getClient()->getId();
1806
1807 // create new client object if it does not exist
1808 if (!$this->setup->ini_client_exists)
1809 {
1810 $client_id = $_POST["client_id"];
1811 $this->setup->newClient($client_id);
1812 }
1813
1814 // set client data
1815 $this->setup->getClient()->setId($_POST["client_id"]);
1816 $this->setup->getClient()->setDbHost($_POST["db_host"]);
1817 $this->setup->getClient()->setDbName($_POST["db_name"]);
1818 $this->setup->getClient()->setDbUser($_POST["db_user"]);
1819 $this->setup->getClient()->setDbPort($_POST["db_port"]);
1820 $this->setup->getClient()->setDbPass($_POST["db_pass"]);
1821 $this->setup->getClient()->setDbType($_SESSION["db_type"]);
1822 $this->setup->getClient()->setDSN();
1823
1824 // try to connect to database
1825 if (!$this->setup->getClient()->checkDatabaseHost())
1826 {
1827 $i = $this->form->getItemByPostVar("db_host");
1828 $i->setAlert($this->lng->txt($this->setup->getClient()->getError()));
1829 ilUtil::sendFailure($this->setup->getClient()->getError(),true);
1830 }
1831 else
1832 {
1833 // check if db exists
1834 $db_installed = $this->setup->getClient()->checkDatabaseExists();
1835
1836 if ($db_installed and (!$this->setup->ini_ilias_exists or ($this->setup->getClient()->getDbName() != $old_db_name)))
1837 {
1838 $_POST["db_name"] = $old_db_name;
1839 $message = ucfirst($this->lng->txt("database"))." \"".$this->setup->getClient()->getDbName()."\" ".$this->lng->txt("ini_db_name_exists");
1840 $i = $this->form->getItemByPostVar("db_name");
1841 $i->setAlert($message);
1842 ilUtil::sendFailure($message, true);
1843 }
1844 else
1845 {
1846 // all ok. create client.ini and save posted data
1847 if (!$this->setup->ini_client_exists)
1848 {
1849 if ($this->setup->saveNewClient())
1850 {
1851 ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
1852 $this->setup->getClient()->status["ini"]["status"] = true;
1853 $_SESSION["ClientId"] = $client_id;
1854 ilUtil::redirect("setup.php?cmd=displayIni&client_id=".$client_id);
1855 }
1856 else
1857 {
1858 $err = $this->setup->getError();
1859 ilUtil::sendFailure($this->lng->txt("save_error").": ".$err, true);
1860 $this->setup->getClient()->status["ini"]["status"] = false;
1861 $this->setup->getClient()->status["ini"]["comment"] = $err;
1862 }
1863 }
1864 else
1865 {
1866 if ($this->setup->getClient()->ini->write())
1867 {
1868 ilUtil::sendSuccess($this->lng->txt("settings_changed"));
1869 $this->setup->getClient()->status["ini"]["status"] = true;
1870 ilUtil::redirect("setup.php?cmd=displayIni");
1871 }
1872 else
1873 {
1874 $err = $this->setup->getClient()->ini->getError();
1875 ilUtil::sendFailure($this->lng->txt("save_error").": ".$err, true);
1876 $this->setup->getClient()->status["ini"]["status"] = false;
1877 $this->setup->getClient()->status["ini"]["comment"] = $err;
1878 }
1879 }
1880 }
1881 }
1882 }
1883 }
1884
1885 $this->form->setValuesByPost();
1886 $this->displayIni(true);
1887 }
1888
1894 function displayError($a_message)
1895 {
1896 $this->tpl->addBlockFile("CONTENT", "content", "tpl.error.html", "setup");
1897
1898 $this->tpl->setCurrentBlock("content");
1899 $this->tpl->setVariable("FORMACTION", $_SESSION["referer"]);
1900 $this->tpl->setVariable("TXT_BACK", $this->lng->txt("back"));
1901 $this->tpl->setVariable("ERROR_MESSAGE",($a_message));
1902 $this->tpl->parseCurrentBlock();
1903
1904 $this->tpl->show();
1905 exit();
1906 }
1907
1911 function displayLogout()
1912 {
1913 $this->tpl->addBlockFile("CONTENT","content","tpl.logout.html", "setup");
1914
1915 session_destroy();
1916
1917 $this->logged_out = true;
1918 $this->tpl->setVariable("TXT_HEADER",$this->lng->txt("logged_out"));
1919 $this->tpl->setCurrentBlock("home_link");
1920 $this->tpl->setVariable("TXT_INDEX",$this->lng->txt("ilias_homepage"));
1921 $this->tpl->setVariable("LNK_INDEX",ILIAS_HTTP_PATH."/index.php");
1922 $this->tpl->parseCurrentBlock();
1923 }
1924
1929 {
1930 include_once("./Services/UIComponent/Checklist/classes/class.ilChecklistGUI.php");
1931 $checklist = new ilChecklistGUI();
1932 $checklist->setHeading($this->lng->txt("setup_process_status"));
1933
1934
1935 $OK = "<font color=\"green\"><strong>OK</strong></font>";
1936
1937 $steps = array();
1938 $steps = $this->setup->getStatus();
1939
1940 // remove access step
1941 unset($steps["access"]);
1942
1943 $steps["ini"]["text"] = $this->lng->txt("setup_process_step_ini");
1944 $steps["db"]["text"] = $this->lng->txt("setup_process_step_db");
1945 //$steps["sess"]["text"] = $this->lng->txt("setup_process_step_sess");
1946 $steps["lang"]["text"] = $this->lng->txt("setup_process_step_lang");
1947 $steps["contact"]["text"] = $this->lng->txt("setup_process_step_contact");
1948 $steps["proxy"]["text"] = $this->lng->txt("setup_process_step_proxy");
1949 $steps["nic"]["text"] = $this->lng->txt("setup_process_step_nic");
1950 $steps["finish"]["text"] = $this->lng->txt("setup_process_step_finish");
1951
1952 $stpl = new ilTemplate("tpl.process_panel.html", true, true, "setup");
1953
1954 $num = 1;
1955
1956 foreach ($steps as $key => $val)
1957 {
1958 $stpl->setCurrentBlock("menu_row");
1959 $stpl->setVariable("TXT_STEP",$this->lng->txt("step")." ".$num.": &nbsp;");
1960 $stpl->setVariable("TXT_ACTION",$val["text"]);
1961 $stpl->setVariable("IMG_ARROW", "spacer.png");
1962
1963 if ($this->cmd == $key and isset($this->cmd))
1964 {
1965 $stpl->setVariable("HIGHLIGHT", " style=\"font-weight:bold;\"");
1966 }
1967
1968 $status = ($val["status"]) ? $OK : "";
1969
1970 $stpl->setVariable("TXT_STATUS",$status);
1971 $stpl->parseCurrentBlock();
1972
1973 $checklist->addEntry($num.". ".$val["text"], "",
1974 ($val["status"]) ?
1976 ($this->cmd == $key and isset($this->cmd)),
1977 "");
1978
1979 $num++;
1980 }
1981
1982 $stpl->setVariable("TXT_SETUP_PROCESS_STATUS",$this->lng->txt("setup_process_status"));
1983
1984 $this->tpl->setVariable("PROCESS_MENU", $checklist->getHTML());
1985 }
1986
1991 {
1992 include_once("./Services/UIComponent/Checklist/classes/class.ilChecklistGUI.php");
1993 $checklist = new ilChecklistGUI();
1994 $checklist->setHeading($this->lng->txt("overall_status"));
1995
1996 $OK = "<font color=\"green\"><strong>OK</strong></font>";
1997
1998 //$this->tpl->addBlockFile("STATUS_PANEL","status_panel","tpl.status_panel.html", "setup");
1999
2000 $this->tpl->setVariable("TXT_OVERALL_STATUS", $this->lng->txt("overall_status"));
2001 // display status
2002 if ($this->setup->getClient()->status)
2003 {
2004 foreach ($this->setup->getClient()->status as $key => $val)
2005 {
2006 $status = ($val["status"]) ? $OK : "&nbsp;";
2007// $this->tpl->setCurrentBlock("status_row");
2008// $this->tpl->setVariable("TXT_STEP", $this->lng->txt("step_".$key));
2009// $this->tpl->setVariable("TXT_STATUS",$status);
2010
2011
2012// $this->tpl->setVariable("TXT_COMMENT",$val["comment"]);
2013// $this->tpl->parseCurrentBlock();
2014
2015 $checklist->addEntry($this->lng->txt("step_".$key), "",
2016 ($val["status"]) ?
2018 }
2019 }
2020 $this->tpl->setVariable("STATUS_PANEL", $checklist->getHTML());
2021 }
2022
2028 function checkDisplayMode($a_title = "")
2029 {
2030 switch ($this->display_mode)
2031 {
2032 case "view":
2033 $this->tpl->addBlockFile("CONTENT","content","tpl.clientview.html", "setup");
2034 // display tabs
2035 include "./setup/include/inc.client_tabs.php";
2036 $client_name = ($this->setup->getClient()->getName()) ? $this->setup->getClient()->getName() : $this->lng->txt("no_client_name");
2037 $this->tpl->setVariable("TXT_HEADER",$client_name." (".$this->lng->txt("client_id").": ".$this->setup->getClient()->getId().")");
2038 break;
2039
2040 case "setup":
2041 $this->tpl->addBlockFile("CONTENT","content","tpl.clientsetup.html", "setup");
2042 $this->tpl->setVariable("TXT_HEADER",$this->lng->txt($a_title));
2043 break;
2044
2045 default:
2046 $this->displayError($this->lng->txt("unknown_display_mode"));
2047 exit();
2048 break;
2049 }
2050 }
2051
2059 {
2060 $sub_tab_html = $this->tabs->getSubTabHTML();
2061 if ($sub_tab_html != "")
2062 {
2063 $this->tpl->setVariable("SUBTABS", $sub_tab_html);
2064 }
2065
2066 }
2067
2068
2073 {
2074 switch ($this->display_mode)
2075 {
2076 case "view":
2077 $this->displayStatusPanel();
2078 break;
2079
2080 case "setup":
2081 $this->displayProcessPanel();
2082 break;
2083 }
2084 }
2085
2090 {
2091 $this->tpl->addBlockFile("CONTENT","content","tpl.clientsetup.html", "setup");
2092
2093 $this->tpl->setVariable("TXT_INFO",$this->lng->txt("info_text_first_client"));
2094 $this->tpl->setVariable("TXT_HEADER",$this->lng->txt("setup_first_client"));
2095
2096 $this->displayProcessPanel();
2097
2098 $this->setButtonNext("ini");
2099 }
2100
2104
2109 {
2110 global $ilErr,$ilDB,$ilLog;
2111
2112 $this->checkDisplayMode("setup_database");
2113
2114 //$this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.clientsetup_db.html", "setup");
2115
2116 // database is intalled
2117 if ($this->setup->getClient()->db_installed)
2118 {
2119 $this->setDbSubTabs("db");
2120
2121 $ilDB = $this->setup->getClient()->db;
2122 $this->lng->setDbHandler($ilDB);
2123 include_once "./Services/Database/classes/class.ilDBUpdate.php";
2124 $dbupdate = new ilDBUpdate($ilDB);
2125 $db_status = $dbupdate->getDBVersionStatus();
2126 $hotfix_available = $dbupdate->hotfixAvailable();
2127 $custom_updates_available = $dbupdate->customUpdatesAvailable();
2128 $this->initClientDbForm(false, $dbupdate, $db_status, $hotfix_available, $custom_updates_available);
2129 $this->getClientDbFormValues($dbupdate);
2130 $this->tpl->setVariable("SETUP_CONTENT", $this->form->getHTML());
2131
2132 if ($db_status)
2133 {
2134 $this->setButtonNext("lang");
2135 }
2136 }
2137 else // database is not installed
2138 {
2139 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_db")."<br />".
2140 "<p><code>CREATE DATABASE &lt;your_db&gt; CHARACTER SET utf8 COLLATE &lt;your_collation&gt;</code></p>".
2141 "<p><b>".$this->lng->txt("info_text_db2")."</b></p><br/>");
2142
2143 $this->initClientDbForm();
2144 $this->getClientDbFormValues();
2145 $this->tpl->setVariable("SETUP_CONTENT", $this->form->getHTML());
2146 $this->setButtonPrev("ini");
2147 }
2148
2149 $this->checkPanelMode();
2150
2151 $this->displaySubTabs();
2152 }
2153
2154
2155 public function displayCache() {
2156 require_once('Services/Form/classes/class.ilPropertyFormGUI.php');
2157 require_once('Services/GlobalCache/classes/class.ilGlobalCache.php');
2158 $this->checkDisplayMode('setup_cache');
2159
2163 $ini = $this->setup->getClient()->ini;
2164
2165 $cache_form = new ilPropertyFormGUI();
2166 $cache_form->setTitle($this->lng->txt('global_cache_configuration'));
2167 $cache_form->addCommandButton('saveCache', $this->lng->txt('save'));
2168 $cache_form->setFormAction('setup.php?cmd=gateway');
2169
2170 $activate_global_cache = 'activate_global_cache';
2171 $global_cache_service_type = 'global_cache_service_type';
2172
2173 $activate_cache = new ilCheckboxInputGUI($this->lng->txt($activate_global_cache), $activate_global_cache);
2174 $activate_cache->setChecked($ini->readVariable('cache', $activate_global_cache));
2175
2176 $service_type = new ilRadioGroupInputGUI($this->lng->txt($global_cache_service_type), $global_cache_service_type);
2177 $some_inactive = false;
2178 $message = '';
2179 foreach (ilGlobalCache::getAllTypes() as $type) {
2180 $option = new ilRadioOption($this->lng->txt($global_cache_service_type . '_' . $type->getServiceType()), $type->getServiceType());
2181 $option->setInfo($this->lng->txt('global_cache_install_info_' . $type->getServiceType()));
2182 if (! $type->isCacheServiceInstallable()) {
2183 $option->setDisabled(true);
2184 $message .= $this->lng->txt($global_cache_service_type . '_' . $type->getServiceType()) . ': '
2185 . $type->getInstallationFailureReason() . '; ';
2186 $some_inactive = true;
2187 }
2188 $service_type->addOption($option);
2189 }
2190
2191 if ($some_inactive) {
2192 $service_type->setAlert($message);
2193 ilUtil::sendInfo($this->lng->txt('global_cache_supported_services'));
2194 }
2195 $service_type->setValue($ini->readVariable('cache', $global_cache_service_type));
2196 $activate_cache->addSubItem($service_type);
2197
2198 $cache_form->addItem($activate_cache);
2199
2200 $this->tpl->setVariable('SETUP_CONTENT', $cache_form->getHTML());
2201 }
2202
2203
2204 public function saveCache(){
2208 require_once('Services/GlobalCache/classes/class.ilGlobalCache.php');
2209 ilGlobalCache::flushAll();
2210 $ini = $this->setup->getClient()->ini;
2211
2212 if(!$ini->readGroup('cache')) {
2213 $ini->addGroup('cache');
2214 }
2215
2216 $activate_global_cache = 'activate_global_cache';
2217 $global_cache_service_type = 'global_cache_service_type';
2218
2219 $ini->setVariable('cache', $activate_global_cache, $_POST[$activate_global_cache]);
2220 $ini->setVariable('cache', $global_cache_service_type, $_POST[$global_cache_service_type]);
2221 $ini->write();
2222
2223 ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
2224 ilUtil::redirect('setup.php?cmd=cache');
2225
2226 }
2227
2228
2232 function displayDatabaseSlave($a_from_save = false)
2233 {
2234 global $ilErr,$ilDB,$ilLog;
2235
2236 $this->checkDisplayMode("setup_database");
2237
2238 //$this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.clientsetup_db.html", "setup");
2239
2240 // database is intalled
2241 if (!$this->setup->getClient()->db_installed)
2242 {
2243 return;
2244 }
2245
2246 $this->setDbSubTabs("repl");
2247
2248 if (!$a_from_save)
2249 {
2250 $ilDB = $this->setup->getClient()->db;
2251 $this->lng->setDbHandler($ilDB);
2252 }
2253
2254 ilUtil::sendInfo($this->lng->txt("mysql_replication_info_alpha"));
2255
2256 if (!$a_from_save)
2257 {
2258 $this->initDbSlaveForm();
2259 }
2260
2261 $this->tpl->setVariable("SETUP_CONTENT", $this->form->getHTML());
2262
2263 $this->checkPanelMode();
2264
2265 $this->displaySubTabs();
2266 }
2267
2271 public function initDbSlaveForm()
2272 {
2273 global $lng, $ilCtrl, $ilDB;
2274
2275 $client = $this->setup->getClient();
2276
2277 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2278 $this->form = new ilPropertyFormGUI();
2279
2280 // db type
2281 $ne = new ilNonEditableValueGUI($lng->txt("db_type"), "slave_type");
2282 $ne->setValue($lng->txt("db_".$ilDB->getDbType()));
2283 $this->form->addItem($ne);
2284
2285 // activate slave
2286 $act = new ilCheckboxInputGUI($this->lng->txt("db_active"), "slave_active");
2287 $act->setChecked($client->getDbSlaveActive());
2288 $this->form->addItem($act);
2289
2290 // slave host
2291 $ti = new ilTextInputGUI($lng->txt("db_host"), "slave_host");
2292 $ti->setValue($client->getDbSlaveHost());
2293 $ti->setMaxLength(120);
2294 $ti->setRequired(true);
2295 $act->addSubItem($ti);
2296
2297 // slave name
2298 $ti = new ilTextInputGUI($lng->txt("db_name"), "slave_name");
2299 $ti->setValue($client->getDbSlaveName());
2300 $ti->setRequired(true);
2301 $ti->setMaxLength(40);
2302 $act->addSubItem($ti);
2303
2304 // slave user
2305 $ti = new ilTextInputGUI($lng->txt("db_user"), "slave_user");
2306 $ti->setValue($client->getDbSlaveUser());
2307 $ti->setMaxLength(40);
2308 $ti->setRequired(true);
2309 $act->addSubItem($ti);
2310
2311 // slave port
2312 $ti = new ilTextInputGUI($lng->txt("db_port"), "slave_port");
2313 $ti->setValue($client->getDbSlavePort());
2314 $ti->setMaxLength(8);
2315 $act->addSubItem($ti);
2316
2317 // set password
2318 $set_pw = new ilCheckboxInputGUI($this->lng->txt("db_set_password"), "set_slave_password");
2319 $act->addSubItem($set_pw);
2320
2321 // slave password
2322 $ti = new ilTextInputGUI($lng->txt("db_pass"), "slave_pass");
2323 $ti->setMaxLength(40);
2324 $set_pw->addSubItem($ti);
2325
2326 $this->form->addCommandButton("saveDbSlave", $lng->txt("save"));
2327
2328 $this->form->setTitle($lng->txt("db_slave_settings"));
2329 $this->form->setFormAction("setup.php?cmd=gateway");
2330 }
2331
2335 public function saveDbSlave()
2336 {
2337 global $tpl, $lng, $ilCtrl, $ilDB;
2338
2339 $client = $this->setup->getClient();
2340
2341 $ilDB = $this->setup->getClient()->db;
2342 $this->lng->setDbHandler($ilDB);
2343
2344 $this->initDbSlaveForm();
2345 if ($this->form->checkInput())
2346 {
2347 $client->setDbSlaveActive($this->form->getInput("slave_active"));
2348 if ($this->form->getInput("slave_active"))
2349 {
2350 $client->setDbSlaveHost($this->form->getInput("slave_host"));
2351 $client->setDbSlaveUser($this->form->getInput("slave_user"));
2352 $client->setDbSlavePort($this->form->getInput("slave_port"));
2353 $client->setDbSlaveName($this->form->getInput("slave_name"));
2354 if ($this->form->getInput("set_slave_password"))
2355 {
2356 $client->setDbSlavePass($this->form->getInput("slave_pass"));
2357 }
2358 }
2359 $client->writeIni();
2360
2361 ilUtil::sendSuccess($lng->txt("saved_successfully"), true);
2362 ilUtil::redirect("setup.php?cmd=dbslave");
2363 }
2364 else
2365 {
2366 $this->form->setValuesByPost();
2367 $this->displayDatabaseSlave(true);
2368 }
2369 }
2370
2371
2378 function setDbSubtabs($a_subtab_id = "db")
2379 {
2380 global $ilDB;
2381
2382 if ($ilDB->getDbType() == "mysql")
2383 {
2384 $this->tabs->addSubTab("db", $this->lng->txt("db_master"), "setup.php?client_id=".$this->client_id."&cmd=db");
2385 $this->tabs->addSubTab("repl", $this->lng->txt("db_slave"), "setup.php?client_id=".$this->client_id."&cmd=dbslave");
2386 }
2387
2388 $this->tabs->activateSubTab($a_subtab_id);
2389 }
2390
2391
2392
2396 public function initClientDbForm($a_install = true, $dbupdate = null, $db_status = false, $hotfix_available = false, $custom_updates_available = false)
2397 {
2398 global $lng, $ilCtrl;
2399
2400 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2401 $this->form = new ilPropertyFormGUI();
2402
2403 // type
2404 $ne = new ilNonEditableValueGUI($lng->txt("db_type"), "db_type");
2405 $this->form->addItem($ne);
2406
2407 // version
2408 if ($this->setup->getClient()->getDBType() == "mysql" ||
2409 $this->setup->getClient()->getDBType() == "innodb")
2410 {
2411 $ne = new ilNonEditableValueGUI($lng->txt("version"), "db_version");
2412 $ilDB = $this->setup->getClient()->db;
2413 $ne->setValue($ilDB->getDBVersion());
2414 $this->form->addItem($ne);
2415 }
2416
2417 // host
2418 $ne = new ilNonEditableValueGUI($lng->txt("host"), "db_host");
2419 $this->form->addItem($ne);
2420
2421 // name
2422 $ne = new ilNonEditableValueGUI($lng->txt("name"), "db_name");
2423 $this->form->addItem($ne);
2424
2425 // user
2426 $ne = new ilNonEditableValueGUI($lng->txt("user"), "db_user");
2427 $this->form->addItem($ne);
2428
2429 // port
2430 $ne = new ilNonEditableValueGUI($lng->txt("port"), "db_port");
2431 $this->form->addItem($ne);
2432
2433 // creation / collation for mysql
2434 if (($this->setup->getClient()->getDBType() == "mysql" ||
2435 $this->setup->getClient()->getDBType() == "innodb") && $a_install)
2436 {
2437 // create database
2438 $cb = new ilCheckboxInputGUI($lng->txt("database_create"), "chk_db_create");
2439
2440 // collation
2441 $collations = array
2442 (
2443 "utf8_unicode_ci",
2444 "utf8_general_ci",
2445 "utf8_czech_ci",
2446 "utf8_danish_ci",
2447 "utf8_estonian_ci",
2448 "utf8_icelandic_ci",
2449 "utf8_latvian_ci",
2450 "utf8_lithuanian_ci",
2451 "utf8_persian_ci",
2452 "utf8_polish_ci",
2453 "utf8_roman_ci",
2454 "utf8_romanian_ci",
2455 "utf8_slovak_ci",
2456 "utf8_slovenian_ci",
2457 "utf8_spanish2_ci",
2458 "utf8_spanish_ci",
2459 "utf8_swedish_ci",
2460 "utf8_turkish_ci"
2461 );
2462 foreach($collations as $collation)
2463 {
2464 $options[$collation] = $collation;
2465 }
2466 $si = new ilSelectInputGUI($lng->txt("collation"), "collation");
2467 $si->setOptions($options);
2468 $si->setInfo($this->lng->txt("info_text_db_collation2")." ".
2469 "<a target=\"_new\" href=\"http://dev.mysql.com/doc/mysql/en/charset-unicode-sets.html\">".
2470 " MySQL Reference Manual :: 10.11.1 Unicode Character Sets</a>");
2471 $cb->addSubItem($si);
2472
2473 $this->form->addItem($cb);
2474 }
2475
2476 if ($a_install)
2477 {
2478 $this->form->addCommandButton("installDatabase", $lng->txt("database_install"));
2479 }
2480 else
2481 {
2482 $ilDB = $this->setup->getClient()->db;
2483 $this->lng->setDbHandler($ilDB);
2484 $dbupdate = new ilDBUpdate($ilDB);
2485
2486 // database version
2487 $ne = new ilNonEditableValueGUI($lng->txt("database_version"), "curv");
2488 $ne->setValue($dbupdate->currentVersion);
2489 $this->form->addItem($ne);
2490
2491 // file version
2492 $ne = new ilNonEditableValueGUI($lng->txt("file_version"), "filev");
2493 $ne->setValue($dbupdate->fileVersion);
2494 $this->form->addItem($ne);
2495
2496 if (!$db_status = $dbupdate->getDBVersionStatus())
2497 {
2498 // next update step
2499 $options = array();
2500 for ($i = $dbupdate->currentVersion + 1; $i <= $dbupdate->fileVersion; $i++)
2501 {
2502 $options[$i] = $i;
2503 }
2504 if (count($options) > 1)
2505 {
2506 $si = new ilSelectInputGUI($lng->txt("next_update_break"), "update_break");
2507 $si->setOptions($options);
2508 $si->setInfo($lng->txt("next_update_break_info"));
2509 $this->form->addItem($si);
2510 }
2511
2512 if ($dbupdate->getRunningStatus() > 0)
2513 {
2514 ilUtil::sendFailure($this->lng->txt("db_update_interrupted")."<br /><br />".
2515 $this->lng->txt("db_update_interrupted_avoid"));
2516 }
2517 else
2518 {
2519 ilUtil::sendInfo($this->lng->txt("database_needs_update"));
2520 }
2521 $this->form->addCommandButton("updateDatabase", $lng->txt("database_update"));
2522 $this->form->addCommandButton("showUpdateSteps", $lng->txt("show_update_steps"));
2523 }
2524 else if ($hotfix_available)
2525 {
2526 // hotfix current version
2527 $ne = new ilNonEditableValueGUI($lng->txt("applied_hotfixes"), "curhf");
2528 $ne->setValue($dbupdate->getHotfixCurrentVersion());
2529 $this->form->addItem($ne);
2530
2531 // hotfix file version
2532 $ne = new ilNonEditableValueGUI($lng->txt("available_hotfixes"), "filehf");
2533 $ne->setValue($dbupdate->getHotfixFileVersion());
2534 $this->form->addItem($ne);
2535
2536 $this->form->addCommandButton("applyHotfix", $lng->txt("apply_hotfixes"));
2537 $this->form->addCommandButton("showHotfixSteps", $lng->txt("show_update_steps"));
2538 ilUtil::sendInfo($this->lng->txt("database_needs_update"));
2539 }
2540 elseif($custom_updates_available)
2541 {
2542 // custom updates current version
2543 $ne = new ilNonEditableValueGUI($lng->txt("applied_custom_updates"), "curcu");
2544 $ne->setValue($dbupdate->getCustomUpdatesCurrentVersion());
2545 $this->form->addItem($ne);
2546
2547 // custom updates file version
2548 $ne = new ilNonEditableValueGUI($lng->txt("available_custom_updates"), "filecu");
2549 $ne->setValue($dbupdate->getCustomUpdatesFileVersion());
2550 $this->form->addItem($ne);
2551
2552 $this->form->addCommandButton("applyCustomUpdates", $lng->txt("apply_custom_updates"));
2553 ilUtil::sendInfo($this->lng->txt("database_needs_update"));
2554 }
2555 else
2556 {
2557 if ($dbupdate->getHotfixFileVersion() > 0)
2558 {
2559 // hotfix current version
2560 $ne = new ilNonEditableValueGUI($lng->txt("applied_hotfixes"), "curhf");
2561 $ne->setValue($dbupdate->getHotfixCurrentVersion());
2562 $this->form->addItem($ne);
2563
2564 // hotfix file version
2565 $ne = new ilNonEditableValueGUI($lng->txt("available_hotfixes"), "filehf");
2566 $ne->setValue($dbupdate->getHotfixFileVersion());
2567 $this->form->addItem($ne);
2568 }
2569 if ($dbupdate->getCustomUpdatesFileVersion() > 0)
2570 {
2571 // custom updates current version
2572 $ne = new ilNonEditableValueGUI($lng->txt("applied_custom_updates"), "curcu");
2573 $ne->setValue($dbupdate->getCustomUpdatesCurrentVersion());
2574 $this->form->addItem($ne);
2575
2576 // custom updates file version
2577 $ne = new ilNonEditableValueGUI($lng->txt("available_custom_updates"), "filecu");
2578 $ne->setValue($dbupdate->getCustomUpdatesFileVersion());
2579 $this->form->addItem($ne);
2580 }
2581 ilUtil::sendSuccess($this->lng->txt("database_is_uptodate"));
2582 }
2583 }
2584
2585 $this->form->setTitle($lng->txt("database"));
2586 $this->form->setFormAction("setup.php?cmd=gateway");
2587 }
2588
2593 public function getClientDbFormValues($dbupdate = null)
2594 {
2595 global $lng;
2596
2597 $values = array();
2598
2599 $values["db_host"] = $this->setup->getClient()->getDbHost();
2600 $values["db_name"] = $this->setup->getClient()->getDbName();
2601 $values["db_user"] = $this->setup->getClient()->getDbUser();
2602 $values["db_port"] = $this->setup->getClient()->getDbPort();
2603 $values["db_type"] = $lng->txt("db_".$this->setup->getClient()->getDbType());
2604 if (is_object($dbupdate))
2605 {
2606 $values["update_break"] = $dbupdate->fileVersion;
2607 if (($dbupdate->fileVersion - $dbupdate->currentVersion) >= 200)
2608 {
2609 $values["update_break"] = $dbupdate->currentVersion + 200 -
2610 ($dbupdate->currentVersion % 100);
2611 }
2612 }
2613
2614 $this->form->setValuesByArray($values);
2615 }
2616
2620
2628 {
2629 if (!$this->setup->getClient()->db_exists)
2630 {
2631 if ($_POST["chk_db_create"])
2632 {
2633 if (!$this->setup->createDatabase($_POST["collation"]))
2634 {
2635 ilUtil::sendFailure($this->lng->txt($this->setup->getError()), true);
2636 ilUtil::redirect("setup.php?cmd=displayDatabase");
2637 }
2638 }
2639 else
2640 {
2641 ilUtil::sendFailure($this->lng->txt("database_not_exists_create_first"), true);
2642 ilUtil::redirect("setup.php?cmd=displayDatabase");
2643 }
2644 }
2645 if (!$this->setup->installDatabase())
2646 {
2647 ilUtil::sendFailure($this->lng->txt($this->setup->getError()), true);
2648 }
2649 else
2650 {
2651 ilUtil::sendSuccess($this->lng->txt("database_installed"), true);
2652 }
2653 ilUtil::redirect("setup.php?cmd=displayDatabase");
2654 }
2655
2659
2664 {
2666
2667 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
2668
2669 include_once "./Services/Database/classes/class.ilDBUpdate.php";
2670 include_once "./Services/AccessControl/classes/class.ilRbacAdmin.php";
2671 include_once "./Services/AccessControl/classes/class.ilRbacReview.php";
2672 include_once "./Services/AccessControl/classes/class.ilRbacSystem.php";
2673 include_once "./Services/Tree/classes/class.ilTree.php";
2674 include_once "./Services/Xml/classes/class.ilSaxParser.php";
2675 include_once "./Services/Object/classes/class.ilObjectDefinition.php";
2676
2677 // #9019: init timezone
2678 $tz = $this->setup->ini->readVariable("server","timezone");
2679 if ($tz != "")
2680 {
2681 if (function_exists('date_default_timezone_set'))
2682 {
2683 date_default_timezone_set($tz);
2684 }
2685 define ("IL_TIMEZONE", $tz);
2686 }
2687
2688 // referencing db handler in language class
2689 $ilDB = $this->setup->getClient()->db;
2690 $this->lng->setDbHandler($ilDB);
2691
2692 // run dbupdate
2693 $dbupdate = new ilDBUpdate($ilDB);
2694 $dbupdate->applyUpdate((int) $_POST["update_break"]);
2695
2696 if ($dbupdate->updateMsg == "no_changes")
2697 {
2698 $message = $this->lng->txt("no_changes").". ".$this->lng->txt("database_is_uptodate");
2699 }
2700 else
2701 {
2702 $sep = "";
2703 foreach ($dbupdate->updateMsg as $row)
2704 {
2705 if ($row["msg"] == "update_applied")
2706 {
2707 $a_message.= $sep.$row["nr"];
2708 $sep = ", ";
2709 }
2710 else
2711 {
2712 $e_message.= "<br/>".$this->lng->txt($row["msg"]).": ".$row["nr"];
2713 }
2714 }
2715 if ($a_message != "")
2716 {
2717 $a_message = $this->lng->txt("update_applied").": ".$a_message;
2718 }
2719 }
2720
2721 ilUtil::sendInfo($a_message.$e_message, true);
2722 ilUtil::redirect("setup.php?cmd=displayDatabase");
2723 }
2724
2728
2736 {
2737 $this->showUpdateSteps(true);
2738 }
2739
2740
2744 function showUpdateSteps($a_hotfix = false)
2745 {
2747
2748 $this->checkDisplayMode("setup_database");
2749
2750 //$this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.clientsetup_db.html", "setup");
2751
2752 // database is intalled
2753 if ($this->setup->getClient()->db_installed)
2754 {
2755 $ilDB = $this->setup->getClient()->db;
2756 $this->lng->setDbHandler($ilDB);
2757 $dbupdate = new ilDBUpdate($ilDB);
2758 $db_status = $dbupdate->getDBVersionStatus();
2759 $hotfix_available = $dbupdate->hotfixAvailable();
2760 $custom_updates_available = $dbupdate->customUpdatesAvailable();
2761// $this->initClientDbForm(false, $dbupdate, $db_status, $hotfix_available, $custom_updates_available);
2762// $this->getClientDbFormValues($dbupdate);
2763
2764 $ntpl = new ilTemplate("tpl.setup_steps.html", true, true, "setup");
2765 if ($a_hotfix)
2766 {
2767 $ntpl->setVariable("CONTENT", $dbupdate->getHotfixSteps());
2768 }
2769 else
2770 {
2771 $ntpl->setVariable("CONTENT", $dbupdate->getUpdateSteps($_POST["update_break"]));
2772 }
2773 $ntpl->setVariable("BACK", $this->lng->txt("back"));
2774 $ntpl->setVariable("HREF_BACK", "./setup.php?client_id=&cmd=db");
2775 $this->tpl->setVariable("SETUP_CONTENT", $ntpl->get());
2776 }
2777 }
2778
2779
2783
2787 function applyHotfix()
2788 {
2790
2791 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
2792
2793 include_once "./Services/Database/classes/class.ilDBUpdate.php";
2794 include_once "./Services/AccessControl/classes/class.ilRbacAdmin.php";
2795 include_once "./Services/AccessControl/classes/class.ilRbacReview.php";
2796 include_once "./Services/AccessControl/classes/class.ilRbacSystem.php";
2797 include_once "./Services/Tree/classes/class.ilTree.php";
2798 include_once "./Services/Xml/classes/class.ilSaxParser.php";
2799 include_once "./Services/Object/classes/class.ilObjectDefinition.php";
2800
2801 // referencing db handler in language class
2802 $ilDB = $this->setup->getClient()->db;
2803 $this->lng->setDbHandler($ilDB);
2804
2805 // run dbupdate
2806 $dbupdate = new ilDBUpdate($ilDB);
2807 $dbupdate->applyHotfix();
2808
2809 if ($dbupdate->updateMsg == "no_changes")
2810 {
2811 $message = $this->lng->txt("no_changes").". ".$this->lng->txt("database_is_uptodate");
2812 }
2813 else
2814 {
2815 $sep = "";
2816 foreach ($dbupdate->updateMsg as $row)
2817 {
2818 if ($row["msg"] == "update_applied")
2819 {
2820 $a_message.= $sep.$row["nr"];
2821 $sep = ", ";
2822 }
2823 else
2824 {
2825 $e_message.= "<br/>".$this->lng->txt($row["msg"]).": ".$row["nr"];
2826 }
2827 }
2828 if ($a_message != "")
2829 {
2830 $a_message = $this->lng->txt("update_applied").": ".$a_message;
2831 }
2832 }
2833
2834 ilUtil::sendInfo($a_message.$e_message, true);
2835 ilUtil::redirect("setup.php?cmd=displayDatabase");
2836 }
2837
2841
2846 {
2847 require_once('Services/Authentication/classes/class.ilSessionControl.php');
2848
2849 $this->checkDisplayMode("setup_sessions");
2850
2851 if (!$this->setup->getClient()->db_installed)
2852 {
2853 // program should never come to this place
2854 $message = "No database found! Please install database first.";
2855 ilUtil::sendInfo($message);
2856 }
2857
2858 $setting_fields = ilSessionControl::getSettingFields();
2859
2860 $valid = true;
2861 $settings = array();
2862
2863 foreach( $setting_fields as $field )
2864 {
2865 if( $field == 'session_allow_client_maintenance' )
2866 {
2867 if( isset($_POST[$field]) ) $_POST[$field] = '1';
2868 else $_POST[$field] = '0';
2869 }
2870
2871 if( isset($_POST[$field]) && $_POST[$field] != '' )
2872 {
2873 $settings[$field] = $_POST[$field];
2874 }
2875 else
2876 {
2877 $valid = false;
2878 break;
2879 }
2880
2881 }
2882
2883 if($valid) $this->setup->setSessionSettings($settings);
2884
2885 $settings = $this->setup->getSessionSettings();
2886
2887 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2888 $form = new ilPropertyFormGUI();
2889
2890 include_once 'Services/Authentication/classes/class.ilSession.php';
2891
2892 // BEGIN SESSION SETTINGS
2893 // create session handling radio group
2894 $ssettings = new ilRadioGroupInputGUI($this->lng->txt('sess_mode'), 'session_handling_type');
2895 $ssettings->setValue($settings['session_handling_type'], ilSession::SESSION_HANDLING_FIXED);
2896
2897 // first option, fixed session duration
2898 $fixed = new ilRadioOption($this->lng->txt('sess_fixed_duration'), ilSession::SESSION_HANDLING_FIXED);
2899
2900 // add session handling to radio group
2901 $ssettings->addOption($fixed);
2902
2903 // second option, session control
2904 $ldsh = new ilRadioOption($this->lng->txt('sess_load_dependent_session_handling'), ilSession::SESSION_HANDLING_LOAD_DEPENDENT);
2905
2906 // this is the max count of active sessions
2907 // that are getting started simlutanously
2908 $ti = new ilTextInputGUI($this->lng->txt('sess_max_session_count'), "session_max_count");
2909 $ti->setInfo($this->lng->txt('sess_max_session_count_info'));
2910 $ti->setMaxLength(5);
2911 $ti->setSize(5);
2912 $ti->setValue($settings['session_max_count']);
2913 $ldsh->addSubItem($ti);
2914
2915 // after this (min) idle time the session can be deleted,
2916 // if there are further requests for new sessions,
2917 // but max session count is reached yet
2918 $ti = new ilTextInputGUI($this->lng->txt('sess_min_session_idle'), "session_min_idle");
2919 $ti->setInfo($this->lng->txt('sess_min_session_idle_info'));
2920 $ti->setMaxLength(5);
2921 $ti->setSize(5);
2922 $ti->setValue($settings['session_min_idle']);
2923 $ldsh->addSubItem($ti);
2924
2925 // after this (max) idle timeout the session expires
2926 // and become invalid, so it is not considered anymore
2927 // when calculating current count of active sessions
2928 $ti = new ilTextInputGUI($this->lng->txt('sess_max_session_idle'), "session_max_idle");
2929 $ti->setInfo($this->lng->txt('sess_max_session_idle_info'));
2930 $ti->setMaxLength(5);
2931 $ti->setSize(5);
2932 $ti->setValue($settings['session_max_idle']);
2933 $ldsh->addSubItem($ti);
2934
2935 // this is the max duration that can elapse between the first and the secnd
2936 // request to the system before the session is immidietly deleted
2937 $ti = new ilTextInputGUI($this->lng->txt('sess_max_session_idle_after_first_request'), "session_max_idle_after_first_request");
2938 $ti->setInfo($this->lng->txt('sess_max_session_idle_after_first_request_info'));
2939 $ti->setMaxLength(5);
2940 $ti->setSize(5);
2941 $ti->setValue($settings['session_max_idle_after_first_request']);
2942 $ldsh->addSubItem($ti);
2943
2944 // add session control to radio group
2945 $ssettings->addOption($ldsh);
2946
2947 $form->addItem($ssettings);
2948
2949 // controls the ability t maintenance the following
2950 // settings in client administration
2951 $chkb = new ilCheckboxInputGUI($this->lng->txt('sess_allow_client_maintenance'), "session_allow_client_maintenance");
2952 $chkb->setInfo($this->lng->txt('sess_allow_client_maintenance_info'));
2953 $chkb->setChecked($settings['session_allow_client_maintenance'] ? true : false);
2954 $form->addItem($chkb);
2955 // END SESSION SETTINGS
2956
2957 // save and cancel commands
2958 $form->addCommandButton("sess", $this->lng->txt('save'));
2959
2960 $form->setTitle($this->lng->txt("sess_sessions"));
2961 $form->setFormAction('setup.php?client_id='.$this->client_id.'&cmd=sess');
2962
2963 $this->tpl->setVariable("TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt('sess_sessions'))));
2964 $this->tpl->setVariable("TXT_INFO", '');
2965 $this->tpl->setVariable("SETUP_CONTENT", $form->getHTML());
2966
2967 /*$this->setButtonPrev("db");
2968
2969 if($this->setup->checkClientSessionSettings($this->client,true))
2970 {
2971 $this->setButtonNext("lang");
2972 }*/
2973
2974 $this->checkPanelMode();
2975 }
2976
2980
2985 {
2986 $this->checkDisplayMode("setup_languages");
2987
2988 if (!$this->setup->getClient()->db_installed)
2989 {
2990 // program should never come to this place
2991 $message = "No database found! Please install database first.";
2992 ilUtil::sendFailure($message);
2993 }
2994
2995 include_once("./setup/classes/class.ilSetupLanguageTableGUI.php");
2996 $tab = new ilSetupLanguageTableGUI($this->setup->getClient());
2997 $this->tpl->setVariable("SETUP_CONTENT", $tab->getHTML());
2998
2999 $this->tpl->setVariable("TXT_SETUP_TITLE",ucfirst(trim($this->lng->txt("setup_languages"))));
3000 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_lang"));
3001
3002 $installed_langs = $this->lng->getInstalledLanguages();
3003 $lang_count = count($installed_langs);
3004 if ($lang_count > 0)
3005 {
3006 $this->setup->getClient()->status["lang"]["status"] = true;
3007 $this->setup->getClient()->status["lang"]["comment"] = $lang_count." ".$this->lng->txt("languages_installed");
3008 }
3009 else
3010 {
3011 $this->setup->getClient()->status["lang"]["status"] = false;
3012 $this->setup->getClient()->status["lang"]["comment"] = $this->lng->txt("lang_none_installed");
3013 }
3014
3015 $this->setButtonPrev("lang");
3016
3017 if ($lang_count > 0)
3018 {
3019 $this->setButtonNext("contact");
3020 }
3021
3022 $this->checkPanelMode();
3023 }
3024
3031 function saveLanguages()
3032 {
3033 if (empty($_POST["form"]["lang_id"]))
3034 {
3035 ilUtil::sendFailure($this->lng->txt("lang_min_one_language"), true);
3036 ilUtil::redirect("setup.php?cmd=lang");
3037 }
3038
3039 if (!in_array($_POST["form"]["lang_default"],$_POST["form"]["lang_id"]))
3040 {
3041 ilUtil::sendFailure($this->lng->txt("lang_not_installed_default"), true);
3042 ilUtil::redirect("setup.php?cmd=lang");
3043 }
3044
3045 $result = $this->lng->installLanguages($_POST["form"]["lang_id"], $_POST["form"]["lang_local"]);
3046
3047 if (is_array($result))
3048 {
3049 $count = count($result);
3050 $txt = "tet";
3051
3052 foreach ($result as $key => $lang_key)
3053 {
3054 $list .= $this->lng->txt("lang_".$lang_key);
3055
3056 if ($count > $key + 1)
3057 {
3058 $list .= ", ";
3059 }
3060 }
3061 }
3062
3063 $this->setup->getClient()->setDefaultLanguage($_POST["form"]["lang_default"]);
3064 $message = $this->lng->txt("languages_installed");
3065
3066 if ($result !== true)
3067 {
3068 $message .= "<br/>(".$this->lng->txt("langs_not_valid_not_installed").": ".$list.")";
3069 }
3070 ilUtil::sendInfo($message, true);
3071 ilUtil::redirect("setup.php?cmd=lang");
3072 }
3073
3077
3081 function displayContactData($a_omit_init = false)
3082 {
3083 $this->checkDisplayMode("setup_contact_data");
3084 $settings = $this->setup->getClient()->getAllSettings();
3085
3086 if (!$a_omit_init)
3087 {
3088 $this->initContactDataForm();
3089 $this->getContactValues();
3090 }
3091 $this->tpl->setVariable("SETUP_CONTENT", $this->form->getHTML());
3092 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_contact"));
3093 $this->setButtonPrev("lang");
3094
3095 $check = $this->setup->checkClientContact($this->setup->client);
3096
3097 $this->setup->getClient()->status["contact"]["status"] = $check["status"];
3098 $this->setup->getClient()->status["contact"]["comment"] = $check["comment"];
3099
3100 if ($check["status"])
3101 {
3102 $this->setButtonNext("proxy");
3103 }
3104
3105 $this->checkPanelMode();
3106 }
3107
3113 public function initContactDataForm()
3114 {
3115 global $lng, $ilCtrl;
3116
3117 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
3118 $this->form = new ilPropertyFormGUI();
3119
3120 // name
3121 $ti = new ilTextInputGUI($lng->txt("name"), "inst_name");
3122 $ti->setMaxLength(64);
3123 $ti->setSize(30);
3124 $ti->setRequired(true);
3125 $this->form->addItem($ti);
3126
3127 // description
3128 $ti = new ilTextInputGUI($lng->txt("client_info"), "inst_info");
3129 $ti->setMaxLength(64);
3130 $ti->setSize(30);
3131 $this->form->addItem($ti);
3132
3133 // institution
3134 $ti = new ilTextInputGUI($lng->txt("client_institution"), "inst_institution");
3135 $ti->setMaxLength(64);
3136 $ti->setSize(30);
3137 $this->form->addItem($ti);
3138
3139 // contact data
3140 $sh = new ilFormSectionHeaderGUI();
3141 $sh->setTitle($lng->txt("contact_data"));
3142 $this->form->addItem($sh);
3143
3144 // first name
3145 $ti = new ilTextInputGUI($lng->txt("firstname"), "admin_firstname");
3146 $ti->setMaxLength(64);
3147 $ti->setSize(30);
3148 $ti->setRequired(true);
3149 $this->form->addItem($ti);
3150
3151 // last name
3152 $ti = new ilTextInputGUI($lng->txt("lastname"), "admin_lastname");
3153 $ti->setMaxLength(64);
3154 $ti->setSize(30);
3155 $ti->setRequired(true);
3156 $this->form->addItem($ti);
3157
3158 $fs = array (
3159 "title" => array("max" => 64, "size" => 30),
3160 "position" => array("max" => 64, "size" => 30),
3161 "institution" => array("max" => 200, "size" => 30),
3162 "street" => array("max" => 64, "size" => 30),
3163 "zipcode" => array("max" => 10, "size" => 5),
3164 "city" => array("max" => 64, "size" => 30),
3165 "country" => array("max" => 64, "size" => 30),
3166 "phone" => array("max" => 64, "size" => 30)
3167 );
3168 foreach ($fs as $f => $op)
3169 {
3170 // field
3171 $ti = new ilTextInputGUI($lng->txt($f), "admin_".$f);
3172 $ti->setMaxLength($op["max"]);
3173 $ti->setSize($op["size"]);
3174 $ti->setInfo($lng->txt(""));
3175 $this->form->addItem($ti);
3176 }
3177
3178 // email
3179 $ti = new ilEmailInputGUI($lng->txt("email"), "admin_email");
3180 $ti->setRequired(true);
3181 $ti->allowRFC822(true);
3182 $this->form->addItem($ti);
3183
3184 // feedback recipient
3185 $ti = new ilEmailInputGUI($lng->txt("feedback_recipient"), "feedback_recipient");
3186 $ti->setInfo($lng->txt("feedback_recipient_info"));
3187 $ti->setRequired(true);
3188 $ti->allowRFC822(true);
3189 $this->form->addItem($ti);
3190
3191 // error recipient
3192 $ti = new ilEmailInputGUI($lng->txt("error_recipient"), "error_recipient");
3193 $ti->allowRFC822(true);
3194 $this->form->addItem($ti);
3195
3196 $this->form->addCommandButton("saveContact", $lng->txt("save"));
3197
3198 $this->form->setTitle($lng->txt("client_data"));
3199 $this->form->setFormAction("setup.php?cmd=gateway");
3200 }
3201
3205 public function getContactValues()
3206 {
3207
3208 $settings = $this->setup->getClient()->getAllSettings();
3209
3210 $values = $settings;
3211
3212 $values["inst_name"] = ($this->setup->getClient()->getName())
3213 ? $this->setup->getClient()->getName()
3214 : $this->setup->getClient()->getId();
3215 $values["inst_info"] = $this->setup->getClient()->getDescription();
3216
3217 $this->form->setValuesByArray($values);
3218 }
3219
3223 public function saveContact()
3224 {
3225 global $tpl, $lng, $ilCtrl;
3226
3227 $this->initContactDataForm();
3228 if ($this->form->checkInput())
3229 {
3230 $this->setup->getClient()->setSetting("admin_firstname", $_POST["admin_firstname"]);
3231 $this->setup->getClient()->setSetting("admin_lastname", $_POST["admin_lastname"]);
3232 $this->setup->getClient()->setSetting("admin_title", $_POST["admin_title"]);
3233 $this->setup->getClient()->setSetting("admin_position", $_POST["admin_position"]);
3234 $this->setup->getClient()->setSetting("admin_institution", $_POST["admin_institution"]);
3235 $this->setup->getClient()->setSetting("admin_street", $_POST["admin_street"]);
3236 $this->setup->getClient()->setSetting("admin_zipcode", $_POST["admin_zipcode"]);
3237 $this->setup->getClient()->setSetting("admin_city", $_POST["admin_city"]);
3238 $this->setup->getClient()->setSetting("admin_country", $_POST["admin_country"]);
3239 $this->setup->getClient()->setSetting("admin_phone", $_POST["admin_phone"]);
3240 $this->setup->getClient()->setSetting("admin_email", $_POST["admin_email"]);
3241 $this->setup->getClient()->setSetting("inst_institution", $_POST["inst_institution"]);
3242 $this->setup->getClient()->setSetting("inst_name", $_POST["inst_name"]);
3243 $this->setup->getClient()->setSetting("feedback_recipient", $_POST["feedback_recipient"]);
3244 $this->setup->getClient()->setSetting("error_recipient", $_POST["error_recipient"]);
3245
3246 // update client.ini
3247 $this->setup->getClient()->setName($_POST["inst_name"]);
3248 $this->setup->getClient()->setDescription($_POST["inst_info"]);
3249 $this->setup->getClient()->ini->write();
3250
3251 ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
3252 ilUtil::redirect("setup.php?cmd=displayContactData");
3253 }
3254
3255 $this->form->setValuesByPost();
3256 $this->displayContactData(true);
3257 }
3258
3262
3266 function displayNIC($a_omit_init = false)
3267 {
3268 $this->checkDisplayMode("nic_registration");
3269 $settings = $this->setup->getClient()->getAllSettings();
3270 $nic_key = $this->setup->getClient()->getNICkey();
3271
3272 // reload settings
3273 $settings = $this->setup->getClient()->getAllSettings();
3274//var_dump($settings);
3275 if ($settings["nic_enabled"] == "1" && $settings["inst_id"] > 0)
3276 {
3277 $this->no_second_nav = true;
3278 $this->tpl->setVariable("TXT_INFO",$this->lng->txt("info_text_nic3")." ".$settings["inst_id"].".");
3279 }
3280 else
3281 {
3282 // reload settings
3283 $settings = $this->setup->getClient()->getAllSettings();
3284
3285 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_nic"));
3286 if (!$a_omit_init)
3287 {
3288 $this->initRegistrationForm();
3289 $this->getRegistrationValues();
3290 }
3291 $this->tpl->setVariable("SETUP_CONTENT", $this->form->getHTML());
3292
3293 if (isset($settings["nic_enabled"]))
3294 {
3295 $this->setup->getClient()->status["nic"]["status"] = true;
3296 }
3297
3298 }
3299
3300 $this->setButtonPrev("proxy");
3301
3302 if ($this->setup->getClient()->status["nic"]["status"])
3303 {
3304 $this->setButtonNext("finish","finish");
3305 }
3306
3307 $this->checkPanelMode();
3308 }
3309
3315 public function initRegistrationForm($a_mode = "edit")
3316 {
3317 global $lng, $ilCtrl;
3318
3319 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
3320 $this->form = new ilPropertyFormGUI();
3321
3322 // registration type
3323 $radg = new ilRadioGroupInputGUI($lng->txt("nic_registration"), "register");
3324 $radg->setValue(1);
3325 $op1 = new ilRadioOption($lng->txt("nic_reg_online"), 1);
3326 $radg->addOption($op1);
3327 $op1 = new ilRadioOption($lng->txt("nic_reg_disable"), 0, $lng->txt("nic_reg_disable_info"));
3328 $radg->addOption($op1);
3329 $this->form->addItem($radg);
3330
3331 $this->form->addCommandButton("saveRegistration", $lng->txt("save"));
3332 $this->form->setFormAction("setup.php?cmd=gateway");
3333 }
3334
3338 public function getRegistrationValues()
3339 {
3340 $settings = $this->setup->getClient()->getAllSettings();
3341 $nic_key = $this->setup->getClient()->getNICkey();
3342
3343
3344 $values = array();
3345
3346 if (!isset($settings["nic_enabled"]) or $settings["nic_enabled"] == "1")
3347 {
3348 $values["register"] = 1;
3349 }
3350 /*elseif ($settings["nic_enabled"] == "2")
3351 {
3352 $this->tpl->setVariable("EMAIL",$checked);
3353 }*/
3354 else
3355 {
3356 $values["register"] = 0;
3357 }
3358
3359 $this->form->setValuesByArray($values);
3360 }
3361
3365 public function saveRegistration()
3366 {
3367 global $tpl, $lng, $ilCtrl;
3368
3369 $this->initRegistrationForm();
3370 if ($this->form->checkInput())
3371 {
3372 // check register option
3373 if ($_POST["register"] == 1)
3374 {
3375 // update nic
3376 $this->setup->getClient()->updateNIC($this->setup->ilias_nic_server);
3377//var_dump($this->setup->getClient()->nic_status);
3378 // online registration failed
3379 if (empty($this->setup->getClient()->nic_status[2]))
3380 {
3381 $this->setup->getClient()->setSetting("nic_enabled","-1");
3382 ilUtil::sendFailure($this->lng->txt("nic_reg_failed"), true);
3383 ilUtil::redirect("setup.php?cmd=displayNIC");
3384 }
3385 else
3386 {
3387 $this->setup->getClient()->setSetting("inst_id",$this->setup->getClient()->nic_status[2]);
3388 $this->setup->getClient()->setSetting("nic_enabled","1");
3389 $this->setup->getClient()->status["nic"]["status"] = true;
3390 ilUtil::sendSuccess($this->lng->txt("nic_reg_enabled"), true);
3391 ilUtil::redirect("setup.php?cmd=displayNIC");
3392 }
3393 }
3394 /*elseif ($_POST["form"]["register"] == 2)
3395 {
3396 $nic_by_email = (int) $_POST["form"]["nic_id"];
3397
3398 $checksum = md5($nic_key.$nic_by_email);
3399
3400 if (!$nic_by_email or $_POST["form"]["nic_checksum"] != $checksum)
3401 {
3402 $message = $this->lng->txt("nic_reg_enter_correct_id");
3403 }
3404 else
3405 {
3406 $this->setup->getClient()->setSetting("inst_id",$nic_by_email);
3407 $this->setup->getClient()->setSetting("nic_enabled","1");
3408 $message = $this->lng->txt("nic_reg_enabled");
3409 }
3410 }*/
3411 else
3412 {
3413 $this->setup->getClient()->setSetting("inst_id","0");
3414 $this->setup->getClient()->setSetting("nic_enabled","0");
3415 ilUtil::sendSuccess($this->lng->txt("nic_reg_disabled"), true);
3416 ilUtil::redirect("setup.php?cmd=displayNIC");
3417 }
3418 }
3419
3420 $this->form->setValuesByPost();
3421 $this->displayNIC(true);
3422 }
3423
3427
3431 function displayTools()
3432 {
3433 $this->checkDisplayMode();
3434
3435 // output
3437
3438 // use property forms and add the settings type switch
3439 $ctrl_structure_form = $this->initControlStructureForm();
3440 $settings_type_form = $this->initSettingsTypeForm();
3441 $mp_ns_form = $this->initTreeImplementationForm();
3442
3443 $this->tpl->setVariable("SETUP_CONTENT",
3444 $ctrl_structure_form->getHTML() . "<br />" .
3445 $settings_type_form->getHTML().'<br />'.
3446 $mp_ns_form->getHTML());
3447
3448 }
3449
3451 {
3452 include_once ("Services/Form/classes/class.ilPropertyFormGUI.php");
3453 $form = new ilPropertyFormGUI();
3454
3455 $form->setId('tree_impl');
3456 $form->setTitle($this->lng->txt('tree_implementation'));
3457 $form->setFormAction('setup.php?cmd=gateway');
3458
3459
3460 $options = new ilRadioGroupInputGUI('', 'tree_impl_type');
3461 #$options->setRequired(true);
3462
3463 $set = new ilSetting('common');
3464 $type = ($set->get('main_tree_impl','ns') == 'ns' ? 'ns' : 'mp');
3465
3466
3467 $options->setValue($type);
3468
3469 $ns = new ilRadioOption($this->lng->txt('tree_implementation_ns'), 'ns');
3470 $options->addOption($ns);
3471
3472 $mp = new ilRadioOption($this->lng->txt('tree_implementation_mp'),'mp');
3473 $options->addOption($mp);
3474
3475 $form->addItem($options);
3476 $form->addCommandButton('switchTree', $this->lng->txt('tree_implementation_switch_btn'));
3477 $form->setShowTopButtons(false);
3478
3479 return $form;
3480
3481 }
3482
3483 public function switchTree()
3484 {
3485 $set = new ilSetting('common');
3486 $type = ($set->get('main_tree_impl','ns') == 'ns' ? 'ns' : 'mp');
3487
3488 if($type == 'ns' and $_POST['tree_impl_type'] == 'mp')
3489 {
3490 // To mp
3491 include_once './Services/Tree/classes/class.ilMaterializedPathTree.php';
3493
3494 $GLOBALS['ilDB']->dropIndexByFields('tree',array('lft'));
3495 $GLOBALS['ilDB']->dropIndexByFields('tree',array('path'));
3496 $GLOBALS['ilDB']->addIndex('tree',array('path'),'i4');
3497
3498 $set->set('main_tree_impl', 'mp');
3499
3500 }
3501 elseif($type == 'mp' and $_POST['tree_impl_type'] == 'ns')
3502 {
3503 include_once './Services/Tree/classes/class.ilTree.php';
3504 $GLOBALS['ilSetting'] = $set;
3505 $tree = new ilTree(1);
3506 $tree->renumber(1);
3507
3508 $GLOBALS['ilDB']->dropIndexByFields('tree',array('lft'));
3509 $GLOBALS['ilDB']->dropIndexByFields('tree',array('path'));
3510 $GLOBALS['ilDB']->addIndex('tree',array('lft'),'i4');
3511
3512 $set->set('main_tree_impl', 'ns');
3513 }
3514
3515 ilUtil::sendInfo($this->lng->txt("tree_implementation_switched"), true);
3516 $this->displayTools();
3517 }
3518
3525 {
3526 include_once ("Services/Form/classes/class.ilPropertyFormGUI.php");
3527 $form = new ilPropertyFormGUI();
3528
3529 $form->setId("control_structure");
3530 $form->setTitle($this->lng->txt("ctrl_structure"));
3531 $form->setFormAction("setup.php?cmd=gateway");
3532
3533 $ilDB = $this->setup->getClient()->db;
3534 $cset = $ilDB->query("SELECT count(*) as cnt FROM ctrl_calls");
3535 $crec = $ilDB->fetchAssoc($cset);
3536
3537 $item = new ilCustomInputGUI($this->lng->txt("ctrl_structure_reload"));
3538 if ($crec["cnt"] == 0)
3539 {
3540 $item->setInfo($this->lng->txt("ctrl_missing_desc"));
3541 }
3542 else
3543 {
3544 $item->setInfo($this->lng->txt("ctrl_structure_desc"));
3545 }
3546 $form->addItem($item);
3547
3548 $form->addCommandButton("reloadStructure", $this->lng->txt("reload"));
3549 return $form;
3550 }
3551
3552
3557 {
3559
3560 if (!$this->setup->getClient()->db_installed)
3561 {
3562 ilUtil::sendInfo($this->lng->txt("no_db"), true);
3563 $this->displayTools();
3564 return;
3565 }
3566
3567 // referencing does not work in dbupdate-script
3568 $GLOBALS["ilDB"] = $this->setup->getClient()->getDB();
3569// BEGIN WebDAV
3570 // read module and service information into db
3571 require_once "./setup/classes/class.ilModuleReader.php";
3572 require_once "./setup/classes/class.ilServiceReader.php";
3573 require_once "./setup/classes/class.ilCtrlStructureReader.php";
3574
3575 require_once "./Services/Component/classes/class.ilModule.php";
3576 require_once "./Services/Component/classes/class.ilService.php";
3579
3580 // clear tables
3581 $mr = new ilModuleReader("", "", "");
3582 $mr->clearTables();
3583 foreach($modules as $module)
3584 {
3585 $mr = new ilModuleReader(ILIAS_ABSOLUTE_PATH."/Modules/".$module["subdir"]."/module.xml",
3586 $module["subdir"], "Modules");
3587 $mr->getModules();
3588 unset($mr);
3589 }
3590
3591 // clear tables
3592 $sr = new ilServiceReader("", "", "");
3593 $sr->clearTables();
3594 foreach($services as $service)
3595 {
3596 $sr = new ilServiceReader(ILIAS_ABSOLUTE_PATH."/Services/".$service["subdir"]."/service.xml",
3597 $service["subdir"], "Services");
3598 $sr->getServices();
3599 unset($sr);
3600 }
3601// END WebDAV
3602
3603 $ilCtrlStructureReader->readStructure(true);
3604 ilUtil::sendInfo($this->lng->txt("ctrl_structure_reloaded"), true);
3605 $this->displayTools();
3606 }
3607
3614 {
3615 include_once("./Services/Administration/classes/class.ilSetting.php");
3616 $type = ilSetting::_getValueType();
3617
3618 include_once ("Services/Form/classes/class.ilPropertyFormGUI.php");
3619 $form = new ilPropertyFormGUI();
3620
3621 $form->setId("settings_type");
3622 $form->setTitle($this->lng->txt("settings_type"));
3623 $form->setFormAction("setup.php?cmd=gateway");
3624
3625 $item = new ilNonEditableValueGUI($this->lng->txt('settings_type_current'));
3626 $item->setValue(strtoupper($type));
3627
3628 if ($type == "clob")
3629 {
3630 $item->setInfo($this->lng->txt('settings_info_clob'));
3631 $form->addCommandButton("showLongerSettings", $this->lng->txt("settings_show_longer"));
3632 $form->addCommandButton("changeSettingsType", $this->lng->txt("settings_change_text"));
3633 }
3634 else
3635 {
3636 $item->setInfo($this->lng->txt('settings_info_text'));
3637 $form->addCommandButton("changeSettingsType", $this->lng->txt("settings_change_clob"));
3638 }
3639 $form->addItem($item);
3640
3641 if (is_array($this->longer_settings))
3642 {
3643 $item = new ilCustomInputGUI($this->lng->txt('settings_longer_values'));
3644
3645 if (count($this->longer_settings))
3646 {
3647 foreach ($this->longer_settings as $row)
3648 {
3649 $subitem = new ilCustomInputGUI(sprintf($this->lng->txt('settings_key_info'), $row['module'], $row['keyword']));
3650 $subitem->setInfo($row['value']);
3651 $item->addSubItem($subitem);
3652 }
3653 }
3654 else
3655 {
3656 $item->setHTML($this->lng->txt('settings_no_longer_values'));
3657 }
3658 $form->addItem($item);
3659 }
3660
3661 return $form;
3662 }
3663
3664
3669 {
3670 include_once("./Services/Administration/classes/class.ilSetting.php");
3671 $old_type = ilSetting::_getValueType();
3672
3673 if ($old_type == "clob")
3674 {
3675 $longer_settings = ilSetting::_getLongerSettings();
3676 if (count($longer_settings))
3677 {
3678 $this->longer_settings = $longer_settings;
3679 ilUtil::sendFailure($this->lng->txt("settings_too_long"));
3680 }
3681 else
3682 {
3684 }
3685 }
3686 else
3687 {
3689 }
3690
3691 if ($changed)
3692 {
3693 ilUtil::sendInfo($this->lng->txt("settings_type_changed"));
3694 }
3695
3696 $this->displayTools();
3697 }
3698
3699
3705 {
3706 include_once("./Services/Administration/classes/class.ilSetting.php");
3707 $this->longer_settings = ilSetting::_getLongerSettings();
3708 $this->displayTools();
3709 }
3710
3715 {
3716 $this->tpl->addBlockFile("CONTENT","content","tpl.std_layout.html", "setup");
3717
3718 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_password"));
3719
3720 // formular sent
3721 if ($_POST["form"])
3722 {
3723 $pass_old = $this->setup->getPassword();
3724
3725 if (empty($_POST["form"]["pass_old"]))
3726 {
3727 $message = $this->lng->txt("password_enter_old");
3728 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3729 }
3730
3731 if (md5($_POST["form"]["pass_old"]) != $pass_old)
3732 {
3733 $message = $this->lng->txt("password_old_wrong");
3734 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3735 }
3736
3737 if (empty($_POST["form"]["pass"]))
3738 {
3739 $message = $this->lng->txt("password_empty");
3740 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3741 }
3742
3743 if ($_POST["form"]["pass"] != $_POST["form"]["pass2"])
3744 {
3745 $message = $this->lng->txt("password_not_match");
3746 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3747 }
3748
3749 if (md5($_POST["form"]["pass"]) == $pass_old)
3750 {
3751 $message = $this->lng->txt("password_same");
3752 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3753 }
3754
3755 if (!$this->setup->setPassword($_POST["form"]["pass"]))
3756 {
3757 $message = $this->lng->txt("save_error");
3758 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
3759 }
3760
3761 ilUtil::sendInfo($this->lng->txt("password_changed"),true);
3762 ilUtil::redirect("setup.php");
3763 }
3764
3765 // output
3766 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.form_change_admin_password.html", "setup");
3767
3768 $this->tpl->setVariable("TXT_HEADER",$this->lng->txt("password_new_master"));
3769
3770 // pass form
3771 $this->tpl->setVariable("FORMACTION", "setup.php?cmd=gateway");
3772 $this->tpl->setVariable("TXT_REQUIRED_FIELDS", $this->lng->txt("required_field"));
3773 $this->tpl->setVariable("TXT_PASS_TITLE",$this->lng->txt("change_password"));
3774 $this->tpl->setVariable("TXT_PASS_OLD",$this->lng->txt("set_oldpasswd"));
3775 $this->tpl->setVariable("TXT_PASS",$this->lng->txt("set_newpasswd"));
3776 $this->tpl->setVariable("TXT_PASS2",$this->lng->txt("password_retype"));
3777 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
3778 }
3779
3784 {
3785 $this->checkDisplayMode("finish_setup");
3786 $this->no_second_nav = true;
3787//echo "<b>1</b>";
3788 if ($this->validateSetup())
3789 {
3790 $txt_info = $this->lng->txt("info_text_finish1")."<br /><br />".
3791 "<p>".$this->lng->txt("user").": <b>root</b><br />".
3792 $this->lng->txt("password").": <b>homer</b></p>";
3793 $this->setButtonNext("login_new","login");
3794//echo "<b>2</b>";
3795 $this->setup->getClient()->reconnect(); // if this is not done, the writing of
3796 // the setup_ok fails (with MDB2 and a larger
3797 // client list), alex 17.1.2008
3798 $this->setup->getClient()->setSetting("setup_ok",1);
3799//$this->setup->getClient()->setSetting("zzz", "Z");
3800//echo "<b>3</b>";
3801 $this->setup->getClient()->status["finish"]["status"] = true;
3802//echo "<b>4</b>";
3803 }
3804 else
3805 {
3806 $txt_info = $this->lng->txt("info_text_finish2");
3807 }
3808
3809//echo "<b>5</b>";
3810 // output
3811 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.clientsetup_finish.html", "setup");
3812 $this->tpl->setVariable("TXT_INFO",$txt_info);
3813
3814 $this->setButtonPrev("nic");
3815//echo "<b>6</b>";
3816 $this->checkPanelMode();
3817//echo "<b>7</b>";
3818 }
3819
3824 {
3825 $this->checkDisplayMode();
3826
3827 // formular sent
3828 if ($_POST["form"]["delete"])
3829 {
3830 $ini = true;
3831 $db = false;
3832 $files = false;
3833
3834 /* disabled
3835 switch ($_POST["form"]["delete"])
3836 {
3837 case 1:
3838 $ini = true;
3839 break;
3840
3841 case 2:
3842 $ini = true;
3843 $db = true;
3844 break;
3845
3846 case 3:
3847 $ini = true;
3848 $db = true;
3849 $files = true;
3850 break;
3851 }
3852 */
3853
3854 $msg = $this->setup->getClient()->delete($ini,$db,$files);
3855
3856 ilUtil::sendInfo($this->lng->txt("client_deleted"),true);
3857 ilUtil::redirect("setup.php");
3858 }
3859
3860 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_delete"));
3861
3862 // output
3863 $this->tpl->addBlockFile("SETUP_CONTENT","setup_content","tpl.form_delete_client.html", "setup");
3864
3865 // delete panel
3866 $this->tpl->setVariable("FORMACTION", "setup.php?cmd=gateway");
3867 $this->tpl->setVariable("TXT_DELETE", $this->lng->txt("delete"));
3868 $this->tpl->setVariable("TXT_DELETE_CONFIRM", $this->lng->txt("delete_confirm"));
3869 $this->tpl->setVariable("TXT_DELETE_INFO", $this->lng->txt("delete_info"));
3870
3871 $this->checkPanelMode();
3872 }
3873
3879 function changeAccessMode($a_back)
3880 {
3881 if ($this->setup->getClient()->status["finish"]["status"])
3882 {
3883 $val = ($this->setup->getClient()->ini->readVariable("client","access")) ? "0" : true;
3884 $this->setup->getClient()->ini->setVariable("client","access",$val);
3885 $this->setup->getClient()->ini->write();
3886 $message = "client_access_mode_changed";
3887 }
3888 else
3889 {
3890 $message = "client_setup_not_finished";
3891 }
3892
3893 ilUtil::sendInfo($this->lng->txt($message),true);
3894
3895 ilUtil::redirect("setup.php?cmd=".$a_back);
3896 }
3897
3902 {
3903 if ($_POST["form"])
3904 {
3905 $client = new ilClient($_POST["form"]["default"], $this->setup->db_connections);
3906
3907 if (!$client->init())
3908 {
3909 $this->setup->raiseError($this->lng->txt("no_valid_client_id"),$this->setup->error_obj->MESSAGE);
3910 }
3911
3912 $status = $this->setup->getStatus($client);
3913
3914 if ($status["finish"]["status"])
3915 {
3916 $this->setup->ini->setVariable("clients","default",$client->getId());
3917 $this->setup->ini->write();
3918 $message = "default_client_changed";
3919 }
3920 else
3921 {
3922 $message = "client_setup_not_finished";
3923 }
3924 }
3925
3926 ilUtil::sendInfo($this->lng->txt($message),true);
3927
3928 ilUtil::redirect("setup.php");
3929 }
3930
3935 function validateSetup()
3936 {
3937 foreach ($this->setup->getClient()->status as $key => $val)
3938 {
3939 if ($key != "finish" and $key != "access")
3940 {
3941 if ($val["status"] != true)
3942 {
3943 return false;
3944 }
3945 }
3946 }
3947
3948//$this->setup->getClient()->setSetting("zzz", "V");
3949 $clientlist = new ilClientList($this->setup->db_connections);
3950//$this->setup->getClient()->setSetting("zzz", "W");
3951 $list = $clientlist->getClients();
3952//$this->setup->getClient()->setSetting("zzz", "X");
3953 if (count($list) == 1)
3954 {
3955 $this->setup->ini->setVariable("clients","default",$this->setup->getClient()->getId());
3956 $this->setup->ini->write();
3957
3958 $this->setup->getClient()->ini->setVariable("client","access",1);
3959 $this->setup->getClient()->ini->write();
3960 }
3961//$this->setup->getClient()->setSetting("zzz", "Y");
3962 return true;
3963 }
3964
3969 {
3970 if (!$this->setup->getClient()->status["db"]["status"])
3971 {
3972 $this->cmd = "db";
3973 ilUtil::sendInfo($this->lng->txt("finish_initial_setup_first"),true);
3974 $this->displayDatabase();
3975 }
3976 elseif (!$this->setup->getClient()->status["lang"]["status"])
3977 {
3978 $this->cmd = "lang";
3979 ilUtil::sendInfo($this->lng->txt("finish_initial_setup_first"),true);
3980 $this->displayLanguages();
3981 }
3982 elseif (!$this->setup->getClient()->status["contact"]["status"])
3983 {
3984 $this->cmd = "contact";
3985 ilUtil::sendInfo($this->lng->txt("finish_initial_setup_first"),true);
3986 $this->displayContactData();
3987 }
3988 elseif(!$this->setup->getClient()->status['proxy']['status'])
3989 {
3990 $this->cmd = "proxy";
3991 ilUtil::sendInfo($this->lng->txt("finish_initial_setup_first"),true);
3992 $this->displayProxy();
3993 }
3994 elseif (!$this->setup->getClient()->status["nic"]["status"])
3995 {
3996 $this->cmd = "nic";
3997 ilUtil::sendInfo($this->lng->txt("finish_initial_setup_first"),true);
3998 $this->displayNIC();
3999 }
4000 elseif (!$this->setup->getClient()->status["finish"]["status"])
4001 {
4002 $this->cmd = "finish";
4003 ilUtil::sendInfo($this->lng->txt("finish_initial_setup_first"),true);
4004 $this->displayFinishSetup();
4005 }
4006 else
4007 {
4008 return false;
4009 }
4010 }
4011
4016 {
4017 if ($this->setup->ini->readVariable("clients","list"))
4018 {
4019 $this->setup->ini->setVariable("clients","list","0");
4020 $this->setup->ini->write();
4021 ilUtil::sendInfo($this->lng->txt("list_disabled"),true);
4022 }
4023 else
4024 {
4025 $this->setup->ini->setVariable("clients","list","1");
4026 $this->setup->ini->write();
4027 ilUtil::sendInfo($this->lng->txt("list_enabled"),true);
4028 }
4029
4030 ilUtil::redirect("setup.php");
4031 }
4032
4036
4038 {
4040
4041 $ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);
4042
4043 include_once "./Services/Database/classes/class.ilDBUpdate.php";
4044 include_once "./Services/AccessControl/classes/class.ilRbacAdmin.php";
4045 include_once "./Services/AccessControl/classes/class.ilRbacReview.php";
4046 include_once "./Services/AccessControl/classes/class.ilRbacSystem.php";
4047 include_once "./Services/Tree/classes/class.ilTree.php";
4048 include_once "./Services/Xml/classes/class.ilSaxParser.php";
4049 include_once "./Services/Object/classes/class.ilObjectDefinition.php";
4050
4051 // referencing db handler in language class
4052 $ilDB = $this->setup->getClient()->db;
4053 $this->lng->setDbHandler($ilDB);
4054
4055 // run dbupdate
4056 $dbupdate = new ilDBUpdate($ilDB);
4057 $dbupdate->applyCustomUpdates();
4058
4059 if ($dbupdate->updateMsg == "no_changes")
4060 {
4061 $message = $this->lng->txt("no_changes").". ".$this->lng->txt("database_is_uptodate");
4062 }
4063 else
4064 {
4065 $sep = "";
4066 foreach ($dbupdate->updateMsg as $row)
4067 {
4068 if ($row["msg"] == "update_applied")
4069 {
4070 $a_message.= $sep.$row["nr"];
4071 $sep = ", ";
4072 }
4073 else
4074 {
4075 $e_message.= "<br/>".$this->lng->txt($row["msg"]).": ".$row["nr"];
4076 }
4077 }
4078 if ($a_message != "")
4079 {
4080 $a_message = $this->lng->txt("update_applied").": ".$a_message;
4081 }
4082 }
4083
4084 ilUtil::sendInfo($a_message.$e_message, true);
4085 ilUtil::redirect("setup.php?cmd=displayDatabase");
4086 }
4087
4091 function cloneInitForm()
4092 {
4093 global $lng, $ilCtrl;
4094
4095 $this->checkDisplayMode();
4096
4097 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
4098 $this->form = new ilPropertyFormGUI();
4099
4100 $this->form->setId("clone_form");
4101 $this->form->setFormAction("setup.php?cmd=gateway");
4102
4103 if ($this->setup->getClient()->status["access"]["status"] === false and stripos($this->setup->getClient()->getName(),"master") === false and $this->setup->getClient()->getdbType() == "mysql" and $this->setup->getClient()->db_exists )
4104 {
4105 $this->form->setTitle($this->lng->txt("clone_source"));
4106 $clients = array();
4107 $clientlist = new ilClientList($this->setup->db_connections);
4108 $list = $clientlist->getClients();
4109 $clientlistarray = array();
4110
4111 foreach ($list as $key => $client){
4112 if ((strcmp($key, $this->setup->getClient()->getId()) != '0') && ($client->getDbType() == 'mysql')) { // You cannot clone yourself
4113 $clientlistarray[$client->id] = $client->id;
4114 }
4115 }
4116
4117 $si = new ilSelectInputGUI($lng->txt("clone_selectsource"), "source");
4118
4119 $si->setOptions(array_merge(
4120 array("" => "-- ".$lng->txt("please_select")." --"),
4121 $clientlistarray));
4122 $si->setRequired(true);
4123 $this->form->addItem($si);
4124
4125 $cb = new ilCheckboxInputGUI($lng->txt("clone_areyousure"), "iamsure");
4126 $cb->setRequired(true);
4127 $this->form->addItem($cb);
4128
4129 $this->form->addCommandButton("cloneSaveSource", $lng->txt("cloneit"));
4130 } else {
4131 $disabledmessage = "<h1>" . $this->lng->txt("clone_disabledmessage") ."</h1><br>";
4132 if (!$this->setup->getClient()->status["access"]["status"] === false) {
4133 $disabledmessage .= $this->lng->txt("clone_clientnotdisabled") . "<br>";
4134 }
4135 if (!stripos($this->setup->getClient()->getName(),"aster") === false) {
4136 $disabledmessage .= $this->lng->txt("clone_clientismaster") . "<br>";
4137 }
4138 if ($this->setup->getClient()->getdbType() != "mysql") {
4139 $disabledmessage .= $this->lng->txt("clone_clientisnotmysql") . "<br>";
4140 }
4141 if (!$this->setup->getClient()->db_exists) {
4142 $disabledmessage .= $this->lng->txt("clone_clientnodatabase") . "<br>";
4143 }
4144 $this->form->setTitle($disabledmessage);
4145 }
4146 }
4147
4149
4150 if (!$this->setup->isAdmin())
4151 {
4152 return;
4153 }
4154
4155 $this->cloneInitForm();
4156 $this->form->setValuesByPost();
4157 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_clone"));
4158 $this->tpl->setVariable("SETUP_CONTENT", $this->form->getHTML());
4159 }
4160
4162 {
4163 global $lng, $ilCtrl;
4164
4165 if (!$this->setup->isAdmin())
4166 {
4167 return;
4168 }
4169
4170 $this->cloneInitForm();
4171
4172 if ($this->form->checkInput())
4173 {
4174 if ($this->form->getInput("iamsure") != "1")
4175 {
4176 $message = $this->lng->txt("clone_youmustcheckiamsure");
4177 $this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);
4178 }
4179 if (!$this->setup->cloneFromSource($this->form->getInput("source")))
4180 {
4181 $message = $this->lng->txt("clone_error");
4182 $this->setup->raiseError($message . " -> " . $this->setup->error,$this->setup->error_obj->MESSAGE);
4183 }
4184
4185 ilUtil::sendInfo($this->lng->txt("client_cloned"),true);
4186 // ilUtil::redirect("setup.php");
4187 }
4188 $this->form->setValuesByPost();
4189 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_clone"));
4190 $this->tpl->setVariable("SETUP_CONTENT", $this->form->getHTML());
4191 }
4192
4193 public function displayProxy($a_omit_init = false)
4194 {
4195 $this->checkDisplayMode("proxy");
4196 $settings = $this->setup->getClient()->getAllSettings();
4197
4198 if (!$a_omit_init)
4199 {
4200 include_once("./Services/Administration/classes/class.ilSetting.php");
4201 $this->initProxyForm();
4202 $this->form->setValuesByArray(array(
4203 'proxy_status' => (bool)$settings['proxy_status'],
4204 'proxy_host' => $settings['proxy_host'],
4205 'proxy_port' => $settings['proxy_port']
4206 ));
4207 if((bool)$settings['proxy_status'])
4208 {
4209 $this->setup->printProxyStatus($this->setup->client);
4210 }
4211 }
4212 $this->tpl->setVariable("SETUP_CONTENT", $this->form->getHTML());
4213 $this->tpl->setVariable("TXT_INFO", $this->lng->txt("info_text_proxy"));
4214
4215
4216 $check = $this->setup->checkClientProxySettings($this->setup->client);
4217
4218 $this->setup->getClient()->status["proxy"]["status"] = $check["status"];
4219 $this->setup->getClient()->status["proxy"]["comment"] = $check["comment"];
4220 $this->setup->getClient()->status["proxy"]["text"] = $check["comment"];
4221
4222 if ($check["status"])
4223 {
4224 $this->setButtonNext("nic");
4225 }
4226
4227 $this->setButtonPrev("contact");
4228 $this->checkPanelMode();
4229 }
4230 private function initProxyForm()
4231 {
4232 global $lng;
4233
4234 include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
4235 $this->form = new ilPropertyFormGUI();
4236 $this->form->setFormAction("setup.php?cmd=gateway");
4237
4238 // Proxy status
4239 $proxs = new ilCheckboxInputGUI($lng->txt('proxy_status'), 'proxy_status');
4240 $proxs->setInfo($lng->txt('proxy_status_info'));
4241 $proxs->setValue(1);
4242 $this->form->addItem($proxs);
4243
4244 // Proxy availability
4245 $proxa = new ilCustomInputGUI('', 'proxy_availability');
4246 $proxs->addSubItem($proxa);
4247
4248 // Proxy
4249 $prox = new ilTextInputGUI($lng->txt('proxy_host'), 'proxy_host');
4250 $prox->setInfo($lng->txt('proxy_host_info'));
4251 $proxs->addSubItem($prox);
4252
4253 // Proxy Port
4254 $proxp = new ilTextInputGUI($lng->txt('proxy_port'), 'proxy_port');
4255 $proxp->setInfo($lng->txt('proxy_port_info'));
4256 $proxp->setSize(10);
4257 $proxp->setMaxLength(10);
4258 $proxs->addSubItem($proxp);
4259
4260 // save and cancel commands
4261 $this->form->addCommandButton('saveProxy', $lng->txt('save'));
4262 }
4263
4271 public function saveProxy()
4272 {
4273 global $lng;
4274
4275 $this->initProxyForm();
4276 $isFormValid = $this->form->checkInput();
4277
4278 $new_settings['proxy_status'] = (int)$this->form->getInput('proxy_status');
4279 $new_settings['proxy_host'] = trim($this->form->getInput('proxy_host'));
4280 $new_settings['proxy_port'] = trim($this->form->getInput('proxy_port'));
4281
4282 if($isFormValid)
4283 {
4284 if($new_settings['proxy_status'] == true)
4285 {
4286 if(!strlen($new_settings['proxy_host']))
4287 {
4288 $isFormValid = false;
4289 $this->form->getItemByPostVar('proxy_host')->setAlert($lng->txt('msg_input_is_required'));
4290 }
4291 if(!strlen($new_settings['proxy_port']))
4292 {
4293 $isFormValid = false;
4294 $this->form->getItemByPostVar('proxy_port')->setAlert($lng->txt('msg_input_is_required'));
4295 }
4296 if(!preg_match('/[0-9]{1,}/', $new_settings['proxy_port']) ||
4297 $new_settings['proxy_port'] < 0 ||
4298 $new_settings['proxy_port'] > 65535)
4299 {
4300 $isFormValid = false;
4301 $this->form->getItemByPostVar('proxy_port')->setAlert($lng->txt('proxy_port_numeric'));
4302 }
4303 }
4304
4305 if($isFormValid)
4306 {
4307 $this->setup->saveProxySettings($new_settings);
4308
4309 ilUtil::sendSuccess($lng->txt('saved_successfully'));
4310 $settings = $this->setup->getClient()->getAllSettings();
4311 if($settings['proxy_status'] == true)
4312 {
4313 $this->setup->printProxyStatus($this->setup->client);
4314 }
4315 }
4316 else
4317 {
4318 ilUtil::sendFailure($lng->txt('form_input_not_valid'));
4319 }
4320 }
4321
4322 $this->form->setValuesByPost();
4323 $this->tpl->setVariable("SETUP_CONTENT", $this->form->getHTML());
4324
4325
4326 $this->displayProxy(true);
4327 }
4328} // END class.ilSetupGUI
4329?>
$result
$_GET["client_id"]
static _getShortTimeZoneList()
get short timezone list
This class represents a checkbox property in a property form.
client management
Client Management.
This class represents a custom property in a property form.
Database Update class.
This class represents a section header in a property form.
This class represents a hidden form property in a property form.
Class ilModuleReader.
static getAvailableCoreModules()
Get all available core modules.
This class represents a non editable value in a property form.
This class represents a password property in a property form.
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
Class ilServiceReader.
static getAvailableCoreServices()
Get all available core services.
static getSettingFields()
returns the array of setting fields
const SESSION_HANDLING_LOAD_DEPENDENT
const SESSION_HANDLING_FIXED
ILIAS Setting Class.
static _getLongerSettings($a_limit='4000')
get a list of setting records with values loger than a limit
static _getValueType()
get the type of the value column in the database
static _changeValueType($a_new_type='text')
change the type of the value column in the database
Setup GUI class.
checkDisplayMode($a_title="")
determine display mode and load according html layout
displayMasterSetup($a_omit_init=false)
display master setup form & process form input
applyHotfix()
Apply hotfixes.
initControlStructureForm()
Init the form to reload the control structure.
displayClientList()
display client list and process form input
initSettingsTypeForm()
Init the form to change the settings value type.
cmdInstall()
process valid commands for pre-installation status
changeMasterPassword()
display change password form and process form input
displayError($a_message)
display error page
displayContactData($a_omit_init=false)
display contact data form and process form input
installDatabase()
Install the database.
displayClientOverview()
display client overview panel
loginClient()
login to a client
displayFinishSetup()
display finish setup page
initMasterLoginForm()
Init master login form.
saveProxy()
Save proxy settings.
setDisplayMode($a_mode)
set display mode to 'view' or 'setup' 'setup' -> show status panel and (prev/next) navigation buttons...
showUpdateSteps($a_hotfix=false)
Update database.
reloadControlStructure()
reload control structure
displayDeleteConfirmation()
display delete client confirmation form and process form input
getContactValues()
Get current values for contact from.
displayNavButtons()
display navigation buttons
getBasicSettingsValues()
Get current values for basic settings from.
displayTools()
display tools
displaySubTabs()
Show subtabs.
displayIni($a_omit_form_init=false)
display setup in step
displayHeader()
display header with admin links and language flags
updateDatabase()
Update database.
performMLogin()
Master Login.
displayProcessPanel()
display process panel
validateSetup()
validatesetup status again and set access mode of the first client to online
initDBSelectionForm()
Init db selection form.
displayStartup()
display intro page for the first client installation
jumpToFirstUnfinishedSetupStep()
if setting up a client was not finished, jump back to the first uncompleted setup step
initRegistrationForm($a_mode="edit")
Init registration form.
setDbSubtabs($a_subtab_id="db")
Set db subtabs.
saveLanguages()
Save languages.
initDbSlaveForm()
Init db slave form.
saveRegistration()
Save registration form.
determineTools($a_tools="")
Determine Tools.
initClientLoginForm()
Init client login form.
initContactDataForm()
Init contact data form.
SetButtonPrev($a_cmd=0, $a_lng=0)
set previous navigation button
displayPreliminaries()
display preliminaries page
changeSettingsType()
change the type of the value field in settings table
showHotfixSteps()
Show hotfix steps.
getClientIniValues()
Get current values for client ini from.
selectDBType()
Select database type.
saveContact()
Save contact form.
getRegistrationValues()
Get current values for registration from.
displayStatusPanel()
display status panel
determineToolsPathInstall()
Determine tools paths.
changeAccessMode($a_back)
enable/disable access to a client
saveBasicSettings()
Save basic settings form.
saveDbSlave()
Save db slave form.
changeDefaultClient()
set defualt client
saveClientIni()
Save client ini form.
SetButtonNext($a_cmd, $a_lng=0)
set next navigation button
updateBasicSettings()
Update basic settings form.
initClientDbForm($a_install=true, $dbupdate=null, $db_status=false, $hotfix_available=false, $custom_updates_available=false)
Init client db form.
displayNIC($a_omit_init=false)
display nic registration form and process form input
initClientIniForm()
Init client ini form.
determineToolsPath()
Determine tools paths.
displaySessions()
display sessions form and process form input
initBasicSettingsForm($a_install=false)
Init basic settings form.
displayDatabase()
display database form and process form input
displayLanguages()
display language form and process form input
toggleClientList()
enable/disable client list on index page
ilSetupGUI()
Constructor.
showLongerSettings()
show a list of setting values that are loger than 4000 characters
cloneInitForm()
Initialize clone form.
displayLogin($a_omit_minit=false, $a_omit_cinit=false)
display login form and process form
cmdClient()
process valid commands for all clients
displayLogout()
display logout page
displayDatabaseSlave($a_from_save=false)
Display database slave.
initClientOverviewForm()
Init client overview form.
checkPanelMode()
determine display mode and load correct panel
displayProxy($a_omit_init=false)
getClientDbFormValues($dbupdate=null)
Get current values for client db from.
cmdAdmin()
process valid commands for admins
performLogin()
Login.
changeMasterSettings($a_omit_init=false)
display master settings and process form input
displayFooter()
page output and set title
Setup class.
Tabs GUI.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
init($a_tpl=null)
Init.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static isWindows()
check wether the current client system is a windows system
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static initDomEvent()
Init YUI DomEvent.
static initjQuery($a_tpl=null)
Init jQuery.
$_POST['username']
Definition: cron.php:12
$valid
$txt
Definition: error.php:10
$GLOBALS['ct_recipient']
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
global $ilCtrl
Definition: ilias.php:18
$client_id
const ILIAS_VERSION
const DEBUG
$ilCtrlStructureReader
exit
Definition: login.php:54
global $ilDB
if(!is_array($argv)) $options
$steps
Definition: latex.php:3
$dirs
const ILIAS_WEB_DIR
const ILIAS_ABSOLUTE_PATH
$ini