4 require_once
"./classes/class.ilObjectGUI.php";
32 define(
'USER_FOLDER_ID',7);
35 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
37 $this->lng->loadLanguageModule(
'search');
38 $this->lng->loadLanguageModule(
"user");
40 $ilCtrl->saveParameter($this,
"letter");
45 $this->user_owner_id = $a_id;
49 return $this->user_owner_id ? $this->user_owner_id :
USER_FOLDER_ID;
56 $next_class = $this->ctrl->getNextClass($this);
57 $cmd = $this->ctrl->getCmd();
62 case 'ilusertablegui':
63 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
65 $u_table->initFilter();
66 $this->ctrl->setReturn($this,
'view');
67 $this->ctrl->forwardCommand($u_table);
70 case 'ilpermissiongui':
71 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
73 $ret =& $this->ctrl->forwardCommand($perm_gui);
76 case 'iladminusersearchgui':
77 include_once(
'./Services/Search/classes/class.ilAdminUserSearchGUI.php');
79 $user_search->enableSearchableCheck(
false);
80 $user_search->setCallback(
82 'searchResultHandler',
84 'delete' => $this->lng->txt(
'delete'),
85 'activate' => $this->lng->txt(
'activate'),
86 'deactivate' => $this->lng->txt(
'deactivate'),
87 'accessRestrict'=> $this->lng->txt(
'accessRestrict'),
88 'accessFree' => $this->lng->txt(
'accessFree'),
89 'export' => $this->lng->txt(
'export')
92 $this->tabs_gui->setTabActive(
'search_user_extended');
93 $this->ctrl->setReturn($this,
'view');
94 $ret =& $this->ctrl->forwardCommand($user_search);
97 case 'ilaccountcodesgui':
98 $this->tabs_gui->setTabActive(
'settings');
100 $ilTabs->activateSubTab(
"account_codes");
101 include_once(
"./Services/User/classes/class.ilAccountCodesGUI.php");
103 $this->ctrl->forwardCommand($acc);
106 case 'ilcustomuserfieldsgui':
107 $this->tabs_gui->setTabActive(
'settings');
109 $ilTabs->activateSubTab(
"user_defined_fields");
110 include_once(
"./Services/User/classes/class.ilCustomUserFieldsGUI.php");
112 $this->ctrl->forwardCommand($cf);
131 global $rbacsystem,
$tpl;
133 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()))
135 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
138 include_once
"Services/User/classes/class.ilUserLPTableGUI.php";
139 $tbl =
new ilUserLPTableGUI($this,
"learningProgress", $this->object->getRefId());
141 $tpl->setContent($tbl->getHTML());
150 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
152 $utab->resetOffset();
153 $utab->resetFilter();
166 $ilCtrl->setParameterByClass(
"ilobjusergui",
"new_type",
"usr");
167 $ilCtrl->redirectByClass(array(
"iladministrationgui",
"ilobjusergui"),
"create");
178 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
180 $utab->resetOffset();
181 $utab->writeFilterToSession();
183 $ilTabs->activateTab(
"obj_usrf");
195 $ilToolbar->addButton($this->lng->txt(
"usr_add"),
196 $this->ctrl->getLinkTarget($this,
"addUser"));
197 $ilToolbar->addButton($this->lng->txt(
"import_users"),
198 $this->ctrl->getLinkTarget($this,
"importUserForm"));
201 include_once
'./Services/User/classes/class.ilUserAccountSettings.php';
203 if ((
int) $ilSetting->get(
'user_adm_alpha_nav'))
205 $ilToolbar->addSeparator();
208 include_once(
"./Services/Form/classes/class.ilAlphabetInputGUI.php");
210 include_once(
"./Services/User/classes/class.ilObjUser.php");
216 $ai->setParentCommand($this,
"chooseLetter");
217 $ai->setHighlighted(
$_GET[
"letter"]);
218 $ilToolbar->addInputItem($ai,
true);
222 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
224 $tpl->setContent($utab->getHTML());
232 include_once
'./Services/User/classes/class.ilUserAutoComplete.php';
234 $auto->setSearchFields(array(
'login',
'firstname',
'lastname',
'email'));
235 $auto->enableFieldSearchableCheck(
false);
250 $ilCtrl->redirect($this,
"view");
264 $operations = array();
266 if ($this->actions ==
"")
269 "delete" => array(
"name" =>
"delete",
"lng" =>
"delete"),
270 "activate" => array(
"name" =>
"activate",
"lng" =>
"activate"),
271 "deactivate" => array(
"name" =>
"deactivate",
"lng" =>
"deactivate"),
272 "accessRestrict" => array(
"name" =>
"accessRestrict",
"lng" =>
"accessRestrict"),
273 "accessFree" => array(
"name" =>
"accessFree",
"lng" =>
"accessFree"),
274 "export" => array(
"name" =>
"export",
"lng" =>
"export")
283 if ($rbacsystem->checkAccess($row[
"name"],$this->object->getRefId()))
285 $operations[] =
$row;
289 if (count($operations) > 0)
291 $select =
"<select name=\"selectedAction\">\n";
292 foreach ($operations as $val)
294 $select .=
"<option value=\"" . $val[
"name"] .
"\"";
295 if (strcmp(
$_POST[
"selectedAction"], $val[
"name"]) == 0)
297 $select .=
" selected=\"selected\"";
300 $select .= $this->lng->txt($val[
"lng"]);
301 $select .=
"</option>";
303 $select .=
"</select>";
304 $this->tpl->setCurrentBlock(
"tbl_action_select");
305 $this->tpl->setVariable(
"SELECT_ACTION", $select);
306 $this->tpl->setVariable(
"BTN_NAME",
"userAction");
307 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"submit"));
308 $this->tpl->parseCurrentBlock();
311 if ($with_subobjects ===
true)
316 if ((count($operations) > 0) or $subobjs ===
true)
318 $this->tpl->setCurrentBlock(
"tbl_action_row");
319 $this->tpl->setVariable(
"COLUMN_COUNTS",count($this->data[
"cols"]));
321 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
322 $this->tpl->parseCurrentBlock();
336 $d = $this->objDefinition->getCreatableSubObjects($this->object->getType());
338 if (!$rbacsystem->checkAccess(
'create_usr',$this->object->getRefId()))
351 for ($i=0; $i<count($this->data[
"ctrl"]); $i++)
353 if ($this->data[
"ctrl"][$i][
"type"] == $row[
"name"])
359 if ($row[
"max"] ==
"" || $count < $row[
"max"])
361 $subobj[] = $row[
"name"];
366 if (is_array($subobj))
370 $this->tpl->setCurrentBlock(
"add_object");
371 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
372 $this->tpl->setVariable(
"BTN_NAME",
"create");
373 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"add"));
374 $this->tpl->parseCurrentBlock();
384 $this->ctrl->redirectByClass(
'iladminusersearchgui',
'showSearchResults');
386 #session_unregister("saved_post");
387 #$this->ctrl->returnToParent($this);
407 global $rbacsystem, $ilUser;
410 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
412 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
421 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
422 $obj->setActive(TRUE, $ilUser->getId());
428 if (
$_SESSION[
'user_activate_search'] ==
true)
430 session_unregister(
"user_activate_search");
431 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show',
'',
false,
false);
436 $this->ctrl->redirect($this,
"view");
457 global $rbacsystem, $ilUser;
460 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
462 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
471 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
472 $obj->setActive(FALSE, $ilUser->getId());
479 if (
$_SESSION[
'user_deactivate_search'] ==
true)
481 session_unregister(
"user_deactivate_search");
482 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show',
'',
false,
false);
487 $this->ctrl->redirect($this,
"view");
498 global $rbacsystem, $ilUser;
501 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
503 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
512 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
513 $obj->setTimeLimitOwner($ilUser->getId());
514 $obj->setTimeLimitUnlimited(1);
515 $obj->setTimeLimitFrom(
"");
516 $obj->setTimeLimitUntil(
"");
517 $obj->setTimeLimitMessage(0);
524 if (
$_SESSION[
'user_accessFree_search'] ==
true)
526 session_unregister(
"user_accessFree_search");
527 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show',
'',
false,
false);
532 $this->ctrl->redirect($this,
"view");
542 $this->tpl->setContent($a_form->getHTML());
547 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
549 $form->setTitle($this->lng->txt(
"time_limit_add_time_limit_for_selected"));
550 $form->setFormAction($this->ctrl->getFormAction($this,
"confirmaccessRestrict"));
554 $from->setRequired(
true);
555 $form->addItem($from);
559 $to->setShowTime(
true);
562 $form->addCommandButton(
"confirmaccessRestrict", $this->lng->txt(
"confirm"));
563 $form->addCommandButton(
"cancelaccessRestrict", $this->lng->txt(
"cancel"));
576 if(!$form->checkInput())
581 $timefrom = $form->getItemByPostVar(
"from")->getDate()->get(
IL_CAL_UNIX);
582 $timeuntil = $form->getItemByPostVar(
"to")->getDate()->get(
IL_CAL_UNIX);
583 if ($timeuntil <= $timefrom)
589 global $rbacsystem, $ilUser;
592 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
594 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
603 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
604 $obj->setTimeLimitOwner($ilUser->getId());
605 $obj->setTimeLimitUnlimited(0);
606 $obj->setTimeLimitFrom($timefrom);
607 $obj->setTimeLimitUntil($timeuntil);
608 $obj->setTimeLimitMessage(0);
615 if (
$_SESSION[
'user_accessRestrict_search'] ==
true)
617 session_unregister(
"user_accessRestrict_search");
618 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show',
'',
false,
false);
623 $this->ctrl->redirect($this,
"view");
647 if (!$rbacsystem->checkAccess(
'delete',$this->object->getRefId()))
650 $ilCtrl->redirect($this,
"view");
657 $this->ilias->raiseError($this->lng->txt(
"msg_no_delete_yourself"),$this->ilias->error_obj->WARNING);
664 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
672 #unset($_SESSION['saved_post']);
674 if (
$_SESSION[
'user_delete_search'] ==
true)
676 session_unregister(
"user_delete_search");
677 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show',
'',
false,
false);
682 $this->ctrl->redirect($this,
"view");
704 session_unregister(
"saved_post");
705 $this->
object->buildExportFile(
$_POST[
"export_type"], $user_data_filter);
706 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
716 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
722 $this->data[
"cols"] = array(
"type",
"title",
"description",
"last_change");
724 foreach(
$_POST[
"id"] as $id)
726 $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($id);
728 $this->data[
"data"][
"$id"] = array(
729 "type" => $obj_data->getType(),
730 "title" => $obj_data->getTitle(),
731 "desc" => $obj_data->getDescription(),
732 "last_update" => $obj_data->getLastUpdateDate());
735 $this->data[
"buttons"] = array(
736 "confirmedDelete" => $this->lng->txt(
"confirm"),
737 "cancelDelete" => $this->lng->txt(
"cancel")
744 $this->tpl->setVariable(
"FORMACTION",
745 $this->ctrl->getFormAction($this));
748 foreach ($this->data[
"cols"] as $key)
750 $this->tpl->setCurrentBlock(
"table_header");
751 $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
752 $this->tpl->parseCurrentBlock();
759 foreach($this->data[
"data"] as $key => $value)
762 foreach($value as $key => $cell_data)
764 $this->tpl->setCurrentBlock(
"table_cell");
773 $this->tpl->setVariable(
"TEXT_CONTENT",$cell_data);
775 $this->tpl->parseCurrentBlock();
778 $this->tpl->setCurrentBlock(
"table_row");
780 $this->tpl->parseCurrentBlock();
786 foreach($this->data[
"buttons"] as $name => $value)
788 $this->tpl->setCurrentBlock(
"operation_btn");
789 $this->tpl->setVariable(
"BTN_NAME",$name);
790 $this->tpl->setVariable(
"BTN_VALUE",$value);
791 $this->tpl->parseCurrentBlock();
799 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm.html");
800 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
801 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"export_format_selection"));
802 $export_types = array(
"userfolder_export_excel_x86",
"userfolder_export_csv",
"userfolder_export_xml");
804 foreach ($export_types as $type)
806 $options[$type] = $this->lng->txt($type);
808 $select =
ilUtil::formSelect(
"userfolder_export_xml",
"export_type" ,$options,
false,
true);
809 $this->tpl->setVariable(
"TXT_CONTENT", $this->lng->txt(
"export_format") .
": " . $select);
810 $this->tpl->setVariable(
"CMD_CANCEL",
"cancelexport");
811 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
812 $this->tpl->setVariable(
"CMD_OK",
"confirmexport");
813 $this->tpl->setVariable(
"TXT_OK", $this->lng->txt(
"confirm"));
814 $this->tpl->parseCurrentBlock();
824 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
835 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
837 $cgui->setFormAction($this->ctrl->getFormAction($this));
838 $cgui->setHeaderText($this->lng->txt(
"info_" . $action .
"_sure"));
839 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancel" . $action);
840 $cgui->setConfirm($this->lng->txt(
"confirm"),
"confirm" . $action);
842 foreach(
$_POST[
"id"] as $id)
846 $login = $user->getLastLogin();
849 $login = $this->lng->txt(
"never");
856 $caption = $user->getFullname().
" (".$user->getLogin().
")".
", ".
857 $user->getEmail().
" - ".$this->lng->txt(
"last_login").
": ".$login;
860 $cgui->addItem(
"user_id[]", $i, $caption);
863 $this->tpl->setContent($cgui->getHTML());
873 $_POST[
"selectedAction"] =
"delete";
882 $_POST[
"selectedAction"] =
"activate";
891 $_POST[
"selectedAction"] =
"deactivate";
900 $_POST[
"selectedAction"] =
"accessRestrict";
909 $_POST[
"selectedAction"] =
"accessFree";
918 $_POST[
"selectedAction"] =
"export";
937 $this->tabs_gui->setTabActive(
'obj_usrf');
939 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_search_form.html");
941 $this->tpl->setVariable(
"FORMACTION",
942 $this->ctrl->getFormAction($this));
943 $this->tpl->setVariable(
"USERNAME_CHECKED",
" checked=\"checked\"");
944 $this->tpl->setVariable(
"FIRSTNAME_CHECKED",
" checked=\"checked\"");
945 $this->tpl->setVariable(
"LASTNAME_CHECKED",
" checked=\"checked\"");
946 $this->tpl->setVariable(
"EMAIL_CHECKED",
" checked=\"checked\"");
947 $this->tpl->setVariable(
"ACTIVE_CHECKED",
" checked=\"checked\"");
948 $this->tpl->setVariable(
"TXT_SEARCH_USER",$this->lng->txt(
"search_user"));
949 $this->tpl->setVariable(
"TXT_SEARCH_IN",$this->lng->txt(
"search_in"));
950 $this->tpl->setVariable(
"TXT_SEARCH_USERNAME",$this->lng->txt(
"username"));
951 $this->tpl->setVariable(
"TXT_SEARCH_FIRSTNAME",$this->lng->txt(
"firstname"));
952 $this->tpl->setVariable(
"TXT_SEARCH_LASTNAME",$this->lng->txt(
"lastname"));
953 $this->tpl->setVariable(
"TXT_SEARCH_EMAIL",$this->lng->txt(
"email"));
954 $this->tpl->setVariable(
"TXT_SEARCH_ACTIVE",$this->lng->txt(
"search_active"));
955 $this->tpl->setVariable(
"TXT_SEARCH_INACTIVE",$this->lng->txt(
"search_inactive"));
956 $this->tpl->setVariable(
"BUTTON_SEARCH",$this->lng->txt(
"search"));
957 $this->tpl->setVariable(
"BUTTON_CANCEL",$this->lng->txt(
"cancel"));
958 $this->tpl->setVariable(
"TXT_SEARCH_NOTE",$this->lng->txt(
"search_note"));
959 $this->tpl->setVariable(
"ACTIVE_CHECKED",
"checked=\"checked\"");
967 $this->ctrl->redirect($this,
"view");
977 $obj_str =
"&obj_id=".$this->obj_id;
979 $_POST[
"search_string"] = trim(
$_POST[
"search_string"]) ? trim(
$_POST[
"search_string"]) : trim(urldecode(
$_GET[
"search_string"]));
983 $_POST[
"search_fields"] = array (
"username",
"firstname",
"lastname",
"email");
985 if (empty(
$_POST[
"search_string"]))
987 $_POST[
"search_string"] =
"%";
990 if (empty(
$_POST[
"search_fields"]))
992 $_POST[
"search_fields"] = array();
996 if (
$_POST[
"search_string"] ==
"%")
998 $_POST[
"search_string"] =
"";
1000 $msg = $this->lng->txt(
"msg_no_search_result");
1001 if (
$_POST[
"search_string"] !=
"")
1003 $msg .=
" ".$this->lng->txt(
"with").
" '".htmlspecialchars(
$_POST[
"search_string"]).
"'";
1006 $this->ctrl->redirect($this,
"searchUserForm");
1009 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
1012 $this->tpl->setCurrentBlock(
"btn_cell");
1013 $this->tpl->setVariable(
"BTN_LINK",
1014 $this->ctrl->getLinkTarget($this,
"searchUserForm"));
1015 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"search_new"));
1016 $this->tpl->parseCurrentBlock();
1018 $this->data[
"cols"] = array(
"",
"login",
"firstname",
"lastname",
"email",
"active");
1022 $searchActive =
true;
1026 $searchInactive =
true;
1029 foreach ($search_result as $key => $val)
1031 $val[
"active_text"] = $this->lng->txt(
"inactive");
1034 $val[
"active_text"] = $this->lng->txt(
"active");
1038 $searchStringToLower = strtolower(
$_POST[
"search_string"]);
1039 $displaySearchResult =
false;
1040 if (in_array(
"username",
$_POST[
"search_fields"]))
1041 if (strpos(strtolower($val[
"login"]), strtolower(
$_POST[
"search_string"])) !==
false)
1042 $displaySearchResult =
true;
1043 if (in_array(
"firstname",
$_POST[
"search_fields"]))
1044 if (strpos(strtolower($val[
"firstname"]), strtolower(
$_POST[
"search_string"])) !==
false)
1045 $displaySearchResult =
true;
1046 if (in_array(
"lastname",
$_POST[
"search_fields"]))
1047 if (strpos(strtolower($val[
"lastname"]), strtolower(
$_POST[
"search_string"])) !==
false)
1048 $displaySearchResult =
true;
1049 if (in_array(
"email",
$_POST[
"search_fields"]))
1050 if (strpos(strtolower($val[
"email"]), strtolower(
$_POST[
"search_string"])) !==
false)
1051 $displaySearchResult =
true;
1052 if (($val[
"active"] == 1) && ($searchActive ==
true) ||
1053 ($val[
"active"] == 0) && ($searchInactive ==
true))
1055 if ((strcmp(
$_POST[
"search_string"],
"%") == 0) || $displaySearchResult)
1058 $this->data[
"data"][] = array(
1059 "login" => $val[
"login"],
1060 "firstname" => $val[
"firstname"],
1061 "lastname" => $val[
"lastname"],
1062 "email" => $val[
"email"],
1063 "active" => $val[
"active_text"],
1064 "obj_id" => $val[
"usr_id"]
1069 if (count($this->data[
"data"]) == 0)
1071 ilUtil::sendInfo($this->lng->txt(
"msg_no_search_result").
" ".$this->lng->txt(
"with").
" '".htmlspecialchars(
$_POST[
"search_string"]).
"'",
true);
1073 $this->ctrl->redirect($this,
"searchUserForm");
1076 $this->maxcount = count($this->data[
"data"]);
1079 if (
$_GET[
"sort_by"] ==
"name")
1081 $_GET[
"sort_by"] =
"login";
1086 $this->data[
"data"] = array_slice($this->data[
"data"],
$_GET[
"offset"],
$_GET[
"limit"]);
1089 foreach ($this->data[
"data"] as $key => $val)
1091 $this->data[
"ctrl"][$key] = array(
1092 "ref_id" => $this->
id,
1093 "obj_id" => $val[
"obj_id"]
1095 $tmp[] = $val[
"obj_id"];
1096 unset($this->data[
"data"][$key][
"obj_id"]);
1103 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
1105 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.obj_tbl_rows.html");
1109 $this->ctrl->setParameter($this,
"sort_by",
"name");
1110 $this->ctrl->setParameter($this,
"sort_order",
$_GET[
"sort_order"]);
1111 $this->ctrl->setParameter($this,
"offset",
$_GET[
"offset"]);
1112 $this->tpl->setVariable(
"FORMACTION",
1113 $this->ctrl->getFormAction($this));
1116 include_once
"./Services/Table/classes/class.ilTableGUI.php";
1120 $tbl->setTitle($this->lng->txt(
"search_result"),
"icon_".$this->object->getType().
".gif",$this->lng->txt(
"obj_".$this->object->getType()));
1121 $tbl->setHelp(
"tbl_help.php",
"icon_help.gif",$this->lng->txt(
"help"));
1123 foreach ($this->data[
"cols"] as $val)
1125 $header_names[] = $this->lng->txt($val);
1128 $tbl->setHeaderNames($header_names);
1130 $header_params = $this->ctrl->getParameterArray($this,
"searchUser");
1131 $header_params[
"search_string"] = urlencode(
$_POST[
"search_string"]);
1132 $header_params[
"search_fields"] = urlencode(implode(
",",
$_POST[
"search_fields"]));
1134 $tbl->setHeaderVars($this->data[
"cols"],$header_params);
1135 $tbl->setColumnWidth(array(
"",
"25%",
"25$%",
"25%",
"25%"));
1138 $tbl->enable(
"hits");
1139 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
1140 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
1141 $tbl->setLimit(
$_GET[
"limit"]);
1142 $tbl->setOffset(
$_GET[
"offset"]);
1143 $tbl->setMaxCount($this->maxcount);
1145 $this->tpl->setVariable(
"COLUMN_COUNTS",count($this->data[
"cols"]));
1148 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1153 if (is_array($this->data[
"data"][0]))
1156 for ($i=0; $i < count($this->data[
"data"]); $i++)
1158 $data = $this->data[
"data"][$i];
1159 $ctrl = $this->data[
"ctrl"][$i];
1162 $this->ids[] =
$ctrl[
"obj_id"];
1167 $this->tpl->setCurrentBlock(
"checkbox");
1168 $this->tpl->setVariable(
"CHECKBOX_ID",
$ctrl[
"obj_id"]);
1170 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1171 $this->tpl->parseCurrentBlock();
1173 $this->tpl->setCurrentBlock(
"table_cell");
1174 $this->tpl->setVariable(
"CELLSTYLE",
"tblrow1");
1175 $this->tpl->parseCurrentBlock();
1177 foreach (
$data as $key => $val)
1180 $this->ctrl->setParameterByClass(
"ilobjusergui",
"ref_id",
"7");
1181 $this->ctrl->setParameterByClass(
"ilobjusergui",
"obj_id",
$ctrl[
"obj_id"]);
1182 $link = $this->ctrl->getLinkTargetByClass(
"ilobjusergui",
"view");
1184 if ($key ==
"login")
1186 $this->tpl->setCurrentBlock(
"begin_link");
1187 $this->tpl->setVariable(
"LINK_TARGET", $link);
1188 $this->tpl->parseCurrentBlock();
1189 $this->tpl->touchBlock(
"end_link");
1192 $this->tpl->setCurrentBlock(
"text");
1193 $this->tpl->setVariable(
"TEXT_CONTENT", $val);
1194 $this->tpl->parseCurrentBlock();
1195 $this->tpl->setCurrentBlock(
"table_cell");
1196 $this->tpl->parseCurrentBlock();
1199 $this->tpl->setCurrentBlock(
"tbl_content");
1200 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1201 $this->tpl->parseCurrentBlock();
1214 global
$tpl, $rbacsystem;
1217 if($this->ctrl->getTargetScript() ==
'repository.php')
1219 $this->tabs_gui->clearTargets();
1222 if (!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
1224 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1228 $tpl->setContent($this->form->getHTML());
1242 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1246 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
1247 $fi =
new ilFileInputGUI($lng->txt(
"import_file"),
"importFile");
1251 $this->form->addItem($fi);
1253 $this->form->addCommandButton(
"importUserRoleAssignment", $lng->txt(
"import"));
1254 $this->form->addCommandButton(
"importCancelled", $lng->txt(
"cancel"));
1256 $this->form->setTitle($lng->txt(
"import_users"));
1257 $this->form->setFormAction($ilCtrl->getFormAction($this));
1271 if (@is_dir($import_dir))
1276 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
1278 $this->ctrl->redirect($this,
"view");
1283 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1296 $importDir =
ilUtil::getDataDir().
'/user_import/usr_'.$ilUser->getId().
'_'.session_id();
1309 if($this->ctrl->getTargetScript() ==
'repository.php')
1311 $this->tabs_gui->clearTargets();
1315 if ($this->form->checkInput())
1317 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
1318 include_once
'./Services/User/classes/class.ilUserImportParser.php';
1320 global $rbacreview, $rbacsystem,
$tree,
$lng;
1323 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_import_roles.html");
1328 if (@is_dir($import_dir))
1340 if (!is_file($_FILES[
"importFile"][
"tmp_name"]))
1343 $this->ilias->raiseError($this->lng->txt(
"no_import_file_found")
1344 , $this->ilias->error_obj->MESSAGE);
1347 $_FILES[
"importFile"][
"name"], $full_path);
1350 if (strtolower($parts[
"extension"]) ==
"zip")
1357 foreach ($file_list as $a_file)
1359 if (substr($a_file[
'entry'],-4) ==
'.xml')
1361 $xml_file = $import_dir.
"/".$a_file[
'entry'];
1365 if (is_null($xml_file))
1367 $subdir = basename($parts[
"basename"],
".".$parts[
"extension"]);
1368 $xml_file = $import_dir.
"/".$subdir.
"/".$subdir.
".xml";
1374 $xml_file = $full_path;
1378 if (!is_file($xml_file))
1381 $this->ilias->raiseError($this->lng->txt(
"no_xml_file_found_in_zip")
1382 .
" ".$subdir.
"/".$subdir.
".xml", $this->ilias->error_obj->MESSAGE);
1385 require_once(
"./Services/User/classes/class.ilUserImportParser.php");
1390 $importParser->startParsing();
1391 switch ($importParser->getErrorLevel())
1396 $this->tpl->setVariable(
"IMPORT_LOG", $importParser->getProtocolAsHTML($lng->txt(
"verification_warning_log")));
1400 $this->ilias->raiseError(
1401 $lng->txt(
"verification_failed").$importParser->getProtocolAsHTML($lng->txt(
"verification_failure_log")),
1402 $this->ilias->error_obj->MESSAGE
1409 $this->tpl->setCurrentBlock(
"role_selection_form");
1410 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1411 $this->tpl->setVariable(
"TXT_IMPORT_USERS", $this->lng->txt(
"import_users"));
1412 $this->tpl->setVariable(
"TXT_IMPORT_FILE", $this->lng->txt(
"import_file"));
1413 $this->tpl->setVariable(
"IMPORT_FILE",
$file_name);
1414 $this->tpl->setVariable(
"TXT_USER_ELEMENT_COUNT", $this->lng->txt(
"num_users"));
1415 $this->tpl->setVariable(
"USER_ELEMENT_COUNT", $importParser->getUserCount());
1416 $this->tpl->setVariable(
"TXT_ROLE_ASSIGNMENT", $this->lng->txt(
"role_assignment"));
1417 $this->tpl->setVariable(
"BTN_IMPORT", $this->lng->txt(
"import"));
1418 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1419 $this->tpl->setVariable(
"XML_FILE_NAME", $xml_file);
1423 $importParser->startParsing();
1424 $roles = $importParser->getCollectedRoles();
1427 $all_gl_roles = $rbacreview->getRoleListByObject(ROLE_FOLDER_ID);
1428 $gl_roles = array();
1429 $roles_of_user = $rbacreview->assignedRoles($ilUser->getId());
1430 foreach ($all_gl_roles as $obj_data)
1441 if ($obj_data[
"obj_id"] != ANONYMOUS_ROLE_ID)
1444 if ($obj_data[
"obj_id"] != SYSTEM_ROLE_ID or in_array(SYSTEM_ROLE_ID,$roles_of_user))
1446 $gl_roles[$obj_data[
"obj_id"]] = $obj_data[
"title"];
1452 $got_globals =
false;
1453 foreach($roles as $role_id => $role)
1455 if ($role[
"type"] ==
"Global")
1459 $got_globals =
true;
1461 $this->tpl->setCurrentBlock(
"global_role_section");
1462 $this->tpl->setVariable(
"TXT_GLOBAL_ROLES_IMPORT", $this->lng->txt(
"roles_of_import_global"));
1463 $this->tpl->setVariable(
"TXT_GLOBAL_ROLES", $this->lng->txt(
"assign_global_role"));
1467 $pre_select = array_search($role[name], $gl_roles);
1470 switch($role[
"name"])
1472 case "Administrator":
1473 $pre_select = array_search(
"Administrator", $gl_roles);
1477 $pre_select = array_search(
"User", $gl_roles);
1481 $pre_select = array_search(
"User", $gl_roles);
1485 $pre_select = array_search(
"Guest", $gl_roles);
1489 $pre_select = array_search(
"User", $gl_roles);
1493 $this->tpl->setCurrentBlock(
"global_role");
1494 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $gl_roles,
false,
true);
1495 $this->tpl->setVariable(
"TXT_IMPORT_GLOBAL_ROLE", $role[
"name"].
" [".$role_id.
"]");
1496 $this->tpl->setVariable(
"SELECT_GLOBAL_ROLE", $role_select);
1497 $this->tpl->parseCurrentBlock();
1502 $got_locals =
false;
1503 foreach($roles as $role_id => $role)
1505 if ($role[
"type"] ==
"Local")
1514 $this->tpl->setCurrentBlock(
"local_role_section");
1515 $this->tpl->setVariable(
"TXT_LOCAL_ROLES_IMPORT", $this->lng->txt(
"roles_of_import_local"));
1516 $this->tpl->setVariable(
"TXT_LOCAL_ROLES", $this->lng->txt(
"assign_local_role"));
1527 $loc_roles = array();
1528 foreach($roles as $role_id => $role)
1530 if ($role[
"type"] ==
"Local")
1532 $searchName = (substr($role[
'name'],0,1) ==
'#') ? $role[
'name'] :
'#'.$role[
'name'];
1533 $matching_role_ids = $rbacreview->searchRolesByMailboxAddressList($searchName);
1534 foreach ($matching_role_ids as $mid) {
1535 if (! in_array($mid, $loc_roles)) {
1536 $loc_roles[] = array(
'obj_id'=>$mid);
1545 $loc_roles = $rbacreview->getAssignableRolesInSubtree($this->object->getRefId());
1550 $l_roles_mailbox_searcharray = array();
1551 foreach ($loc_roles as $key => $loc_role)
1554 $rolf = $rbacreview->getFoldersAssignedToRole($loc_role[
"obj_id"],
true);
1560 if (!$rbacreview->isDeleted($rolf[0])
1561 && $rbacsystem->checkAccess(
'write',$tree->getParentId($rolf[0]))
1562 && $rolf[0] != ROLE_FOLDER_ID
1576 if ($this->tree->isInTree($rolf[0]))
1580 $tmpPath = $this->tree->getPathFull($rolf[0]);
1581 for ($i = 1,
$n = count($tmpPath) - 1; $i <
$n; $i++)
1587 if ($i < 3 || $i > $n - 3)
1591 else if ($i == 3 || $i == $n - 3)
1596 $isInSubtree |= $tmpPath[$i][
'obj_id'] == $this->
object->getId();
1601 $path =
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$loc_role[
"obj_id"].
")</b>";
1603 $roleMailboxAddress = $rbacreview->getRoleMailboxAddress($loc_role[
'obj_id']);
1604 $l_roles[$loc_role[
'obj_id']] = $roleMailboxAddress.
', '.
$path;
1609 natcasesort($l_roles);
1610 $l_roles[
""] = $this->lng->txt(
"usrimport_ignore_role");
1611 foreach($roles as $role_id => $role)
1613 if ($role[
"type"] ==
"Local")
1615 $this->tpl->setCurrentBlock(
"local_role");
1616 $this->tpl->setVariable(
"TXT_IMPORT_LOCAL_ROLE", $role[
"name"]);
1617 $searchName = (substr($role[
'name'],0,1) ==
'#') ? $role[
'name'] :
'#'.$role[
'name'];
1618 $matching_role_ids = $rbacreview->searchRolesByMailboxAddressList($searchName);
1619 $pre_select = count($matching_role_ids) == 1 ? $matching_role_ids[0] :
"";
1624 $selectable_roles = array();
1625 $selectable_roles[
""] = $this->lng->txt(
"usrimport_ignore_role");
1626 foreach ($matching_role_ids as $id)
1628 $selectable_roles[$id] = $l_roles[$id];
1630 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $selectable_roles,
false,
true);
1632 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $l_roles,
false,
true);
1634 $this->tpl->setVariable(
"SELECT_LOCAL_ROLE", $role_select);
1635 $this->tpl->parseCurrentBlock();
1641 $this->tpl->setVariable(
"TXT_CONFLICT_HANDLING", $lng->txt(
"conflict_handling"));
1646 $this->tpl->setVariable(
"TXT_CONFLICT_HANDLING_INFO", str_replace(
'\n',
'<br>',$this->lng->txt(
"usrimport_conflict_handling_info")));
1647 $this->tpl->setVariable(
"TXT_CONFLICT_CHOICE", $lng->txt(
"conflict_handling"));
1651 $this->lng->loadLanguageModule(
"mail");
1652 include_once
'./Services/User/classes/class.ilObjUserFolder.php';
1654 if (trim($amail[
"body"]) !=
"" && trim($amail[
"subject"]) !=
"")
1656 $this->tpl->setCurrentBlock(
"inform_user");
1657 $this->tpl->setVariable(
"TXT_ACCOUNT_MAIL", $lng->txt(
"mail_account_mail"));
1660 $this->tpl->setVariable(
"SEND_MAIL",
" checked=\"checked\"");
1662 $this->tpl->setVariable(
"TXT_INFORM_USER_MAIL",
1663 $this->lng->txt(
"user_send_new_account_mail"));
1664 $this->tpl->parseCurrentBlock();
1669 $this->form->setValuesByPost();
1670 $tpl->setContent($this->form->getHtml());
1679 global $rbacreview,$ilUser;
1682 if($this->ctrl->getTargetScript() ==
'repository.php')
1684 $this->tabs_gui->clearTargets();
1687 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
1688 include_once
'./Services/User/classes/class.ilUserImportParser.php';
1690 global $rbacreview, $rbacsystem,
$tree,
$lng;
1692 switch (
$_POST[
"conflict_handling_choice"])
1694 case "update_on_conflict" :
1697 case "ignore_on_conflict" :
1709 if (
$_POST[
"role_assign"])
1711 $global_roles = $rbacreview->getGlobalRoles();
1712 $roles_of_user = $rbacreview->assignedRoles($ilUser->getId());
1713 foreach (
$_POST[
"role_assign"] as $role_id)
1717 if (in_array($role_id, $global_roles))
1719 if(!in_array(SYSTEM_ROLE_ID,$roles_of_user))
1721 if ($role_id == SYSTEM_ROLE_ID && ! in_array(SYSTEM_ROLE_ID,$roles_of_user)
1727 $this->ilias->raiseError($this->lng->txt(
"usrimport_with_specified_role_not_permitted"),
1728 $this->ilias->error_obj->MESSAGE);
1734 $rolf = $rbacreview->getFoldersAssignedToRole($role_id,
true);
1735 if ($rbacreview->isDeleted($rolf[0])
1736 || ! $rbacsystem->checkAccess(
'write',$tree->getParentId($rolf[0])))
1739 $this->ilias->raiseError($this->lng->txt(
"usrimport_with_specified_role_not_permitted"),
1740 $this->ilias->error_obj->MESSAGE);
1748 $importParser->setRoleAssignment(
$_POST[
"role_assign"]);
1749 $importParser->startParsing();
1754 switch ($importParser->getErrorLevel())
1760 ilUtil::sendInfo($this->lng->txt(
"user_imported_with_warnings").$importParser->getProtocolAsHTML($lng->txt(
"import_warning_log")),
true);
1763 $this->ilias->raiseError(
1764 $this->lng->txt(
"user_import_failed")
1765 .$importParser->getProtocolAsHTML($lng->txt(
"import_failure_log")),
1766 $this->ilias->error_obj->MESSAGE
1771 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
1773 $this->ctrl->redirect($this,
"view");
1778 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1785 global $rbacsystem,
$ilias;
1789 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
1791 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1794 if(!count($app_users =& $ilias->account->getAppliedUsers()))
1801 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_applied_users.html");
1802 $this->lng->loadLanguageModule(
'crs');
1805 foreach($app_users as
$usr_id)
1810 $f_result[$counter][] = $tmp_user->getLogin();
1811 $f_result[$counter][] = $tmp_user->getFirstname();
1812 $f_result[$counter][] = $tmp_user->getLastname();
1814 if($tmp_user->getTimeLimitUnlimited())
1816 $f_result[$counter][] =
"<b>".$this->lng->txt(
'crs_unlimited').
"</b>";
1820 $limit =
"<b>".$this->lng->txt(
'crs_from').
'</b> '.strftime(
"%Y-%m-%d %R",$tmp_user->getTimeLimitFrom()).
'<br />';
1821 $limit .=
"<b>".$this->lng->txt(
'crs_to').
'</b> '.strftime(
"%Y-%m-%d %R",$tmp_user->getTimeLimitUntil());
1823 $f_result[$counter][] = $limit;
1837 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
1839 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
1842 $this->lng->loadLanguageModule(
'crs');
1846 if(!isset(
$_SESSION[
'error_post_vars']))
1848 ilUtil::sendInfo($this->lng->txt(
'time_limit_add_time_limit_for_selected'));
1851 if(!count(
$_POST[
"users"]))
1867 $title .= $tmp_user->getLogin();
1877 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_edit_applied_users.html");
1878 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1881 $time_limit_unlimited =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_unlimited"] ?
1884 $time_limit_start =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_start"] ?
1887 $time_limit_end =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_end"] ?
1893 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
"obj_usr"));
1895 $this->tpl->setVariable(
"TITLE",
$title);
1896 $this->tpl->setVariable(
"TXT_TIME_LIMIT",$this->lng->txt(
"time_limit"));
1897 $this->tpl->setVariable(
"TXT_TIME_LIMIT_START",$this->lng->txt(
"crs_start"));
1898 $this->tpl->setVariable(
"TXT_TIME_LIMIT_END",$this->lng->txt(
"crs_end"));
1899 $this->tpl->setVariable(
"CMD_SUBMIT",
"updateAppliedUsers");
1900 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
"cancel"));
1901 $this->tpl->setVariable(
"TXT_SUBMIT",$this->lng->txt(
"submit"));
1905 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_DAY",$this->
__getDateSelect(
"day",
"au[time_limit_start][day]",
1906 date(
"d",$time_limit_start)));
1907 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_MONTH",$this->
__getDateSelect(
"month",
"au[time_limit_start][month]",
1908 date(
"m",$time_limit_start)));
1909 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_YEAR",$this->
__getDateSelect(
"year",
"au[time_limit_start][year]",
1910 date(
"Y",$time_limit_start)));
1911 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_HOUR",$this->
__getDateSelect(
"hour",
"au[time_limit_start][hour]",
1912 date(
"G",$time_limit_start)));
1913 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_MINUTE",$this->
__getDateSelect(
"minute",
"au[time_limit_start][minute]",
1914 date(
"i",$time_limit_start)));
1915 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_DAY",$this->
__getDateSelect(
"day",
"au[time_limit_end][day]",
1916 date(
"d",$time_limit_end)));
1917 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_MONTH",$this->
__getDateSelect(
"month",
"au[time_limit_end][month]",
1918 date(
"m",$time_limit_end)));
1919 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_YEAR",$this->
__getDateSelect(
"year",
"au[time_limit_end][year]",
1920 date(
"Y",$time_limit_end)));
1921 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_HOUR",$this->
__getDateSelect(
"hour",
"au[time_limit_end][hour]",
1922 date(
"G",$time_limit_end)));
1923 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_MINUTE",$this->
__getDateSelect(
"minute",
"au[time_limit_end][minute]",
1924 date(
"i",$time_limit_end)));
1925 if($this->ilias->account->getTimeLimitUnlimited())
1927 $this->tpl->setVariable(
"ROWSPAN",3);
1928 $this->tpl->setCurrentBlock(
"unlimited");
1929 $this->tpl->setVariable(
"TXT_TIME_LIMIT_UNLIMITED",$this->lng->txt(
"crs_unlimited"));
1930 $this->tpl->setVariable(
"TIME_LIMIT_UNLIMITED",
ilUtil::formCheckbox($time_limit_unlimited,
"au[time_limit_unlimited]",1));
1931 $this->tpl->parseCurrentBlock();
1935 $this->tpl->setVariable(
"ROWSPAN",2);
1943 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
1945 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
1951 if(!
$_POST[
'au'][
'time_limit_unlimited'])
1962 #if(!$this->ilias->account->getTimeLimitUnlimited())
1964 # if($start < $this->ilias->account->getTimeLimitFrom() or
1965 # $end > $this->ilias->account->getTimeLimitUntil())
1967 # $_SESSION['error_post_vars'] = $_POST;
1968 # ilUtil::sendInfo($this->lng->txt('time_limit_not_within_owners'));
1969 # $this->editAppliedUsersObject();
1979 $tmp_user->setTimeLimitUnlimited((
int)
$_POST[
'au'][
'time_limit_unlimited']);
1980 $tmp_user->setTimeLimitFrom($start);
1981 $tmp_user->setTimeLimitUntil($end);
1982 $tmp_user->setTimeLimitMessage(0);
1983 $tmp_user->update();
1998 $tpl =& $tbl->getTemplateObject();
2001 $tpl->setCurrentBlock(
"tbl_form_header");
2003 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2004 $tpl->parseCurrentBlock();
2006 $tpl->setCurrentBlock(
"tbl_action_btn");
2007 $tpl->setVariable(
"BTN_NAME",
'editAppliedUsers');
2008 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
'edit'));
2009 $tpl->parseCurrentBlock();
2011 $tpl->setCurrentBlock(
"tbl_action_row");
2012 $tpl->setVariable(
"COLUMN_COUNTS",5);
2014 $tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
2015 $tpl->parseCurrentBlock();
2019 $tbl->setTitle($this->lng->txt(
"time_limit_applied_users"),
"icon_usr_b.gif",$this->lng->txt(
"users"));
2020 $tbl->setHeaderNames(array(
'',
2021 $this->lng->txt(
"login"),
2022 $this->lng->txt(
"firstname"),
2023 $this->lng->txt(
"lastname"),
2024 $this->lng->txt(
"time_limits")));
2025 $header_params = $this->ctrl->getParameterArray($this,
"appliedUsers");
2026 $tbl->setHeaderVars(array(
"",
2031 array($header_params));
2032 $tbl->setColumnWidth(array(
"3%",
"19%",
"19%",
"19%",
"40%"));
2038 $this->tpl->setVariable(
"APPLIED_USERS",$tbl->tpl->get());
2045 include_once
"./Services/Table/classes/class.ilTableGUI.php";
2052 $offset =
$_GET[
"offset"];
2053 $order =
$_GET[
"sort_by"];
2054 $direction =
$_GET[
"sort_order"];
2057 $tbl->setOrderColumn($order);
2058 $tbl->setOrderDirection($direction);
2059 $tbl->setOffset($offset);
2060 $tbl->setLimit(
$_GET[
"limit"]);
2061 $tbl->setMaxCount(count($result_set));
2062 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
2063 $tbl->setData($result_set);
2071 for($i=0;$i<=60;$i++)
2073 $days[$i] = $i < 10 ?
"0".$i : $i;
2078 for($i=0;$i<24;$i++)
2080 $days[$i] = $i < 10 ?
"0".$i : $i;
2085 for($i=1;$i<32;$i++)
2087 $days[$i] = $i < 10 ?
"0".$i : $i;
2092 for($i=1;$i<13;$i++)
2094 $month[$i] = $i < 10 ?
"0".$i : $i;
2099 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
2108 return mktime($a_time_arr[
"hour"],
2109 $a_time_arr[
"minute"],
2110 $a_time_arr[
"second"],
2111 $a_time_arr[
"month"],
2113 $a_time_arr[
"year"]);
2132 include_once
'./Services/User/classes/class.ilUserAccountSettings.php';
2134 $this->form->setValuesByArray(
2136 'lua' => $aset->isLocalUserAdministrationEnabled(),
2137 'lrua' => $aset->isUserAccessRestricted(),
2138 'allow_change_loginname' => (bool)$ilSetting->get(
'allow_change_loginname'),
2139 'create_history_loginname' => (bool)$ilSetting->get(
'create_history_loginname'),
2140 'prevent_reuse_of_loginnames' => (bool)$ilSetting->get(
'prevent_reuse_of_loginnames'),
2141 'loginname_change_blocking_time' => (int)$ilSetting->get(
'loginname_change_blocking_time'),
2142 'user_adm_alpha_nav' => (int)$ilSetting->get(
'user_adm_alpha_nav'),
2144 'user_reactivate_code' => (int)$ilSetting->get(
'user_reactivate_code')
2148 $this->tpl->setContent($this->form->getHTML());
2161 if($this->form->checkInput())
2165 if(strlen($this->form->getInput(
'loginname_change_blocking_time')) &&
2166 !preg_match(
'/^[0-9]*$/',
2167 $this->form->getInput(
'loginname_change_blocking_time')))
2170 $this->form->getItemByPostVar(
'loginname_change_blocking_time')
2171 ->setAlert($this->lng->txt(
'loginname_change_blocking_time_invalidity_info'));
2176 include_once
'./Services/User/classes/class.ilUserAccountSettings.php';
2182 $ilSetting->set(
'allow_change_loginname', (
int)$this->form->getInput(
'allow_change_loginname'));
2183 $ilSetting->set(
'create_history_loginname', (
int)$this->form->getInput(
'create_history_loginname'));
2184 $ilSetting->set(
'prevent_reuse_of_loginnames', (
int)$this->form->getInput(
'prevent_reuse_of_loginnames'));
2185 $ilSetting->set(
'loginname_change_blocking_time', (
int)$this->form->getInput(
'loginname_change_blocking_time'));
2186 $ilSetting->set(
'user_adm_alpha_nav', (
int)$this->form->getInput(
'user_adm_alpha_nav'));
2188 $ilSetting->set(
'user_portfolios', (
int)$this->form->getInput(
'user_portfolios'));
2189 $ilSetting->set(
'user_reactivate_code', (
int)$this->form->getInput(
'user_reactivate_code'));
2202 $this->form->setValuesByPost();
2203 $this->tpl->setContent($this->form->getHTML());
2214 $this->tabs_gui->setTabActive(
'settings');
2215 $this->tabs_gui->setSubTabActive(
'general_settings');
2217 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
2219 $this->form->setFormAction($this->ctrl->getFormAction($this,
'saveGeneralSettings'));
2221 $this->form->setTitle($this->lng->txt(
'general_settings'));
2223 $lua =
new ilCheckboxInputGUI($this->lng->txt(
'enable_local_user_administration'),
'lua');
2224 $lua->
setInfo($this->lng->txt(
'enable_local_user_administration_info'));
2226 $this->form->addItem($lua);
2229 $lrua->
setInfo($this->lng->txt(
'restrict_user_access_info'));
2231 $this->form->addItem($lrua);
2234 $alph =
new ilCheckboxInputGUI($this->lng->txt(
'user_adm_enable_alpha_nav'),
'user_adm_alpha_nav');
2237 $this->form->addItem($alph);
2246 $code =
new ilCheckboxInputGUI($this->lng->txt(
"user_account_code_setting"),
"user_reactivate_code");
2247 $code->
setInfo($this->lng->txt(
'user_account_code_setting_info'));
2248 $this->form->addItem($code);
2251 $log->setTitle($this->lng->txt(
'loginname_settings'));
2252 $this->form->addItem(
$log);
2254 $chbChangeLogin =
new ilCheckboxInputGUI($this->lng->txt(
'allow_change_loginname'),
'allow_change_loginname');
2256 $this->form->addItem($chbChangeLogin);
2257 $chbCreateHistory =
new ilCheckboxInputGUI($this->lng->txt(
'history_loginname'),
'create_history_loginname');
2258 $chbCreateHistory->
setInfo($this->lng->txt(
'loginname_history_info'));
2259 $chbCreateHistory->setValue(1);
2261 $chbChangeLogin->addSubItem($chbCreateHistory);
2262 $chbReuseLoginnames =
new ilCheckboxInputGUI($this->lng->txt(
'reuse_of_loginnames_contained_in_history'),
'prevent_reuse_of_loginnames');
2264 $chbReuseLoginnames->setInfo($this->lng->txt(
'prevent_reuse_of_loginnames_contained_in_history_info'));
2266 $chbChangeLogin->addSubItem($chbReuseLoginnames);
2267 $chbChangeBlockingTime =
new ilTextInputGUI($this->lng->txt(
'loginname_change_blocking_time'),
'loginname_change_blocking_time');
2268 $chbChangeBlockingTime->
setInfo($this->lng->txt(
'loginname_change_blocking_time_info'));
2269 $chbChangeBlockingTime->setSize(10);
2270 $chbChangeBlockingTime->setMaxLength(10);
2271 $chbChangeLogin->addSubItem($chbChangeBlockingTime);
2273 $this->form->addCommandButton(
'saveGeneralSettings', $this->lng->txt(
'save'));
2293 include_once
'Services/Search/classes/class.ilUserSearchOptions.php';
2294 $lng->loadLanguageModule(
"administration");
2295 $lng->loadLanguageModule(
"mail");
2298 include_once(
"./Services/User/classes/class.ilUserFieldSettingsTableGUI.php");
2300 if($this->confirm_change)
$tab->setConfirmChange();
2301 $tpl->setContent(
$tab->getHTML());
2311 include_once
'Services/Search/classes/class.ilUserSearchOptions.php';
2312 include_once
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
2317 include_once(
"./Services/User/classes/class.ilUserProfile.php");
2319 $up->skipField(
"username");
2320 $field_properties = $up->getStandardFields();
2321 $profile_fields = array_keys($field_properties);
2324 foreach ($profile_fields as $field)
2326 if (
$_POST[
"chb"][
"required_".$field] &&
2327 !(
int)
$_POST[
'chb'][
'visib_reg_' . $field]
2338 $this->confirm_change = 1;
2344 $fixed_required_fields = array(
2351 "hits_per_page" => 0,
2352 "show_users_online" => 0,
2353 "hide_own_online_status" => 0
2358 if ($privacy->enabledCourseExport() ==
true &&
2359 $privacy->courseConfirmationRequired() ==
true &&
2362 foreach ($profile_fields as $field)
2364 if (! $ilias->getSetting(
"usr_settings_course_export_" . $field) &&
$_POST[
"chb"][
"course_export_" . $field] ==
"1")
2366 #ilUtil::sendQuestion($this->lng->txt('confirm_message_course_export'));
2367 #$this->confirm_change = 1;
2368 #$this->settingsObject();
2374 if($action ==
'save')
2376 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
2380 foreach ($profile_fields as $field)
2388 if (!
$_POST[
"chb"][
"visible_".$field] && !$field_properties[$field][
"visible_hide"])
2390 $ilias->setSetting(
"usr_settings_hide_".$field,
"1");
2394 $ilias->deleteSetting(
"usr_settings_hide_".$field);
2397 if (!
$_POST[
"chb"][
"changeable_" . $field] && !$field_properties[$field][
"changeable_hide"])
2399 $ilias->setSetting(
"usr_settings_disable_".$field,
"1");
2403 $ilias->deleteSetting(
"usr_settings_disable_".$field);
2407 if ((
int)
$_POST[
'chb'][
'visib_reg_' . $field] && !$field_properties[$field][
"visib_reg_hide"])
2409 $ilSetting->set(
'usr_settings_visib_reg_'.$field,
'1');
2413 $ilSetting->set(
'usr_settings_visib_reg_'.$field,
'0');
2416 if ((
int)
$_POST[
'chb'][
'visib_lua_' . $field])
2419 $ilSetting->set(
'usr_settings_visib_lua_'.$field,
'1');
2423 $ilSetting->set(
'usr_settings_visib_lua_'.$field,
'0');
2426 if ((
int)
$_POST[
'chb'][
'changeable_lua_' . $field])
2429 $ilSetting->set(
'usr_settings_changeable_lua_'.$field,
'1');
2433 $ilSetting->set(
'usr_settings_changeable_lua_'.$field,
'0');
2436 if (
$_POST[
"chb"][
"export_" . $field] && !$field_properties[$field][
"export_hide"])
2438 $ilias->setSetting(
"usr_settings_export_".$field,
"1");
2442 $ilias->deleteSetting(
"usr_settings_export_".$field);
2446 if (
$_POST[
"chb"][
"course_export_" . $field] && !$field_properties[$field][
"course_export_hide"])
2448 $ilias->setSetting(
"usr_settings_course_export_".$field,
"1");
2452 $ilias->deleteSetting(
"usr_settings_course_export_".$field);
2456 if (
$_POST[
"chb"][
"group_export_" . $field] && !$field_properties[$field][
"group_export_hide"])
2458 $ilias->setSetting(
"usr_settings_group_export_".$field,
"1");
2462 $ilias->deleteSetting(
"usr_settings_group_export_".$field);
2465 $is_fixed = array_key_exists($field, $fixed_required_fields);
2466 if ($is_fixed && $fixed_required_fields[$field] || ! $is_fixed &&
$_POST[
"chb"][
"required_".$field])
2468 $ilias->setSetting(
"require_".$field,
"1");
2472 $ilias->deleteSetting(
"require_" . $field);
2476 if (
$_POST[
"select"][
"default_hits_per_page"])
2478 $ilias->setSetting(
"hits_per_page",
$_POST[
"select"][
"default_hits_per_page"]);
2481 if (
$_POST[
"select"][
"default_show_users_online"])
2483 $ilias->setSetting(
"show_users_online",
$_POST[
"select"][
"default_show_users_online"]);
2486 if (
$_POST[
"chb"][
"export_preferences"])
2488 $ilias->setSetting(
"usr_settings_export_preferences",
$_POST[
"chb"][
"export_preferences"]);
2490 $ilias->deleteSetting(
"usr_settings_export_preferences");
2493 $ilias->setSetting(
'mail_incoming_mail', (
int)
$_POST[
'select'][
'default_mail_incoming_mail']);
2505 $action[-1] = $this->lng->txt(
'all_users');
2506 $action[1] = $this->lng->txt(
'usr_active_only');
2507 $action[0] = $this->lng->txt(
'usr_inactive_only');
2508 $action[2] = $this->lng->txt(
'usr_limited_access_only');
2509 $action[3] = $this->lng->txt(
'usr_without_courses');
2510 $action[4] = $this->lng->txt(
'usr_filter_lastlogin');
2511 $action[5] = $this->lng->txt(
"usr_filter_coursemember");
2512 $action[6] = $this->lng->txt(
"usr_filter_groupmember");
2513 $action[7] = $this->lng->txt(
"usr_filter_role");
2526 if(!isset(
$_POST[
"file"]))
2528 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2531 if (count(
$_POST[
"file"]) > 1)
2533 $this->ilias->raiseError($this->lng->txt(
"select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2538 $export_dir = $this->
object->getExportDirectory();
2547 if(!isset(
$_POST[
"file"]))
2549 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2559 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
2562 $this->tpl->setCurrentBlock(
"table_header");
2563 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
2564 $this->tpl->parseCurrentBlock();
2570 $this->tpl->setCurrentBlock(
"table_row");
2573 $this->tpl->setVariable(
"TEXT_CONTENT", $file);
2574 $this->tpl->parseCurrentBlock();
2579 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
2580 $buttons = array(
"cancelDeleteExportFile" => $this->lng->txt(
"cancel"),
2581 "deleteExportFile" => $this->lng->txt(
"confirm"));
2582 foreach ($buttons as $name => $value)
2584 $this->tpl->setCurrentBlock(
"operation_btn");
2585 $this->tpl->setVariable(
"BTN_NAME",$name);
2586 $this->tpl->setVariable(
"BTN_VALUE",$value);
2587 $this->tpl->parseCurrentBlock();
2597 session_unregister(
"ilExportFiles");
2598 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
2607 $export_dir = $this->
object->getExportDirectory();
2610 $file = basename($file);
2612 $exp_file = $export_dir.
"/".
$file;
2613 if (@is_file($exp_file))
2618 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
2635 if (
$_POST[
"cmd"][
"export"])
2637 $this->
object->buildExportFile(
$_POST[
"export_type"]);
2638 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
2644 $export_types = array(
2645 "userfolder_export_excel_x86",
2646 "userfolder_export_csv",
2647 "userfolder_export_xml"
2651 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
2655 $this->tpl->addBlockfile(
"EXPORT_FILES",
"export_files",
"tpl.table.html");
2658 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.usr_export_file_row.html");
2662 $tbl->setTitle($this->lng->txt(
"userfolder_export_files"));
2664 $tbl->setHeaderNames(array(
"", $this->lng->txt(
"userfolder_export_file"),
2665 $this->lng->txt(
"userfolder_export_file_size"), $this->lng->txt(
"date") ));
2666 $tbl->setHeaderVars(array(), $ilCtrl->getParameterArray($this,
"export"));
2668 $tbl->enabled[
"sort"] =
false;
2669 $tbl->setColumnWidth(array(
"1%",
"49%",
"25%",
"25%"));
2672 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
2673 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
2674 $tbl->setLimit(
$_GET[
"limit"]);
2675 $tbl->setOffset(
$_GET[
"offset"]);
2676 $tbl->setMaxCount($this->maxcount);
2679 $this->tpl->setVariable(
"COLUMN_COUNTS", 4);
2683 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
2684 $this->tpl->setCurrentBlock(
"tbl_action_btn");
2685 $this->tpl->setVariable(
"BTN_NAME",
"confirmDeleteExportFile");
2686 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
2687 $this->tpl->parseCurrentBlock();
2689 $this->tpl->setCurrentBlock(
"tbl_action_btn");
2690 $this->tpl->setVariable(
"BTN_NAME",
"downloadExportFile");
2691 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"download"));
2692 $this->tpl->parseCurrentBlock();
2695 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
2698 $export_files = $this->
object->getExportFiles();
2700 $tbl->setMaxCount(count($export_files));
2701 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
2705 if(count($export_files) > 0)
2708 foreach($export_files as $exp_file)
2710 $this->tpl->setCurrentBlock(
"tbl_content");
2711 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"filename"]);
2714 $this->tpl->setVariable(
"CSS_ROW", $css_row);
2716 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"filesize"]);
2717 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"filename"]);
2719 $file_arr = explode(
"__", $exp_file[
"filename"]);
2722 $this->tpl->parseCurrentBlock();
2725 $this->tpl->setCurrentBlock(
"selectall");
2726 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
2727 $this->tpl->setVariable(
"CSS_ROW", $css_row);
2728 $this->tpl->parseCurrentBlock();
2741 $this->tpl->parseCurrentBlock();
2744 foreach ($export_types as $export_type)
2746 $this->tpl->setCurrentBlock(
"option");
2747 $this->tpl->setVariable(
"OPTION_VALUE", $export_type);
2748 $this->tpl->setVariable(
"OPTION_TEXT", $this->lng->txt($export_type));
2749 $this->tpl->parseCurrentBlock();
2752 $this->tpl->setVariable(
"EXPORT_BUTTON", $this->lng->txt(
"create_export_file"));
2753 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
2760 $lng->loadLanguageModule(
"meta");
2761 $lng->loadLanguageModule(
"mail");
2763 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
2765 $form->setFormAction($ilCtrl->getFormAction($this));
2768 $form->setTitle($lng->txt(
"user_new_account_mail"));
2769 $form->setDescription($lng->txt(
"user_new_account_mail_desc"));
2771 $langs = $lng->getInstalledLanguages();
2772 foreach($langs as $lang_key)
2774 $amail = $this->
object->_lookupNewAccountMail($lang_key);
2776 $title = $lng->txt(
"meta_l_".$lang_key);
2777 if ($lang_key == $lng->getDefaultLanguage())
2779 $title .=
" (".$lng->txt(
"default").
")";
2783 $header->setTitle(
$title);
2784 $form->addItem($header);
2786 $subj =
new ilTextInputGUI($lng->txt(
"subject"),
"subject_".$lang_key);
2788 $subj->
setValue($amail[
"subject"]);
2789 $form->addItem($subj);
2791 $salg =
new ilTextInputGUI($lng->txt(
"mail_salutation_general"),
"sal_g_".$lang_key);
2794 $form->addItem($salg);
2796 $salf =
new ilTextInputGUI($lng->txt(
"mail_salutation_female"),
"sal_f_".$lang_key);
2799 $form->addItem($salf);
2801 $salm =
new ilTextInputGUI($lng->txt(
"mail_salutation_male"),
"sal_m_".$lang_key);
2804 $form->addItem($salm);
2810 $body->setCols(100);
2811 $form->addItem($body);
2814 $form->addCommandButton(
"saveNewAccountMail", $lng->txt(
"save"));
2815 $form->addCommandButton(
"cancelNewAccountMail", $lng->txt(
"cancel"));
2828 $this->tabs_gui->setTabActive(
'settings');
2829 $this->tabs_gui->setSubTabActive(
'user_new_account_mail');
2833 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_new_account_mail.html');
2834 $this->tpl->setVariable(
"FORM", $form->getHTML());
2837 $this->tpl->setVariable(
"TXT_USE_PLACEHOLDERS", $lng->txt(
"mail_nacc_use_placeholder"));
2838 $this->tpl->setVariable(
"TXT_MAIL_SALUTATION", $lng->txt(
"mail_nacc_salutation"));
2839 $this->tpl->setVariable(
"TXT_FIRST_NAME", $lng->txt(
"firstname"));
2840 $this->tpl->setVariable(
"TXT_LAST_NAME", $lng->txt(
"lastname"));
2841 $this->tpl->setVariable(
"TXT_EMAIL", $lng->txt(
"email"));
2842 $this->tpl->setVariable(
"TXT_LOGIN", $lng->txt(
"mail_nacc_login"));
2843 $this->tpl->setVariable(
"TXT_PASSWORD", $lng->txt(
"password"));
2844 $this->tpl->setVariable(
"TXT_PASSWORD_BLOCK", $lng->txt(
"mail_nacc_pw_block"));
2845 $this->tpl->setVariable(
"TXT_NOPASSWORD_BLOCK", $lng->txt(
"mail_nacc_no_pw_block"));
2846 $this->tpl->setVariable(
"TXT_ADMIN_MAIL", $lng->txt(
"mail_nacc_admin_mail"));
2847 $this->tpl->setVariable(
"TXT_ILIAS_URL", $lng->txt(
"mail_nacc_ilias_url"));
2848 $this->tpl->setVariable(
"TXT_CLIENT_NAME", $lng->txt(
"mail_nacc_client_name"));
2849 $this->tpl->setVariable(
"TXT_TARGET", $lng->txt(
"mail_nacc_target"));
2850 $this->tpl->setVariable(
"TXT_TARGET_TITLE", $lng->txt(
"mail_nacc_target_title"));
2851 $this->tpl->setVariable(
"TXT_TARGET_TYPE", $lng->txt(
"mail_nacc_target_type"));
2852 $this->tpl->setVariable(
"TXT_TARGET_BLOCK", $lng->txt(
"mail_nacc_target_block"));
2857 $this->ctrl->redirect($this,
"settings");
2864 $langs = $lng->getInstalledLanguages();
2865 foreach($langs as $lang_key)
2867 $this->
object->_writeNewAccountMail($lang_key,
2876 $this->ctrl->redirect($this,
"newAccountMail");
2891 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
2895 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
2897 $tabs_gui->addTarget(
"obj_usrf",
2898 $this->ctrl->getLinkTarget($this,
"view"), array(
"view",
"delete",
"resetFilter",
"userAction",
""),
"",
"");
2900 $tabs_gui->addTarget(
2901 "search_user_extended",
2902 $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
''),
2904 "iladminusersearchgui",
2909 if ($rbacsystem->checkAccess(
"write",$this->object->getRefId()))
2911 $tabs_gui->addTarget(
"settings",
2912 $this->ctrl->getLinkTarget($this,
"generalSettings"),array(
'settings',
'generalSettings',
'listUserDefinedField',
'newAccountMail'));
2914 $tabs_gui->addTarget(
"export",
2915 $this->ctrl->getLinkTarget($this,
"export"),
"export",
"",
"");
2921 $tabs_gui->addTarget(
"learning_progress",
2922 $this->ctrl->getLinkTarget($this,
"learningProgress"),
"learningProgress",
"",
"");
2926 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
2928 $tabs_gui->addTarget(
"perm_settings",
2929 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
2930 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
2940 global $rbacsystem,$ilUser;
2945 $this->tabs_gui->addSubTabTarget(
2947 $this->ctrl->getLinkTarget($this,
'generalSettings'),
'generalSettings', get_class($this));
2948 $this->tabs_gui->addSubTabTarget(
"standard_fields",
2949 $this->ctrl->getLinkTarget($this,
'settings'),
2950 array(
"settings",
"saveGlobalUserSettings"), get_class($this));
2951 $this->tabs_gui->addSubTabTarget(
"user_defined_fields",
2952 $this->ctrl->getLinkTargetByClass(
"ilcustomuserfieldsgui",
"listUserDefinedFields"),
2953 "listUserDefinedFields",get_class($this));
2954 $this->tabs_gui->addSubTabTarget(
"user_new_account_mail",
2955 $this->ctrl->getLinkTarget($this,
'newAccountMail'),
2956 "newAccountMail",get_class($this));
2957 $this->tabs_gui->addSubTab(
"account_codes", $this->lng->txt(
"user_account_codes"),
2958 $this->ctrl->getLinkTargetByClass(
"ilaccountcodesgui"));
2968 $this->loginSettingsForm->setValuesByArray(array(
2969 'allow_change_loginname' => (
bool)$ilSetting->get(
'allow_change_loginname'),
2970 'create_history_loginname' => (bool)$ilSetting->get(
'create_history_loginname'),
2971 'prevent_reuse_of_loginnames' => (bool)$ilSetting->get(
'prevent_reuse_of_loginnames'),
2972 'loginname_change_blocking_time' => (int)$ilSetting->get(
'loginname_change_blocking_time')
2975 $this->tpl->setVariable(
'ADM_CONTENT', $this->loginSettingsForm->getHTML());
2981 $this->tabs_gui->setTabActive(
'settings');
2982 $this->tabs_gui->setSubTabActive(
'loginname_settings');
2984 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
2986 $this->loginSettingsForm->
setFormAction($this->ctrl->getFormAction($this,
'saveLoginnameSettings'));
2987 $this->loginSettingsForm->setTitle($this->lng->txt(
'loginname_settings'));
2989 $chbChangeLogin =
new ilCheckboxInputGUI($this->lng->txt(
'allow_change_loginname'),
'allow_change_loginname');
2991 $this->loginSettingsForm->addItem($chbChangeLogin);
2992 $chbCreateHistory =
new ilCheckboxInputGUI($this->lng->txt(
'history_loginname'),
'create_history_loginname');
2993 $chbCreateHistory->
setInfo($this->lng->txt(
'loginname_history_info'));
2994 $chbCreateHistory->setValue(1);
2995 $chbChangeLogin->addSubItem($chbCreateHistory);
2996 $chbReuseLoginnames =
new ilCheckboxInputGUI($this->lng->txt(
'reuse_of_loginnames_contained_in_history'),
'prevent_reuse_of_loginnames');
2998 $chbReuseLoginnames->setInfo($this->lng->txt(
'prevent_reuse_of_loginnames_contained_in_history_info'));
2999 $chbChangeLogin->addSubItem($chbReuseLoginnames);
3000 $chbChangeBlockingTime =
new ilTextInputGUI($this->lng->txt(
'loginname_change_blocking_time'),
'loginname_change_blocking_time');
3001 $chbChangeBlockingTime->
setInfo($this->lng->txt(
'loginname_change_blocking_time_info'));
3002 $chbChangeBlockingTime->setSize(10);
3003 $chbChangeBlockingTime->setMaxLength(10);
3004 $chbChangeLogin->addSubItem($chbChangeBlockingTime);
3006 $this->loginSettingsForm->addCommandButton(
'saveLoginnameSettings', $this->lng->txt(
'save'));
3014 if($this->loginSettingsForm->checkInput())
3018 if(strlen($this->loginSettingsForm->getInput(
'loginname_change_blocking_time')) &&
3019 !preg_match(
'/^[0-9]*$/',
3020 $this->loginSettingsForm->getInput(
'loginname_change_blocking_time')))
3023 $this->loginSettingsForm->getItemByPostVar(
'loginname_change_blocking_time')
3024 ->setAlert($this->lng->txt(
'loginname_change_blocking_time_invalidity_info'));
3029 $ilSetting->set(
'allow_change_loginname', (
int)$this->loginSettingsForm->getInput(
'allow_change_loginname'));
3030 $ilSetting->set(
'create_history_loginname', (
int)$this->loginSettingsForm->getInput(
'create_history_loginname'));
3031 $ilSetting->set(
'prevent_reuse_of_loginnames', (
int)$this->loginSettingsForm->getInput(
'prevent_reuse_of_loginnames'));
3032 $ilSetting->set(
'loginname_change_blocking_time', (
int)$this->loginSettingsForm->getInput(
'loginname_change_blocking_time'));
3045 $this->loginSettingsForm->setValuesByPost();
3047 $this->tpl->setVariable(
'ADM_CONTENT', $this->loginSettingsForm->getHTML());
3059 if ($ilAccess->checkAccess(
"read",
"", $a_target))
3061 ilUtil::redirect(
"ilias.php?baseClass=ilAdministrationGUI&ref_id=".$a_target.
"&jmpToUser=".$a_user);
3066 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
3068 $_GET[
"cmd"] =
"frameset";
3069 $_GET[
"target"] =
"";
3070 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
3073 include(
"repository.php");
3077 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
3089 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id", (
int) $_GET[
"jmpToUser"]);
3090 $ilCtrl->redirectByClass(
"ilobjusergui",
"view");
3101 if(!count((array) $a_usr_ids))
3107 $_POST[
'id'] = $a_usr_ids;
3117 $_POST[
'selectedAction'] = $a_cmd;