4 require_once
"./Services/Object/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 'ilrepositorysearchgui':
77 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
79 $user_search->enableSearchableCheck(
false);
80 $user_search->setCallback(
82 'searchResultHandler',
85 $this->tabs_gui->setTabActive(
'search_user_extended');
86 $this->ctrl->setReturn($this,
'view');
87 $ret =& $this->ctrl->forwardCommand($user_search);
90 case 'ilaccountcodesgui':
91 $this->tabs_gui->setTabActive(
'settings');
93 $ilTabs->activateSubTab(
"account_codes");
94 include_once(
"./Services/User/classes/class.ilAccountCodesGUI.php");
96 $this->ctrl->forwardCommand($acc);
99 case 'ilcustomuserfieldsgui':
100 $this->tabs_gui->setTabActive(
'settings');
102 $ilTabs->activateSubTab(
"user_defined_fields");
103 include_once(
"./Services/User/classes/class.ilCustomUserFieldsGUI.php");
105 $this->ctrl->forwardCommand($cf);
124 global $rbacsystem,
$tpl;
129 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()) ||
133 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
136 include_once
"Services/User/classes/class.ilUserLPTableGUI.php";
137 $tbl =
new ilUserLPTableGUI($this,
"learningProgress", $this->object->getRefId());
139 $tpl->setContent($tbl->getHTML());
148 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
150 $utab->resetOffset();
151 $utab->resetFilter();
164 $ilCtrl->setParameterByClass(
"ilobjusergui",
"new_type",
"usr");
165 $ilCtrl->redirectByClass(array(
"iladministrationgui",
"ilobjusergui"),
"create");
176 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
178 $utab->resetOffset();
179 $utab->writeFilterToSession();
181 $ilTabs->activateTab(
"usrf");
193 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
195 if ($rbacsystem->checkAccess(
'create_usr', $this->object->getRefId()) ||
196 $rbacsystem->checkAccess(
'cat_administrate_users', $this->object->getRefId()))
199 $button->setCaption(
"usr_add");
200 $button->setUrl($this->ctrl->getLinkTarget($this,
"addUser"));
201 $ilToolbar->addButtonInstance($button);
204 $button->setCaption(
"import_users");
205 $button->setUrl($this->ctrl->getLinkTarget($this,
"importUserForm"));
206 $ilToolbar->addButtonInstance($button);
210 include_once
'./Services/User/classes/class.ilUserAccountSettings.php';
212 if ((
int) $ilSetting->get(
'user_adm_alpha_nav'))
214 $ilToolbar->addSeparator();
217 include_once(
"./Services/Form/classes/class.ilAlphabetInputGUI.php");
219 include_once(
"./Services/User/classes/class.ilObjUser.php");
225 $ai->setParentCommand($this,
"chooseLetter");
226 $ai->setHighlighted(
$_GET[
"letter"]);
227 $ilToolbar->addInputItem($ai,
true);
231 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
233 $tpl->setContent($utab->getHTML());
241 include_once
'./Services/User/classes/class.ilUserAutoComplete.php';
243 $auto->setSearchFields(array(
'login',
'firstname',
'lastname',
'email'));
244 $auto->enableFieldSearchableCheck(
false);
245 $auto->setMoreLinkAvailable(
true);
266 $ilCtrl->redirect($this,
"view");
280 $operations = array();
282 if ($this->actions ==
"")
285 "delete" => array(
"name" =>
"delete",
"lng" =>
"delete"),
286 "activate" => array(
"name" =>
"activate",
"lng" =>
"activate"),
287 "deactivate" => array(
"name" =>
"deactivate",
"lng" =>
"deactivate"),
288 "accessRestrict" => array(
"name" =>
"accessRestrict",
"lng" =>
"accessRestrict"),
289 "accessFree" => array(
"name" =>
"accessFree",
"lng" =>
"accessFree"),
290 "export" => array(
"name" =>
"export",
"lng" =>
"export")
299 if ($rbacsystem->checkAccess($row[
"name"],$this->object->getRefId()))
301 $operations[] =
$row;
305 if (count($operations) > 0)
307 $select =
"<select name=\"selectedAction\">\n";
308 foreach ($operations as $val)
310 $select .=
"<option value=\"" . $val[
"name"] .
"\"";
311 if (strcmp(
$_POST[
"selectedAction"], $val[
"name"]) == 0)
313 $select .=
" selected=\"selected\"";
316 $select .= $this->lng->txt($val[
"lng"]);
317 $select .=
"</option>";
319 $select .=
"</select>";
320 $this->tpl->setCurrentBlock(
"tbl_action_select");
321 $this->tpl->setVariable(
"SELECT_ACTION", $select);
322 $this->tpl->setVariable(
"BTN_NAME",
"userAction");
323 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"submit"));
324 $this->tpl->parseCurrentBlock();
327 if ($with_subobjects ===
true)
332 if ((count($operations) > 0) or $subobjs ===
true)
334 $this->tpl->setCurrentBlock(
"tbl_action_row");
335 $this->tpl->setVariable(
"COLUMN_COUNTS",count($this->data[
"cols"]));
337 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
338 $this->tpl->parseCurrentBlock();
352 $d = $this->objDefinition->getCreatableSubObjects($this->object->getType());
354 if (!$rbacsystem->checkAccess(
'create_usr',$this->object->getRefId()))
367 for ($i=0; $i<count($this->data[
"ctrl"]); $i++)
369 if ($this->data[
"ctrl"][$i][
"type"] == $row[
"name"])
375 if ($row[
"max"] ==
"" || $count < $row[
"max"])
377 $subobj[] = $row[
"name"];
382 if (is_array($subobj))
386 $this->tpl->setCurrentBlock(
"add_object");
387 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
388 $this->tpl->setVariable(
"BTN_NAME",
"create");
389 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"add"));
390 $this->tpl->parseCurrentBlock();
400 $this->ctrl->redirect($this,
'view');
405 $this->ctrl->redirectByClass(
'ilrepositorysearchgui',
'showSearchResults');
418 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
420 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
424 foreach (
$_POST[
"id"] as $id)
427 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
428 $obj->setActive(TRUE, $ilUser->getId());
436 $this->ctrl->redirectByClass(
'ilRepositorySearchGUI',
'show');
440 $this->ctrl->redirect($this,
"view");
454 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
456 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
460 foreach (
$_POST[
"id"] as $id)
463 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
464 $obj->setActive(FALSE, $ilUser->getId());
473 $this->ctrl->redirectByClass(
'ilRepositorySearchGUI',
'show');
477 $this->ctrl->redirect($this,
"view");
486 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
488 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
492 foreach (
$_POST[
"id"] as $id)
495 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
496 $obj->setTimeLimitOwner($ilUser->getId());
497 $obj->setTimeLimitUnlimited(1);
498 $obj->setTimeLimitFrom(
"");
499 $obj->setTimeLimitUntil(
"");
500 $obj->setTimeLimitMessage(0);
509 $this->ctrl->redirectByClass(
'ilRepositorySearchGUI',
'show');
513 $this->ctrl->redirect($this,
"view");
523 $this->tpl->setContent($a_form->getHTML());
538 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
540 $form->setTitle($this->lng->txt(
"time_limit_add_time_limit_for_selected"));
541 $form->setFormAction($this->ctrl->getFormAction($this,
"confirmaccessRestrict"));
545 $from->setRequired(
true);
546 $form->addItem($from);
550 $to->setShowTime(
true);
553 $form->addCommandButton(
"confirmaccessRestrict", $this->lng->txt(
"confirm"));
554 $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
556 foreach($user_ids as $user_id)
559 $ufield->setValue($user_id);
560 $form->addItem($ufield);
564 if($a_from_search ||
$_POST[
"frsrch"])
568 $form->addItem($field);
577 if(!$form->checkInput())
582 $timefrom = $form->getItemByPostVar(
"from")->getDate()->get(
IL_CAL_UNIX);
583 $timeuntil = $form->getItemByPostVar(
"to")->getDate()->get(
IL_CAL_UNIX);
584 if ($timeuntil <= $timefrom)
593 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
595 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
599 foreach (
$_POST[
"id"] as $id)
602 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
603 $obj->setTimeLimitOwner($ilUser->getId());
604 $obj->setTimeLimitUnlimited(0);
605 $obj->setTimeLimitFrom($timefrom);
606 $obj->setTimeLimitUntil($timeuntil);
607 $obj->setTimeLimitMessage(0);
616 $this->ctrl->redirectByClass(
'ilRepositorySearchGUI',
'show');
620 $this->ctrl->redirect($this,
"view");
634 if (!$rbacsystem->checkAccess(
'delete',$this->object->getRefId()))
637 $ilCtrl->redirect($this,
"view");
640 if (in_array($ilUser->getId(),
$_POST[
"id"]))
642 $this->ilias->raiseError($this->lng->txt(
"msg_no_delete_yourself"),$this->ilias->error_obj->WARNING);
646 foreach (
$_POST[
"id"] as $id)
649 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
658 $this->ctrl->redirectByClass(
'ilRepositorySearchGUI',
'show');
662 $this->ctrl->redirect($this,
"view");
673 if(
$_POST[
"select_cmd_all"])
675 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
677 return $utab->getUserIdsForFilter();
695 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
700 $ilTabs->activateTab(
"obj_usrf");
704 $ilTabs->activateTab(
"search_user_extended");
707 if (strcmp($action,
"accessRestrict") == 0)
711 if (strcmp($action,
"mail") == 0)
720 $cancel =
"cancelUserFolderAction";
724 $cancel =
"cancelSearchAction";
728 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
730 $cgui->setFormAction($this->ctrl->getFormAction($this));
731 $cgui->setHeaderText($this->lng->txt(
"info_" . $action .
"_sure"));
732 $cgui->setCancel($this->lng->txt(
"cancel"), $cancel);
733 $cgui->setConfirm($this->lng->txt(
"confirm"),
"confirm" . $action);
737 $cgui->addHiddenItem(
"frsrch", 1);
740 foreach($user_ids as $id)
744 $login = $user->getLastLogin();
747 $login = $this->lng->txt(
"never");
754 $caption = $user->getFullname().
" (".$user->getLogin().
")".
", ".
755 $user->getEmail().
" - ".$this->lng->txt(
"last_login").
": ".$login;
757 $cgui->addItem(
"id[]", $id, $caption);
760 $this->tpl->setContent($cgui->getHTML());
770 $_POST[
"selectedAction"] =
"delete";
779 $_POST[
"selectedAction"] =
"activate";
788 $_POST[
"selectedAction"] =
"deactivate";
797 $_POST[
"selectedAction"] =
"accessRestrict";
806 $_POST[
"selectedAction"] =
"accessFree";
820 global
$tpl, $rbacsystem;
823 if (
$_GET[
"baseClass"] ==
'ilRepositoryGUI')
825 $this->tabs_gui->clearTargets();
828 if (!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
830 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
834 $tpl->setContent($this->form->getHTML());
846 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
850 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
855 $this->form->addItem($fi);
857 $this->form->addCommandButton(
"importUserRoleAssignment", $lng->txt(
"import"));
858 $this->form->addCommandButton(
"importCancelled", $lng->txt(
"cancel"));
860 $this->form->setTitle($lng->txt(
"import_users"));
861 $this->form->setFormAction($ilCtrl->getFormAction($this));
874 if (@is_dir($import_dir))
879 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
881 $this->ctrl->redirect($this,
"view");
886 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
899 $importDir =
ilUtil::getDataDir().
'/user_import/usr_'.$ilUser->getId().
'_'.session_id();
912 if (
$_GET[
"baseClass"] ==
'ilRepositoryGUI')
914 $this->tabs_gui->clearTargets();
918 if ($this->form->checkInput())
920 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
921 include_once
'./Services/User/classes/class.ilUserImportParser.php';
923 global $rbacreview, $rbacsystem,
$tree,
$lng;
926 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_import_roles.html",
"Services/User");
931 if (@is_dir($import_dir))
938 $file_name = $_FILES[
"importFile"][
"name"];
939 $parts = pathinfo($file_name);
940 $full_path = $import_dir.
"/".$file_name;
943 if (!is_file($_FILES[
"importFile"][
"tmp_name"]))
946 $this->ilias->raiseError($this->lng->txt(
"no_import_file_found")
947 , $this->ilias->error_obj->MESSAGE);
950 $_FILES[
"importFile"][
"name"], $full_path);
953 if (strtolower($parts[
"extension"]) ==
"zip")
960 foreach ($file_list as $a_file)
962 if (substr($a_file[
'entry'],-4) ==
'.xml')
964 $xml_file = $import_dir.
"/".$a_file[
'entry'];
968 if (is_null($xml_file))
970 $subdir = basename($parts[
"basename"],
".".$parts[
"extension"]);
971 $xml_file = $import_dir.
"/".$subdir.
"/".$subdir.
".xml";
977 $xml_file = $full_path;
981 if (!is_file($xml_file))
984 $this->ilias->raiseError($this->lng->txt(
"no_xml_file_found_in_zip")
985 .
" ".$subdir.
"/".$subdir.
".xml", $this->ilias->error_obj->MESSAGE);
988 require_once(
"./Services/User/classes/class.ilUserImportParser.php");
993 $importParser->startParsing();
994 switch ($importParser->getErrorLevel())
999 $this->tpl->setVariable(
"IMPORT_LOG", $importParser->getProtocolAsHTML($lng->txt(
"verification_warning_log")));
1003 $this->ilias->raiseError(
1004 $lng->txt(
"verification_failed").$importParser->getProtocolAsHTML($lng->txt(
"verification_failure_log")),
1005 $this->ilias->error_obj->MESSAGE
1012 $this->tpl->setCurrentBlock(
"role_selection_form");
1013 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1014 $this->tpl->setVariable(
"TXT_IMPORT_USERS", $this->lng->txt(
"import_users"));
1015 $this->tpl->setVariable(
"TXT_IMPORT_FILE", $this->lng->txt(
"import_file"));
1016 $this->tpl->setVariable(
"IMPORT_FILE", $file_name);
1017 $this->tpl->setVariable(
"TXT_USER_ELEMENT_COUNT", $this->lng->txt(
"num_users"));
1018 $this->tpl->setVariable(
"USER_ELEMENT_COUNT", $importParser->getUserCount());
1019 $this->tpl->setVariable(
"TXT_ROLE_ASSIGNMENT", $this->lng->txt(
"role_assignment"));
1020 $this->tpl->setVariable(
"BTN_IMPORT", $this->lng->txt(
"import"));
1021 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1022 $this->tpl->setVariable(
"XML_FILE_NAME", $xml_file);
1026 $importParser->startParsing();
1027 $roles = $importParser->getCollectedRoles();
1030 $all_gl_roles = $rbacreview->getRoleListByObject(ROLE_FOLDER_ID);
1031 $gl_roles = array();
1032 $roles_of_user = $rbacreview->assignedRoles($ilUser->getId());
1033 foreach ($all_gl_roles as $obj_data)
1044 if ($obj_data[
"obj_id"] != ANONYMOUS_ROLE_ID)
1047 if ($obj_data[
"obj_id"] != SYSTEM_ROLE_ID or in_array(SYSTEM_ROLE_ID,$roles_of_user))
1049 $gl_roles[$obj_data[
"obj_id"]] = $obj_data[
"title"];
1055 $got_globals =
false;
1056 foreach($roles as $role_id => $role)
1058 if ($role[
"type"] ==
"Global")
1062 $got_globals =
true;
1064 $this->tpl->setCurrentBlock(
"global_role_section");
1065 $this->tpl->setVariable(
"TXT_GLOBAL_ROLES_IMPORT", $this->lng->txt(
"roles_of_import_global"));
1066 $this->tpl->setVariable(
"TXT_GLOBAL_ROLES", $this->lng->txt(
"assign_global_role"));
1070 $pre_select = array_search($role[name], $gl_roles);
1073 switch($role[
"name"])
1075 case "Administrator":
1076 $pre_select = array_search(
"Administrator", $gl_roles);
1080 $pre_select = array_search(
"User", $gl_roles);
1084 $pre_select = array_search(
"User", $gl_roles);
1088 $pre_select = array_search(
"Guest", $gl_roles);
1092 $pre_select = array_search(
"User", $gl_roles);
1096 $this->tpl->setCurrentBlock(
"global_role");
1097 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $gl_roles,
false,
true);
1098 $this->tpl->setVariable(
"TXT_IMPORT_GLOBAL_ROLE", $role[
"name"].
" [".$role_id.
"]");
1099 $this->tpl->setVariable(
"SELECT_GLOBAL_ROLE", $role_select);
1100 $this->tpl->parseCurrentBlock();
1105 $got_locals =
false;
1106 foreach($roles as $role_id => $role)
1108 if ($role[
"type"] ==
"Local")
1117 $this->tpl->setCurrentBlock(
"local_role_section");
1118 $this->tpl->setVariable(
"TXT_LOCAL_ROLES_IMPORT", $this->lng->txt(
"roles_of_import_local"));
1119 $this->tpl->setVariable(
"TXT_LOCAL_ROLES", $this->lng->txt(
"assign_local_role"));
1130 $loc_roles = array();
1131 foreach($roles as $role_id => $role)
1133 if ($role[
"type"] ==
"Local")
1135 $searchName = (substr($role[
'name'],0,1) ==
'#') ? $role[
'name'] :
'#'.$role[
'name'];
1136 $matching_role_ids = $rbacreview->searchRolesByMailboxAddressList($searchName);
1137 foreach ($matching_role_ids as $mid) {
1138 if (! in_array($mid, $loc_roles)) {
1139 $loc_roles[] = $mid;
1148 $loc_roles = $rbacreview->getAssignableRolesInSubtree($this->object->getRefId());
1153 $l_roles_mailbox_searcharray = array();
1154 foreach ($loc_roles as $key => $loc_role)
1157 $rolf = $rbacreview->getFoldersAssignedToRole($loc_role,
true);
1164 !$rbacreview->isDeleted($rolf[0]) &&
1165 $rbacsystem->checkAccess(
'write',$rolf[0]) &&
1166 $rolf[0] != ROLE_FOLDER_ID
1180 if ($this->tree->isInTree($rolf[0]))
1184 $tmpPath = $this->tree->getPathFull($rolf[0]);
1185 for ($i = 1,
$n = count($tmpPath) - 1; $i <
$n; $i++)
1191 if ($i < 3 || $i > $n - 3)
1195 else if ($i == 3 || $i == $n - 3)
1200 $isInSubtree |= $tmpPath[$i][
'obj_id'] == $this->
object->getId();
1205 $path =
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$loc_role.
")</b>";
1207 $roleMailboxAddress = $rbacreview->getRoleMailboxAddress($loc_role);
1208 $l_roles[$loc_role] = $roleMailboxAddress.
', '.
$path;
1213 natcasesort($l_roles);
1214 $l_roles[
""] = $this->lng->txt(
"usrimport_ignore_role");
1215 foreach($roles as $role_id => $role)
1217 if ($role[
"type"] ==
"Local")
1219 $this->tpl->setCurrentBlock(
"local_role");
1220 $this->tpl->setVariable(
"TXT_IMPORT_LOCAL_ROLE", $role[
"name"]);
1221 $searchName = (substr($role[
'name'],0,1) ==
'#') ? $role[
'name'] :
'#'.$role[
'name'];
1222 $matching_role_ids = $rbacreview->searchRolesByMailboxAddressList($searchName);
1223 $pre_select = count($matching_role_ids) == 1 ? $matching_role_ids[0] :
"";
1228 $selectable_roles = array();
1229 $selectable_roles[
""] = $this->lng->txt(
"usrimport_ignore_role");
1230 foreach ($matching_role_ids as $id)
1232 $selectable_roles[$id] = $l_roles[$id];
1234 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $selectable_roles,
false,
true);
1236 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $l_roles,
false,
true);
1238 $this->tpl->setVariable(
"SELECT_LOCAL_ROLE", $role_select);
1239 $this->tpl->parseCurrentBlock();
1245 $this->tpl->setVariable(
"TXT_CONFLICT_HANDLING", $lng->txt(
"conflict_handling"));
1250 $this->tpl->setVariable(
"TXT_CONFLICT_HANDLING_INFO", str_replace(
'\n',
'<br>',$this->lng->txt(
"usrimport_conflict_handling_info")));
1251 $this->tpl->setVariable(
"TXT_CONFLICT_CHOICE", $lng->txt(
"conflict_handling"));
1255 $this->lng->loadLanguageModule(
"mail");
1256 include_once
'./Services/User/classes/class.ilObjUserFolder.php';
1258 if (trim($amail[
"body"]) !=
"" && trim($amail[
"subject"]) !=
"")
1260 $this->tpl->setCurrentBlock(
"inform_user");
1261 $this->tpl->setVariable(
"TXT_ACCOUNT_MAIL", $lng->txt(
"mail_account_mail"));
1264 $this->tpl->setVariable(
"SEND_MAIL",
" checked=\"checked\"");
1266 $this->tpl->setVariable(
"TXT_INFORM_USER_MAIL",
1267 $this->lng->txt(
"user_send_new_account_mail"));
1268 $this->tpl->parseCurrentBlock();
1273 $this->form->setValuesByPost();
1274 $tpl->setContent($this->form->getHtml());
1286 if (
$_GET[
"baseClass"] ==
'ilRepositoryGUI')
1288 $this->tabs_gui->clearTargets();
1291 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
1292 include_once
'./Services/User/classes/class.ilUserImportParser.php';
1294 global $rbacreview, $rbacsystem,
$tree,
$lng;
1296 switch (
$_POST[
"conflict_handling_choice"])
1298 case "update_on_conflict" :
1301 case "ignore_on_conflict" :
1313 if (
$_POST[
"role_assign"])
1315 $global_roles = $rbacreview->getGlobalRoles();
1316 $roles_of_user = $rbacreview->assignedRoles($ilUser->getId());
1317 foreach (
$_POST[
"role_assign"] as $role_id)
1321 if (in_array($role_id, $global_roles))
1323 if(!in_array(SYSTEM_ROLE_ID,$roles_of_user))
1325 if ($role_id == SYSTEM_ROLE_ID && ! in_array(SYSTEM_ROLE_ID,$roles_of_user)
1331 $this->ilias->raiseError($this->lng->txt(
"usrimport_with_specified_role_not_permitted"),
1332 $this->ilias->error_obj->MESSAGE);
1338 $rolf = $rbacreview->getFoldersAssignedToRole($role_id,
true);
1339 if ($rbacreview->isDeleted($rolf[0])
1340 || ! $rbacsystem->checkAccess(
'write',$rolf[0]))
1343 $this->ilias->raiseError($this->lng->txt(
"usrimport_with_specified_role_not_permitted"),
1344 $this->ilias->error_obj->MESSAGE);
1352 $importParser->setRoleAssignment(
$_POST[
"role_assign"]);
1353 $importParser->startParsing();
1358 switch ($importParser->getErrorLevel())
1364 ilUtil::sendInfo($this->lng->txt(
"user_imported_with_warnings").$importParser->getProtocolAsHTML($lng->txt(
"import_warning_log")),
true);
1367 $this->ilias->raiseError(
1368 $this->lng->txt(
"user_import_failed")
1369 .$importParser->getProtocolAsHTML($lng->txt(
"import_failure_log")),
1370 $this->ilias->error_obj->MESSAGE
1375 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
1377 $this->ctrl->redirect($this,
"view");
1382 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1389 global $rbacsystem,
$ilias;
1393 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
1395 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1398 if(!count($app_users =& $ilias->account->getAppliedUsers()))
1405 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_applied_users.html",
"Services/User");
1406 $this->lng->loadLanguageModule(
'crs');
1409 foreach($app_users as $usr_id)
1414 $f_result[$counter][] = $tmp_user->getLogin();
1415 $f_result[$counter][] = $tmp_user->getFirstname();
1416 $f_result[$counter][] = $tmp_user->getLastname();
1418 if($tmp_user->getTimeLimitUnlimited())
1420 $f_result[$counter][] =
"<b>".$this->lng->txt(
'crs_unlimited').
"</b>";
1424 $limit =
"<b>".$this->lng->txt(
'crs_from').
'</b> '.strftime(
"%Y-%m-%d %R",$tmp_user->getTimeLimitFrom()).
'<br />';
1425 $limit .=
"<b>".$this->lng->txt(
'crs_to').
'</b> '.strftime(
"%Y-%m-%d %R",$tmp_user->getTimeLimitUntil());
1427 $f_result[$counter][] = $limit;
1441 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
1443 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
1446 $this->lng->loadLanguageModule(
'crs');
1450 if(!isset(
$_SESSION[
'error_post_vars']))
1452 ilUtil::sendInfo($this->lng->txt(
'time_limit_add_time_limit_for_selected'));
1455 if(!count(
$_POST[
"users"]))
1464 foreach(
$_POST[
'users'] as $usr_id)
1471 $title .= $tmp_user->getLogin();
1474 if(strlen($title) > 79)
1476 $title = substr($title,0,80);
1481 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_edit_applied_users.html",
"Services/User");
1482 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1485 $time_limit_unlimited =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_unlimited"] ?
1488 $time_limit_start =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_start"] ?
1491 $time_limit_end =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_end"] ?
1497 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
"obj_usr"));
1499 $this->tpl->setVariable(
"TITLE",$title);
1500 $this->tpl->setVariable(
"TXT_TIME_LIMIT",$this->lng->txt(
"time_limit"));
1501 $this->tpl->setVariable(
"TXT_TIME_LIMIT_START",$this->lng->txt(
"crs_start"));
1502 $this->tpl->setVariable(
"TXT_TIME_LIMIT_END",$this->lng->txt(
"crs_end"));
1503 $this->tpl->setVariable(
"CMD_SUBMIT",
"updateAppliedUsers");
1504 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
"cancel"));
1505 $this->tpl->setVariable(
"TXT_SUBMIT",$this->lng->txt(
"submit"));
1509 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_DAY",$this->
__getDateSelect(
"day",
"au[time_limit_start][day]",
1510 date(
"d",$time_limit_start)));
1511 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_MONTH",$this->
__getDateSelect(
"month",
"au[time_limit_start][month]",
1512 date(
"m",$time_limit_start)));
1513 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_YEAR",$this->
__getDateSelect(
"year",
"au[time_limit_start][year]",
1514 date(
"Y",$time_limit_start)));
1515 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_HOUR",$this->
__getDateSelect(
"hour",
"au[time_limit_start][hour]",
1516 date(
"G",$time_limit_start)));
1517 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_MINUTE",$this->
__getDateSelect(
"minute",
"au[time_limit_start][minute]",
1518 date(
"i",$time_limit_start)));
1519 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_DAY",$this->
__getDateSelect(
"day",
"au[time_limit_end][day]",
1520 date(
"d",$time_limit_end)));
1521 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_MONTH",$this->
__getDateSelect(
"month",
"au[time_limit_end][month]",
1522 date(
"m",$time_limit_end)));
1523 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_YEAR",$this->
__getDateSelect(
"year",
"au[time_limit_end][year]",
1524 date(
"Y",$time_limit_end)));
1525 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_HOUR",$this->
__getDateSelect(
"hour",
"au[time_limit_end][hour]",
1526 date(
"G",$time_limit_end)));
1527 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_MINUTE",$this->
__getDateSelect(
"minute",
"au[time_limit_end][minute]",
1528 date(
"i",$time_limit_end)));
1529 if($this->ilias->account->getTimeLimitUnlimited())
1531 $this->tpl->setVariable(
"ROWSPAN",3);
1532 $this->tpl->setCurrentBlock(
"unlimited");
1533 $this->tpl->setVariable(
"TXT_TIME_LIMIT_UNLIMITED",$this->lng->txt(
"crs_unlimited"));
1534 $this->tpl->setVariable(
"TIME_LIMIT_UNLIMITED",
ilUtil::formCheckbox($time_limit_unlimited,
"au[time_limit_unlimited]",1));
1535 $this->tpl->parseCurrentBlock();
1539 $this->tpl->setVariable(
"ROWSPAN",2);
1547 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
1549 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
1555 if(!
$_POST[
'au'][
'time_limit_unlimited'])
1566 #if(!$this->ilias->account->getTimeLimitUnlimited())
1568 # if($start < $this->ilias->account->getTimeLimitFrom() or
1569 # $end > $this->ilias->account->getTimeLimitUntil())
1571 # $_SESSION['error_post_vars'] = $_POST;
1572 # ilUtil::sendInfo($this->lng->txt('time_limit_not_within_owners'));
1573 # $this->editAppliedUsersObject();
1579 foreach(
$_SESSION[
'applied_users'] as $usr_id)
1583 $tmp_user->setTimeLimitUnlimited((
int)
$_POST[
'au'][
'time_limit_unlimited']);
1584 $tmp_user->setTimeLimitFrom($start);
1585 $tmp_user->setTimeLimitUntil($end);
1586 $tmp_user->setTimeLimitMessage(0);
1587 $tmp_user->update();
1602 $tpl =& $tbl->getTemplateObject();
1605 $tpl->setCurrentBlock(
"tbl_form_header");
1607 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1608 $tpl->parseCurrentBlock();
1610 $tpl->setCurrentBlock(
"tbl_action_btn");
1611 $tpl->setVariable(
"BTN_NAME",
'editAppliedUsers');
1612 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
'edit'));
1613 $tpl->parseCurrentBlock();
1615 $tpl->setCurrentBlock(
"tbl_action_row");
1616 $tpl->setVariable(
"COLUMN_COUNTS",5);
1618 $tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
1619 $tpl->parseCurrentBlock();
1623 $tbl->setTitle($this->lng->txt(
"time_limit_applied_users"),
"",$this->lng->txt(
"users"));
1624 $tbl->setHeaderNames(array(
'',
1625 $this->lng->txt(
"login"),
1626 $this->lng->txt(
"firstname"),
1627 $this->lng->txt(
"lastname"),
1628 $this->lng->txt(
"time_limits")));
1629 $header_params = $this->ctrl->getParameterArray($this,
"appliedUsers");
1630 $tbl->setHeaderVars(array(
"",
1635 array($header_params));
1636 $tbl->setColumnWidth(array(
"3%",
"19%",
"19%",
"19%",
"40%"));
1642 $this->tpl->setVariable(
"APPLIED_USERS",$tbl->tpl->get());
1649 include_once
"./Services/Table/classes/class.ilTableGUI.php";
1656 $offset =
$_GET[
"offset"];
1657 $order =
$_GET[
"sort_by"];
1658 $direction =
$_GET[
"sort_order"];
1661 $tbl->setOrderColumn($order);
1662 $tbl->setOrderDirection($direction);
1663 $tbl->setOffset($offset);
1664 $tbl->setLimit(
$_GET[
"limit"]);
1665 $tbl->setMaxCount(count($result_set));
1666 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1667 $tbl->setData($result_set);
1675 for($i=0;$i<=60;$i++)
1677 $days[$i] = $i < 10 ?
"0".$i : $i;
1682 for($i=0;$i<24;$i++)
1684 $days[$i] = $i < 10 ?
"0".$i : $i;
1689 for($i=1;$i<32;$i++)
1691 $days[$i] = $i < 10 ?
"0".$i : $i;
1696 for($i=1;$i<13;$i++)
1698 $month[$i] = $i < 10 ?
"0".$i : $i;
1703 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
1712 return mktime($a_time_arr[
"hour"],
1713 $a_time_arr[
"minute"],
1714 $a_time_arr[
"second"],
1715 $a_time_arr[
"month"],
1717 $a_time_arr[
"year"]);
1736 include_once
'./Services/User/classes/class.ilUserAccountSettings.php';
1739 $show_blocking_time_in_days = $ilSetting->get(
'loginname_change_blocking_time') / 86400;
1740 $show_blocking_time_in_days = (float)$show_blocking_time_in_days;
1742 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
1745 $this->form->setValuesByArray(
1747 'lua' => $aset->isLocalUserAdministrationEnabled(),
1748 'lrua' => $aset->isUserAccessRestricted(),
1749 'allow_change_loginname' => (bool)$ilSetting->get(
'allow_change_loginname'),
1750 'create_history_loginname' => (bool)$ilSetting->get(
'create_history_loginname'),
1751 'reuse_of_loginnames' => (bool)$ilSetting->get(
'reuse_of_loginnames'),
1752 'loginname_change_blocking_time' => (float)$show_blocking_time_in_days,
1753 'user_adm_alpha_nav' => (
int)$ilSetting->get(
'user_adm_alpha_nav'),
1755 'user_reactivate_code' => (int)$ilSetting->get(
'user_reactivate_code'),
1756 'user_own_account' => (int)$ilSetting->get(
'user_delete_own_account'),
1757 'user_own_account_email' => $ilSetting->get(
'user_delete_own_account_email'),
1760 'session_reminder_enabled' => $ilSetting->get(
'session_reminder_enabled'),
1766 'passwd_auto_generate' => (bool)$ilSetting->get(
"passwd_auto_generate"),
1767 'password_change_on_first_login_enabled' => $security->isPasswordChangeOnFirstLoginEnabled() ? 1 : 0,
1768 'password_must_not_contain_loginame' => $security->getPasswordMustNotContainLoginnameStatus() ? 1 : 0,
1769 'password_chars_and_numbers_enabled' => $security->isPasswordCharsAndNumbersEnabled() ? 1 : 0,
1770 'password_special_chars_enabled' => $security->isPasswordSpecialCharsEnabled() ? 1 : 0 ,
1771 'password_min_length' => $security->getPasswordMinLength(),
1772 'password_max_length' => $security->getPasswordMaxLength(),
1773 'password_ucase_chars_num' => $security->getPasswordNumberOfUppercaseChars(),
1774 'password_lowercase_chars_num' => $security->getPasswordNumberOfLowercaseChars(),
1775 'password_max_age' => $security->getPasswordMaxAge(),
1777 'login_max_attempts' => $security->getLoginMaxAttempts(),
1778 'ps_prevent_simultaneous_logins' => (int)$security->isPreventionOfSimultaneousLoginsEnabled(),
1779 'password_assistance' => (bool)$ilSetting->get(
"password_assistance")
1783 $this->tpl->setContent($this->form->getHTML());
1796 if($this->form->checkInput())
1800 if(!strlen($this->form->getInput(
'loginname_change_blocking_time')))
1803 $this->form->getItemByPostVar(
'loginname_change_blocking_time')
1804 ->setAlert($this->lng->txt(
'loginname_change_blocking_time_invalidity_info'));
1807 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
1811 $security->setPasswordCharsAndNumbersEnabled((
bool)
$_POST[
"password_chars_and_numbers_enabled"]);
1812 $security->setPasswordSpecialCharsEnabled((
bool) $_POST[
"password_special_chars_enabled"]);
1813 $security->setPasswordMinLength((
int) $_POST[
"password_min_length"]);
1814 $security->setPasswordMaxLength((
int) $_POST[
"password_max_length"]);
1815 $security->setPasswordNumberOfUppercaseChars((
int) $_POST[
'password_ucase_chars_num']);
1816 $security->setPasswordNumberOfLowercaseChars((
int) $_POST[
'password_lowercase_chars_num']);
1817 $security->setPasswordMaxAge((
int) $_POST[
"password_max_age"]);
1818 $security->setLoginMaxAttempts((
int) $_POST[
"login_max_attempts"]);
1819 $security->setPreventionOfSimultaneousLogins((
bool)$_POST[
'ps_prevent_simultaneous_logins']);
1820 $security->setPasswordChangeOnFirstLoginEnabled((
bool) $_POST[
'password_change_on_first_login_enabled']);
1821 $security->setPasswordMustNotContainLoginnameStatus((
int) $_POST[
'password_must_not_contain_loginame']);
1823 if(!$security->validate($this->form))
1832 include_once
'./Services/User/classes/class.ilUserAccountSettings.php';
1837 $ilSetting->set(
'allow_change_loginname', (
int)$this->form->getInput(
'allow_change_loginname'));
1838 $ilSetting->set(
'create_history_loginname', (
int)$this->form->getInput(
'create_history_loginname'));
1839 $ilSetting->set(
'reuse_of_loginnames', (
int)$this->form->getInput(
'reuse_of_loginnames'));
1840 $save_blocking_time_in_seconds = (int)($this->form->getInput(
'loginname_change_blocking_time') * 86400);
1841 $ilSetting->set(
'loginname_change_blocking_time', (
int)$save_blocking_time_in_seconds);
1842 $ilSetting->set(
'user_adm_alpha_nav', (
int)$this->form->getInput(
'user_adm_alpha_nav'));
1843 $ilSetting->set(
'user_reactivate_code', (
int)$this->form->getInput(
'user_reactivate_code'));
1845 $ilSetting->set(
'user_delete_own_account', (
int)$this->form->getInput(
'user_own_account'));
1846 $ilSetting->set(
'user_delete_own_account_email', $this->form->getInput(
'user_own_account_email'));
1848 $ilSetting->set(
"passwd_auto_generate", $this->form->getInput(
"passwd_auto_generate"));
1849 $ilSetting->set(
"password_assistance", $this->form->getInput(
"password_assistance"));
1852 $ilSetting->set(
'session_handling_type',
1853 (
int)$this->form->getInput(
'session_handling_type'));
1857 $ilSetting->set(
'session_reminder_enabled',
1858 $this->form->getInput(
'session_reminder_enabled'));
1862 require_once
'Services/Authentication/classes/class.ilSessionControl.php';
1864 $ilSetting->get(
'session_allow_client_maintenance',
1869 include_once
"Services/Authentication/classes/class.ilSessionStatistics.php";
1872 $ilSetting->set(
'session_max_count',
1873 (
int)$this->form->getInput(
'session_max_count'));
1874 $ilSetting->set(
'session_min_idle',
1875 (
int)$this->form->getInput(
'session_min_idle'));
1876 $ilSetting->set(
'session_max_idle',
1877 (
int)$this->form->getInput(
'session_max_idle'));
1878 $ilSetting->set(
'session_max_idle_after_first_request',
1879 (
int)$this->form->getInput(
'session_max_idle_after_first_request'));
1895 $this->form->setValuesByPost();
1896 $this->tpl->setContent($this->form->getHTML());
1909 $this->tabs_gui->setTabActive(
'settings');
1910 $this->tabs_gui->setSubTabActive(
'general_settings');
1912 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1914 $this->form->setFormAction($this->ctrl->getFormAction($this,
'saveGeneralSettings'));
1916 $this->form->setTitle($this->lng->txt(
'general_settings'));
1918 $lua =
new ilCheckboxInputGUI($this->lng->txt(
'enable_local_user_administration'),
'lua');
1919 $lua->
setInfo($this->lng->txt(
'enable_local_user_administration_info'));
1921 $this->form->addItem($lua);
1924 $lrua->
setInfo($this->lng->txt(
'restrict_user_access_info'));
1926 $this->form->addItem($lrua);
1929 $alph =
new ilCheckboxInputGUI($this->lng->txt(
'user_adm_enable_alpha_nav'),
'user_adm_alpha_nav');
1932 $this->form->addItem($alph);
1935 $code =
new ilCheckboxInputGUI($this->lng->txt(
"user_account_code_setting"),
"user_reactivate_code");
1936 $code->
setInfo($this->lng->txt(
'user_account_code_setting_info'));
1937 $this->form->addItem($code);
1940 $own =
new ilCheckboxInputGUI($this->lng->txt(
"user_allow_delete_own_account"),
"user_own_account");
1941 $this->form->addItem($own);
1942 $own_email =
new ilEMailInputGUI($this->lng->txt(
"user_delete_own_account_notification_email"),
"user_own_account_email");
1943 $own->addSubItem($own_email);
1955 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"session_reminder"),
"session_reminder_enabled");
1958 $cb->
setInfo($this->lng->txt(
"session_reminder_info").
"<br />".
1959 sprintf($this->lng->txt(
'session_reminder_session_duration'), $time));
1963 $ssettings->addOption($fixed);
1969 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
1973 $sub_ti =
new ilTextInputGUI($this->lng->txt(
'session_max_count'),
'session_max_count');
1975 $sub_ti->setSize(5);
1976 $sub_ti->setInfo($this->lng->txt(
'session_max_count_info'));
1978 $sub_ti->setDisabled(
true);
1979 $ldsh->addSubItem($sub_ti);
1984 $sub_ti =
new ilTextInputGUI($this->lng->txt(
'session_min_idle'),
'session_min_idle');
1986 $sub_ti->setSize(5);
1987 $sub_ti->setInfo($this->lng->txt(
'session_min_idle_info'));
1989 $sub_ti->setDisabled(
true);
1990 $ldsh->addSubItem($sub_ti);
1995 $sub_ti =
new ilTextInputGUI($this->lng->txt(
'session_max_idle'),
'session_max_idle');
1997 $sub_ti->setSize(5);
1998 $sub_ti->setInfo($this->lng->txt(
'session_max_idle_info'));
2000 $sub_ti->setDisabled(
true);
2001 $ldsh->addSubItem($sub_ti);
2006 $this->lng->txt(
'session_max_idle_after_first_request'),
2007 'session_max_idle_after_first_request'
2010 $sub_ti->setSize(5);
2011 $sub_ti->setInfo($this->lng->txt(
'session_max_idle_after_first_request_info'));
2013 $sub_ti->setDisabled(
true);
2014 $ldsh->addSubItem($sub_ti);
2017 $ssettings->addOption($ldsh);
2024 $this->form->addItem($ssettings);
2031 $ti->
setValue($this->lng->txt(
'session_config_maintenance_disabled'));
2032 $ssettings->setDisabled(
true);
2033 $ti->addSubItem($ssettings);
2034 $this->form->addItem($ti);
2040 $this->lng->loadLanguageModule(
'ps');
2043 $pass->setTitle($this->lng->txt(
'ps_password_settings'));
2044 $this->form->addItem(
$pass);
2047 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"passwd_generation_pre"),
"passwd_auto_generate");
2048 $cb->setChecked($ilSetting->get(
"passwd_auto_generate"));
2049 $cb->
setInfo($this->lng->txt(
"passwd_generation_info"));
2050 $this->form->addItem($cb);
2052 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_change_on_first_login_enabled'),
'password_change_on_first_login_enabled');
2053 $check->
setInfo($this->lng->txt(
'ps_password_change_on_first_login_enabled_info'));
2054 $this->form->addItem($check);
2056 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
2058 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_must_not_contain_loginame'),
'password_must_not_contain_loginame');
2059 $check->
setInfo($this->lng->txt(
'ps_password_must_not_contain_loginame_info'));
2060 $this->form->addItem($check);
2062 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_chars_and_numbers_enabled'),
'password_chars_and_numbers_enabled');
2064 $check->
setInfo($this->lng->txt(
'ps_password_chars_and_numbers_enabled_info'));
2065 $this->form->addItem($check);
2067 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_special_chars_enabled'),
'password_special_chars_enabled');
2069 $check->
setInfo($this->lng->txt(
'ps_password_special_chars_enabled_info'));
2070 $this->form->addItem($check);
2072 $text =
new ilNumberInputGUI($this->lng->txt(
'ps_password_min_length'),
'password_min_length');
2073 $text->
setInfo($this->lng->txt(
'ps_password_min_length_info'));
2075 $text->setMaxLength(2);
2076 $this->form->addItem($text);
2078 $text =
new ilNumberInputGUI($this->lng->txt(
'ps_password_max_length'),
'password_max_length');
2079 $text->
setInfo($this->lng->txt(
'ps_password_max_length_info'));
2081 $text->setMaxLength(3);
2082 $this->form->addItem($text);
2084 $text =
new ilNumberInputGUI($this->lng->txt(
'ps_password_uppercase_chars_num'),
'password_ucase_chars_num');
2085 $text->
setInfo($this->lng->txt(
'ps_password_uppercase_chars_num_info'));
2086 $text->setMinValue(0);
2088 $text->setMaxLength(3);
2089 $this->form->addItem($text);
2091 $text =
new ilNumberInputGUI($this->lng->txt(
'ps_password_lowercase_chars_num'),
'password_lowercase_chars_num');
2092 $text->
setInfo($this->lng->txt(
'ps_password_lowercase_chars_num_info'));
2093 $text->setMinValue(0);
2095 $text->setMaxLength(3);
2096 $this->form->addItem($text);
2098 $text =
new ilNumberInputGUI($this->lng->txt(
'ps_password_max_age'),
'password_max_age');
2099 $text->
setInfo($this->lng->txt(
'ps_password_max_age_info'));
2101 $text->setMaxLength(3);
2102 $this->form->addItem($text);
2105 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"enable_password_assistance"),
"password_assistance");
2106 $cb->
setInfo($this->lng->txt(
"password_assistance_info"));
2107 $this->form->addItem($cb);
2110 $pass->setTitle($this->lng->txt(
'ps_security_protection'));
2111 $this->form->addItem(
$pass);
2113 $text =
new ilNumberInputGUI($this->lng->txt(
'ps_login_max_attempts'),
'login_max_attempts');
2114 $text->
setInfo($this->lng->txt(
'ps_login_max_attempts_info'));
2116 $text->setMaxLength(2);
2117 $this->form->addItem($text);
2120 $objCb =
new ilCheckboxInputGUI($this->lng->txt(
'ps_prevent_simultaneous_logins'),
'ps_prevent_simultaneous_logins');
2122 $objCb->setInfo($this->lng->txt(
'ps_prevent_simultaneous_logins_info'));
2123 $this->form->addItem($objCb);
2129 $log->setTitle($this->lng->txt(
'loginname_settings'));
2130 $this->form->addItem(
$log);
2132 $chbChangeLogin =
new ilCheckboxInputGUI($this->lng->txt(
'allow_change_loginname'),
'allow_change_loginname');
2134 $this->form->addItem($chbChangeLogin);
2135 $chbCreateHistory =
new ilCheckboxInputGUI($this->lng->txt(
'history_loginname'),
'create_history_loginname');
2136 $chbCreateHistory->
setInfo($this->lng->txt(
'loginname_history_info'));
2137 $chbCreateHistory->setValue(1);
2139 $chbChangeLogin->addSubItem($chbCreateHistory);
2140 $chbReuseLoginnames =
new ilCheckboxInputGUI($this->lng->txt(
'reuse_of_loginnames_contained_in_history'),
'reuse_of_loginnames');
2142 $chbReuseLoginnames->setInfo($this->lng->txt(
'reuse_of_loginnames_contained_in_history_info'));
2144 $chbChangeLogin->addSubItem($chbReuseLoginnames);
2145 $chbChangeBlockingTime =
new ilNumberInputGUI($this->lng->txt(
'loginname_change_blocking_time'),
'loginname_change_blocking_time');
2147 $chbChangeBlockingTime->setSuffix($this->lng->txt(
'days'));
2148 $chbChangeBlockingTime->setInfo($this->lng->txt(
'loginname_change_blocking_time_info'));
2149 $chbChangeBlockingTime->setSize(10);
2150 $chbChangeBlockingTime->setMaxLength(10);
2151 $chbChangeLogin->addSubItem($chbChangeBlockingTime);
2153 $this->form->addCommandButton(
'saveGeneralSettings', $this->lng->txt(
'save'));
2173 include_once
'Services/Search/classes/class.ilUserSearchOptions.php';
2174 $lng->loadLanguageModule(
"administration");
2175 $lng->loadLanguageModule(
"mail");
2177 $ilTabs->activateTab(
'settings');
2178 $ilTabs->activateSubTab(
'standard_fields');
2180 include_once(
"./Services/User/classes/class.ilUserFieldSettingsTableGUI.php");
2182 if($this->confirm_change)
$tab->setConfirmChange();
2183 $tpl->setContent(
$tab->getHTML());
2193 include_once
'Services/Search/classes/class.ilUserSearchOptions.php';
2194 include_once
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
2199 include_once(
"./Services/User/classes/class.ilUserProfile.php");
2201 $up->skipField(
"username");
2202 $field_properties = $up->getStandardFields();
2203 $profile_fields = array_keys($field_properties);
2206 foreach ($profile_fields as $field)
2208 if (
$_POST[
"chb"][
"required_".$field] &&
2209 !(
int)
$_POST[
'chb'][
'visib_reg_' . $field]
2220 $this->confirm_change = 1;
2226 $fixed_required_fields = array(
2233 "hits_per_page" => 0,
2234 "show_users_online" => 0,
2235 "hide_own_online_status" => 0
2240 if ($privacy->enabledCourseExport() ==
true &&
2241 $privacy->courseConfirmationRequired() ==
true &&
2244 foreach ($profile_fields as $field)
2246 if (! $ilias->getSetting(
"usr_settings_course_export_" . $field) &&
$_POST[
"chb"][
"course_export_" . $field] ==
"1")
2248 #ilUtil::sendQuestion($this->lng->txt('confirm_message_course_export'));
2249 #$this->confirm_change = 1;
2250 #$this->settingsObject();
2256 if($action ==
'save')
2258 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
2262 foreach ($profile_fields as $field)
2270 if (!
$_POST[
"chb"][
"visible_".$field] && !$field_properties[$field][
"visible_hide"])
2272 $ilias->setSetting(
"usr_settings_hide_".$field,
"1");
2276 $ilias->deleteSetting(
"usr_settings_hide_".$field);
2279 if (!
$_POST[
"chb"][
"changeable_" . $field] && !$field_properties[$field][
"changeable_hide"])
2281 $ilias->setSetting(
"usr_settings_disable_".$field,
"1");
2285 $ilias->deleteSetting(
"usr_settings_disable_".$field);
2289 if ((
int)
$_POST[
'chb'][
'visib_reg_' . $field] && !$field_properties[$field][
"visib_reg_hide"])
2291 $ilSetting->set(
'usr_settings_visib_reg_'.$field,
'1');
2295 $ilSetting->set(
'usr_settings_visib_reg_'.$field,
'0');
2298 if ((
int)
$_POST[
'chb'][
'visib_lua_' . $field])
2301 $ilSetting->set(
'usr_settings_visib_lua_'.$field,
'1');
2305 $ilSetting->set(
'usr_settings_visib_lua_'.$field,
'0');
2308 if ((
int)
$_POST[
'chb'][
'changeable_lua_' . $field])
2311 $ilSetting->set(
'usr_settings_changeable_lua_'.$field,
'1');
2315 $ilSetting->set(
'usr_settings_changeable_lua_'.$field,
'0');
2318 if (
$_POST[
"chb"][
"export_" . $field] && !$field_properties[$field][
"export_hide"])
2320 $ilias->setSetting(
"usr_settings_export_".$field,
"1");
2324 $ilias->deleteSetting(
"usr_settings_export_".$field);
2328 if (
$_POST[
"chb"][
"course_export_" . $field] && !$field_properties[$field][
"course_export_hide"])
2330 $ilias->setSetting(
"usr_settings_course_export_".$field,
"1");
2334 $ilias->deleteSetting(
"usr_settings_course_export_".$field);
2338 if (
$_POST[
"chb"][
"group_export_" . $field] && !$field_properties[$field][
"group_export_hide"])
2340 $ilias->setSetting(
"usr_settings_group_export_".$field,
"1");
2344 $ilias->deleteSetting(
"usr_settings_group_export_".$field);
2347 $is_fixed = array_key_exists($field, $fixed_required_fields);
2348 if ($is_fixed && $fixed_required_fields[$field] || ! $is_fixed &&
$_POST[
"chb"][
"required_".$field])
2350 $ilias->setSetting(
"require_".$field,
"1");
2354 $ilias->deleteSetting(
"require_" . $field);
2358 if (
$_POST[
"select"][
"default_hits_per_page"])
2360 $ilias->setSetting(
"hits_per_page",
$_POST[
"select"][
"default_hits_per_page"]);
2363 if (
$_POST[
"select"][
"default_show_users_online"])
2365 $ilias->setSetting(
"show_users_online",
$_POST[
"select"][
"default_show_users_online"]);
2368 if (
$_POST[
"chb"][
"export_preferences"])
2370 $ilias->setSetting(
"usr_settings_export_preferences",
$_POST[
"chb"][
"export_preferences"]);
2372 $ilias->deleteSetting(
"usr_settings_export_preferences");
2375 $ilias->setSetting(
'mail_incoming_mail', (
int)
$_POST[
'select'][
'default_mail_incoming_mail']);
2387 $action[-1] = $this->lng->txt(
'all_users');
2388 $action[1] = $this->lng->txt(
'usr_active_only');
2389 $action[0] = $this->lng->txt(
'usr_inactive_only');
2390 $action[2] = $this->lng->txt(
'usr_limited_access_only');
2391 $action[3] = $this->lng->txt(
'usr_without_courses');
2392 $action[4] = $this->lng->txt(
'usr_filter_lastlogin');
2393 $action[5] = $this->lng->txt(
"usr_filter_coursemember");
2394 $action[6] = $this->lng->txt(
"usr_filter_groupmember");
2395 $action[7] = $this->lng->txt(
"usr_filter_role");
2408 if(!isset(
$_POST[
"file"]))
2410 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2413 if (count(
$_POST[
"file"]) > 1)
2415 $this->ilias->raiseError($this->lng->txt(
"select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2420 $export_dir = $this->
object->getExportDirectory();
2429 if(!isset(
$_POST[
"file"]))
2431 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2435 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
2437 $cgui->setFormAction($this->ctrl->getFormAction($this));
2438 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
2439 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelDeleteExportFile");
2440 $cgui->setConfirm($this->lng->txt(
"confirm"),
"deleteExportFile");
2448 $this->tpl->setContent($cgui->getHTML());
2457 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
2466 $export_dir = $this->
object->getExportDirectory();
2469 $file = basename($file);
2471 $exp_file = $export_dir.
"/".
$file;
2472 if (@is_file($exp_file))
2477 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
2494 if (
$_POST[
"cmd"][
"export"])
2496 $this->
object->buildExportFile(
$_POST[
"export_type"]);
2497 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
2501 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_export.html',
'Services/User');
2503 $export_types = array(
2504 "userfolder_export_excel_x86",
2505 "userfolder_export_csv",
2506 "userfolder_export_xml"
2510 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
2514 $this->tpl->addBlockfile(
"EXPORT_FILES",
"export_files",
"tpl.table.html");
2517 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.usr_export_file_row.html",
"Services/User");
2521 $tbl->setTitle($this->lng->txt(
"userfolder_export_files"));
2523 $tbl->setHeaderNames(array(
"", $this->lng->txt(
"userfolder_export_file"),
2524 $this->lng->txt(
"userfolder_export_file_size"), $this->lng->txt(
"date") ));
2525 $tbl->setHeaderVars(array(), $ilCtrl->getParameterArray($this,
"export"));
2527 $tbl->enabled[
"sort"] =
false;
2528 $tbl->setColumnWidth(array(
"1%",
"49%",
"25%",
"25%"));
2531 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
2532 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
2533 $tbl->setLimit(
$_GET[
"limit"]);
2534 $tbl->setOffset(
$_GET[
"offset"]);
2535 $tbl->setMaxCount($this->maxcount);
2538 $this->tpl->setVariable(
"COLUMN_COUNTS", 4);
2542 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
2543 $this->tpl->setCurrentBlock(
"tbl_action_btn");
2544 $this->tpl->setVariable(
"BTN_NAME",
"confirmDeleteExportFile");
2545 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
2546 $this->tpl->parseCurrentBlock();
2548 $this->tpl->setCurrentBlock(
"tbl_action_btn");
2549 $this->tpl->setVariable(
"BTN_NAME",
"downloadExportFile");
2550 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"download"));
2551 $this->tpl->parseCurrentBlock();
2554 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
2557 $export_files = $this->
object->getExportFiles();
2559 $tbl->setMaxCount(count($export_files));
2560 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
2564 if(count($export_files) > 0)
2567 foreach($export_files as $exp_file)
2569 $this->tpl->setCurrentBlock(
"tbl_content");
2570 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"filename"]);
2573 $this->tpl->setVariable(
"CSS_ROW", $css_row);
2575 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"filesize"]);
2576 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"filename"]);
2578 $file_arr = explode(
"__", $exp_file[
"filename"]);
2581 $this->tpl->parseCurrentBlock();
2584 $this->tpl->setCurrentBlock(
"selectall");
2585 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
2586 $this->tpl->setVariable(
"CSS_ROW", $css_row);
2587 $this->tpl->parseCurrentBlock();
2600 $this->tpl->parseCurrentBlock();
2603 foreach ($export_types as $export_type)
2605 $this->tpl->setCurrentBlock(
"option");
2606 $this->tpl->setVariable(
"OPTION_VALUE", $export_type);
2607 $this->tpl->setVariable(
"OPTION_TEXT", $this->lng->txt($export_type));
2608 $this->tpl->parseCurrentBlock();
2611 $this->tpl->setVariable(
"EXPORT_BUTTON", $this->lng->txt(
"create_export_file"));
2612 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
2619 $lng->loadLanguageModule(
"meta");
2620 $lng->loadLanguageModule(
"mail");
2622 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
2624 $form->setFormAction($ilCtrl->getFormAction($this));
2627 $form->setTitle($lng->txt(
"user_new_account_mail"));
2628 $form->setDescription($lng->txt(
"user_new_account_mail_desc"));
2630 $langs = $lng->getInstalledLanguages();
2631 foreach($langs as $lang_key)
2633 $amail = $this->
object->_lookupNewAccountMail($lang_key);
2635 $title = $lng->txt(
"meta_l_".$lang_key);
2636 if ($lang_key == $lng->getDefaultLanguage())
2638 $title .=
" (".$lng->txt(
"default").
")";
2642 $header->setTitle($title);
2643 $form->addItem($header);
2645 $subj =
new ilTextInputGUI($lng->txt(
"subject"),
"subject_".$lang_key);
2647 $subj->
setValue($amail[
"subject"]);
2648 $form->addItem($subj);
2650 $salg =
new ilTextInputGUI($lng->txt(
"mail_salutation_general"),
"sal_g_".$lang_key);
2653 $form->addItem($salg);
2655 $salf =
new ilTextInputGUI($lng->txt(
"mail_salutation_female"),
"sal_f_".$lang_key);
2658 $form->addItem($salf);
2660 $salm =
new ilTextInputGUI($lng->txt(
"mail_salutation_male"),
"sal_m_".$lang_key);
2663 $form->addItem($salm);
2669 $body->setCols(100);
2670 $form->addItem($body);
2672 $att =
new ilFileInputGUI($lng->txt(
"attachment"),
"att_".$lang_key);
2673 $att->setAllowDeletion(
true);
2674 if($amail[
"att_file"])
2676 $att->
setValue($amail[
"att_file"]);
2678 $form->addItem($att);
2681 $form->addCommandButton(
"saveNewAccountMail", $lng->txt(
"save"));
2682 $form->addCommandButton(
"cancelNewAccountMail", $lng->txt(
"cancel"));
2695 $this->tabs_gui->setTabActive(
'settings');
2696 $this->tabs_gui->setSubTabActive(
'user_new_account_mail');
2700 $ftpl =
new ilTemplate(
'tpl.usrf_new_account_mail.html',
true,
true,
'Services/User');
2701 $ftpl->setVariable(
"FORM", $form->getHTML());
2705 $ftpl->setVariable(
"TXT_USE_PLACEHOLDERS", $lng->txt(
"mail_nacc_use_placeholder"));
2706 $ftpl->setVariable(
"TXT_MAIL_SALUTATION", $lng->txt(
"mail_nacc_salutation"));
2707 $ftpl->setVariable(
"TXT_FIRST_NAME", $lng->txt(
"firstname"));
2708 $ftpl->setVariable(
"TXT_LAST_NAME", $lng->txt(
"lastname"));
2709 $ftpl->setVariable(
"TXT_EMAIL", $lng->txt(
"email"));
2710 $ftpl->setVariable(
"TXT_LOGIN", $lng->txt(
"mail_nacc_login"));
2711 $ftpl->setVariable(
"TXT_PASSWORD", $lng->txt(
"password"));
2712 $ftpl->setVariable(
"TXT_PASSWORD_BLOCK", $lng->txt(
"mail_nacc_pw_block"));
2713 $ftpl->setVariable(
"TXT_NOPASSWORD_BLOCK", $lng->txt(
"mail_nacc_no_pw_block"));
2714 $ftpl->setVariable(
"TXT_ADMIN_MAIL", $lng->txt(
"mail_nacc_admin_mail"));
2715 $ftpl->setVariable(
"TXT_ILIAS_URL", $lng->txt(
"mail_nacc_ilias_url"));
2716 $ftpl->setVariable(
"TXT_CLIENT_NAME", $lng->txt(
"mail_nacc_client_name"));
2717 $ftpl->setVariable(
"TXT_TARGET", $lng->txt(
"mail_nacc_target"));
2718 $ftpl->setVariable(
"TXT_TARGET_TITLE", $lng->txt(
"mail_nacc_target_title"));
2719 $ftpl->setVariable(
"TXT_TARGET_TYPE", $lng->txt(
"mail_nacc_target_type"));
2720 $ftpl->setVariable(
"TXT_TARGET_BLOCK", $lng->txt(
"mail_nacc_target_block"));
2721 $ftpl->setVariable(
"TXT_IF_TIMELIMIT", $lng->txt(
"mail_nacc_if_timelimit"));
2722 $ftpl->setVariable(
"TXT_TIMELIMIT", $lng->txt(
"mail_nacc_timelimit"));
2724 $this->tpl->setContent($ftpl->get());
2729 $this->ctrl->redirect($this,
"settings");
2736 $langs = $lng->getInstalledLanguages();
2737 foreach($langs as $lang_key)
2739 $this->
object->_writeNewAccountMail($lang_key,
2746 if($_FILES[
"att_".$lang_key][
"tmp_name"])
2748 $this->
object->_updateAccountMailAttachment($lang_key,
2749 $_FILES[
"att_".$lang_key][
"tmp_name"],
2750 $_FILES[
"att_".$lang_key][
"name"]);
2753 if (
$_POST[
"att_".$lang_key.
"_delete"])
2755 $this->
object->_deleteAccountMailAttachment($lang_key);
2760 $this->ctrl->redirect($this,
"newAccountMail");
2775 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
2779 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
2781 $tabs_gui->addTarget(
"usrf",
2782 $this->ctrl->getLinkTarget($this,
"view"), array(
"view",
"delete",
"resetFilter",
"userAction",
""),
"",
"");
2784 $tabs_gui->addTarget(
2785 "search_user_extended",
2786 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
''),
2788 "ilrepositorysearchgui",
2793 if ($rbacsystem->checkAccess(
"write",$this->object->getRefId()))
2795 $tabs_gui->addTarget(
"settings",
2796 $this->ctrl->getLinkTarget($this,
"generalSettings"),array(
'settings',
'generalSettings',
'listUserDefinedField',
'newAccountMail'));
2798 $tabs_gui->addTarget(
"export",
2799 $this->ctrl->getLinkTarget($this,
"export"),
"export",
"",
"");
2811 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
2813 $tabs_gui->addTarget(
"perm_settings",
2814 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
2815 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
2830 $this->tabs_gui->addSubTabTarget(
2832 $this->ctrl->getLinkTarget($this,
'generalSettings'),
'generalSettings', get_class($this));
2833 $this->tabs_gui->addSubTabTarget(
"standard_fields",
2834 $this->ctrl->getLinkTarget($this,
'settings'),
2835 array(
"settings",
"saveGlobalUserSettings"), get_class($this));
2836 $this->tabs_gui->addSubTabTarget(
"user_defined_fields",
2837 $this->ctrl->getLinkTargetByClass(
"ilcustomuserfieldsgui",
"listUserDefinedFields"),
2838 "listUserDefinedFields",get_class($this));
2839 $this->tabs_gui->addSubTabTarget(
"user_new_account_mail",
2840 $this->ctrl->getLinkTarget($this,
'newAccountMail'),
2841 "newAccountMail",get_class($this));
2842 #$this->tabs_gui->addSubTab("account_codes", $this->lng->txt("user_account_codes"),
2843 # $this->ctrl->getLinkTargetByClass("ilaccountcodesgui"));
2852 $show_blocking_time_in_days = (int)$ilSetting->get(
'loginname_change_blocking_time') / 86400;
2855 $this->loginSettingsForm->setValuesByArray(array(
2856 'allow_change_loginname' => (
bool)$ilSetting->get(
'allow_change_loginname'),
2857 'create_history_loginname' => (bool)$ilSetting->get(
'create_history_loginname'),
2858 'reuse_of_loginnames' => (bool)$ilSetting->get(
'reuse_of_loginnames'),
2859 'loginname_change_blocking_time' => (float)$show_blocking_time_in_days
2862 $this->tpl->setVariable(
'ADM_CONTENT', $this->loginSettingsForm->getHTML());
2868 $this->tabs_gui->setTabActive(
'settings');
2869 $this->tabs_gui->setSubTabActive(
'loginname_settings');
2871 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
2873 $this->loginSettingsForm->
setFormAction($this->ctrl->getFormAction($this,
'saveLoginnameSettings'));
2874 $this->loginSettingsForm->setTitle($this->lng->txt(
'loginname_settings'));
2876 $chbChangeLogin =
new ilCheckboxInputGUI($this->lng->txt(
'allow_change_loginname'),
'allow_change_loginname');
2878 $this->loginSettingsForm->addItem($chbChangeLogin);
2879 $chbCreateHistory =
new ilCheckboxInputGUI($this->lng->txt(
'history_loginname'),
'create_history_loginname');
2880 $chbCreateHistory->
setInfo($this->lng->txt(
'loginname_history_info'));
2881 $chbCreateHistory->setValue(1);
2882 $chbChangeLogin->addSubItem($chbCreateHistory);
2883 $chbReuseLoginnames =
new ilCheckboxInputGUI($this->lng->txt(
'reuse_of_loginnames_contained_in_history'),
'reuse_of_loginnames');
2885 $chbReuseLoginnames->setInfo($this->lng->txt(
'reuse_of_loginnames_contained_in_history_info'));
2886 $chbChangeLogin->addSubItem($chbReuseLoginnames);
2887 $chbChangeBlockingTime =
new ilNumberInputGUI($this->lng->txt(
'loginname_change_blocking_time'),
'loginname_change_blocking_time');
2889 $chbChangeBlockingTime->setSuffix($this->lng->txt(
'days'));
2890 $chbChangeBlockingTime->setInfo($this->lng->txt(
'loginname_change_blocking_time_info'));
2891 $chbChangeBlockingTime->setSize(10);
2892 $chbChangeBlockingTime->setMaxLength(10);
2893 $chbChangeLogin->addSubItem($chbChangeBlockingTime);
2895 $this->loginSettingsForm->addCommandButton(
'saveLoginnameSettings', $this->lng->txt(
'save'));
2903 if($this->loginSettingsForm->checkInput())
2907 if(!strlen($this->loginSettingsForm->getInput(
'loginname_change_blocking_time')))
2910 $this->loginSettingsForm->getItemByPostVar(
'loginname_change_blocking_time')
2911 ->setAlert($this->lng->txt(
'loginname_change_blocking_time_invalidity_info'));
2916 $save_blocking_time_in_seconds = (int)$this->loginSettingsForm->getInput(
'loginname_change_blocking_time') * 86400;
2918 $ilSetting->set(
'allow_change_loginname', (
int)$this->loginSettingsForm->getInput(
'allow_change_loginname'));
2919 $ilSetting->set(
'create_history_loginname', (
int)$this->loginSettingsForm->getInput(
'create_history_loginname'));
2920 $ilSetting->set(
'reuse_of_loginnames', (
int)$this->loginSettingsForm->getInput(
'reuse_of_loginnames'));
2921 $ilSetting->set(
'loginname_change_blocking_time', (
int)$save_blocking_time_in_seconds);
2934 $this->loginSettingsForm->setValuesByPost();
2936 $this->tpl->setVariable(
'ADM_CONTENT', $this->loginSettingsForm->getHTML());
2948 if ($ilAccess->checkAccess(
"read",
"", $a_target))
2950 ilUtil::redirect(
"ilias.php?baseClass=ilAdministrationGUI&ref_id=".$a_target.
"&jmpToUser=".$a_user);
2955 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
2962 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
2974 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id", (
int) $_GET[
"jmpToUser"]);
2975 $ilCtrl->redirectByClass(
"ilobjusergui",
"view");
2984 if(!count((array) $a_usr_ids))
2990 $_POST[
'id'] = $a_usr_ids;
2993 if(stristr($a_cmd,
"export"))
2995 $cmd = $a_cmd.
"Object";
2996 return $this->
$cmd();
2999 $_POST[
'selectedAction'] = $a_cmd;
3011 'activate' => $this->lng->txt(
'activate'),
3012 'deactivate' => $this->lng->txt(
'deactivate'),
3013 'accessRestrict' => $this->lng->txt(
'accessRestrict'),
3014 'accessFree' => $this->lng->txt(
'accessFree')
3017 if ($rbacsystem->checkAccess(
'delete', $this->object->getRefId()))
3019 $cmds[
"delete"] = $this->lng->txt(
"delete");
3026 'activateUsers' => $this->lng->txt(
'activate'),
3027 'deactivateUsers' => $this->lng->txt(
'deactivate'),
3028 'restrictAccess' => $this->lng->txt(
'accessRestrict'),
3029 'freeAccess' => $this->lng->txt(
'accessFree')
3032 if ($rbacsystem->checkAccess(
'delete', $this->object->getRefId()))
3034 $cmds[
"deleteUsers"] = $this->lng->txt(
"delete");
3039 $export_types = array(
"userfolder_export_excel_x86",
"userfolder_export_csv",
"userfolder_export_xml");
3040 foreach ($export_types as $type)
3042 $cmd = explode(
"_", $type);
3044 $cmds[
'usrExport'.ucfirst(
$cmd)] = $this->lng->txt(
'export').
' - '.
3045 $this->lng->txt($type);
3049 include_once
"Services/Mail/classes/class.ilMail.php";
3050 $mail =
new ilMail($ilUser->getId());
3051 if($rbacsystem->checkAccess(
'internal_mail', $mail->getMailObjectReferenceId()))
3053 $cmds[
"mail"] = $this->lng->txt(
"send_mail");
3067 $this->
object->buildExportFile(
"userfolder_export_excel_x86", $user_ids);
3068 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
3079 $this->
object->buildExportFile(
"userfolder_export_csv", $user_ids);
3080 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
3091 $this->
object->buildExportFile(
"userfolder_export_xml", $user_ids);
3092 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
3107 include_once
"Services/Contact/classes/class.ilMailingLists.php";
3109 $list->deleteTemporaryLists();
3112 include_once
"Services/Contact/classes/class.ilMailingList.php";
3115 $list->setTitle(
"-TEMPORARY SYSTEM LIST-");
3116 $list->setDescription(
"-USER ACCOUNTS MAIL-");
3117 $list->setCreateDate(date(
"Y-m-d H:i:s"));
3119 $list_id = $list->getId();
3122 foreach($user_ids as $user_id)
3124 $list->assignAddressbookEntry($user_id);
3127 include_once
"Services/Mail/classes/class.ilFormatMail.php";
3131 if(!is_array($mail_data))
3133 $mail_data = array(
"user_id" => $ilUser->getId());
3140 $mail_data[
'user_id'],
3141 $mail_data[
'attachments'],
3143 $mail_data[
'rcp_cc'],
3144 $mail_data[
'rcp_bcc'],
3145 $mail_data[
'm_type'],
3146 $mail_data[
'm_email'],
3147 $mail_data[
'm_subject'],
3148 $mail_data[
'm_message'],
3149 $mail_data[
'use_placeholders']
3161 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
3171 'ps_password_min_length' => (
int)$security->getPasswordMinLength(),
3172 'ps_password_max_length' => (int)$security->getPasswordMaxLength(),
3173 'ps_password_uppercase_chars_num' => (int)$security->getPasswordNumberOfUppercaseChars(),
3174 'ps_password_lowercase_chars_num' => (int)$security->getPasswordNumberOfLowercaseChars(),
3175 'ps_password_max_age' => (int)$security->getPasswordMaxAge()
3177 $fields[
'ps_password_settings'] = array(null, null, $subitems);
3180 'ps_login_max_attempts' => (
int)$security->getLoginMaxAttempts(),
3183 $fields[
'ps_security_protection'] = array(null, null, $subitems);
3185 return array(array(
"generalSettings", $fields));