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 $ilToolbar->addButton($this->lng->txt(
"usr_add"),
194 $this->ctrl->getLinkTarget($this,
"addUser"));
195 $ilToolbar->addButton($this->lng->txt(
"import_users"),
196 $this->ctrl->getLinkTarget($this,
"importUserForm"));
199 include_once
'./Services/User/classes/class.ilUserAccountSettings.php';
201 if ((
int) $ilSetting->get(
'user_adm_alpha_nav'))
203 $ilToolbar->addSeparator();
206 include_once(
"./Services/Form/classes/class.ilAlphabetInputGUI.php");
208 include_once(
"./Services/User/classes/class.ilObjUser.php");
214 $ai->setParentCommand($this,
"chooseLetter");
215 $ai->setHighlighted(
$_GET[
"letter"]);
216 $ilToolbar->addInputItem($ai,
true);
220 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
222 $tpl->setContent($utab->getHTML());
230 include_once
'./Services/User/classes/class.ilUserAutoComplete.php';
232 $auto->setSearchFields(array(
'login',
'firstname',
'lastname',
'email'));
233 $auto->enableFieldSearchableCheck(
false);
248 $ilCtrl->redirect($this,
"view");
262 $operations = array();
264 if ($this->actions ==
"")
267 "delete" => array(
"name" =>
"delete",
"lng" =>
"delete"),
268 "activate" => array(
"name" =>
"activate",
"lng" =>
"activate"),
269 "deactivate" => array(
"name" =>
"deactivate",
"lng" =>
"deactivate"),
270 "accessRestrict" => array(
"name" =>
"accessRestrict",
"lng" =>
"accessRestrict"),
271 "accessFree" => array(
"name" =>
"accessFree",
"lng" =>
"accessFree"),
272 "export" => array(
"name" =>
"export",
"lng" =>
"export")
281 if ($rbacsystem->checkAccess($row[
"name"],$this->object->getRefId()))
283 $operations[] =
$row;
287 if (count($operations) > 0)
289 $select =
"<select name=\"selectedAction\">\n";
290 foreach ($operations as $val)
292 $select .=
"<option value=\"" . $val[
"name"] .
"\"";
293 if (strcmp(
$_POST[
"selectedAction"], $val[
"name"]) == 0)
295 $select .=
" selected=\"selected\"";
298 $select .= $this->lng->txt($val[
"lng"]);
299 $select .=
"</option>";
301 $select .=
"</select>";
302 $this->tpl->setCurrentBlock(
"tbl_action_select");
303 $this->tpl->setVariable(
"SELECT_ACTION", $select);
304 $this->tpl->setVariable(
"BTN_NAME",
"userAction");
305 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"submit"));
306 $this->tpl->parseCurrentBlock();
309 if ($with_subobjects ===
true)
314 if ((count($operations) > 0) or $subobjs ===
true)
316 $this->tpl->setCurrentBlock(
"tbl_action_row");
317 $this->tpl->setVariable(
"COLUMN_COUNTS",count($this->data[
"cols"]));
319 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
320 $this->tpl->parseCurrentBlock();
334 $d = $this->objDefinition->getCreatableSubObjects($this->object->getType());
336 if (!$rbacsystem->checkAccess(
'create_usr',$this->object->getRefId()))
349 for ($i=0; $i<count($this->data[
"ctrl"]); $i++)
351 if ($this->data[
"ctrl"][$i][
"type"] == $row[
"name"])
357 if ($row[
"max"] ==
"" || $count < $row[
"max"])
359 $subobj[] = $row[
"name"];
364 if (is_array($subobj))
368 $this->tpl->setCurrentBlock(
"add_object");
369 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
370 $this->tpl->setVariable(
"BTN_NAME",
"create");
371 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"add"));
372 $this->tpl->parseCurrentBlock();
382 $this->ctrl->redirect($this,
'view');
387 $this->ctrl->redirectByClass(
'ilrepositorysearchgui',
'showSearchResults');
400 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
402 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
406 foreach (
$_POST[
"id"] as $id)
409 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
410 $obj->setActive(TRUE, $ilUser->getId());
418 $this->ctrl->redirectByClass(
'ilRepositorySearchGUI',
'show');
422 $this->ctrl->redirect($this,
"view");
436 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
438 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
442 foreach (
$_POST[
"id"] as $id)
445 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
446 $obj->setActive(FALSE, $ilUser->getId());
455 $this->ctrl->redirectByClass(
'ilRepositorySearchGUI',
'show');
459 $this->ctrl->redirect($this,
"view");
468 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
470 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
474 foreach (
$_POST[
"id"] as $id)
477 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
478 $obj->setTimeLimitOwner($ilUser->getId());
479 $obj->setTimeLimitUnlimited(1);
480 $obj->setTimeLimitFrom(
"");
481 $obj->setTimeLimitUntil(
"");
482 $obj->setTimeLimitMessage(0);
491 $this->ctrl->redirectByClass(
'ilRepositorySearchGUI',
'show');
495 $this->ctrl->redirect($this,
"view");
505 $this->tpl->setContent($a_form->getHTML());
520 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
522 $form->setTitle($this->lng->txt(
"time_limit_add_time_limit_for_selected"));
523 $form->setFormAction($this->ctrl->getFormAction($this,
"confirmaccessRestrict"));
527 $from->setRequired(
true);
528 $form->addItem($from);
532 $to->setShowTime(
true);
535 $form->addCommandButton(
"confirmaccessRestrict", $this->lng->txt(
"confirm"));
536 $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
538 foreach($user_ids as $user_id)
541 $ufield->setValue($user_id);
542 $form->addItem($ufield);
546 if($a_from_search ||
$_POST[
"frsrch"])
550 $form->addItem($field);
559 if(!$form->checkInput())
564 $timefrom = $form->getItemByPostVar(
"from")->getDate()->get(
IL_CAL_UNIX);
565 $timeuntil = $form->getItemByPostVar(
"to")->getDate()->get(
IL_CAL_UNIX);
566 if ($timeuntil <= $timefrom)
575 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
577 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
581 foreach (
$_POST[
"id"] as $id)
584 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
585 $obj->setTimeLimitOwner($ilUser->getId());
586 $obj->setTimeLimitUnlimited(0);
587 $obj->setTimeLimitFrom($timefrom);
588 $obj->setTimeLimitUntil($timeuntil);
589 $obj->setTimeLimitMessage(0);
598 $this->ctrl->redirectByClass(
'ilRepositorySearchGUI',
'show');
602 $this->ctrl->redirect($this,
"view");
616 if (!$rbacsystem->checkAccess(
'delete',$this->object->getRefId()))
619 $ilCtrl->redirect($this,
"view");
622 if (in_array($ilUser->getId(),
$_POST[
"id"]))
624 $this->ilias->raiseError($this->lng->txt(
"msg_no_delete_yourself"),$this->ilias->error_obj->WARNING);
628 foreach (
$_POST[
"id"] as $id)
631 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
640 $this->ctrl->redirectByClass(
'ilRepositorySearchGUI',
'show');
644 $this->ctrl->redirect($this,
"view");
655 if(
$_POST[
"select_cmd_all"])
657 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
659 return $utab->getUserIdsForFilter();
677 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
682 $ilTabs->activateTab(
"obj_usrf");
686 $ilTabs->activateTab(
"search_user_extended");
689 if (strcmp($action,
"accessRestrict") == 0)
693 if (strcmp($action,
"mail") == 0)
702 $cancel =
"cancelUserFolderAction";
706 $cancel =
"cancelSearchAction";
710 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
712 $cgui->setFormAction($this->ctrl->getFormAction($this));
713 $cgui->setHeaderText($this->lng->txt(
"info_" . $action .
"_sure"));
714 $cgui->setCancel($this->lng->txt(
"cancel"), $cancel);
715 $cgui->setConfirm($this->lng->txt(
"confirm"),
"confirm" . $action);
719 $cgui->addHiddenItem(
"frsrch", 1);
722 foreach($user_ids as $id)
726 $login = $user->getLastLogin();
729 $login = $this->lng->txt(
"never");
736 $caption = $user->getFullname().
" (".$user->getLogin().
")".
", ".
737 $user->getEmail().
" - ".$this->lng->txt(
"last_login").
": ".$login;
739 $cgui->addItem(
"id[]", $id, $caption);
742 $this->tpl->setContent($cgui->getHTML());
752 $_POST[
"selectedAction"] =
"delete";
761 $_POST[
"selectedAction"] =
"activate";
770 $_POST[
"selectedAction"] =
"deactivate";
779 $_POST[
"selectedAction"] =
"accessRestrict";
788 $_POST[
"selectedAction"] =
"accessFree";
802 global
$tpl, $rbacsystem;
805 if (
$_GET[
"baseClass"] ==
'ilRepositoryGUI')
807 $this->tabs_gui->clearTargets();
810 if (!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
812 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
816 $tpl->setContent($this->form->getHTML());
828 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
832 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
837 $this->form->addItem($fi);
839 $this->form->addCommandButton(
"importUserRoleAssignment", $lng->txt(
"import"));
840 $this->form->addCommandButton(
"importCancelled", $lng->txt(
"cancel"));
842 $this->form->setTitle($lng->txt(
"import_users"));
843 $this->form->setFormAction($ilCtrl->getFormAction($this));
856 if (@is_dir($import_dir))
861 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
863 $this->ctrl->redirect($this,
"view");
868 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
881 $importDir =
ilUtil::getDataDir().
'/user_import/usr_'.$ilUser->getId().
'_'.session_id();
894 if (
$_GET[
"baseClass"] ==
'ilRepositoryGUI')
896 $this->tabs_gui->clearTargets();
900 if ($this->form->checkInput())
902 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
903 include_once
'./Services/User/classes/class.ilUserImportParser.php';
905 global $rbacreview, $rbacsystem,
$tree,
$lng;
908 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_import_roles.html",
"Services/User");
913 if (@is_dir($import_dir))
920 $file_name = $_FILES[
"importFile"][
"name"];
921 $parts = pathinfo($file_name);
922 $full_path = $import_dir.
"/".$file_name;
925 if (!is_file($_FILES[
"importFile"][
"tmp_name"]))
928 $this->ilias->raiseError($this->lng->txt(
"no_import_file_found")
929 , $this->ilias->error_obj->MESSAGE);
932 $_FILES[
"importFile"][
"name"], $full_path);
935 if (strtolower($parts[
"extension"]) ==
"zip")
942 foreach ($file_list as $a_file)
944 if (substr($a_file[
'entry'],-4) ==
'.xml')
946 $xml_file = $import_dir.
"/".$a_file[
'entry'];
950 if (is_null($xml_file))
952 $subdir = basename($parts[
"basename"],
".".$parts[
"extension"]);
953 $xml_file = $import_dir.
"/".$subdir.
"/".$subdir.
".xml";
959 $xml_file = $full_path;
963 if (!is_file($xml_file))
966 $this->ilias->raiseError($this->lng->txt(
"no_xml_file_found_in_zip")
967 .
" ".$subdir.
"/".$subdir.
".xml", $this->ilias->error_obj->MESSAGE);
970 require_once(
"./Services/User/classes/class.ilUserImportParser.php");
975 $importParser->startParsing();
976 switch ($importParser->getErrorLevel())
981 $this->tpl->setVariable(
"IMPORT_LOG", $importParser->getProtocolAsHTML($lng->txt(
"verification_warning_log")));
985 $this->ilias->raiseError(
986 $lng->txt(
"verification_failed").$importParser->getProtocolAsHTML($lng->txt(
"verification_failure_log")),
987 $this->ilias->error_obj->MESSAGE
994 $this->tpl->setCurrentBlock(
"role_selection_form");
995 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
996 $this->tpl->setVariable(
"TXT_IMPORT_USERS", $this->lng->txt(
"import_users"));
997 $this->tpl->setVariable(
"TXT_IMPORT_FILE", $this->lng->txt(
"import_file"));
998 $this->tpl->setVariable(
"IMPORT_FILE", $file_name);
999 $this->tpl->setVariable(
"TXT_USER_ELEMENT_COUNT", $this->lng->txt(
"num_users"));
1000 $this->tpl->setVariable(
"USER_ELEMENT_COUNT", $importParser->getUserCount());
1001 $this->tpl->setVariable(
"TXT_ROLE_ASSIGNMENT", $this->lng->txt(
"role_assignment"));
1002 $this->tpl->setVariable(
"BTN_IMPORT", $this->lng->txt(
"import"));
1003 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1004 $this->tpl->setVariable(
"XML_FILE_NAME", $xml_file);
1008 $importParser->startParsing();
1009 $roles = $importParser->getCollectedRoles();
1012 $all_gl_roles = $rbacreview->getRoleListByObject(ROLE_FOLDER_ID);
1013 $gl_roles = array();
1014 $roles_of_user = $rbacreview->assignedRoles($ilUser->getId());
1015 foreach ($all_gl_roles as $obj_data)
1026 if ($obj_data[
"obj_id"] != ANONYMOUS_ROLE_ID)
1029 if ($obj_data[
"obj_id"] != SYSTEM_ROLE_ID or in_array(SYSTEM_ROLE_ID,$roles_of_user))
1031 $gl_roles[$obj_data[
"obj_id"]] = $obj_data[
"title"];
1037 $got_globals =
false;
1038 foreach($roles as $role_id => $role)
1040 if ($role[
"type"] ==
"Global")
1044 $got_globals =
true;
1046 $this->tpl->setCurrentBlock(
"global_role_section");
1047 $this->tpl->setVariable(
"TXT_GLOBAL_ROLES_IMPORT", $this->lng->txt(
"roles_of_import_global"));
1048 $this->tpl->setVariable(
"TXT_GLOBAL_ROLES", $this->lng->txt(
"assign_global_role"));
1052 $pre_select = array_search($role[name], $gl_roles);
1055 switch($role[
"name"])
1057 case "Administrator":
1058 $pre_select = array_search(
"Administrator", $gl_roles);
1062 $pre_select = array_search(
"User", $gl_roles);
1066 $pre_select = array_search(
"User", $gl_roles);
1070 $pre_select = array_search(
"Guest", $gl_roles);
1074 $pre_select = array_search(
"User", $gl_roles);
1078 $this->tpl->setCurrentBlock(
"global_role");
1079 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $gl_roles,
false,
true);
1080 $this->tpl->setVariable(
"TXT_IMPORT_GLOBAL_ROLE", $role[
"name"].
" [".$role_id.
"]");
1081 $this->tpl->setVariable(
"SELECT_GLOBAL_ROLE", $role_select);
1082 $this->tpl->parseCurrentBlock();
1087 $got_locals =
false;
1088 foreach($roles as $role_id => $role)
1090 if ($role[
"type"] ==
"Local")
1099 $this->tpl->setCurrentBlock(
"local_role_section");
1100 $this->tpl->setVariable(
"TXT_LOCAL_ROLES_IMPORT", $this->lng->txt(
"roles_of_import_local"));
1101 $this->tpl->setVariable(
"TXT_LOCAL_ROLES", $this->lng->txt(
"assign_local_role"));
1112 $loc_roles = array();
1113 foreach($roles as $role_id => $role)
1115 if ($role[
"type"] ==
"Local")
1117 $searchName = (substr($role[
'name'],0,1) ==
'#') ? $role[
'name'] :
'#'.$role[
'name'];
1118 $matching_role_ids = $rbacreview->searchRolesByMailboxAddressList($searchName);
1119 foreach ($matching_role_ids as $mid) {
1120 if (! in_array($mid, $loc_roles)) {
1121 $loc_roles[] = $mid;
1130 $loc_roles = $rbacreview->getAssignableRolesInSubtree($this->object->getRefId());
1135 $l_roles_mailbox_searcharray = array();
1136 foreach ($loc_roles as $key => $loc_role)
1139 $rolf = $rbacreview->getFoldersAssignedToRole($loc_role,
true);
1145 if (!$rbacreview->isDeleted($rolf[0])
1146 && $rbacsystem->checkAccess(
'write',$tree->getParentId($rolf[0]))
1147 && $rolf[0] != ROLE_FOLDER_ID
1161 if ($this->tree->isInTree($rolf[0]))
1165 $tmpPath = $this->tree->getPathFull($rolf[0]);
1166 for ($i = 1,
$n = count($tmpPath) - 1; $i <
$n; $i++)
1172 if ($i < 3 || $i > $n - 3)
1176 else if ($i == 3 || $i == $n - 3)
1181 $isInSubtree |= $tmpPath[$i][
'obj_id'] == $this->
object->getId();
1186 $path =
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$loc_role.
")</b>";
1188 $roleMailboxAddress = $rbacreview->getRoleMailboxAddress($loc_role);
1189 $l_roles[$loc_role] = $roleMailboxAddress.
', '.
$path;
1194 natcasesort($l_roles);
1195 $l_roles[
""] = $this->lng->txt(
"usrimport_ignore_role");
1196 foreach($roles as $role_id => $role)
1198 if ($role[
"type"] ==
"Local")
1200 $this->tpl->setCurrentBlock(
"local_role");
1201 $this->tpl->setVariable(
"TXT_IMPORT_LOCAL_ROLE", $role[
"name"]);
1202 $searchName = (substr($role[
'name'],0,1) ==
'#') ? $role[
'name'] :
'#'.$role[
'name'];
1203 $matching_role_ids = $rbacreview->searchRolesByMailboxAddressList($searchName);
1204 $pre_select = count($matching_role_ids) == 1 ? $matching_role_ids[0] :
"";
1209 $selectable_roles = array();
1210 $selectable_roles[
""] = $this->lng->txt(
"usrimport_ignore_role");
1211 foreach ($matching_role_ids as $id)
1213 $selectable_roles[$id] = $l_roles[$id];
1215 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $selectable_roles,
false,
true);
1217 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $l_roles,
false,
true);
1219 $this->tpl->setVariable(
"SELECT_LOCAL_ROLE", $role_select);
1220 $this->tpl->parseCurrentBlock();
1226 $this->tpl->setVariable(
"TXT_CONFLICT_HANDLING", $lng->txt(
"conflict_handling"));
1231 $this->tpl->setVariable(
"TXT_CONFLICT_HANDLING_INFO", str_replace(
'\n',
'<br>',$this->lng->txt(
"usrimport_conflict_handling_info")));
1232 $this->tpl->setVariable(
"TXT_CONFLICT_CHOICE", $lng->txt(
"conflict_handling"));
1236 $this->lng->loadLanguageModule(
"mail");
1237 include_once
'./Services/User/classes/class.ilObjUserFolder.php';
1239 if (trim($amail[
"body"]) !=
"" && trim($amail[
"subject"]) !=
"")
1241 $this->tpl->setCurrentBlock(
"inform_user");
1242 $this->tpl->setVariable(
"TXT_ACCOUNT_MAIL", $lng->txt(
"mail_account_mail"));
1245 $this->tpl->setVariable(
"SEND_MAIL",
" checked=\"checked\"");
1247 $this->tpl->setVariable(
"TXT_INFORM_USER_MAIL",
1248 $this->lng->txt(
"user_send_new_account_mail"));
1249 $this->tpl->parseCurrentBlock();
1254 $this->form->setValuesByPost();
1255 $tpl->setContent($this->form->getHtml());
1267 if (
$_GET[
"baseClass"] ==
'ilRepositoryGUI')
1269 $this->tabs_gui->clearTargets();
1272 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
1273 include_once
'./Services/User/classes/class.ilUserImportParser.php';
1275 global $rbacreview, $rbacsystem,
$tree,
$lng;
1277 switch (
$_POST[
"conflict_handling_choice"])
1279 case "update_on_conflict" :
1282 case "ignore_on_conflict" :
1294 if (
$_POST[
"role_assign"])
1296 $global_roles = $rbacreview->getGlobalRoles();
1297 $roles_of_user = $rbacreview->assignedRoles($ilUser->getId());
1298 foreach (
$_POST[
"role_assign"] as $role_id)
1302 if (in_array($role_id, $global_roles))
1304 if(!in_array(SYSTEM_ROLE_ID,$roles_of_user))
1306 if ($role_id == SYSTEM_ROLE_ID && ! in_array(SYSTEM_ROLE_ID,$roles_of_user)
1312 $this->ilias->raiseError($this->lng->txt(
"usrimport_with_specified_role_not_permitted"),
1313 $this->ilias->error_obj->MESSAGE);
1319 $rolf = $rbacreview->getFoldersAssignedToRole($role_id,
true);
1320 if ($rbacreview->isDeleted($rolf[0])
1321 || ! $rbacsystem->checkAccess(
'write',$tree->getParentId($rolf[0])))
1324 $this->ilias->raiseError($this->lng->txt(
"usrimport_with_specified_role_not_permitted"),
1325 $this->ilias->error_obj->MESSAGE);
1333 $importParser->setRoleAssignment(
$_POST[
"role_assign"]);
1334 $importParser->startParsing();
1339 switch ($importParser->getErrorLevel())
1345 ilUtil::sendInfo($this->lng->txt(
"user_imported_with_warnings").$importParser->getProtocolAsHTML($lng->txt(
"import_warning_log")),
true);
1348 $this->ilias->raiseError(
1349 $this->lng->txt(
"user_import_failed")
1350 .$importParser->getProtocolAsHTML($lng->txt(
"import_failure_log")),
1351 $this->ilias->error_obj->MESSAGE
1356 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
1358 $this->ctrl->redirect($this,
"view");
1363 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1370 global $rbacsystem,
$ilias;
1374 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
1376 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1379 if(!count($app_users =& $ilias->account->getAppliedUsers()))
1386 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_applied_users.html",
"Services/User");
1387 $this->lng->loadLanguageModule(
'crs');
1390 foreach($app_users as
$usr_id)
1395 $f_result[$counter][] = $tmp_user->getLogin();
1396 $f_result[$counter][] = $tmp_user->getFirstname();
1397 $f_result[$counter][] = $tmp_user->getLastname();
1399 if($tmp_user->getTimeLimitUnlimited())
1401 $f_result[$counter][] =
"<b>".$this->lng->txt(
'crs_unlimited').
"</b>";
1405 $limit =
"<b>".$this->lng->txt(
'crs_from').
'</b> '.strftime(
"%Y-%m-%d %R",$tmp_user->getTimeLimitFrom()).
'<br />';
1406 $limit .=
"<b>".$this->lng->txt(
'crs_to').
'</b> '.strftime(
"%Y-%m-%d %R",$tmp_user->getTimeLimitUntil());
1408 $f_result[$counter][] = $limit;
1422 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
1424 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
1427 $this->lng->loadLanguageModule(
'crs');
1431 if(!isset(
$_SESSION[
'error_post_vars']))
1433 ilUtil::sendInfo($this->lng->txt(
'time_limit_add_time_limit_for_selected'));
1436 if(!count(
$_POST[
"users"]))
1452 $title .= $tmp_user->getLogin();
1455 if(strlen($title) > 79)
1457 $title = substr($title,0,80);
1462 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_edit_applied_users.html",
"Services/User");
1463 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1466 $time_limit_unlimited =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_unlimited"] ?
1469 $time_limit_start =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_start"] ?
1472 $time_limit_end =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_end"] ?
1478 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
"obj_usr"));
1480 $this->tpl->setVariable(
"TITLE",$title);
1481 $this->tpl->setVariable(
"TXT_TIME_LIMIT",$this->lng->txt(
"time_limit"));
1482 $this->tpl->setVariable(
"TXT_TIME_LIMIT_START",$this->lng->txt(
"crs_start"));
1483 $this->tpl->setVariable(
"TXT_TIME_LIMIT_END",$this->lng->txt(
"crs_end"));
1484 $this->tpl->setVariable(
"CMD_SUBMIT",
"updateAppliedUsers");
1485 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
"cancel"));
1486 $this->tpl->setVariable(
"TXT_SUBMIT",$this->lng->txt(
"submit"));
1490 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_DAY",$this->
__getDateSelect(
"day",
"au[time_limit_start][day]",
1491 date(
"d",$time_limit_start)));
1492 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_MONTH",$this->
__getDateSelect(
"month",
"au[time_limit_start][month]",
1493 date(
"m",$time_limit_start)));
1494 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_YEAR",$this->
__getDateSelect(
"year",
"au[time_limit_start][year]",
1495 date(
"Y",$time_limit_start)));
1496 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_HOUR",$this->
__getDateSelect(
"hour",
"au[time_limit_start][hour]",
1497 date(
"G",$time_limit_start)));
1498 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_MINUTE",$this->
__getDateSelect(
"minute",
"au[time_limit_start][minute]",
1499 date(
"i",$time_limit_start)));
1500 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_DAY",$this->
__getDateSelect(
"day",
"au[time_limit_end][day]",
1501 date(
"d",$time_limit_end)));
1502 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_MONTH",$this->
__getDateSelect(
"month",
"au[time_limit_end][month]",
1503 date(
"m",$time_limit_end)));
1504 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_YEAR",$this->
__getDateSelect(
"year",
"au[time_limit_end][year]",
1505 date(
"Y",$time_limit_end)));
1506 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_HOUR",$this->
__getDateSelect(
"hour",
"au[time_limit_end][hour]",
1507 date(
"G",$time_limit_end)));
1508 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_MINUTE",$this->
__getDateSelect(
"minute",
"au[time_limit_end][minute]",
1509 date(
"i",$time_limit_end)));
1510 if($this->ilias->account->getTimeLimitUnlimited())
1512 $this->tpl->setVariable(
"ROWSPAN",3);
1513 $this->tpl->setCurrentBlock(
"unlimited");
1514 $this->tpl->setVariable(
"TXT_TIME_LIMIT_UNLIMITED",$this->lng->txt(
"crs_unlimited"));
1515 $this->tpl->setVariable(
"TIME_LIMIT_UNLIMITED",
ilUtil::formCheckbox($time_limit_unlimited,
"au[time_limit_unlimited]",1));
1516 $this->tpl->parseCurrentBlock();
1520 $this->tpl->setVariable(
"ROWSPAN",2);
1528 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
1530 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
1536 if(!
$_POST[
'au'][
'time_limit_unlimited'])
1547 #if(!$this->ilias->account->getTimeLimitUnlimited())
1549 # if($start < $this->ilias->account->getTimeLimitFrom() or
1550 # $end > $this->ilias->account->getTimeLimitUntil())
1552 # $_SESSION['error_post_vars'] = $_POST;
1553 # ilUtil::sendInfo($this->lng->txt('time_limit_not_within_owners'));
1554 # $this->editAppliedUsersObject();
1564 $tmp_user->setTimeLimitUnlimited((
int)
$_POST[
'au'][
'time_limit_unlimited']);
1565 $tmp_user->setTimeLimitFrom($start);
1566 $tmp_user->setTimeLimitUntil($end);
1567 $tmp_user->setTimeLimitMessage(0);
1568 $tmp_user->update();
1583 $tpl =& $tbl->getTemplateObject();
1586 $tpl->setCurrentBlock(
"tbl_form_header");
1588 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1589 $tpl->parseCurrentBlock();
1591 $tpl->setCurrentBlock(
"tbl_action_btn");
1592 $tpl->setVariable(
"BTN_NAME",
'editAppliedUsers');
1593 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
'edit'));
1594 $tpl->parseCurrentBlock();
1596 $tpl->setCurrentBlock(
"tbl_action_row");
1597 $tpl->setVariable(
"COLUMN_COUNTS",5);
1599 $tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
1600 $tpl->parseCurrentBlock();
1604 $tbl->setTitle($this->lng->txt(
"time_limit_applied_users"),
"icon_usr_b.png",$this->lng->txt(
"users"));
1605 $tbl->setHeaderNames(array(
'',
1606 $this->lng->txt(
"login"),
1607 $this->lng->txt(
"firstname"),
1608 $this->lng->txt(
"lastname"),
1609 $this->lng->txt(
"time_limits")));
1610 $header_params = $this->ctrl->getParameterArray($this,
"appliedUsers");
1611 $tbl->setHeaderVars(array(
"",
1616 array($header_params));
1617 $tbl->setColumnWidth(array(
"3%",
"19%",
"19%",
"19%",
"40%"));
1623 $this->tpl->setVariable(
"APPLIED_USERS",$tbl->tpl->get());
1630 include_once
"./Services/Table/classes/class.ilTableGUI.php";
1637 $offset =
$_GET[
"offset"];
1638 $order =
$_GET[
"sort_by"];
1639 $direction =
$_GET[
"sort_order"];
1642 $tbl->setOrderColumn($order);
1643 $tbl->setOrderDirection($direction);
1644 $tbl->setOffset($offset);
1645 $tbl->setLimit(
$_GET[
"limit"]);
1646 $tbl->setMaxCount(count($result_set));
1647 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1648 $tbl->setData($result_set);
1656 for($i=0;$i<=60;$i++)
1658 $days[$i] = $i < 10 ?
"0".$i : $i;
1663 for($i=0;$i<24;$i++)
1665 $days[$i] = $i < 10 ?
"0".$i : $i;
1670 for($i=1;$i<32;$i++)
1672 $days[$i] = $i < 10 ?
"0".$i : $i;
1677 for($i=1;$i<13;$i++)
1679 $month[$i] = $i < 10 ?
"0".$i : $i;
1684 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
1693 return mktime($a_time_arr[
"hour"],
1694 $a_time_arr[
"minute"],
1695 $a_time_arr[
"second"],
1696 $a_time_arr[
"month"],
1698 $a_time_arr[
"year"]);
1717 include_once
'./Services/User/classes/class.ilUserAccountSettings.php';
1720 $show_blocking_time_in_days = $ilSetting->get(
'loginname_change_blocking_time') / 86400;
1721 $show_blocking_time_in_days = (float)$show_blocking_time_in_days;
1723 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
1726 $this->form->setValuesByArray(
1728 'lua' => $aset->isLocalUserAdministrationEnabled(),
1729 'lrua' => $aset->isUserAccessRestricted(),
1730 'allow_change_loginname' => (bool)$ilSetting->get(
'allow_change_loginname'),
1731 'create_history_loginname' => (bool)$ilSetting->get(
'create_history_loginname'),
1732 'reuse_of_loginnames' => (bool)$ilSetting->get(
'reuse_of_loginnames'),
1733 'loginname_change_blocking_time' => (float)$show_blocking_time_in_days,
1734 'user_adm_alpha_nav' => (
int)$ilSetting->get(
'user_adm_alpha_nav'),
1736 'user_reactivate_code' => (int)$ilSetting->get(
'user_reactivate_code'),
1737 'user_own_account' => (int)$ilSetting->get(
'user_delete_own_account'),
1738 'user_own_account_email' => $ilSetting->get(
'user_delete_own_account_email'),
1741 'session_reminder_enabled' => $ilSetting->get(
'session_reminder_enabled'),
1747 'passwd_auto_generate' => (bool)$ilSetting->get(
"passwd_auto_generate"),
1748 'password_change_on_first_login_enabled' => $security->isPasswordChangeOnFirstLoginEnabled() ? 1 : 0,
1749 'password_must_not_contain_loginame' => $security->getPasswordMustNotContainLoginnameStatus() ? 1 : 0,
1750 'password_chars_and_numbers_enabled' => $security->isPasswordCharsAndNumbersEnabled() ? 1 : 0,
1751 'password_special_chars_enabled' => $security->isPasswordSpecialCharsEnabled() ? 1 : 0 ,
1752 'password_min_length' => $security->getPasswordMinLength(),
1753 'password_max_length' => $security->getPasswordMaxLength(),
1754 'password_ucase_chars_num' => $security->getPasswordNumberOfUppercaseChars(),
1755 'password_lowercase_chars_num' => $security->getPasswordNumberOfLowercaseChars(),
1756 'password_max_age' => $security->getPasswordMaxAge(),
1758 'login_max_attempts' => $security->getLoginMaxAttempts(),
1759 'ps_prevent_simultaneous_logins' => (int)$security->isPreventionOfSimultaneousLoginsEnabled(),
1760 'password_assistance' => (bool)$ilSetting->get(
"password_assistance")
1764 $this->tpl->setContent($this->form->getHTML());
1777 if($this->form->checkInput())
1781 if(!strlen($this->form->getInput(
'loginname_change_blocking_time')))
1784 $this->form->getItemByPostVar(
'loginname_change_blocking_time')
1785 ->setAlert($this->lng->txt(
'loginname_change_blocking_time_invalidity_info'));
1788 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
1792 $security->setPasswordCharsAndNumbersEnabled((
bool)
$_POST[
"password_chars_and_numbers_enabled"]);
1793 $security->setPasswordSpecialCharsEnabled((
bool) $_POST[
"password_special_chars_enabled"]);
1794 $security->setPasswordMinLength((
int) $_POST[
"password_min_length"]);
1795 $security->setPasswordMaxLength((
int) $_POST[
"password_max_length"]);
1796 $security->setPasswordNumberOfUppercaseChars((
int) $_POST[
'password_ucase_chars_num']);
1797 $security->setPasswordNumberOfLowercaseChars((
int) $_POST[
'password_lowercase_chars_num']);
1798 $security->setPasswordMaxAge((
int) $_POST[
"password_max_age"]);
1799 $security->setLoginMaxAttempts((
int) $_POST[
"login_max_attempts"]);
1800 $security->setPreventionOfSimultaneousLogins((
bool)$_POST[
'ps_prevent_simultaneous_logins']);
1801 $security->setPasswordChangeOnFirstLoginEnabled((
bool) $_POST[
'password_change_on_first_login_enabled']);
1802 $security->setPasswordMustNotContainLoginnameStatus((
int) $_POST[
'password_must_not_contain_loginame']);
1804 if(!$security->validate($this->form))
1813 include_once
'./Services/User/classes/class.ilUserAccountSettings.php';
1818 $ilSetting->set(
'allow_change_loginname', (
int)$this->form->getInput(
'allow_change_loginname'));
1819 $ilSetting->set(
'create_history_loginname', (
int)$this->form->getInput(
'create_history_loginname'));
1820 $ilSetting->set(
'reuse_of_loginnames', (
int)$this->form->getInput(
'reuse_of_loginnames'));
1821 $save_blocking_time_in_seconds = (int)($this->form->getInput(
'loginname_change_blocking_time') * 86400);
1822 $ilSetting->set(
'loginname_change_blocking_time', (
int)$save_blocking_time_in_seconds);
1823 $ilSetting->set(
'user_adm_alpha_nav', (
int)$this->form->getInput(
'user_adm_alpha_nav'));
1824 $ilSetting->set(
'user_reactivate_code', (
int)$this->form->getInput(
'user_reactivate_code'));
1826 $ilSetting->set(
'user_delete_own_account', (
int)$this->form->getInput(
'user_own_account'));
1827 $ilSetting->set(
'user_delete_own_account_email', $this->form->getInput(
'user_own_account_email'));
1829 $ilSetting->set(
"passwd_auto_generate", $this->form->getInput(
"passwd_auto_generate"));
1830 $ilSetting->set(
"password_assistance", $this->form->getInput(
"password_assistance"));
1833 $ilSetting->set(
'session_handling_type',
1834 (
int)$this->form->getInput(
'session_handling_type'));
1838 $ilSetting->set(
'session_reminder_enabled',
1839 $this->form->getInput(
'session_reminder_enabled'));
1843 require_once
'Services/Authentication/classes/class.ilSessionControl.php';
1845 $ilSetting->get(
'session_allow_client_maintenance',
1850 include_once
"Services/Authentication/classes/class.ilSessionStatistics.php";
1853 $ilSetting->set(
'session_max_count',
1854 (
int)$this->form->getInput(
'session_max_count'));
1855 $ilSetting->set(
'session_min_idle',
1856 (
int)$this->form->getInput(
'session_min_idle'));
1857 $ilSetting->set(
'session_max_idle',
1858 (
int)$this->form->getInput(
'session_max_idle'));
1859 $ilSetting->set(
'session_max_idle_after_first_request',
1860 (
int)$this->form->getInput(
'session_max_idle_after_first_request'));
1876 $this->form->setValuesByPost();
1877 $this->tpl->setContent($this->form->getHTML());
1890 $this->tabs_gui->setTabActive(
'settings');
1891 $this->tabs_gui->setSubTabActive(
'general_settings');
1893 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1895 $this->form->setFormAction($this->ctrl->getFormAction($this,
'saveGeneralSettings'));
1897 $this->form->setTitle($this->lng->txt(
'general_settings'));
1899 $lua =
new ilCheckboxInputGUI($this->lng->txt(
'enable_local_user_administration'),
'lua');
1900 $lua->
setInfo($this->lng->txt(
'enable_local_user_administration_info'));
1902 $this->form->addItem($lua);
1905 $lrua->
setInfo($this->lng->txt(
'restrict_user_access_info'));
1907 $this->form->addItem($lrua);
1910 $alph =
new ilCheckboxInputGUI($this->lng->txt(
'user_adm_enable_alpha_nav'),
'user_adm_alpha_nav');
1913 $this->form->addItem($alph);
1916 $code =
new ilCheckboxInputGUI($this->lng->txt(
"user_account_code_setting"),
"user_reactivate_code");
1917 $code->
setInfo($this->lng->txt(
'user_account_code_setting_info'));
1918 $this->form->addItem($code);
1921 $own =
new ilCheckboxInputGUI($this->lng->txt(
"user_allow_delete_own_account"),
"user_own_account");
1922 $this->form->addItem($own);
1923 $own_email =
new ilEMailInputGUI($this->lng->txt(
"user_delete_own_account_notification_email"),
"user_own_account_email");
1924 $own->addSubItem($own_email);
1936 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"session_reminder"),
"session_reminder_enabled");
1939 $cb->
setInfo($this->lng->txt(
"session_reminder_info").
"<br />".
1940 sprintf($this->lng->txt(
'session_reminder_session_duration'), $time));
1944 $ssettings->addOption($fixed);
1950 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
1954 $sub_ti =
new ilTextInputGUI($this->lng->txt(
'session_max_count'),
'session_max_count');
1956 $sub_ti->setSize(5);
1957 $sub_ti->setInfo($this->lng->txt(
'session_max_count_info'));
1959 $sub_ti->setDisabled(
true);
1960 $ldsh->addSubItem($sub_ti);
1965 $sub_ti =
new ilTextInputGUI($this->lng->txt(
'session_min_idle'),
'session_min_idle');
1967 $sub_ti->setSize(5);
1968 $sub_ti->setInfo($this->lng->txt(
'session_min_idle_info'));
1970 $sub_ti->setDisabled(
true);
1971 $ldsh->addSubItem($sub_ti);
1976 $sub_ti =
new ilTextInputGUI($this->lng->txt(
'session_max_idle'),
'session_max_idle');
1978 $sub_ti->setSize(5);
1979 $sub_ti->setInfo($this->lng->txt(
'session_max_idle_info'));
1981 $sub_ti->setDisabled(
true);
1982 $ldsh->addSubItem($sub_ti);
1987 $this->lng->txt(
'session_max_idle_after_first_request'),
1988 'session_max_idle_after_first_request'
1991 $sub_ti->setSize(5);
1992 $sub_ti->setInfo($this->lng->txt(
'session_max_idle_after_first_request_info'));
1994 $sub_ti->setDisabled(
true);
1995 $ldsh->addSubItem($sub_ti);
1998 $ssettings->addOption($ldsh);
2005 $this->form->addItem($ssettings);
2012 $ti->
setValue($this->lng->txt(
'session_config_maintenance_disabled'));
2013 $ssettings->setDisabled(
true);
2014 $ti->addSubItem($ssettings);
2015 $this->form->addItem($ti);
2021 $this->lng->loadLanguageModule(
'ps');
2024 $pass->setTitle($this->lng->txt(
'ps_password_settings'));
2025 $this->form->addItem(
$pass);
2028 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"passwd_generation_pre"),
"passwd_auto_generate");
2029 $cb->setChecked($ilSetting->get(
"passwd_auto_generate"));
2030 $cb->
setInfo($this->lng->txt(
"passwd_generation_info"));
2031 $this->form->addItem($cb);
2033 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_change_on_first_login_enabled'),
'password_change_on_first_login_enabled');
2034 $check->
setInfo($this->lng->txt(
'ps_password_change_on_first_login_enabled_info'));
2035 $this->form->addItem($check);
2037 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
2039 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_must_not_contain_loginame'),
'password_must_not_contain_loginame');
2040 $check->
setInfo($this->lng->txt(
'ps_password_must_not_contain_loginame_info'));
2041 $this->form->addItem($check);
2043 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_chars_and_numbers_enabled'),
'password_chars_and_numbers_enabled');
2045 $check->
setInfo($this->lng->txt(
'ps_password_chars_and_numbers_enabled_info'));
2046 $this->form->addItem($check);
2048 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_special_chars_enabled'),
'password_special_chars_enabled');
2050 $check->
setInfo($this->lng->txt(
'ps_password_special_chars_enabled_info'));
2051 $this->form->addItem($check);
2053 $text =
new ilNumberInputGUI($this->lng->txt(
'ps_password_min_length'),
'password_min_length');
2054 $text->
setInfo($this->lng->txt(
'ps_password_min_length_info'));
2056 $text->setMaxLength(2);
2057 $this->form->addItem($text);
2059 $text =
new ilNumberInputGUI($this->lng->txt(
'ps_password_max_length'),
'password_max_length');
2060 $text->
setInfo($this->lng->txt(
'ps_password_max_length_info'));
2062 $text->setMaxLength(3);
2063 $this->form->addItem($text);
2065 $text =
new ilNumberInputGUI($this->lng->txt(
'ps_password_uppercase_chars_num'),
'password_ucase_chars_num');
2066 $text->
setInfo($this->lng->txt(
'ps_password_uppercase_chars_num_info'));
2067 $text->setMinValue(0);
2069 $text->setMaxLength(3);
2070 $this->form->addItem($text);
2072 $text =
new ilNumberInputGUI($this->lng->txt(
'ps_password_lowercase_chars_num'),
'password_lowercase_chars_num');
2073 $text->
setInfo($this->lng->txt(
'ps_password_lowercase_chars_num_info'));
2074 $text->setMinValue(0);
2076 $text->setMaxLength(3);
2077 $this->form->addItem($text);
2079 $text =
new ilNumberInputGUI($this->lng->txt(
'ps_password_max_age'),
'password_max_age');
2080 $text->
setInfo($this->lng->txt(
'ps_password_max_age_info'));
2082 $text->setMaxLength(3);
2083 $this->form->addItem($text);
2086 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"enable_password_assistance"),
"password_assistance");
2087 $cb->
setInfo($this->lng->txt(
"password_assistance_info"));
2088 $this->form->addItem($cb);
2091 $pass->setTitle($this->lng->txt(
'ps_security_protection'));
2092 $this->form->addItem(
$pass);
2094 $text =
new ilNumberInputGUI($this->lng->txt(
'ps_login_max_attempts'),
'login_max_attempts');
2095 $text->
setInfo($this->lng->txt(
'ps_login_max_attempts_info'));
2097 $text->setMaxLength(2);
2098 $this->form->addItem($text);
2101 $objCb =
new ilCheckboxInputGUI($this->lng->txt(
'ps_prevent_simultaneous_logins'),
'ps_prevent_simultaneous_logins');
2103 $objCb->setInfo($this->lng->txt(
'ps_prevent_simultaneous_logins_info'));
2104 $this->form->addItem($objCb);
2110 $log->setTitle($this->lng->txt(
'loginname_settings'));
2111 $this->form->addItem(
$log);
2113 $chbChangeLogin =
new ilCheckboxInputGUI($this->lng->txt(
'allow_change_loginname'),
'allow_change_loginname');
2115 $this->form->addItem($chbChangeLogin);
2116 $chbCreateHistory =
new ilCheckboxInputGUI($this->lng->txt(
'history_loginname'),
'create_history_loginname');
2117 $chbCreateHistory->
setInfo($this->lng->txt(
'loginname_history_info'));
2118 $chbCreateHistory->setValue(1);
2120 $chbChangeLogin->addSubItem($chbCreateHistory);
2121 $chbReuseLoginnames =
new ilCheckboxInputGUI($this->lng->txt(
'reuse_of_loginnames_contained_in_history'),
'reuse_of_loginnames');
2123 $chbReuseLoginnames->setInfo($this->lng->txt(
'reuse_of_loginnames_contained_in_history_info'));
2125 $chbChangeLogin->addSubItem($chbReuseLoginnames);
2126 $chbChangeBlockingTime =
new ilNumberInputGUI($this->lng->txt(
'loginname_change_blocking_time'),
'loginname_change_blocking_time');
2128 $chbChangeBlockingTime->setSuffix($this->lng->txt(
'days'));
2129 $chbChangeBlockingTime->setInfo($this->lng->txt(
'loginname_change_blocking_time_info'));
2130 $chbChangeBlockingTime->setSize(10);
2131 $chbChangeBlockingTime->setMaxLength(10);
2132 $chbChangeLogin->addSubItem($chbChangeBlockingTime);
2134 $this->form->addCommandButton(
'saveGeneralSettings', $this->lng->txt(
'save'));
2154 include_once
'Services/Search/classes/class.ilUserSearchOptions.php';
2155 $lng->loadLanguageModule(
"administration");
2156 $lng->loadLanguageModule(
"mail");
2158 $ilTabs->activateTab(
'settings');
2159 $ilTabs->activateSubTab(
'standard_fields');
2161 include_once(
"./Services/User/classes/class.ilUserFieldSettingsTableGUI.php");
2163 if($this->confirm_change)
$tab->setConfirmChange();
2164 $tpl->setContent(
$tab->getHTML());
2174 include_once
'Services/Search/classes/class.ilUserSearchOptions.php';
2175 include_once
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
2180 include_once(
"./Services/User/classes/class.ilUserProfile.php");
2182 $up->skipField(
"username");
2183 $field_properties = $up->getStandardFields();
2184 $profile_fields = array_keys($field_properties);
2187 foreach ($profile_fields as $field)
2189 if (
$_POST[
"chb"][
"required_".$field] &&
2190 !(
int)
$_POST[
'chb'][
'visib_reg_' . $field]
2201 $this->confirm_change = 1;
2207 $fixed_required_fields = array(
2214 "hits_per_page" => 0,
2215 "show_users_online" => 0,
2216 "hide_own_online_status" => 0
2221 if ($privacy->enabledCourseExport() ==
true &&
2222 $privacy->courseConfirmationRequired() ==
true &&
2225 foreach ($profile_fields as $field)
2227 if (! $ilias->getSetting(
"usr_settings_course_export_" . $field) &&
$_POST[
"chb"][
"course_export_" . $field] ==
"1")
2229 #ilUtil::sendQuestion($this->lng->txt('confirm_message_course_export'));
2230 #$this->confirm_change = 1;
2231 #$this->settingsObject();
2237 if($action ==
'save')
2239 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
2243 foreach ($profile_fields as $field)
2251 if (!
$_POST[
"chb"][
"visible_".$field] && !$field_properties[$field][
"visible_hide"])
2253 $ilias->setSetting(
"usr_settings_hide_".$field,
"1");
2257 $ilias->deleteSetting(
"usr_settings_hide_".$field);
2260 if (!
$_POST[
"chb"][
"changeable_" . $field] && !$field_properties[$field][
"changeable_hide"])
2262 $ilias->setSetting(
"usr_settings_disable_".$field,
"1");
2266 $ilias->deleteSetting(
"usr_settings_disable_".$field);
2270 if ((
int)
$_POST[
'chb'][
'visib_reg_' . $field] && !$field_properties[$field][
"visib_reg_hide"])
2272 $ilSetting->set(
'usr_settings_visib_reg_'.$field,
'1');
2276 $ilSetting->set(
'usr_settings_visib_reg_'.$field,
'0');
2279 if ((
int)
$_POST[
'chb'][
'visib_lua_' . $field])
2282 $ilSetting->set(
'usr_settings_visib_lua_'.$field,
'1');
2286 $ilSetting->set(
'usr_settings_visib_lua_'.$field,
'0');
2289 if ((
int)
$_POST[
'chb'][
'changeable_lua_' . $field])
2292 $ilSetting->set(
'usr_settings_changeable_lua_'.$field,
'1');
2296 $ilSetting->set(
'usr_settings_changeable_lua_'.$field,
'0');
2299 if (
$_POST[
"chb"][
"export_" . $field] && !$field_properties[$field][
"export_hide"])
2301 $ilias->setSetting(
"usr_settings_export_".$field,
"1");
2305 $ilias->deleteSetting(
"usr_settings_export_".$field);
2309 if (
$_POST[
"chb"][
"course_export_" . $field] && !$field_properties[$field][
"course_export_hide"])
2311 $ilias->setSetting(
"usr_settings_course_export_".$field,
"1");
2315 $ilias->deleteSetting(
"usr_settings_course_export_".$field);
2319 if (
$_POST[
"chb"][
"group_export_" . $field] && !$field_properties[$field][
"group_export_hide"])
2321 $ilias->setSetting(
"usr_settings_group_export_".$field,
"1");
2325 $ilias->deleteSetting(
"usr_settings_group_export_".$field);
2328 $is_fixed = array_key_exists($field, $fixed_required_fields);
2329 if ($is_fixed && $fixed_required_fields[$field] || ! $is_fixed &&
$_POST[
"chb"][
"required_".$field])
2331 $ilias->setSetting(
"require_".$field,
"1");
2335 $ilias->deleteSetting(
"require_" . $field);
2339 if (
$_POST[
"select"][
"default_hits_per_page"])
2341 $ilias->setSetting(
"hits_per_page",
$_POST[
"select"][
"default_hits_per_page"]);
2344 if (
$_POST[
"select"][
"default_show_users_online"])
2346 $ilias->setSetting(
"show_users_online",
$_POST[
"select"][
"default_show_users_online"]);
2349 if (
$_POST[
"chb"][
"export_preferences"])
2351 $ilias->setSetting(
"usr_settings_export_preferences",
$_POST[
"chb"][
"export_preferences"]);
2353 $ilias->deleteSetting(
"usr_settings_export_preferences");
2356 $ilias->setSetting(
'mail_incoming_mail', (
int)
$_POST[
'select'][
'default_mail_incoming_mail']);
2368 $action[-1] = $this->lng->txt(
'all_users');
2369 $action[1] = $this->lng->txt(
'usr_active_only');
2370 $action[0] = $this->lng->txt(
'usr_inactive_only');
2371 $action[2] = $this->lng->txt(
'usr_limited_access_only');
2372 $action[3] = $this->lng->txt(
'usr_without_courses');
2373 $action[4] = $this->lng->txt(
'usr_filter_lastlogin');
2374 $action[5] = $this->lng->txt(
"usr_filter_coursemember");
2375 $action[6] = $this->lng->txt(
"usr_filter_groupmember");
2376 $action[7] = $this->lng->txt(
"usr_filter_role");
2389 if(!isset(
$_POST[
"file"]))
2391 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2394 if (count(
$_POST[
"file"]) > 1)
2396 $this->ilias->raiseError($this->lng->txt(
"select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2401 $export_dir = $this->
object->getExportDirectory();
2410 if(!isset(
$_POST[
"file"]))
2412 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2416 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
2418 $cgui->setFormAction($this->ctrl->getFormAction($this));
2419 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
2420 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelDeleteExportFile");
2421 $cgui->setConfirm($this->lng->txt(
"confirm"),
"deleteExportFile");
2429 $cgui->addItem(
"file[]", $file, $caption);
2432 $this->tpl->setContent($cgui->getHTML());
2441 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
2450 $export_dir = $this->
object->getExportDirectory();
2453 $file = basename($file);
2455 $exp_file = $export_dir.
"/".
$file;
2456 if (@is_file($exp_file))
2461 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
2478 if (
$_POST[
"cmd"][
"export"])
2480 $this->
object->buildExportFile(
$_POST[
"export_type"]);
2481 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
2485 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_export.html',
'Services/User');
2487 $export_types = array(
2488 "userfolder_export_excel_x86",
2489 "userfolder_export_csv",
2490 "userfolder_export_xml"
2494 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
2498 $this->tpl->addBlockfile(
"EXPORT_FILES",
"export_files",
"tpl.table.html");
2501 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.usr_export_file_row.html",
"Services/User");
2505 $tbl->setTitle($this->lng->txt(
"userfolder_export_files"));
2507 $tbl->setHeaderNames(array(
"", $this->lng->txt(
"userfolder_export_file"),
2508 $this->lng->txt(
"userfolder_export_file_size"), $this->lng->txt(
"date") ));
2509 $tbl->setHeaderVars(array(), $ilCtrl->getParameterArray($this,
"export"));
2511 $tbl->enabled[
"sort"] =
false;
2512 $tbl->setColumnWidth(array(
"1%",
"49%",
"25%",
"25%"));
2515 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
2516 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
2517 $tbl->setLimit(
$_GET[
"limit"]);
2518 $tbl->setOffset(
$_GET[
"offset"]);
2519 $tbl->setMaxCount($this->maxcount);
2522 $this->tpl->setVariable(
"COLUMN_COUNTS", 4);
2526 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
2527 $this->tpl->setCurrentBlock(
"tbl_action_btn");
2528 $this->tpl->setVariable(
"BTN_NAME",
"confirmDeleteExportFile");
2529 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
2530 $this->tpl->parseCurrentBlock();
2532 $this->tpl->setCurrentBlock(
"tbl_action_btn");
2533 $this->tpl->setVariable(
"BTN_NAME",
"downloadExportFile");
2534 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"download"));
2535 $this->tpl->parseCurrentBlock();
2538 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
2541 $export_files = $this->
object->getExportFiles();
2543 $tbl->setMaxCount(count($export_files));
2544 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
2548 if(count($export_files) > 0)
2551 foreach($export_files as $exp_file)
2553 $this->tpl->setCurrentBlock(
"tbl_content");
2554 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"filename"]);
2557 $this->tpl->setVariable(
"CSS_ROW", $css_row);
2559 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"filesize"]);
2560 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"filename"]);
2562 $file_arr = explode(
"__", $exp_file[
"filename"]);
2565 $this->tpl->parseCurrentBlock();
2568 $this->tpl->setCurrentBlock(
"selectall");
2569 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
2570 $this->tpl->setVariable(
"CSS_ROW", $css_row);
2571 $this->tpl->parseCurrentBlock();
2584 $this->tpl->parseCurrentBlock();
2587 foreach ($export_types as $export_type)
2589 $this->tpl->setCurrentBlock(
"option");
2590 $this->tpl->setVariable(
"OPTION_VALUE", $export_type);
2591 $this->tpl->setVariable(
"OPTION_TEXT", $this->lng->txt($export_type));
2592 $this->tpl->parseCurrentBlock();
2595 $this->tpl->setVariable(
"EXPORT_BUTTON", $this->lng->txt(
"create_export_file"));
2596 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
2603 $lng->loadLanguageModule(
"meta");
2604 $lng->loadLanguageModule(
"mail");
2606 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
2608 $form->setFormAction($ilCtrl->getFormAction($this));
2611 $form->setTitle($lng->txt(
"user_new_account_mail"));
2612 $form->setDescription($lng->txt(
"user_new_account_mail_desc"));
2614 $langs = $lng->getInstalledLanguages();
2615 foreach($langs as $lang_key)
2617 $amail = $this->
object->_lookupNewAccountMail($lang_key);
2619 $title = $lng->txt(
"meta_l_".$lang_key);
2620 if ($lang_key == $lng->getDefaultLanguage())
2622 $title .=
" (".$lng->txt(
"default").
")";
2626 $header->setTitle($title);
2627 $form->addItem($header);
2629 $subj =
new ilTextInputGUI($lng->txt(
"subject"),
"subject_".$lang_key);
2631 $subj->
setValue($amail[
"subject"]);
2632 $form->addItem($subj);
2634 $salg =
new ilTextInputGUI($lng->txt(
"mail_salutation_general"),
"sal_g_".$lang_key);
2637 $form->addItem($salg);
2639 $salf =
new ilTextInputGUI($lng->txt(
"mail_salutation_female"),
"sal_f_".$lang_key);
2642 $form->addItem($salf);
2644 $salm =
new ilTextInputGUI($lng->txt(
"mail_salutation_male"),
"sal_m_".$lang_key);
2647 $form->addItem($salm);
2653 $body->setCols(100);
2654 $form->addItem($body);
2656 $att =
new ilFileInputGUI($lng->txt(
"attachment"),
"att_".$lang_key);
2657 $att->setAllowDeletion(
true);
2658 if($amail[
"att_file"])
2660 $att->
setValue($amail[
"att_file"]);
2662 $form->addItem($att);
2665 $form->addCommandButton(
"saveNewAccountMail", $lng->txt(
"save"));
2666 $form->addCommandButton(
"cancelNewAccountMail", $lng->txt(
"cancel"));
2679 $this->tabs_gui->setTabActive(
'settings');
2680 $this->tabs_gui->setSubTabActive(
'user_new_account_mail');
2684 $ftpl =
new ilTemplate(
'tpl.usrf_new_account_mail.html',
true,
true,
'Services/User');
2685 $ftpl->setVariable(
"FORM", $form->getHTML());
2689 $ftpl->setVariable(
"TXT_USE_PLACEHOLDERS", $lng->txt(
"mail_nacc_use_placeholder"));
2690 $ftpl->setVariable(
"TXT_MAIL_SALUTATION", $lng->txt(
"mail_nacc_salutation"));
2691 $ftpl->setVariable(
"TXT_FIRST_NAME", $lng->txt(
"firstname"));
2692 $ftpl->setVariable(
"TXT_LAST_NAME", $lng->txt(
"lastname"));
2693 $ftpl->setVariable(
"TXT_EMAIL", $lng->txt(
"email"));
2694 $ftpl->setVariable(
"TXT_LOGIN", $lng->txt(
"mail_nacc_login"));
2695 $ftpl->setVariable(
"TXT_PASSWORD", $lng->txt(
"password"));
2696 $ftpl->setVariable(
"TXT_PASSWORD_BLOCK", $lng->txt(
"mail_nacc_pw_block"));
2697 $ftpl->setVariable(
"TXT_NOPASSWORD_BLOCK", $lng->txt(
"mail_nacc_no_pw_block"));
2698 $ftpl->setVariable(
"TXT_ADMIN_MAIL", $lng->txt(
"mail_nacc_admin_mail"));
2699 $ftpl->setVariable(
"TXT_ILIAS_URL", $lng->txt(
"mail_nacc_ilias_url"));
2700 $ftpl->setVariable(
"TXT_CLIENT_NAME", $lng->txt(
"mail_nacc_client_name"));
2701 $ftpl->setVariable(
"TXT_TARGET", $lng->txt(
"mail_nacc_target"));
2702 $ftpl->setVariable(
"TXT_TARGET_TITLE", $lng->txt(
"mail_nacc_target_title"));
2703 $ftpl->setVariable(
"TXT_TARGET_TYPE", $lng->txt(
"mail_nacc_target_type"));
2704 $ftpl->setVariable(
"TXT_TARGET_BLOCK", $lng->txt(
"mail_nacc_target_block"));
2705 $ftpl->setVariable(
"TXT_IF_TIMELIMIT", $lng->txt(
"mail_nacc_if_timelimit"));
2706 $ftpl->setVariable(
"TXT_TIMELIMIT", $lng->txt(
"mail_nacc_timelimit"));
2708 $this->tpl->setContent($ftpl->get());
2713 $this->ctrl->redirect($this,
"settings");
2720 $langs = $lng->getInstalledLanguages();
2721 foreach($langs as $lang_key)
2723 $this->
object->_writeNewAccountMail($lang_key,
2730 if($_FILES[
"att_".$lang_key][
"tmp_name"])
2732 $this->
object->_updateAccountMailAttachment($lang_key,
2733 $_FILES[
"att_".$lang_key][
"tmp_name"],
2734 $_FILES[
"att_".$lang_key][
"name"]);
2737 if (
$_POST[
"att_".$lang_key.
"_delete"])
2739 $this->
object->_deleteAccountMailAttachment($lang_key);
2744 $this->ctrl->redirect($this,
"newAccountMail");
2759 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
2763 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
2765 $tabs_gui->addTarget(
"usrf",
2766 $this->ctrl->getLinkTarget($this,
"view"), array(
"view",
"delete",
"resetFilter",
"userAction",
""),
"",
"");
2768 $tabs_gui->addTarget(
2769 "search_user_extended",
2770 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
''),
2772 "ilrepositorysearchgui",
2777 if ($rbacsystem->checkAccess(
"write",$this->object->getRefId()))
2779 $tabs_gui->addTarget(
"settings",
2780 $this->ctrl->getLinkTarget($this,
"generalSettings"),array(
'settings',
'generalSettings',
'listUserDefinedField',
'newAccountMail'));
2782 $tabs_gui->addTarget(
"export",
2783 $this->ctrl->getLinkTarget($this,
"export"),
"export",
"",
"");
2795 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
2797 $tabs_gui->addTarget(
"perm_settings",
2798 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
2799 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
2814 $this->tabs_gui->addSubTabTarget(
2816 $this->ctrl->getLinkTarget($this,
'generalSettings'),
'generalSettings', get_class($this));
2817 $this->tabs_gui->addSubTabTarget(
"standard_fields",
2818 $this->ctrl->getLinkTarget($this,
'settings'),
2819 array(
"settings",
"saveGlobalUserSettings"), get_class($this));
2820 $this->tabs_gui->addSubTabTarget(
"user_defined_fields",
2821 $this->ctrl->getLinkTargetByClass(
"ilcustomuserfieldsgui",
"listUserDefinedFields"),
2822 "listUserDefinedFields",get_class($this));
2823 $this->tabs_gui->addSubTabTarget(
"user_new_account_mail",
2824 $this->ctrl->getLinkTarget($this,
'newAccountMail'),
2825 "newAccountMail",get_class($this));
2826 $this->tabs_gui->addSubTab(
"account_codes", $this->lng->txt(
"user_account_codes"),
2827 $this->ctrl->getLinkTargetByClass(
"ilaccountcodesgui"));
2836 $show_blocking_time_in_days = (int)$ilSetting->get(
'loginname_change_blocking_time') / 86400;
2839 $this->loginSettingsForm->setValuesByArray(array(
2840 'allow_change_loginname' => (
bool)$ilSetting->get(
'allow_change_loginname'),
2841 'create_history_loginname' => (bool)$ilSetting->get(
'create_history_loginname'),
2842 'reuse_of_loginnames' => (bool)$ilSetting->get(
'reuse_of_loginnames'),
2843 'loginname_change_blocking_time' => (float)$show_blocking_time_in_days
2846 $this->tpl->setVariable(
'ADM_CONTENT', $this->loginSettingsForm->getHTML());
2852 $this->tabs_gui->setTabActive(
'settings');
2853 $this->tabs_gui->setSubTabActive(
'loginname_settings');
2855 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
2857 $this->loginSettingsForm->
setFormAction($this->ctrl->getFormAction($this,
'saveLoginnameSettings'));
2858 $this->loginSettingsForm->setTitle($this->lng->txt(
'loginname_settings'));
2860 $chbChangeLogin =
new ilCheckboxInputGUI($this->lng->txt(
'allow_change_loginname'),
'allow_change_loginname');
2862 $this->loginSettingsForm->addItem($chbChangeLogin);
2863 $chbCreateHistory =
new ilCheckboxInputGUI($this->lng->txt(
'history_loginname'),
'create_history_loginname');
2864 $chbCreateHistory->
setInfo($this->lng->txt(
'loginname_history_info'));
2865 $chbCreateHistory->setValue(1);
2866 $chbChangeLogin->addSubItem($chbCreateHistory);
2867 $chbReuseLoginnames =
new ilCheckboxInputGUI($this->lng->txt(
'reuse_of_loginnames_contained_in_history'),
'reuse_of_loginnames');
2869 $chbReuseLoginnames->setInfo($this->lng->txt(
'reuse_of_loginnames_contained_in_history_info'));
2870 $chbChangeLogin->addSubItem($chbReuseLoginnames);
2871 $chbChangeBlockingTime =
new ilNumberInputGUI($this->lng->txt(
'loginname_change_blocking_time'),
'loginname_change_blocking_time');
2873 $chbChangeBlockingTime->setSuffix($this->lng->txt(
'days'));
2874 $chbChangeBlockingTime->setInfo($this->lng->txt(
'loginname_change_blocking_time_info'));
2875 $chbChangeBlockingTime->setSize(10);
2876 $chbChangeBlockingTime->setMaxLength(10);
2877 $chbChangeLogin->addSubItem($chbChangeBlockingTime);
2879 $this->loginSettingsForm->addCommandButton(
'saveLoginnameSettings', $this->lng->txt(
'save'));
2887 if($this->loginSettingsForm->checkInput())
2891 if(!strlen($this->loginSettingsForm->getInput(
'loginname_change_blocking_time')))
2894 $this->loginSettingsForm->getItemByPostVar(
'loginname_change_blocking_time')
2895 ->setAlert($this->lng->txt(
'loginname_change_blocking_time_invalidity_info'));
2900 $save_blocking_time_in_seconds = (int)$this->loginSettingsForm->getInput(
'loginname_change_blocking_time') * 86400;
2902 $ilSetting->set(
'allow_change_loginname', (
int)$this->loginSettingsForm->getInput(
'allow_change_loginname'));
2903 $ilSetting->set(
'create_history_loginname', (
int)$this->loginSettingsForm->getInput(
'create_history_loginname'));
2904 $ilSetting->set(
'reuse_of_loginnames', (
int)$this->loginSettingsForm->getInput(
'reuse_of_loginnames'));
2905 $ilSetting->set(
'loginname_change_blocking_time', (
int)$save_blocking_time_in_seconds);
2918 $this->loginSettingsForm->setValuesByPost();
2920 $this->tpl->setVariable(
'ADM_CONTENT', $this->loginSettingsForm->getHTML());
2932 if ($ilAccess->checkAccess(
"read",
"", $a_target))
2934 ilUtil::redirect(
"ilias.php?baseClass=ilAdministrationGUI&ref_id=".$a_target.
"&jmpToUser=".$a_user);
2939 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
2946 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
2958 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id", (
int) $_GET[
"jmpToUser"]);
2959 $ilCtrl->redirectByClass(
"ilobjusergui",
"view");
2968 if(!count((array) $a_usr_ids))
2974 $_POST[
'id'] = $a_usr_ids;
2977 if(stristr($a_cmd,
"export"))
2979 $cmd = $a_cmd.
"Object";
2980 return $this->
$cmd();
2983 $_POST[
'selectedAction'] = $a_cmd;
2995 'activate' => $this->lng->txt(
'activate'),
2996 'deactivate' => $this->lng->txt(
'deactivate'),
2997 'accessRestrict' => $this->lng->txt(
'accessRestrict'),
2998 'accessFree' => $this->lng->txt(
'accessFree')
3001 if ($rbacsystem->checkAccess(
'delete', $this->object->getRefId()))
3003 $cmds[
"delete"] = $this->lng->txt(
"delete");
3010 'activateUsers' => $this->lng->txt(
'activate'),
3011 'deactivateUsers' => $this->lng->txt(
'deactivate'),
3012 'restrictAccess' => $this->lng->txt(
'accessRestrict'),
3013 'freeAccess' => $this->lng->txt(
'accessFree')
3016 if ($rbacsystem->checkAccess(
'delete', $this->object->getRefId()))
3018 $cmds[
"deleteUsers"] = $this->lng->txt(
"delete");
3023 $export_types = array(
"userfolder_export_excel_x86",
"userfolder_export_csv",
"userfolder_export_xml");
3024 foreach ($export_types as $type)
3026 $cmd = explode(
"_", $type);
3028 $cmds[
'usrExport'.ucfirst(
$cmd)] = $this->lng->txt(
'export').
' - '.
3029 $this->lng->txt($type);
3033 include_once
"Services/Mail/classes/class.ilMail.php";
3034 $mail =
new ilMail($ilUser->getId());
3035 if($rbacsystem->checkAccess(
'internal_mail', $mail->getMailObjectReferenceId()))
3037 $cmds[
"mail"] = $this->lng->txt(
"send_mail");
3051 $this->
object->buildExportFile(
"userfolder_export_excel_x86", $user_ids);
3052 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
3063 $this->
object->buildExportFile(
"userfolder_export_csv", $user_ids);
3064 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
3075 $this->
object->buildExportFile(
"userfolder_export_xml", $user_ids);
3076 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
3091 include_once
"Services/Contact/classes/class.ilMailingLists.php";
3093 $list->deleteTemporaryLists();
3096 include_once
"Services/Contact/classes/class.ilMailingList.php";
3099 $list->setTitle(
"-TEMPORARY SYSTEM LIST-");
3100 $list->setDescription(
"-USER ACCOUNTS MAIL-");
3101 $list->setCreateDate(date(
"Y-m-d H:i:s"));
3103 $list_id = $list->getId();
3106 foreach($user_ids as $user_id)
3108 $list->assignAddressbookEntry($user_id);
3111 include_once
"Services/Mail/classes/class.ilFormatMail.php";
3115 if(!is_array($mail_data))
3117 $mail_data = array(
"user_id" => $ilUser->getId());
3124 $mail_data[
'user_id'],
3125 $mail_data[
'attachments'],
3127 $mail_data[
'rcp_cc'],
3128 $mail_data[
'rcp_bcc'],
3129 $mail_data[
'm_type'],
3130 $mail_data[
'm_email'],
3131 $mail_data[
'm_subject'],
3132 $mail_data[
'm_message'],
3133 $mail_data[
'use_placeholders']
3145 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
3155 'ps_password_min_length' => (
int)$security->getPasswordMinLength(),
3156 'ps_password_max_length' => (int)$security->getPasswordMaxLength(),
3157 'ps_password_uppercase_chars_num' => (int)$security->getPasswordNumberOfUppercaseChars(),
3158 'ps_password_lowercase_chars_num' => (int)$security->getPasswordNumberOfLowercaseChars(),
3159 'ps_password_max_age' => (int)$security->getPasswordMaxAge()
3161 $fields[
'ps_password_settings'] = array(null, null, $subitems);
3164 'ps_login_max_attempts' => (
int)$security->getLoginMaxAttempts(),
3167 $fields[
'ps_security_protection'] = array(null, null, $subitems);
3169 return array(array(
"generalSettings", $fields));