00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00035 require_once "class.ilObjectGUI.php";
00036
00037 class ilObjSystemFolderGUI extends ilObjectGUI
00038 {
00044 var $type;
00045
00050 function ilObjSystemFolderGUI($a_data,$a_id,$a_call_by_reference)
00051 {
00052 $this->type = "adm";
00053 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference);
00054
00055 $this->lng->loadLanguageModule("administration");
00056 }
00057
00063 function viewObject()
00064 {
00065 global $rbacsystem;
00066
00067 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
00068 {
00069 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
00070 }
00071
00072 $_GET["sort_by"] = $_GET['sort_by'] ? $_GET['sort_by'] : 'title';
00073
00074
00075 $this->objectList = array();
00076 $this->data["data"] = array();
00077 $this->data["ctrl"] = array();
00078 $this->data["cols"] = array("type", "title", "last_change");
00079
00080 $childs = $this->tree->getChilds($this->object->getRefId(),$_GET["order"],$_GET["direction"]);
00081
00082 foreach ($childs as $key => $val)
00083 {
00084
00085 if (!$rbacsystem->checkAccess("visible",$val["ref_id"]))
00086 {
00087 continue;
00088 }
00089
00090
00091 if ($this->objDefinition->getDevMode($val["type"]))
00092 {
00093 continue;
00094 }
00095
00096
00097 if ($val["ref_id"] == RECOVERY_FOLDER_ID and !$this->tree->getChilds(RECOVERY_FOLDER_ID))
00098 {
00099 continue;
00100 }
00101
00102
00103 $this->data["data"][] = array(
00104 "type" => $val["type"],
00105 "title" => $val["title"]."#separator#".$val["desc"],
00106
00107 "last_change" => $val["last_update"],
00108 "ref_id" => $val["ref_id"]
00109 );
00110
00111
00112
00113 }
00114
00115 $this->maxcount = count($this->data["data"]);
00116
00117
00118 $this->data["data"] = ilUtil::sortArray($this->data["data"],$_GET["sort_by"],$_GET["sort_order"]);
00119
00120
00121 foreach ($this->data["data"] as $key => $val)
00122 {
00123 $this->data["ctrl"][$key] = array(
00124 "type" => $val["type"],
00125 "ref_id" => $val["ref_id"]
00126 );
00127
00128 unset($this->data["data"][$key]["ref_id"]);
00129 $this->data["data"][$key]["last_change"] = ilFormat::formatDate($this->data["data"][$key]["last_change"]);
00130 }
00131
00132
00133 $this->displayList();
00134
00135
00136 if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
00137 {
00138 $this->displayBasicSettings();
00139 }
00140 }
00141
00147 function displayList()
00148 {
00149 global $rbacsystem;
00150
00151 include_once "./classes/class.ilTableGUI.php";
00152
00153
00154 $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
00155
00156 $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
00157
00158 $num = 0;
00159
00160 $obj_str = ($this->call_by_reference) ? "" : "&obj_id=".$this->obj_id;
00161 $this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=".$this->ref_id."$obj_str&cmd=gateway");
00162
00163
00164 $tbl = new ilTableGUI();
00165
00166
00167 $tbl->setTitle($this->lng->txt("obj_".$this->object->getType()),"icon_".$this->object->getType()."_b.gif",$this->lng->txt("obj_".$this->object->getType()));
00168 $tbl->setHelp("tbl_help.php","icon_help.gif",$this->lng->txt("help"));
00169
00170 foreach ($this->data["cols"] as $val)
00171 {
00172 $header_names[] = $this->lng->txt($val);
00173 }
00174
00175 $tbl->setHeaderNames($header_names);
00176
00177 $header_params = array("ref_id" => $this->ref_id);
00178 $tbl->setHeaderVars($this->data["cols"],$header_params);
00179 $tbl->setColumnWidth(array("15","75%","25%"));
00180
00181
00182 $tbl->setOrderColumn($_GET["sort_by"]);
00183 $tbl->setOrderDirection($_GET["sort_order"]);
00184 $tbl->setLimit(0);
00185 $tbl->setOffset(0);
00186 $tbl->setMaxCount($this->maxcount);
00187
00188
00189 $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
00190 $tbl->disable("numinfo");
00191
00192
00193 $tbl->render();
00194
00195 if (is_array($this->data["data"][0]))
00196 {
00197
00198 for ($i=0; $i < count($this->data["data"]); $i++)
00199 {
00200 $data = $this->data["data"][$i];
00201 $ctrl = $this->data["ctrl"][$i];
00202
00203
00204 $css_row = ilUtil::switchColor($i+1,"tblrow1","tblrow2");
00205
00206 $this->tpl->setCurrentBlock("table_cell");
00207 $this->tpl->setVariable("CELLSTYLE", "tblrow1");
00208 $this->tpl->parseCurrentBlock();
00209
00210 foreach ($data as $key => $val)
00211 {
00212
00213 $link = "adm_object.php?";
00214
00215 $n = 0;
00216
00217 foreach ($ctrl as $key2 => $val2)
00218 {
00219 $link .= $key2."=".$val2;
00220
00221 if ($n < count($ctrl)-1)
00222 {
00223 $link .= "&";
00224 $n++;
00225 }
00226 }
00227
00228 if ($key == "title")
00229 {
00230 $name_field = explode("#separator#",$val);
00231 }
00232
00233 if ($key == "title" || $key == "type")
00234 {
00235 $this->tpl->setCurrentBlock("begin_link");
00236 $this->tpl->setVariable("LINK_TARGET", $link);
00237
00238 $this->tpl->parseCurrentBlock();
00239 $this->tpl->touchBlock("end_link");
00240 }
00241
00242 $this->tpl->setCurrentBlock("text");
00243
00244 if ($key == "type")
00245 {
00246 $val = ilUtil::getImageTagByType($val,$this->tpl->tplPath);
00247 }
00248
00249 if ($key == "title")
00250 {
00251 $this->tpl->setVariable("TEXT_CONTENT", $name_field[0]);
00252
00253 $this->tpl->setCurrentBlock("subtitle");
00254 $this->tpl->setVariable("DESC", $name_field[1]);
00255 $this->tpl->parseCurrentBlock();
00256 }
00257 else
00258 {
00259 $this->tpl->setVariable("TEXT_CONTENT", $val);
00260 }
00261
00262 $this->tpl->parseCurrentBlock();
00263
00264 $this->tpl->setCurrentBlock("table_cell");
00265 $this->tpl->parseCurrentBlock();
00266
00267 }
00268
00269 $this->tpl->setCurrentBlock("tbl_content");
00270 $this->tpl->setVariable("CSS_ROW", $css_row);
00271 $this->tpl->parseCurrentBlock();
00272 }
00273
00274 }
00275 else
00276 {
00277 $this->tpl->setCurrentBlock("notfound");
00278 $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
00279 $this->tpl->setVariable("NUM_COLS", $num);
00280 $this->tpl->parseCurrentBlock();
00281 }
00282 }
00283
00289 function displayBasicSettings()
00290 {
00291 global $rbacsystem;
00292
00293 $this->tpl->addBlockFile("SYSTEMSETTINGS", "systemsettings", "tpl.adm_basicdata.html");
00294
00295 $settings = $this->ilias->getAllSettings();
00296
00297 if (isset($_POST["save_settings"]))
00298 {
00299
00300 $form_valid = true;
00301
00302 if($_POST['https'])
00303 {
00304 include_once './classes/class.ilHTTPS.php';
00305
00306 if(!ilHTTPS::_checkHTTPS())
00307 {
00308 sendInfo($this->lng->txt('https_not_possible'));
00309 $form_valid = false;
00310 }
00311 if(!ilHTTPS::_checkHTTP())
00312 {
00313 sendInfo($this->lng->txt('http_not_possible'));
00314 $form_valid = false;
00315 }
00316 }
00317
00318
00319 if (empty($_POST["admin_firstname"]) or empty($_POST["admin_lastname"])
00320 or empty($_POST["admin_street"]) or empty($_POST["admin_zipcode"])
00321 or empty($_POST["admin_country"]) or empty($_POST["admin_city"])
00322 or empty($_POST["admin_phone"]) or empty($_POST["admin_email"]))
00323 {
00324
00325 sendInfo($this->lng->txt("fill_out_all_required_fields"));
00326 $form_valid = false;
00327 }
00328
00329
00330 if (!ilUtil::is_email($_POST["feedback_recipient"]) and !empty($_POST["feedback_recipient"]) and $form_valid)
00331 {
00332 sendInfo($this->lng->txt("input_error").": '".$this->lng->txt("feedback_recipient")."'<br/>".$this->lng->txt("email_not_valid"));
00333 $form_valid = false;
00334 }
00335
00336
00337 if (!ilUtil::is_email($_POST["error_recipient"]) and !empty($_POST["error_recipient"]) and $form_valid)
00338 {
00339 sendInfo($this->lng->txt("input_error").": '".$this->lng->txt("error_recipient")."'<br/>".$this->lng->txt("email_not_valid"));
00340 $form_valid = false;
00341 }
00342
00343
00344 if (!ilUtil::is_email($_POST["admin_email"]) and $form_valid)
00345 {
00346 sendInfo($this->lng->txt("input_error").": '".$this->lng->txt("email")."'<br/>".$this->lng->txt("email_not_valid"));
00347 $form_valid = false;
00348 }
00349
00350
00351 foreach ($_POST as $key => $val)
00352 {
00353 if (!is_array($val)) $_POST[$key] = ilUtil::prepareFormOutput($val,true);
00354 }
00355
00356 if (!$form_valid)
00357 {
00359
00360
00361
00362 $settings["feedback_recipient"] = $_POST["feedback_recipient"];
00363 $settings["error_recipient"] = $_POST["error_recipient"];
00364
00365
00366 $settings["pub_section"] = $_POST["pub_section"];
00367 $settings["enable_calendar"] = $_POST["enable_calendar"];
00368 $settings["default_repository_view"] = $_POST["default_rep_view"];
00369 $settings["password_assistance"] = $_POST["password_assistance"];
00370 $settings["js_edit"] = $_POST["js_edit"];
00371 $settings["enable_registration"] = $_POST["enable_registration"];
00372 $settings["passwd_auto_generate"] = $_POST["passwd_auto_generate"];
00373 $settings["https"] = $_POST["https"];
00374
00375
00376 $settings["admin_firstname"] = $_POST["admin_firstname"];
00377 $settings["admin_lastname"] = $_POST["admin_lastname"];
00378 $settings["admin_title"] = $_POST["admin_title"];
00379 $settings["admin_position"] = $_POST["admin_position"];
00380 $settings["admin_institution"] = $_POST["admin_institution"];
00381 $settings["admin_street"] = $_POST["admin_street"];
00382 $settings["admin_zipcode"] = $_POST["admin_zipcode"];
00383 $settings["admin_city"] = $_POST["admin_city"];
00384 $settings["admin_country"] = $_POST["admin_country"];
00385 $settings["admin_phone"] = $_POST["admin_phone"];
00386 $settings["admin_email"] = $_POST["admin_email"];
00387
00388
00389 $settings["enable_registration"] = $_POST["enable_registration"];
00390
00391
00392 $settings["cron_user_check"] = $_POST["cron_user_check"];
00393 $settings["cron_link_check"] = $_POST["cron_link_check"];
00394 $settings["cron_web_resource_check"] = $_POST["cron_web_resource_check"];
00395 $settings["cron_lucene_index"] = $_POST["cron_lucene_index"];
00396
00397
00398 $settings['frm_store_new'] = $_POST['frm_store_new'];
00399
00400
00401 $settings["soap_user_administration"] = $_POST["soap_user_administration"];
00402 }
00403 else
00404 {
00405
00407
00408
00409
00410 $this->ilias->setSetting("feedback_recipient",$_POST["feedback_recipient"]);
00411 $this->ilias->setSetting("error_recipient",$_POST["error_recipient"]);
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428 if ($_POST["open_views_inside_frameset"] == "1")
00429 {
00430 $this->ilias->ini->setVariable("layout","view_target","frame");
00431 }
00432 else
00433 {
00434 $this->ilias->ini->setVariable("layout","view_target","window");
00435 }
00436
00437
00438 $this->ilias->setSetting("pub_section",$_POST["pub_section"]);
00439 $this->ilias->setSetting("enable_calendar",$_POST["enable_calendar"]);
00440 $this->ilias->setSetting("default_repository_view",$_POST["default_rep_view"]);
00441 $this->ilias->setSetting("enable_registration",$_POST["enable_registration"]);
00442 $this->ilias->setSetting("passwd_auto_generate",$_POST["passwd_auto_generate"]);
00443 $this->ilias->setSetting('https',$_POST['https']);
00444 $this->ilias->setSetting('password_assistance',$_POST['password_assistance']);
00445 $this->ilias->setSetting('enable_js_edit',$_POST['js_edit']);
00446
00447
00448 $this->ilias->setSetting("admin_firstname",$_POST["admin_firstname"]);
00449 $this->ilias->setSetting("admin_lastname",$_POST["admin_lastname"]);
00450 $this->ilias->setSetting("admin_title",$_POST["admin_title"]);
00451 $this->ilias->setSetting("admin_position",$_POST["admin_position"]);
00452 $this->ilias->setSetting("admin_institution",$_POST["admin_institution"]);
00453 $this->ilias->setSetting("admin_street",$_POST["admin_street"]);
00454 $this->ilias->setSetting("admin_zipcode",$_POST["admin_zipcode"]);
00455 $this->ilias->setSetting("admin_city",$_POST["admin_city"]);
00456 $this->ilias->setSetting("admin_country",$_POST["admin_country"]);
00457 $this->ilias->setSetting("admin_phone",$_POST["admin_phone"]);
00458 $this->ilias->setSetting("admin_email",$_POST["admin_email"]);
00459
00460
00461 $this->ilias->setSetting("enable_registration",$_POST["enable_registration"]);
00462
00463
00464 $this->ilias->setSetting("auto_registration",$_POST["auto_registration"]);
00465 $this->ilias->setSetting("approve_recipient",$_POST["approve_recipient"]);
00466
00467
00468 $this->ilias->setSetting("cron_user_check",$_POST["cron_user_check"]);
00469 $this->ilias->setSetting("cron_link_check",$_POST["cron_link_check"]);
00470 $this->ilias->setSetting("cron_web_resource_check",$_POST["cron_web_resource_check"]);
00471 $this->ilias->setSetting("cron_lucene_index",$_POST["cron_lucene_index"]);
00472
00473
00474 $this->ilias->setSetting("soap_user_administration",$_POST["soap_user_administration"]);
00475
00476
00477 $this->ilias->setSetting('frm_store_new',$_POST['frm_store_new']);
00478
00479
00480 $this->ilias->ini->write();
00481
00482 $settings = $this->ilias->getAllSettings();
00483
00484
00485 sendInfo($this->lng->txt("saved_successfully"));
00486 }
00487 }
00488
00489 $this->tpl->setVariable("TXT_BASIC_DATA", $this->lng->txt("basic_data"));
00490
00492
00493
00494
00495 $this->tpl->setVariable("TXT_ILIAS_VERSION", $this->lng->txt("ilias_version"));
00496 $this->tpl->setVariable("TXT_DB_VERSION", $this->lng->txt("db_version"));
00497 $this->tpl->setVariable("TXT_CLIENT_ID", $this->lng->txt("client_id"));
00498 $this->tpl->setVariable("TXT_INST_ID", $this->lng->txt("inst_id"));
00499 $this->tpl->setVariable("TXT_ACTIVATE_HTTPS",$this->lng->txt('activate_https'));
00500 $this->tpl->setVariable("TXT_HOSTNAME", $this->lng->txt("host"));
00501 $this->tpl->setVariable("TXT_IP_ADDRESS", $this->lng->txt("ip_address"));
00502 $this->tpl->setVariable("TXT_SERVER_DATA", $this->lng->txt("server_data"));
00503 $this->tpl->setVariable("TXT_SERVER_PORT", $this->lng->txt("port"));
00504 $this->tpl->setVariable("TXT_SERVER_SOFTWARE", $this->lng->txt("server_software"));
00505 $this->tpl->setVariable("TXT_HTTP_PATH", $this->lng->txt("http_path"));
00506 $this->tpl->setVariable("TXT_ABSOLUTE_PATH", $this->lng->txt("absolute_path"));
00507 $this->tpl->setVariable("TXT_INST_NAME", $this->lng->txt("inst_name"));
00508 $this->tpl->setVariable("TXT_INST_INFO", $this->lng->txt("inst_info"));
00509 $this->tpl->setVariable("TXT_OPEN_VIEWS_INSIDE_FRAMESET", $this->lng->txt("open_views_inside_frameset"));
00510 $this->tpl->setVariable("TXT_FEEDBACK_RECIPIENT", $this->lng->txt("feedback_recipient"));
00511 $this->tpl->setVariable("TXT_ERROR_RECIPIENT", $this->lng->txt("error_recipient"));
00512 $this->tpl->setVariable("TXT_HEADER_TITLE", $this->lng->txt("header_title"));
00513 $this->tpl->setVariable("TXT_CHANGE", $this->lng->txt("change"));
00514 $this->tpl->setVariable("LINK_HEADER_TITLE", "adm_object.php?ref_id=".
00515 $_GET["ref_id"]."&cmd=changeHeaderTitle");
00516 $this->tpl->setVariable("VAL_HEADER_TITLE",
00517 ilObjSystemFolder::_getHeaderTitle());
00518
00519 include_once ("./classes/class.ilDBUpdate.php");
00520 $dbupdate = new ilDBUpdate($this->ilias->db,true);
00521
00522 if (!$dbupdate->getDBVersionStatus())
00523 {
00524 $this->tpl->setVariable("TXT_DB_UPDATE", " (<span class=\"warning\">".$this->lng->txt("db_need_update")."</span>)");
00525 }
00526
00527
00528 $this->tpl->setVariable("TXT_PUB_SECTION", $this->lng->txt("pub_section"));
00529 $this->tpl->setVariable("TXT_ENABLE_CALENDAR", $this->lng->txt("enable_calendar"));
00530 $this->tpl->setVariable("TXT_DEFAULT_REPOSITORY_VIEW", $this->lng->txt("def_repository_view"));
00531 $this->tpl->setVariable("TXT_FLAT", $this->lng->txt("flatview"));
00532 $this->tpl->setVariable("TXT_TREE", $this->lng->txt("treeview"));
00533
00534 $this->tpl->setVariable("TXT_ENABLE_PASSWORD_ASSISTANCE", $this->lng->txt("enable_password_assistance"));
00535
00536 if (AUTH_DEFAULT != AUTH_LOCAL)
00537 {
00538 $this->tpl->setVariable("DISABLE_PASSWORD_ASSISTANCE", 'disabled=\"disabled\"');
00539 $this->tpl->setVariable("TXT_PASSWORD_ASSISTANCE_DISABLED", $this->lng->txt("password_assistance_disabled"));
00540 }
00541
00542 $this->tpl->setVariable("TXT_PASSWORD_ASSISTANCE_INFO", $this->lng->txt("password_assistance_info"));
00543
00544
00545 $this->tpl->setVariable("TXT_JS_EDIT", $this->lng->txt("enable_js_edit"));
00546 $this->tpl->setVariable("TXT_JS_EDIT_INFO", $this->lng->txt("enable_js_edit_info"));
00547
00548
00549 $this->tpl->setVariable("TXT_REGISTRATION", $this->lng->txt("registration"));
00550 $this->tpl->setVariable("TXT_ENABLE_REGISTRATION", $this->lng->txt("enable_registration"));
00551 $this->tpl->setVariable("TXT_PASSWD_AUTO_GENERATE", $this->lng->txt("passwd_auto_generate"));
00552
00553
00554
00555
00556
00557
00558
00559
00560 $this->tpl->setVariable("TXT_SOFTWARE", $this->lng->txt("3rd_party_software"));
00561 $this->tpl->setVariable("TXT_CONVERT_PATH", $this->lng->txt("path_to_convert"));
00562 $this->tpl->setVariable("TXT_ZIP_PATH", $this->lng->txt("path_to_zip"));
00563 $this->tpl->setVariable("TXT_UNZIP_PATH", $this->lng->txt("path_to_unzip"));
00564 $this->tpl->setVariable("TXT_JAVA_PATH", $this->lng->txt("path_to_java"));
00565 $this->tpl->setVariable("TXT_HTMLDOC_PATH", $this->lng->txt("path_to_htmldoc"));
00566
00567
00568 $this->tpl->setVariable("TXT_CRON",$this->lng->txt('cron_jobs'));
00569 $this->tpl->setVariable("TXT_CRON_DESC",$this->lng->txt('cron_jobs_desc'));
00570 $this->tpl->setVariable("TXT_CRON_USER_ACCOUNTS",$this->lng->txt('check_user_accounts'));
00571 $this->tpl->setVariable("CRON_USER_ACCOUNTS_DESC",$this->lng->txt('check_user_accounts_desc'));
00572 $this->tpl->setVariable("TXT_CRON_LINK_CHECK",$this->lng->txt('check_link'));
00573 $this->tpl->setVariable("CRON_LINK_CHECK_DESC",$this->lng->txt('check_link_desc'));
00574 $this->tpl->setVariable("TXT_CRON_WEB_RESOURCE_CHECK",$this->lng->txt('check_web_resources'));
00575 $this->tpl->setVariable("CRON_WEB_RESOURCE_CHECK_DESC",$this->lng->txt('check_web_resources_desc'));
00576
00577 $this->tpl->setVariable("TXT_CRON_LUCENE_INDEX",$this->lng->txt('cron_lucene_index'));
00578 $this->tpl->setVariable("TXT_CRON_LUCENE_INDEX_INFO",$this->lng->txt('cron_lucene_index_info'));
00579
00580 $this->tpl->setVariable("TXT_NEVER",$this->lng->txt('never'));
00581 $this->tpl->setVariable("TXT_DAILY",$this->lng->txt('daily'));
00582 $this->tpl->setVariable("TXT_WEEKLY",$this->lng->txt('weekly'));
00583 $this->tpl->setVariable("TXT_MONTHLY",$this->lng->txt('monthly'));
00584 $this->tpl->setVariable("TXT_QUARTERLY",$this->lng->txt('quarterly'));
00585
00586 $this->tpl->setVariable("TXT_WEBSERVICES",$this->lng->txt('webservices'));
00587 $this->tpl->setVariable("TXT_SOAP_USER_ADMINISTRATION",$this->lng->txt('soap_user_administration'));
00588 $this->tpl->setVariable("TXT_SOAP_USER_ADMINISTRATION_DESC",$this->lng->txt('soap_user_administration_desc'));
00589
00590
00591 $this->tpl->setVariable("TXT_FORUMS",$this->lng->txt('obj_frm'));
00592 $this->tpl->setVariable("TXT_STATUS_NEW",$this->lng->txt('frm_status_new'));
00593 $this->tpl->setVariable("TXT_STATUS_NEW_DESC",$this->lng->txt('frm_status_new_desc'));
00594
00595 $this->tpl->setVariable("TXT_ONE_WEEK","1 ". $this->lng->txt('week'));
00596 $this->tpl->setVariable("TXT_TWO_WEEKS","2 ". $this->lng->txt('weeks'));
00597 $this->tpl->setVariable("TXT_FOUR_WEEKS","4 ". $this->lng->txt('weeks'));
00598 $this->tpl->setVariable("TXT_EIGHT_WEEKS","8 ". $this->lng->txt('weeks'));
00599
00600
00601 $this->tpl->setVariable("TXT_CONTACT_DATA", $this->lng->txt("contact_data"));
00602 $this->tpl->setVariable("TXT_REQUIRED_FIELDS", $this->lng->txt("required_field"));
00603 $this->tpl->setVariable("TXT_ADMIN", $this->lng->txt("administrator"));
00604 $this->tpl->setVariable("TXT_FIRSTNAME", $this->lng->txt("firstname"));
00605 $this->tpl->setVariable("TXT_LASTNAME", $this->lng->txt("lastname"));
00606 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
00607 $this->tpl->setVariable("TXT_POSITION", $this->lng->txt("position"));
00608 $this->tpl->setVariable("TXT_INSTITUTION", $this->lng->txt("institution"));
00609 $this->tpl->setVariable("TXT_STREET", $this->lng->txt("street"));
00610 $this->tpl->setVariable("TXT_ZIPCODE", $this->lng->txt("zipcode"));
00611 $this->tpl->setVariable("TXT_CITY", $this->lng->txt("city"));
00612 $this->tpl->setVariable("TXT_COUNTRY", $this->lng->txt("country"));
00613 $this->tpl->setVariable("TXT_PHONE", $this->lng->txt("phone"));
00614 $this->tpl->setVariable("TXT_EMAIL", $this->lng->txt("email"));
00615 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
00616
00617
00618 $this->tpl->setVariable("TXT_AUTO_REGISTRATION", $this->lng->txt("auto_registration"));
00619 $this->tpl->setVariable("TXT_APPROVE_RECIPIENT", $this->lng->txt("approve_recipient"));
00620
00622
00623
00624
00625 $loc = "adm_object.php?ref_id=".$this->object->getRefId();
00626 $this->tpl->setVariable("FORMACTION_BASICDATA", $loc);
00627 $this->tpl->setVariable("HTTP_PATH",ILIAS_HTTP_PATH);
00628 $this->tpl->setVariable("ABSOLUTE_PATH",ILIAS_ABSOLUTE_PATH);
00629 $this->tpl->setVariable("HOSTNAME", $_SERVER["SERVER_NAME"]);
00630 $this->tpl->setVariable("SERVER_PORT", $_SERVER["SERVER_PORT"]);
00631 $this->tpl->setVariable("SERVER_ADMIN", $_SERVER["SERVER_ADMIN"]);
00632 $this->tpl->setVariable("SERVER_SOFTWARE", $_SERVER["SERVER_SOFTWARE"]);
00633 $this->tpl->setVariable("IP_ADDRESS", $_SERVER["SERVER_ADDR"]);
00634 $this->tpl->setVariable("DB_VERSION",$settings["db_version"]);
00635 $this->tpl->setVariable("ILIAS_VERSION",$settings["ilias_version"]);
00636 $this->tpl->setVariable("INST_ID",$settings["inst_id"]);
00637 $this->tpl->setVariable("CLIENT_ID",CLIENT_ID);
00638 $this->tpl->setVariable("INST_NAME",$this->ilias->ini->readVariable("client","name"));
00639 $this->tpl->setVariable("INST_INFO",$this->ilias->ini->readVariable("client","description"));
00640 $this->tpl->setVariable("FEEDBACK_RECIPIENT",$settings["feedback_recipient"]);
00641 $this->tpl->setVariable("ERROR_RECIPIENT",$settings["error_recipient"]);
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671 $view_target = $this->ilias->ini->readVariable("layout","view_target");
00672 if ($view_target == "frame")
00673 {
00674 $this->tpl->setVariable("OPEN_VIEWS_INSIDE_FRAMESET","checked=\"checked\"");
00675 }
00676 else
00677 {
00678 $this->tpl->setVariable("OPEN_VIEWS_INSIDE_FRAMESET","");
00679 }
00680
00681 if ($settings["pub_section"])
00682 {
00683 $this->tpl->setVariable("PUB_SECTION","checked=\"checked\"");
00684 }
00685
00686 if ($settings["enable_calendar"])
00687 {
00688 $this->tpl->setVariable("ENABLE_CALENDAR","checked=\"checked\"");
00689 }
00690
00691 if ($settings["default_repository_view"] == "tree")
00692 {
00693 $this->tpl->setVariable("TREESELECTED","selected=\"1\"");
00694 }
00695 else
00696 {
00697 $this->tpl->setVariable("FLATSELECTED","selected=\"1\"");
00698 }
00699
00700 if($settings['https'])
00701 {
00702 $this->tpl->setVariable("HTTPS","checked=\"checked\"");
00703 }
00704 if($settings['password_assistance'])
00705 {
00706 $this->tpl->setVariable("PASSWORD_ASSISTANCE","checked=\"checked\"");
00707 }
00708
00709
00710 if($settings['enable_js_edit'])
00711 {
00712 $this->tpl->setVariable("JS_EDIT","checked=\"checked\"");
00713 }
00714
00715
00716
00717 if ($settings["passwd_auto_generate"])
00718 {
00719 $this->tpl->setVariable("PASSWD_AUTO_GENERATE","checked=\"checked\"");
00720 }
00721 if ($settings["enable_registration"])
00722 {
00723 $this->tpl->setVariable("ENABLE_REGISTRATION","checked=\"checked\"");
00724 }
00725
00726
00727 if ($settings["auto_registration"])
00728 {
00729 $this->tpl->setVariable("AUTO_REGISTRATION","checked=\"checked\"");
00730 }
00731 if ($settings["approve_recipient"])
00732 {
00733 $this->tpl->setVariable("APPROVE_RECIPIENT",$settings["approve_recipient"]);
00734 }
00735 if ($settings["require_login"])
00736 {
00737 $this->tpl->setVariable("REQUIRE_LOGIN","checked=\"checked\"");
00738 }
00739 if ($settings["require_passwd"])
00740 {
00741 $this->tpl->setVariable("REQUIRE_PASSWD","checked=\"checked\"");
00742 }
00743 if ($settings["require_passwd2"])
00744 {
00745 $this->tpl->setVariable("REQUIRE_PASSWD2","checked=\"checked\"");
00746 }
00747 if ($settings["require_firstname"])
00748 {
00749 $this->tpl->setVariable("REQUIRE_FIRSTNAME","checked=\"checked\"");
00750 }
00751 if ($settings["require_gender"])
00752 {
00753 $this->tpl->setVariable("REQUIRE_GENDER","checked=\"checked\"");
00754 }
00755 if ($settings["require_lastname"])
00756 {
00757 $this->tpl->setVariable("REQUIRE_LASTNAME","checked=\"checked\"");
00758 }
00759 if ($settings["require_institution"])
00760 {
00761 $this->tpl->setVariable("REQUIRE_INSTITUTION","checked=\"checked\"");
00762 }
00763 if ($settings["require_department"])
00764 {
00765 $this->tpl->setVariable("REQUIRE_DEPARTMENT","checked=\"checked\"");
00766 }
00767 if ($settings["require_street"])
00768 {
00769 $this->tpl->setVariable("REQUIRE_STREET","checked=\"checked\"");
00770 }
00771 if ($settings["require_city"])
00772 {
00773 $this->tpl->setVariable("REQUIRE_CITY","checked=\"checked\"");
00774 }
00775 if ($settings["require_zipcode"])
00776 {
00777 $this->tpl->setVariable("REQUIRE_ZIPCODE","checked=\"checked\"");
00778 }
00779 if ($settings["require_country"])
00780 {
00781 $this->tpl->setVariable("REQUIRE_COUNTRY","checked=\"checked\"");
00782 }
00783 if ($settings["require_phone_office"])
00784 {
00785 $this->tpl->setVariable("REQUIRE_PHONE_OFFICE","checked=\"checked\"");
00786 }
00787 if ($settings["require_phone_home"])
00788 {
00789 $this->tpl->setVariable("REQUIRE_PHONE_HOME","checked=\"checked\"");
00790 }
00791 if ($settings["require_phone_mobile"])
00792 {
00793 $this->tpl->setVariable("REQUIRE_PHONE_MOBILE","checked=\"checked\"");
00794 }
00795 if ($settings["require_fax"])
00796 {
00797 $this->tpl->setVariable("REQUIRE_FAX","checked=\"checked\"");
00798 }
00799 if ($settings["require_email"])
00800 {
00801 $this->tpl->setVariable("REQUIRE_EMAIL","checked=\"checked\"");
00802 }
00803 if ($settings["require_hobby"])
00804 {
00805 $this->tpl->setVariable("REQUIRE_HOBBY","checked=\"checked\"");
00806 }
00807 if ($settings["require_default_role"])
00808 {
00809 $this->tpl->setVariable("REQUIRE_DEFAULT_ROLE","checked=\"checked\"");
00810 }
00811 if ($settings["require_referral_comment"])
00812 {
00813 $this->tpl->setVariable("REQUIRE_REFERRAL_COMMENT","checked=\"checked\"");
00814 }
00815 if ($settings["require_matriculation"])
00816 {
00817 $this->tpl->setVariable("REQUIRE_MATRICULATION","checked=\"checked\"");
00818 }
00819 if ($settings["cron_user_check"])
00820 {
00821 $this->tpl->setVariable("CRON_USER_CHECK","checked=\"checked\"");
00822 }
00823 if ($settings["cron_link_check"])
00824 {
00825 $this->tpl->setVariable("CRON_LINK_CHECK","checked=\"checked\"");
00826 }
00827 if($settings["cron_lucene_index"])
00828 {
00829 $this->tpl->setVariable("CRON_LUCENE_INDEX","checked=\"checked\"");
00830 }
00831 if ($val = $settings["cron_web_resource_check"])
00832 {
00833 switch($val)
00834 {
00835 case 1:
00836 $this->tpl->setVariable("D_SELECT",'selected="selected"');
00837 break;
00838 case 2:
00839 $this->tpl->setVariable("W_SELECT",'selected="selected"');
00840 break;
00841 case 3:
00842 $this->tpl->setVariable("M_SELECT",'selected="selected"');
00843 break;
00844 case 4:
00845 $this->tpl->setVariable("Q_SELECT",'selected="selected"');
00846 break;
00847
00848 }
00849 }
00850 switch($settings['frm_store_new'])
00851 {
00852 case 1:
00853 $this->tpl->setVariable("ONE_SELECT",'selected="selected"');
00854 break;
00855
00856 case 2:
00857 $this->tpl->setVariable("TWO_SELECT",'selected="selected"');
00858 break;
00859
00860 case 4:
00861 $this->tpl->setVariable("FOUR_SELECT",'selected="selected"');
00862 break;
00863
00864 case 8:
00865 default:
00866 $this->tpl->setVariable("EIGHT_SELECT",'selected="selected"');
00867 break;
00868 }
00869 if ($settings["soap_user_administration"])
00870 {
00871 $this->tpl->setVariable("SOAP_USER_ADMINISTRATION_CHECK","checked=\"checked\"");
00872 }
00873
00874
00875 $not_set = $this->lng->txt("path_not_set");
00876
00877 $this->tpl->setVariable("CONVERT_PATH",(PATH_TO_CONVERT) ? PATH_TO_CONVERT : $not_set);
00878 $this->tpl->setVariable("ZIP_PATH",(PATH_TO_ZIP) ? PATH_TO_ZIP : $not_set);
00879 $this->tpl->setVariable("UNZIP_PATH",(PATH_TO_UNZIP) ? PATH_TO_UNZIP : $not_set);
00880 $this->tpl->setVariable("JAVA_PATH",(PATH_TO_JAVA) ? PATH_TO_JAVA : $not_set);
00881 $this->tpl->setVariable("HTMLDOC_PATH",(PATH_TO_HTMLDOC) ? PATH_TO_HTMLDOC : $not_set);
00882
00883
00884 $this->tpl->setVariable("ADMIN_FIRSTNAME",$settings["admin_firstname"]);
00885 $this->tpl->setVariable("ADMIN_LASTNAME",$settings["admin_lastname"]);
00886 $this->tpl->setVariable("ADMIN_TITLE",$settings["admin_title"]);
00887 $this->tpl->setVariable("ADMIN_POSITION",$settings["admin_position"]);
00888 $this->tpl->setVariable("ADMIN_INSTITUTION",$settings["admin_institution"]);
00889 $this->tpl->setVariable("ADMIN_STREET",$settings["admin_street"]);
00890 $this->tpl->setVariable("ADMIN_ZIPCODE",$settings["admin_zipcode"]);
00891 $this->tpl->setVariable("ADMIN_CITY",$settings["admin_city"]);
00892 $this->tpl->setVariable("ADMIN_COUNTRY",$settings["admin_country"]);
00893 $this->tpl->setVariable("ADMIN_PHONE",$settings["admin_phone"]);
00894 $this->tpl->setVariable("ADMIN_EMAIL",$settings["admin_email"]);
00895
00896 $this->tpl->parseCurrentBlock();
00897 }
00898
00904 function checkObject()
00905 {
00906 global $rbacsystem;
00907
00908 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
00909 {
00910 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
00911 }
00912
00913 if ($_POST["systemcheck"])
00914 {
00915 return $this->viewScanLog();
00916 }
00917
00918 if ($_POST["mode"])
00919 {
00920 $this->startValidator($_POST["mode"],$_POST["log_scan"]);
00921 }
00922 else
00923 {
00924 include_once "classes/class.ilValidator.php";
00925 $validator = new ilValidator();
00926 $last_scan = $validator->readScanLog();
00927
00928 $this->getTemplateFile("check");
00929
00930 if (is_array($last_scan))
00931 {
00932 $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_last_log"));
00933 }
00934
00935 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("systemcheck"));
00936 $this->tpl->setVariable("COLSPAN", 3);
00937 $this->tpl->setVariable("TXT_OPTIONS", $this->lng->txt("options"));
00938 $this->tpl->setVariable("TXT_ANALYZE_TITLE", $this->lng->txt("analyze_data"));
00939 $this->tpl->setVariable("TXT_ANALYZE", $this->lng->txt("scan_only"));
00940 $this->tpl->setVariable("TXT_ANALYZE_DESC", $this->lng->txt("analyze_desc"));
00941
00942
00943 $this->tpl->setVariable("TXT_CLEAN", $this->lng->txt("clean"));
00944 $this->tpl->setVariable("TXT_CLEAN_DESC", $this->lng->txt("clean_desc"));
00945 $this->tpl->setVariable("TXT_RESTORE", $this->lng->txt("restore_missing"));
00946 $this->tpl->setVariable("TXT_RESTORE_DESC", $this->lng->txt("restore_missing_desc"));
00947 $this->tpl->setVariable("TXT_PURGE", $this->lng->txt("purge_missing"));
00948 $this->tpl->setVariable("TXT_PURGE_DESC", $this->lng->txt("purge_missing_desc"));
00949 $this->tpl->setVariable("TXT_RESTORE_TRASH", $this->lng->txt("restore_trash"));
00950 $this->tpl->setVariable("TXT_RESTORE_TRASH_DESC", $this->lng->txt("restore_trash_desc"));
00951 $this->tpl->setVariable("TXT_PURGE_TRASH", $this->lng->txt("purge_trash"));
00952 $this->tpl->setVariable("TXT_PURGE_TRASH_DESC", $this->lng->txt("purge_trash_desc"));
00953 $this->tpl->setVariable("TXT_LOG_SCAN", $this->lng->txt("log_scan"));
00954 $this->tpl->setVariable("TXT_LOG_SCAN_DESC", $this->lng->txt("log_scan_desc"));
00955 $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("start_scan"));
00956 }
00957 }
00958
00964 function changeHeaderTitleObject()
00965 {
00966 global $rbacsystem, $styleDefinition;
00967
00968 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.header_title_edit.html");
00969
00970 $array_push = true;
00971
00972 if ($_SESSION["error_post_vars"])
00973 {
00974 $_SESSION["translation_post"] = $_SESSION["error_post_vars"];
00975 $_GET["mode"] = "session";
00976 $array_push = false;
00977 }
00978
00979
00980 if (($_GET["mode"] != "session"))
00981 {
00982 $data = $this->object->getHeaderTitleTranslations();
00983 $_SESSION["translation_post"] = $data;
00984 $array_push = false;
00985 }
00986 elseif ($_GET["entry"] != 0)
00987 {
00988 array_splice($_SESSION["translation_post"]["Fobject"],$_GET["entry"],1,array());
00989
00990 if ($_GET["entry"] == $_SESSION["translation_post"]["default_language"])
00991 {
00992 $_SESSION["translation_post"]["default_language"] = "";
00993 }
00994 }
00995
00996 $data = $_SESSION["translation_post"];
00997
00998
00999 if (!$_GET["entry"] and $array_push)
01000 {
01001 $count = array_push($data["Fobject"],array("title" => "","desc" => ""));
01002 }
01003 else
01004 {
01005 $count = count($data["Fobject"]);
01006 }
01007
01008
01009 $strip = isset($_SESSION["translation_post"]) ? true : false;
01010
01011 foreach ($data["Fobject"] as $key => $val)
01012 {
01013
01014 if ($key == $count -1)
01015 {
01016 $this->tpl->setCurrentBlock("addTranslation");
01017 $this->tpl->setVariable("TXT_ADD_TRANSLATION",$this->lng->txt("add_translation")." >>");
01018 $this->tpl->parseCurrentBlock();
01019 }
01020
01021
01022 if ($key != 0)
01023 {
01024 $this->tpl->setCurrentBlock("removeTranslation");
01025 $this->tpl->setVariable("TXT_REMOVE_TRANSLATION",$this->lng->txt("remove_translation"));
01026 $this->tpl->setVariable("LINK_REMOVE_TRANSLATION", "adm_object.php?cmd=removeTranslation&entry=".$key."&mode=edit&ref_id=".$_GET["ref_id"]);
01027 $this->tpl->parseCurrentBlock();
01028 }
01029
01030
01031 $this->tpl->addBlockFile("SEL_LANGUAGE", "sel_language", "tpl.lang_selection.html", false);
01032 $this->tpl->setVariable("SEL_NAME", "Fobject[".$key."][lang]");
01033
01034 include_once("classes/class.ilMetaData.php");
01035
01036 $languages = ilMetaData::getLanguages();
01037
01038 foreach ($languages as $code => $language)
01039 {
01040 $this->tpl->setCurrentBlock("lg_option");
01041 $this->tpl->setVariable("VAL_LG", $code);
01042 $this->tpl->setVariable("TXT_LG", $language);
01043
01044 if ($code == $val["lang"])
01045 {
01046 $this->tpl->setVariable("SELECTED", "selected=\"selected\"");
01047 }
01048
01049 $this->tpl->parseCurrentBlock();
01050 }
01051
01052
01053 $this->tpl->setCurrentBlock("obj_form");
01054
01055 if ($key == 0)
01056 {
01057 $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("change_header_title"));
01058 }
01059 else
01060 {
01061 $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("translation")." ".$key);
01062 }
01063
01064 if ($key == $data["default_language"])
01065 {
01066 $this->tpl->setVariable("CHECKED", "checked=\"checked\"");
01067 }
01068
01069 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
01070 $this->tpl->setVariable("TXT_DESC", $this->lng->txt("desc"));
01071 $this->tpl->setVariable("TXT_DEFAULT", $this->lng->txt("default"));
01072 $this->tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language"));
01073 $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($val["title"],$strip));
01074 $this->tpl->setVariable("DESC", ilUtil::stripSlashes($val["desc"]));
01075 $this->tpl->setVariable("NUM", $key);
01076 $this->tpl->parseCurrentBlock();
01077 }
01078
01079
01080 $this->tpl->setCurrentBlock("adm_content");
01081 $this->tpl->setVariable("FORMACTION", $this->getFormAction("update","adm_object.php?cmd=gateway&mode=edit&ref_id=".$_GET["ref_id"]));
01082 $this->tpl->setVariable("TARGET", $this->getTargetFrame("update"));
01083 $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
01084 $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
01085 $this->tpl->setVariable("CMD_SUBMIT", "saveHeaderTitle");
01086 $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
01087 }
01088
01092 function saveHeaderTitleObject()
01093 {
01094 $data = $_POST;
01095
01096
01097 if (!isset($data["default_language"]))
01098 {
01099 $this->ilias->raiseError($this->lng->txt("msg_no_default_language"),$this->ilias->error_obj->MESSAGE);
01100 }
01101
01102
01103 foreach ($data["Fobject"] as $key => $val)
01104 {
01105 $langs[$key] = $val["lang"];
01106 }
01107
01108 $langs = array_count_values($langs);
01109
01110
01111 if (array_key_exists("",$langs))
01112 {
01113 $this->ilias->raiseError($this->lng->txt("msg_no_language_selected"),$this->ilias->error_obj->MESSAGE);
01114 }
01115
01116
01117 if (array_sum($langs) > count($langs))
01118 {
01119 $this->ilias->raiseError($this->lng->txt("msg_multi_language_selected"),$this->ilias->error_obj->MESSAGE);
01120 }
01121
01122
01123 $_POST["Fobject"]["title"] = $_POST["Fobject"][$_POST["default_language"]]["title"];
01124 $_POST["Fobject"]["desc"] = $_POST["Fobject"][$_POST["default_language"]]["desc"];
01125
01126
01127 $this->object->removeHeaderTitleTranslations();
01128
01129
01130 foreach ($data["Fobject"] as $key => $val)
01131 {
01132 if ($key == $data["default_language"])
01133 {
01134 $default = 1;
01135 }
01136 else
01137 {
01138 $default = 0;
01139 }
01140
01141 $this->object->addHeaderTitleTranslation(ilUtil::stripSlashes($val["title"]),ilUtil::stripSlashes($val["desc"]),$val["lang"],$default);
01142 }
01143
01144 sendInfo($this->lng->txt("msg_obj_modified"),true);
01145
01146 header("Location:".$this->getReturnLocation("update","adm_object.php?".$this->link_params));
01147 exit();
01148 }
01149
01155 function addHeaderTitleTranslationObject()
01156 {
01157 $_SESSION["translation_post"] = $_POST;
01158 header("Location:".$this->getReturnLocation("addTranslation",
01159 "adm_object.php?cmd=changeHeaderTitle&entry=0&mode=session&ref_id=".$_GET["ref_id"]."&new_type=".$_GET["new_type"]));
01160 exit();
01161 }
01162
01168 function removeTranslationObject()
01169 {
01170 header("location: adm_object.php?cmd=changeHeaderTitle&entry=".$_GET["entry"]."&mode=session&ref_id=".$_GET["ref_id"]."&new_type=".$_GET["new_type"]);
01171 exit();
01172 }
01173
01174
01175 function startValidator($a_mode,$a_log)
01176 {
01177 global $rbacsystem;
01178
01179 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
01180 {
01181 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
01182 }
01183
01184 $logging = ($a_log) ? true : false;
01185 include_once "classes/class.ilValidator.php";
01186 $validator = new ilValidator($logging);
01187 $validator->setMode("all",false);
01188
01189 foreach ($a_mode as $mode => $value)
01190 {
01191 $validator->setMode($mode,(bool) $value);
01192
01193 }
01194
01195
01196
01197 $scan_log .= $this->lng->txt("analyzing");
01198
01199 if (!$validator->isModeEnabled("analyze"))
01200 {
01201 $scan_log .= $this->lng->txt("disabled");
01202 }
01203 else
01204 {
01205 $scan_log .= "<br />".$this->lng->txt("searching_invalid_refs");
01206 if ($validator->findInvalidReferences())
01207 {
01208 $scan_log .= count($validator->getInvalidReferences())." ".$this->lng->txt("found");
01209 }
01210 else
01211 {
01212 $scan_log .= $this->lng->txt("found_none");
01213 }
01214
01215 $scan_log .= "<br />".$this->lng->txt("searching_invalid_childs");
01216 if ($validator->findInvalidChilds())
01217 {
01218 $scan_log .= count($validator->getInvalidChilds())." ".$this->lng->txt("found");
01219
01220 }
01221 else
01222 {
01223 $scan_log .= $this->lng->txt("found_none");
01224 }
01225
01226 $scan_log .= "<br />".$this->lng->txt("searching_missing_objs");
01227 if ($validator->findMissingObjects())
01228 {
01229 $scan_log .= count($validator->getMissingObjects())." ".$this->lng->txt("found");
01230
01231 }
01232 else
01233 {
01234 $scan_log .= $this->lng->txt("found_none");
01235 }
01236
01237 $scan_log .= "<br />".$this->lng->txt("searching_unbound_objs");
01238 if ($validator->findUnboundObjects())
01239 {
01240 $scan_log .= count($validator->getUnboundObjects())." ".$this->lng->txt("found");
01241
01242 }
01243 else
01244 {
01245 $scan_log .= $this->lng->txt("found_none");
01246 }
01247
01248 $scan_log .= "<br />".$this->lng->txt("searching_deleted_objs");
01249 if ($validator->findDeletedObjects())
01250 {
01251 $scan_log .= count($validator->getDeletedObjects())." ".$this->lng->txt("found");
01252
01253 }
01254 else
01255 {
01256 $scan_log .= $this->lng->txt("found_none");
01257 }
01258
01259 $scan_log .= "<br />".$this->lng->txt("searching_invalid_rolfs");
01260 if ($validator->findInvalidRolefolders())
01261 {
01262 $scan_log .= count($validator->getInvalidRolefolders())." ".$this->lng->txt("found");
01263
01264 }
01265 else
01266 {
01267 $scan_log .= $this->lng->txt("found_none");
01268 }
01269
01270
01271
01272
01273
01274
01275
01276
01277
01278
01279
01280 }
01281
01282
01283 $scan_log .= "<br /><br />".$this->lng->txt("analyzing_tree_structure");
01284
01285 if (!$validator->isModeEnabled("check_tree"))
01286 {
01287 $scan_log .= $this->lng->txt("disabled");
01288 }
01289 else
01290 {
01291 if ($validator->checkTreeStructure())
01292 {
01293 $scan_log .= $this->lng->txt("tree_corrupt");
01294 }
01295 else
01296 {
01297 $scan_log .= $this->lng->txt("disabled");
01298 }
01299 }
01300
01301
01302 $scan_log .= "<br /><br />".$this->lng->txt("cleaning");
01303
01304 if (!$validator->isModeEnabled("clean"))
01305 {
01306 $scan_log .= $this->lng->txt("disabled");
01307 }
01308 else
01309 {
01310 $scan_log .= "<br />".$this->lng->txt("removing_invalid_refs");
01311 if ($validator->removeInvalidReferences())
01312 {
01313 $scan_log .= strtolower($this->lng->txt("done"));
01314 }
01315 else
01316 {
01317 $scan_log .= $this->lng->txt("nothing_to_remove").$this->lng->txt("skipped");
01318 }
01319
01320 $scan_log .= "<br />".$this->lng->txt("removing_invalid_childs");
01321 if ($validator->removeInvalidChilds())
01322 {
01323 $scan_log .= strtolower($this->lng->txt("done"));
01324 }
01325 else
01326 {
01327 $scan_log .= $this->lng->txt("nothing_to_remove").$this->lng->txt("skipped");
01328 }
01329
01330 $scan_log .= "<br />".$this->lng->txt("removing_invalid_rolfs");
01331 if ($validator->removeInvalidRolefolders())
01332 {
01333 $scan_log .= strtolower($this->lng->txt("done"));
01334 }
01335 else
01336 {
01337 $scan_log .= $this->lng->txt("nothing_to_remove").$this->lng->txt("skipped");
01338 }
01339
01340
01341
01342
01343
01344
01345
01346
01347
01348
01349
01350
01351
01352
01353
01354 $validator->findUnboundObjects();
01355 }
01356
01357
01358 $scan_log .= "<br /><br />".$this->lng->txt("restoring");
01359
01360 if (!$validator->isModeEnabled("restore"))
01361 {
01362 $scan_log .= $this->lng->txt("disabled");
01363 }
01364 else
01365 {
01366 $scan_log .= "<br />".$this->lng->txt("restoring_missing_objs");
01367 if ($validator->restoreMissingObjects())
01368 {
01369 $scan_log .= strtolower($this->lng->txt("done"));
01370 }
01371 else
01372 {
01373 $scan_log .= $this->lng->txt("nothing_to_restore").$this->lng->txt("skipped");
01374 }
01375
01376 $scan_log .= "<br />".$this->lng->txt("restoring_unbound_objs");
01377 if ($validator->restoreUnboundObjects())
01378 {
01379 $scan_log .= strtolower($this->lng->txt("done"));
01380 }
01381 else
01382 {
01383 $scan_log .= $this->lng->txt("nothing_to_restore").$this->lng->txt("skipped");
01384 }
01385 }
01386
01387
01388 $scan_log .= "<br /><br />".$this->lng->txt("restoring_trash");
01389
01390 if (!$validator->isModeEnabled("restore_trash"))
01391 {
01392 $scan_log .= $this->lng->txt("disabled");
01393 }
01394 else
01395 {
01396 if ($validator->restoreTrash())
01397 {
01398 $scan_log .= strtolower($this->lng->txt("done"));
01399 }
01400 else
01401 {
01402 $scan_log .= $this->lng->txt("nothing_to_restore").$this->lng->txt("skipped");
01403 }
01404 }
01405
01406
01407 $scan_log .= "<br /><br />".$this->lng->txt("purging");
01408
01409 if (!$validator->isModeEnabled("purge"))
01410 {
01411 $scan_log .= $this->lng->txt("disabled");
01412 }
01413 else
01414 {
01415 $scan_log .= "<br />".$this->lng->txt("purging_missing_objs");
01416 if ($validator->purgeMissingObjects())
01417 {
01418 $scan_log .= strtolower($this->lng->txt("done"));
01419 }
01420 else
01421 {
01422 $scan_log .= $this->lng->txt("nothing_to_purge").$this->lng->txt("skipped");
01423 }
01424
01425 $scan_log .= "<br />".$this->lng->txt("purging_unbound_objs");
01426 if ($validator->purgeUnboundObjects())
01427 {
01428 $scan_log .= strtolower($this->lng->txt("done"));
01429 }
01430 else
01431 {
01432 $scan_log .= $this->lng->txt("nothing_to_purge").$this->lng->txt("skipped");
01433 }
01434 }
01435
01436
01437 $scan_log .= "<br /><br />".$this->lng->txt("purging_trash");
01438
01439 if (!$validator->isModeEnabled("purge_trash"))
01440 {
01441 $scan_log .= $this->lng->txt("disabled");
01442 }
01443 else
01444 {
01445 if ($validator->purgeTrash())
01446 {
01447 $scan_log .= strtolower($this->lng->txt("done"));
01448 }
01449 else
01450 {
01451 $scan_log .= $this->lng->txt("nothing_to_purge").$this->lng->txt("skipped");
01452 }
01453 }
01454
01455
01456 if ($validator->isModeEnabled("clean"))
01457 {
01458 $scan_log .= "<br /><br />".$this->lng->txt("cleaning_final");
01459 if ($validator->closeGapsInTree())
01460 {
01461 $scan_log .= "<br />".$this->lng->txt("closing_gaps")." ".strtolower($this->lng->txt("done"));
01462 }
01463 }
01464
01465
01466
01467
01468
01469 foreach ($validator->mode as $mode => $value)
01470 {
01471 $arr[] = $mode."[".(int)$value."]";
01472 }
01473
01474 $scan_log .= "<br /><br />".$this->lng->txt("scan_completed");
01475
01476
01477 $mode = $this->lng->txt("scan_modes").": ".implode(', ',$arr);
01478
01479
01480 $this->getTemplateFile("scan");
01481 $this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=".$this->ref_id."&cmd=check");
01482 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scanning_system"));
01483 $this->tpl->setVariable("COLSPAN", 3);
01484 $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
01485 $this->tpl->setVariable("TXT_MODE", $mode);
01486
01487 if ($logging === true)
01488 {
01489 $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_log"));
01490 }
01491
01492 $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
01493
01494 $validator->writeScanLogLine($mode);
01495 }
01496
01497 function viewScanLog()
01498 {
01499 include_once "classes/class.ilValidator.php";
01500 $validator = new IlValidator();
01501 $scan_log = $validator->readScanLog();
01502
01503 if (is_array($scan_log))
01504 {
01505 $scan_log = nl2br(implode("",$scan_log));
01506 $this->tpl->setVariable("ADM_CONTENT", $scan_log);
01507 }
01508 else
01509 {
01510 $scan_log = "no scanlog found.";
01511 }
01512
01513
01514 $this->getTemplateFile("scan");
01515 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("scan_details"));
01516 $this->tpl->setVariable("COLSPAN", 3);
01517 $this->tpl->setVariable("TXT_SCAN_LOG", $scan_log);
01518 $this->tpl->setVariable("TXT_DONE", $this->lng->txt("done"));
01519 }
01520
01521
01525 function benchmarkObject()
01526 {
01527 global $ilBench, $rbacsystem;
01528
01529 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
01530 {
01531 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
01532 }
01533
01534 $this->getTemplateFile("bench");
01535 $this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=".$_GET["ref_id"]."&cur_mod=".$_GET["cur_mod"]."&cmd=gateway");
01536 $this->tpl->setVariable("TXT_BENCH_SETTINGS", $this->lng->txt("benchmark_settings"));
01537 $this->tpl->setVariable("TXT_ACTIVATION", $this->lng->txt("activation"));
01538 $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save_settings"));
01539 $this->tpl->setVariable("TXT_CUR_RECORDS", $this->lng->txt("cur_number_rec"));
01540 $this->tpl->setVariable("VAL_CUR_RECORDS", $ilBench->getCurrentRecordNumber());
01541 $this->tpl->setVariable("TXT_MAX_RECORDS", $this->lng->txt("max_number_rec"));
01542 $this->tpl->setVariable("VAL_MAX_RECORDS", $ilBench->getMaximumRecords());
01543 $this->tpl->setVariable("TXT_CLEAR", $this->lng->txt("delete_all_rec"));
01544 if($ilBench->isEnabled())
01545 {
01546 $this->tpl->setVariable("ACT_CHECKED", " checked=\"1\" ");
01547 }
01548
01549 $modules = $ilBench->getMeasuredModules();
01550
01551 if (count($modules) > 0)
01552 {
01553 $this->tpl->setCurrentBlock("eval_table");
01554
01555 $cur_module = ($_GET["cur_mod"] != "" &&
01556 in_array($_GET["cur_mod"], $modules))
01557 ? $_GET["cur_mod"]
01558 : current($modules);
01559
01560 $benchs = $ilBench->getEvaluation($cur_module);
01561
01562 $i=0;
01563 foreach($benchs as $bench)
01564 {
01565 $this->tpl->setCurrentBlock("eval_row");
01566 $this->tpl->setVariable("ROWCOL",
01567 ilUtil::switchColor($i++, "tblrow2", "tblrow1"));
01568
01569 $this->tpl->setVariable("VAL_BENCH", $bench["benchmark"]);
01570 $this->tpl->setVariable("VAL_NUMBER_RECORDS", $bench["cnt"]);
01571 $this->tpl->setVariable("VAL_AVG_TIME", $bench["duration"]);
01572 $this->tpl->setVariable("VAL_MIN_TIME", $bench["min"]);
01573 $this->tpl->setVariable("VAL_MAX_TIME", $bench["max"]);
01574 $this->tpl->setVariable("VAL_CUM_TIME", $bench["duration"] * $bench["cnt"]);
01575 $this->tpl->parseCurrentBlock();
01576 }
01577
01578 $this->tpl->setVariable("SELECT_MODULE",
01579 ilUtil::formSelect($cur_module, "module",$modules, false, true));
01580
01581 $this->tpl->setVariable("TXT_SHOW", $this->lng->txt("show"));
01582 $this->tpl->setVariable("TXT_BENCH", $this->lng->txt("benchmark"));
01583 $this->tpl->setVariable("TXT_NUMBER_RECORDS", $this->lng->txt("number_of_records"));
01584 $this->tpl->setVariable("TXT_AVG_TIME", $this->lng->txt("average_time"));
01585 $this->tpl->setVariable("TXT_MIN_TIME", $this->lng->txt("min_time"));
01586 $this->tpl->setVariable("TXT_MAX_TIME", $this->lng->txt("max_time"));
01587 $this->tpl->setVariable("TXT_CUM_TIME", $this->lng->txt("cumulative_time"));
01588
01589 $this->tpl->parseCurrentBlock();
01590 }
01591 }
01592
01593
01597 function saveBenchSettingsObject()
01598 {
01599 global $ilBench;
01600
01601 if ($_POST["activate"] == "y")
01602 {
01603 $ilBench->enable(true);
01604 }
01605 else
01606 {
01607 $ilBench->enable(false);
01608 }
01609
01610 $ilBench->setMaximumRecords($_POST["max_records"]);
01611
01612 sendinfo($this->lng->txt("msg_obj_modified"), true);
01613
01614 ilUtil::redirect("adm_object.php?cur_mod=".$_POST["module"]."&ref_id=".$_GET["ref_id"]."&cmd=benchmark");
01615 }
01616
01617
01621 function switchBenchModuleObject()
01622 {
01623 global $ilBench;
01624
01625 ilUtil::redirect("adm_object.php?cur_mod=".$_POST["module"]."&ref_id=".$_GET["ref_id"]."&cmd=benchmark");
01626 }
01627
01628
01632 function clearBenchObject()
01633 {
01634 global $ilBench;
01635
01636 $ilBench->clearData();
01637 $this->saveBenchSettingsObject();
01638
01639 }
01640
01641
01642 function getTabs(&$tabs_gui)
01643 {
01644 global $rbacsystem;
01645
01646 $this->ctrl->setParameter($this,"ref_id",$this->ref_id);
01647
01648 if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
01649 {
01650 $tabs_gui->addTarget("settings",
01651 $this->ctrl->getLinkTarget($this, "view"), "view", get_class($this));
01652 }
01653
01654 if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
01655 {
01656
01657
01658
01659 $tabs_gui->addTarget("system_check",
01660 $this->ctrl->getLinkTarget($this, "check"), "check", get_class($this));
01661
01662 $tabs_gui->addTarget("benchmarks",
01663 $this->ctrl->getLinkTarget($this, "benchmark"), "benchmark", get_class($this));
01664 }
01665
01666 if ($rbacsystem->checkAccess("edit_permission",$this->object->getRefId()))
01667 {
01668 $tabs_gui->addTarget("perm_settings",
01669 $this->ctrl->getLinkTarget($this, "perm"), "perm", get_class($this));
01670 }
01671 }
01672 }
01673 ?>