4 require_once
"./classes/class.ilObjectGUI.php";
29 define(
'USER_FOLDER_ID',7);
32 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
34 $this->lng->loadLanguageModule(
'search');
35 $this->lng->loadLanguageModule(
"user");
40 $this->user_owner_id = $a_id;
44 return $this->user_owner_id ? $this->user_owner_id :
USER_FOLDER_ID;
49 $next_class = $this->ctrl->getNextClass($this);
50 $cmd = $this->ctrl->getCmd();
55 case 'ilusertablegui':
56 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
58 $u_table->initFilter();
59 $this->ctrl->setReturn($this,
'view');
60 $this->ctrl->forwardCommand($u_table);
63 case 'ilpermissiongui':
64 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
66 $ret =& $this->ctrl->forwardCommand($perm_gui);
69 case 'iladminusersearchgui':
70 include_once(
'./Services/Search/classes/class.ilAdminUserSearchGUI.php');
72 $user_search->setCallbackClass($this);
74 $this->tabs_gui->setTabActive(
'search_user_extended');
75 $this->ctrl->setReturn($this,
'view');
76 $ret =& $this->ctrl->forwardCommand($user_search);
97 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()))
99 $ilErr->raiseError($this->lng->txt(
"permission_denied"),$ilErr->MESSAGE);
102 include_once
'./Services/Excel/classes/class.ilExcelWriterAdapter.php';
111 $workbook =& $pewa->getWorkbook();
117 include_once
'Services/Excel/classes/class.ilExcelUtils.php';
119 $workbook =& $pewa->getWorkbook();
120 $worksheet =& $workbook->addWorksheet($this->lng->txt(
'objs_usr'));
123 $worksheet->mergeCells(0,0,0,4);
124 $worksheet->setColumn(1,0,32);
125 $worksheet->setColumn(1,1,32);
126 $worksheet->setColumn(1,2,32);
127 $worksheet->setColumn(1,3,32);
128 $worksheet->setColumn(1,4,32);
130 $title = $this->lng->txt(
'learning_progress');
131 $title .=
' '.$this->lng->txt(
'as_of').
': ';
132 $title .= strftime(
'%Y-%m-%d %R',time());
148 foreach($usr_data as
$user)
150 $worksheet->writeString($counter,0,$user[
'login']);
151 $worksheet->writeString($counter,1,$user[
'lastname']);
152 $worksheet->writeString($counter,2,$user[
'firstname']);
154 $pewa->getFormatDayTime());
155 $worksheet->writeString($counter,4,$user[
'last_login'],
156 $pewa->getFormatDate());
165 include_once
'Services/Tracking/classes/class.ilOnlineTracking.php';
166 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
170 global $ilUser,$rbacsystem;
172 $this->max_count = $ilUser->getPref(
'hits_per_page');
174 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()))
176 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
187 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
190 $this->lng->loadLanguageModule(
'payment');
191 $this->tpl->setCurrentBlock(
"btn_cell");
192 $this->tpl->setVariable(
"BTN_LINK",
193 $this->ctrl->getLinkTarget($this,
"learningProgressExcelExport"));
194 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"excel_export"));
195 $this->tpl->parseCurrentBlock();
198 $data[
"cols"] = array(
"login",
"firstname",
"lastname",
"online_time",
'last_login');
201 $num_users = count($usr_data) - 1;
206 $usr_data = array_slice($usr_data,
$_GET[
"offset"],$this->max_count);
208 foreach ($usr_data as $val)
210 if ($val[
"usr_id"] == ANONYMOUS_USER_ID)
215 $data[
"data"][
"$val[usr_id]"] = array(
216 "login" => $val[
"login"],
217 "firstname" => $val[
"firstname"],
218 "lastname" => $val[
"lastname"],
224 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_list.html");
228 include_once
"./Services/Table/classes/class.ilTableGUI.php";
229 $this->tpl->addBlockfile(
"USR_TABLE",
"user_table",
"tpl.table.html");
230 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.usr_tbl_row.html");
232 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
238 $tbl->setTitle($this->object->getTitle(),
"icon_usr.gif",
239 $this->lng->txt(
"obj_".$this->object->getType()));
241 foreach (
$data[
"cols"] as $val)
243 $header_names[] = $this->lng->txt($val);
246 $tbl->setHeaderNames($header_names);
248 $header_params = $this->ctrl->getParameterArray($this,
"learningProgress");
249 $tbl->setHeaderVars(
$data[
"cols"],$header_params);
250 $tbl->setColumnWidth(array(
"20%",
"20%",
"20%",
"20%"));
255 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
256 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
257 $tbl->setLimit($this->max_count);
258 $tbl->setOffset(
$_GET[
"offset"]);
259 $tbl->setMaxCount($num_users);
262 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
274 $this->tpl->setVariable(
"CSS_ROW", $css_row);
276 foreach ($fields as
$key => $val)
281 $this->ids[] =
$ctrl[
"obj_id"];
283 if (
$key ==
"login" and $lp_active)
285 $this->ctrl->setParameterByClass(
"illearningprogressgui",
"ref_id",$this->object->getRefId());
286 $this->ctrl->setParameterByClass(
"illearningprogressgui",
"obj_id",
$usr_id);
287 $link = $this->ctrl->getLinkTargetByClass(array(
"ilobjusergui",
'illearningprogressgui'),
"");
289 $this->tpl->setCurrentBlock(
"begin_link");
290 $this->tpl->setVariable(
"LINK_TARGET", $link);
291 $this->tpl->parseCurrentBlock();
292 $this->tpl->touchBlock(
"end_link");
295 $this->tpl->setCurrentBlock(
"text");
296 $this->tpl->setVariable(
"TEXT_CONTENT", $val);
297 $this->tpl->parseCurrentBlock();
298 $this->tpl->setCurrentBlock(
"table_cell");
299 $this->tpl->parseCurrentBlock();
302 $this->tpl->setCurrentBlock(
"tbl_content");
303 $this->tpl->setVariable(
"CSS_ROW", $css_row);
304 $this->tpl->parseCurrentBlock();
314 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
316 $utab->resetOffset();
317 $utab->resetFilter();
330 $ilCtrl->setParameterByClass(
"ilobjusergui",
"new_type",
"usr");
331 $ilCtrl->redirectByClass(array(
"iladministrationgui",
"ilobjusergui"),
"create");
342 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
344 $utab->resetOffset();
345 $utab->writeFilterToSession();
347 $ilTabs->activateTab(
"obj_usrf");
357 global $rbacsystem, $ilUser, $ilToolbar,
$tpl;
372 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
374 $tpl->setContent($utab->getHTML());
385 $_SESSION[
"usergui_cmd_node"] = $this->ctrl->getNodeIdForTargetClass($this->ctrl->getCmdNode(),
"ilobjusergui");
386 $this->ctrl->saveParameter($this,
"user_filter_date_y");
387 $this->ctrl->saveParameter($this,
"user_filter_date_m");
388 $this->ctrl->saveParameter($this,
"user_filter_date_d");
389 $this->ctrl->saveParameter($this,
"selected_course");
390 $this->ctrl->saveParameter($this,
"selected_group");
391 $this->ctrl->saveParameter($this,
"selected_role");
392 $this->ctrl->saveParameterByClass(
"ilAdminUserSearchGUI",
"user_filter_date_y");
393 $this->ctrl->saveParameterByClass(
"ilAdminUserSearchGUI",
"user_filter_date_m");
394 $this->ctrl->saveParameterByClass(
"ilAdminUserSearchGUI",
"user_filter_date_d");
395 $this->ctrl->saveParameterByClass(
"ilAdminUserSearchGUI",
"selected_course");
396 $this->ctrl->saveParameterByClass(
"ilAdminUserSearchGUI",
"selected_group");
397 $this->ctrl->saveParameterByClass(
"ilAdminUserSearchGUI",
"selected_role");
398 if (strlen(
$_GET[
"user_filter_date_y"].
$_GET[
"user_filter_date_m"].
$_GET[
"user_filter_date_d"]))
401 "y" => $_GET[
"user_filter_date_y"],
402 "m" => $_GET[
"user_filter_date_m"],
403 "d" => $_GET[
"user_filter_date_d"],
406 if (strlen($_GET[
"selected_course"]))
408 $_SESSION[
"user_filter_data"] = $_GET[
"selected_course"];
410 if (strlen($_GET[
"selected_group"]))
412 $_SESSION[
"user_filter_data"] = $_GET[
"selected_group"];
414 if (strlen($_GET[
"selected_role"]))
416 $_SESSION[
"user_filter_data"] = $_GET[
"selected_role"];
418 if (isset(
$_POST[
"user_filter"]))
421 switch (
$_POST[
"user_filter"])
425 $this->ctrl->setParameterByClass(
"ilAdminUserSearchGUI",
"user_filter_date_y",
$_POST[
"date"][
"y"]);
426 $this->ctrl->setParameterByClass(
"ilAdminUserSearchGUI",
"user_filter_date_m",
$_POST[
"date"][
"m"]);
427 $this->ctrl->setParameterByClass(
"ilAdminUserSearchGUI",
"user_filter_date_d",
$_POST[
"date"][
"d"]);
428 $this->ctrl->setParameter($this,
"user_filter_date_y",
$_POST[
"date"][
"y"]);
429 $this->ctrl->setParameter($this,
"user_filter_date_m",
$_POST[
"date"][
"m"]);
430 $this->ctrl->setParameter($this,
"user_filter_date_d",
$_POST[
"date"][
"d"]);
434 $this->ctrl->setParameterByClass(
"ilAdminUserSearchGUI",
"selected_course",
$_POST[
"courseId"]);
435 $this->ctrl->setParameter($this,
"selected_course",
$_POST[
"courseId"]);
439 $this->ctrl->setParameterByClass(
"ilAdminUserSearchGUI",
"selected_group",
$_POST[
"groupId"]);
440 $this->ctrl->setParameter($this,
"selected_group",
$_POST[
"groupId"]);
444 $this->ctrl->setParameterByClass(
"ilAdminUserSearchGUI",
"selected_role",
$_POST[
"roleId"]);
445 $this->ctrl->setParameter($this,
"selected_role",
$_POST[
"roleId"]);
456 if (isset(
$_GET[
"sort_by"]))
460 if (isset(
$_GET[
"sort_order"]))
464 if (isset(
$_GET[
"offset"]))
472 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
474 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
478 $this->data = array();
479 $this->data[
"data"] = array();
480 $this->data[
"ctrl"] = array();
482 $this->data[
"cols"] = array(
"",
"login",
"firstname",
"lastname",
"email",
"access_until",
"last_login");
484 $usr_data =
ilObjUser::_getAllUserData(array(
"login",
"firstname",
"lastname",
"email",
"time_limit_until",
"time_limit_unlimited",
"last_login",
"active"),
$_SESSION[
"user_filter"]);
487 $current_time = time();
489 foreach ($usr_data as $val)
491 if ($val[
"usr_id"] == ANONYMOUS_USER_ID)
501 if ($val[
"time_limit_unlimited"])
503 $txt_access = $this->lng->txt(
"access_unlimited");
505 elseif ($val[
"time_limit_until"] < $current_time)
507 $txt_access = $this->lng->txt(
"access_expired");
516 $txt_access = $this->lng->txt(
"inactive");
519 $this->data[
"data"][] = array(
520 "login" => $val[
"login"],
521 "firstname" => $val[
"firstname"],
522 "lastname" => $val[
"lastname"],
523 "email" => $val[
"email"],
524 "access_until" => $txt_access,
525 "last_login" => $val[
"last_login"],
526 "obj_id" => $val[
"usr_id"]
530 $this->maxcount = count($this->data[
"data"]);
532 if (
$_GET[
"offset"] >= $this->maxcount)
538 if (
$_GET[
"sort_by"] ==
"name")
540 $_GET[
"sort_by"] =
"login";
546 $this->data[
"data"] = array_slice($this->data[
"data"],
$_GET[
"offset"],
$_GET[
"limit"]);
549 foreach ($this->data[
"data"] as
$key => $val)
551 $this->data[
"ctrl"][
$key] = array(
552 "ref_id" => $this->
id,
553 "obj_id" => $val[
"obj_id"]
555 $tmp[] = $val[
"obj_id"];
556 unset($this->data[
"data"][
$key][
"obj_id"]);
559 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_list.html");
564 $this->tpl->setCurrentBlock(
"filter_date");
566 $this->tpl->setVariable(
"TEXT_FILTER_DATE", $this->lng->txt(
"before"));
567 $this->tpl->parseCurrentBlock();
570 $this->tpl->setCurrentBlock(
"filter_course");
574 $this->tpl->setVariable(
"COURSE_SELECTION", $select);
575 $this->tpl->setVariable(
"TEXT_FILTER_COURSE", $this->lng->txt(
"course"));
576 $this->tpl->parseCurrentBlock();
579 $this->tpl->setCurrentBlock(
"filter_group");
583 $this->tpl->setVariable(
"GROUP_SELECTION", $select);
584 $this->tpl->setVariable(
"TEXT_FILTER_GROUP", $this->lng->txt(
"grp"));
585 $this->tpl->parseCurrentBlock();
589 $this->tpl->setCurrentBlock(
"filter_role");
590 $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId());
592 foreach ($roles as $role)
594 $options[$role[
"rol_id"]] = $role[
"title"];
597 $this->tpl->setVariable(
"ROLE_SELECTION", $select);
598 $this->tpl->setVariable(
"TEXT_FILTER_ROLE", $this->lng->txt(
"role"));
599 $this->tpl->parseCurrentBlock();
602 $this->tpl->setCurrentBlock(
"filter");
603 $this->tpl->setVariable(
"FILTER_TXT_FILTER",$this->lng->txt(
'filter'));
605 $this->tpl->setVariable(
"FILTER_ACTION",$this->ctrl->getFormAction($this));
606 $this->tpl->setVariable(
"FILTER_NAME",
'view');
607 $this->tpl->setVariable(
"FILTER_VALUE",$this->lng->txt(
'apply_filter'));
608 $this->tpl->setVariable(
"FILTER_VALUE_RESET",$this->lng->txt(
'reset_filter'));
609 $this->tpl->parseCurrentBlock();
611 $this->tpl->setCurrentBlock(
"search");
612 $this->tpl->setVariable(
"SEARCH_TXT_SEARCH",$this->lng->txt(
'search'));
613 $this->ctrl->setParameterByClass(
"ilAdminUserSearchGUI",
"user_filter",
$_SESSION[
"user_filter"]);
614 $this->tpl->setVariable(
"SEARCH_ACTION",$this->ctrl->getFormActionByClass(
'ilAdminUserSearchGUI',
'startSimple'));
615 $this->tpl->setVariable(
"SEARCH_NAME",
'startSimple');
616 $this->tpl->setVariable(
"SEARCH_VALUE",$this->lng->txt(
'search_users'));
617 $this->tpl->parseCurrentBlock();
632 if (!is_array($this->data[
"data"][0]))
637 include_once
"./Services/Table/classes/class.ilTableGUI.php";
640 $this->tpl->addBlockfile(
"USR_TABLE",
"user_table",
"tpl.table.html");
642 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.obj_tbl_rows.html");
647 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
653 $tbl->setTitle($this->object->getTitle(),
"icon_usr.gif", $this->lng->txt(
"obj_".$this->object->getType()));
655 foreach ($this->data[
"cols"] as $val)
657 $header_names[] = $this->lng->txt($val);
660 $tbl->setHeaderNames($header_names);
662 $header_params = $this->ctrl->getParameterArray($this,
"view");
663 $tbl->setHeaderVars($this->data[
"cols"],$header_params);
664 $tbl->setColumnWidth(array(
"",
"15%",
"15%",
"15%",
"20%",
"15%",
"20%"));
666 $tbl->enable(
"select_all");
667 $tbl->enable(
"numinfo_header");
668 $tbl->setFormName(
"cmd");
669 $tbl->setSelectAllCheckbox(
"id");
672 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
673 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
674 $tbl->setLimit(
$_GET[
"limit"]);
675 $tbl->setOffset(
$_GET[
"offset"]);
676 $tbl->setMaxCount($this->maxcount);
678 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
683 if (is_array($this->data[
"data"][0]))
686 for ($i=0; $i < count($this->data[
"data"]); $i++)
688 $data = $this->data[
"data"][$i];
689 $ctrl = $this->data[
"ctrl"][$i];
694 $this->tpl->setCurrentBlock(
"checkbox");
695 $this->tpl->setVariable(
"CHECKBOX_ID",
$ctrl[
"obj_id"]);
696 $this->tpl->setVariable(
"CSS_ROW", $css_row);
697 $this->tpl->parseCurrentBlock();
699 $this->tpl->setCurrentBlock(
"table_cell");
700 $this->tpl->setVariable(
"CELLSTYLE",
"tblrow1");
701 $this->tpl->parseCurrentBlock();
706 $this->ctrl->setParameterByClass(
"ilobjusergui",
"ref_id",
"7");
707 $this->ctrl->setParameterByClass(
"ilobjusergui",
"obj_id",
$ctrl[
"obj_id"]);
708 $link = $this->ctrl->getLinkTargetByClass(
"ilobjusergui",
"view");
711 $this->ids[] =
$ctrl[
"obj_id"];
715 $this->tpl->setCurrentBlock(
"begin_link");
716 $this->tpl->setVariable(
"LINK_TARGET", $link);
717 $this->tpl->parseCurrentBlock();
718 $this->tpl->touchBlock(
"end_link");
721 if (
$key ==
"access_until")
723 if ($val == $this->lng->txt(
"access_unlimited"))
725 $val =
"<span class=\"smallgreen\">".$val.
"</span>";
727 elseif ($val == $this->lng->txt(
"access_expired") ||
728 $val == $this->lng->txt(
"inactive"))
730 $val =
"<span class=\"smallred\">".$val.
"</span>";
734 $val =
"<span class=\"small\">".$val.
"</span>";
738 if (
$key ==
"last_login")
743 if (
$key !=
"access_until")
745 $val =
"<span class=\"small\">".$val.
"</span>";
748 $this->tpl->setCurrentBlock(
"text");
749 $this->tpl->setVariable(
"TEXT_CONTENT", $val);
750 $this->tpl->parseCurrentBlock();
751 $this->tpl->setCurrentBlock(
"table_cell");
752 $this->tpl->parseCurrentBlock();
755 $this->tpl->setCurrentBlock(
"tbl_content");
756 $this->tpl->setVariable(
"CSS_ROW", $css_row);
757 $this->tpl->parseCurrentBlock();
776 $operations = array();
778 if ($this->actions ==
"")
781 "delete" => array(
"name" =>
"delete",
"lng" =>
"delete"),
782 "activate" => array(
"name" =>
"activate",
"lng" =>
"activate"),
783 "deactivate" => array(
"name" =>
"deactivate",
"lng" =>
"deactivate"),
784 "accessRestrict" => array(
"name" =>
"accessRestrict",
"lng" =>
"accessRestrict"),
785 "accessFree" => array(
"name" =>
"accessFree",
"lng" =>
"accessFree"),
786 "export" => array(
"name" =>
"export",
"lng" =>
"export")
795 if ($rbacsystem->checkAccess($row[
"name"],$this->object->getRefId()))
797 $operations[] =
$row;
801 if (count($operations) > 0)
803 $select =
"<select name=\"selectedAction\">\n";
804 foreach ($operations as $val)
806 $select .=
"<option value=\"" . $val[
"name"] .
"\"";
807 if (strcmp(
$_POST[
"selectedAction"], $val[
"name"]) == 0)
809 $select .=
" selected=\"selected\"";
812 $select .= $this->lng->txt($val[
"lng"]);
813 $select .=
"</option>";
815 $select .=
"</select>";
816 $this->tpl->setCurrentBlock(
"tbl_action_select");
817 $this->tpl->setVariable(
"SELECT_ACTION", $select);
818 $this->tpl->setVariable(
"BTN_NAME",
"userAction");
819 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"submit"));
820 $this->tpl->parseCurrentBlock();
823 if ($with_subobjects ===
true)
828 if ((count($operations) > 0) or $subobjs ===
true)
830 $this->tpl->setCurrentBlock(
"tbl_action_row");
831 $this->tpl->setVariable(
"COLUMN_COUNTS",count($this->data[
"cols"]));
833 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
834 $this->tpl->parseCurrentBlock();
848 $d = $this->objDefinition->getCreatableSubObjects($this->object->getType());
850 if (!$rbacsystem->checkAccess(
'create_user',$this->object->getRefId()))
863 for ($i=0; $i<count($this->data[
"ctrl"]); $i++)
865 if ($this->data[
"ctrl"][$i][
"type"] == $row[
"name"])
871 if ($row[
"max"] ==
"" || $count < $row[
"max"])
873 $subobj[] = $row[
"name"];
878 if (is_array($subobj))
882 $this->tpl->setCurrentBlock(
"add_object");
883 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
884 $this->tpl->setVariable(
"BTN_NAME",
"create");
885 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"add"));
886 $this->tpl->parseCurrentBlock();
896 session_unregister(
"saved_post");
897 $this->ctrl->returnToParent($this);
917 global $rbacsystem, $ilUser;
920 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
922 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
931 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
932 $obj->setActive(TRUE, $ilUser->getId());
938 if (
$_SESSION[
'user_activate_search'] ==
true)
940 session_unregister(
"user_activate_search");
941 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show');
946 $this->ctrl->redirect($this,
"view");
967 global $rbacsystem, $ilUser;
970 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
972 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
981 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
982 $obj->setActive(FALSE, $ilUser->getId());
989 if (
$_SESSION[
'user_deactivate_search'] ==
true)
991 session_unregister(
"user_deactivate_search");
992 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show');
997 $this->ctrl->redirect($this,
"view");
1008 global $rbacsystem, $ilUser;
1011 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
1013 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
1019 foreach (
$_SESSION[
"saved_post"] as $id)
1022 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
1023 $obj->setTimeLimitOwner($ilUser->getId());
1024 $obj->setTimeLimitUnlimited(1);
1025 $obj->setTimeLimitFrom(
"");
1026 $obj->setTimeLimitUntil(
"");
1027 $obj->setTimeLimitMessage(0);
1034 if (
$_SESSION[
'user_accessFree_search'] ==
true)
1036 session_unregister(
"user_accessFree_search");
1037 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show');
1042 $this->ctrl->redirect($this,
"view");
1048 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm.html");
1049 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1050 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"time_limit_add_time_limit_for_selected"));
1051 include_once
"./classes/class.ilTemplate.php";
1052 $tsTemplate =
new ilTemplate(
"tpl.time.limit.html", TRUE, TRUE);
1053 $from = (array_key_exists(
"from",
$_GET)) ?
$_GET[
"from"] : time();
1054 $until = (array_key_exists(
"until",
$_GET)) ?
$_GET[
"until"] : time();
1055 $fromA = getdate($from);
1056 $untilA = getdate($until);
1061 $tsTemplate->setVariable(
"TEXT_FROM", $this->lng->txt(
"access_from") .
": ");
1062 $tsTemplate->setVariable(
"TEXT_UNTIL", $this->lng->txt(
"access_until") .
": ");
1063 $tsTemplate->setVariable(
"DATE_FROM", $fromDate);
1064 $tsTemplate->setVariable(
"TIME_FROM", $fromTime);
1065 $tsTemplate->setVariable(
"DATE_UNTIL", $untilDate);
1066 $tsTemplate->setVariable(
"TIME_UNTIL", $untilTime);
1067 $this->tpl->setVariable(
"TXT_CONTENT", $tsTemplate->get());
1068 $this->tpl->setVariable(
"CMD_CANCEL",
"cancelaccessRestrict");
1069 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
1070 $this->tpl->setVariable(
"CMD_OK",
"confirmaccessRestrict");
1071 $this->tpl->setVariable(
"TXT_OK", $this->lng->txt(
"confirm"));
1072 $this->tpl->parseCurrentBlock();
1082 $timefrom = mktime(
$_POST[
"fromTime"][
"h"],
$_POST[
"fromTime"][
"m"], 0,
$_POST[
"fromDate"][
"m"],
$_POST[
"fromDate"][
"d"],
$_POST[
"fromDate"][
"y"]);
1083 $timeuntil = mktime(
$_POST[
"untilTime"][
"h"],
$_POST[
"untilTime"][
"m"], 0,
$_POST[
"untilDate"][
"m"],
$_POST[
"untilDate"][
"d"],
$_POST[
"untilDate"][
"y"]);
1084 if ($timeuntil <= $timefrom)
1087 $this->ctrl->setParameter($this,
"from", $timefrom);
1088 $this->ctrl->setParameter($this,
"until", $timeuntil);
1089 $this->ctrl->redirect($this,
"setAccessRestriction");
1092 global $rbacsystem, $ilUser;
1095 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
1097 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
1103 foreach (
$_SESSION[
"saved_post"] as $id)
1106 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
1107 $obj->setTimeLimitOwner($ilUser->getId());
1108 $obj->setTimeLimitUnlimited(0);
1109 $obj->setTimeLimitFrom($timefrom);
1110 $obj->setTimeLimitUntil($timeuntil);
1111 $obj->setTimeLimitMessage(0);
1118 if (
$_SESSION[
'user_accessRestrict_search'] ==
true)
1120 session_unregister(
"user_accessRestrict_search");
1121 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show');
1126 $this->ctrl->redirect($this,
"view");
1150 if (!$rbacsystem->checkAccess(
'delete',$this->object->getRefId()))
1153 $ilCtrl->redirect($this,
"view");
1160 $this->ilias->raiseError($this->lng->txt(
"msg_no_delete_yourself"),$this->ilias->error_obj->WARNING);
1164 foreach (
$_SESSION[
"saved_post"] as $id)
1167 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
1175 #unset($_SESSION['saved_post']);
1177 if (
$_SESSION[
'user_delete_search'] ==
true)
1179 session_unregister(
"user_delete_search");
1180 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show');
1185 $this->ctrl->redirect($this,
"view");
1207 session_unregister(
"saved_post");
1208 $this->
object->buildExportFile(
$_POST[
"export_type"], $user_data_filter);
1209 ilUtil::redirect($this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"export"));
1219 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1225 $this->data[
"cols"] = array(
"type",
"title",
"description",
"last_change");
1227 foreach(
$_POST[
"id"] as $id)
1229 $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($id);
1231 $this->data[
"data"][
"$id"] = array(
1232 "type" => $obj_data->getType(),
1233 "title" => $obj_data->getTitle(),
1234 "desc" => $obj_data->getDescription(),
1235 "last_update" => $obj_data->getLastUpdateDate());
1238 $this->data[
"buttons"] = array(
"cancelDelete" => $this->lng->txt(
"cancel"),
1239 "confirmedDelete" => $this->lng->txt(
"confirm"));
1245 $this->tpl->setVariable(
"FORMACTION",
1246 $this->ctrl->getFormAction($this));
1249 foreach ($this->data[
"cols"] as
$key)
1251 $this->tpl->setCurrentBlock(
"table_header");
1252 $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
1253 $this->tpl->parseCurrentBlock();
1260 foreach($this->data[
"data"] as $key => $value)
1263 foreach($value as $key => $cell_data)
1265 $this->tpl->setCurrentBlock(
"table_cell");
1274 $this->tpl->setVariable(
"TEXT_CONTENT",$cell_data);
1276 $this->tpl->parseCurrentBlock();
1279 $this->tpl->setCurrentBlock(
"table_row");
1281 $this->tpl->parseCurrentBlock();
1287 foreach($this->data[
"buttons"] as
$name => $value)
1289 $this->tpl->setCurrentBlock(
"operation_btn");
1290 $this->tpl->setVariable(
"BTN_NAME",
$name);
1291 $this->tpl->setVariable(
"BTN_VALUE",$value);
1292 $this->tpl->parseCurrentBlock();
1298 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm.html");
1299 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1300 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"export_format_selection"));
1301 $export_types = array(
"userfolder_export_excel_x86",
"userfolder_export_csv",
"userfolder_export_xml");
1303 foreach ($export_types as
$type)
1305 $options[
$type] = $this->lng->txt($type);
1307 $select =
ilUtil::formSelect(
"userfolder_export_xml",
"export_type" ,$options,
false,
true);
1308 $this->tpl->setVariable(
"TXT_CONTENT", $this->lng->txt(
"export_format") .
": " . $select);
1309 $this->tpl->setVariable(
"CMD_CANCEL",
"cancelexport");
1310 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
1311 $this->tpl->setVariable(
"CMD_OK",
"confirmexport");
1312 $this->tpl->setVariable(
"TXT_OK", $this->lng->txt(
"confirm"));
1313 $this->tpl->parseCurrentBlock();
1323 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1332 $this->data[
"cols"] = array(
"type",
"title",
"description",
"last_change");
1334 foreach(
$_POST[
"id"] as $id)
1336 $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($id);
1338 $this->data[
"data"][
"$id"] = array(
1339 "type" => $obj_data->getType(),
1340 "title" => $obj_data->getTitle(),
1341 "desc" => $obj_data->getDescription(),
1342 "last_update" => $obj_data->getLastUpdateDate());
1345 $this->data[
"buttons"] = array(
"cancel" . $action => $this->lng->txt(
"cancel"),
1346 "confirm" . $action => $this->lng->txt(
"confirm"));
1352 $this->tpl->setVariable(
"FORMACTION",
1353 $this->ctrl->getFormAction($this));
1356 foreach ($this->data[
"cols"] as
$key)
1358 $this->tpl->setCurrentBlock(
"table_header");
1359 $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
1360 $this->tpl->parseCurrentBlock();
1367 foreach($this->data[
"data"] as $key => $value)
1370 foreach($value as $key => $cell_data)
1372 $this->tpl->setCurrentBlock(
"table_cell");
1381 $this->tpl->setVariable(
"TEXT_CONTENT",$cell_data);
1383 $this->tpl->parseCurrentBlock();
1386 $this->tpl->setCurrentBlock(
"table_row");
1388 $this->tpl->parseCurrentBlock();
1394 foreach($this->data[
"buttons"] as
$name => $value)
1396 $this->tpl->setCurrentBlock(
"operation_btn");
1397 $this->tpl->setVariable(
"BTN_NAME",
$name);
1398 $this->tpl->setVariable(
"BTN_VALUE",$value);
1399 $this->tpl->parseCurrentBlock();
1408 $_POST[
"selectedAction"] =
"delete";
1417 $_POST[
"selectedAction"] =
"activate";
1426 $_POST[
"selectedAction"] =
"deactivate";
1435 $_POST[
"selectedAction"] =
"accessRestrict";
1444 $_POST[
"selectedAction"] =
"accessFree";
1453 $_POST[
"selectedAction"] =
"export";
1472 $this->tabs_gui->setTabActive(
'obj_usrf');
1474 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_search_form.html");
1476 $this->tpl->setVariable(
"FORMACTION",
1477 $this->ctrl->getFormAction($this));
1478 $this->tpl->setVariable(
"USERNAME_CHECKED",
" checked=\"checked\"");
1479 $this->tpl->setVariable(
"FIRSTNAME_CHECKED",
" checked=\"checked\"");
1480 $this->tpl->setVariable(
"LASTNAME_CHECKED",
" checked=\"checked\"");
1481 $this->tpl->setVariable(
"EMAIL_CHECKED",
" checked=\"checked\"");
1482 $this->tpl->setVariable(
"ACTIVE_CHECKED",
" checked=\"checked\"");
1483 $this->tpl->setVariable(
"TXT_SEARCH_USER",$this->lng->txt(
"search_user"));
1484 $this->tpl->setVariable(
"TXT_SEARCH_IN",$this->lng->txt(
"search_in"));
1485 $this->tpl->setVariable(
"TXT_SEARCH_USERNAME",$this->lng->txt(
"username"));
1486 $this->tpl->setVariable(
"TXT_SEARCH_FIRSTNAME",$this->lng->txt(
"firstname"));
1487 $this->tpl->setVariable(
"TXT_SEARCH_LASTNAME",$this->lng->txt(
"lastname"));
1488 $this->tpl->setVariable(
"TXT_SEARCH_EMAIL",$this->lng->txt(
"email"));
1489 $this->tpl->setVariable(
"TXT_SEARCH_ACTIVE",$this->lng->txt(
"search_active"));
1490 $this->tpl->setVariable(
"TXT_SEARCH_INACTIVE",$this->lng->txt(
"search_inactive"));
1491 $this->tpl->setVariable(
"BUTTON_SEARCH",$this->lng->txt(
"search"));
1492 $this->tpl->setVariable(
"BUTTON_CANCEL",$this->lng->txt(
"cancel"));
1493 $this->tpl->setVariable(
"TXT_SEARCH_NOTE",$this->lng->txt(
"search_note"));
1494 $this->tpl->setVariable(
"ACTIVE_CHECKED",
"checked=\"checked\"");
1502 $this->ctrl->redirect($this,
"view");
1512 $obj_str =
"&obj_id=".$this->obj_id;
1514 $_POST[
"search_string"] = trim(
$_POST[
"search_string"]) ? trim(
$_POST[
"search_string"]) : trim(urldecode(
$_GET[
"search_string"]));
1518 $_POST[
"search_fields"] = array (
"username",
"firstname",
"lastname",
"email");
1520 if (empty(
$_POST[
"search_string"]))
1522 $_POST[
"search_string"] =
"%";
1525 if (empty(
$_POST[
"search_fields"]))
1527 $_POST[
"search_fields"] = array();
1531 if (
$_POST[
"search_string"] ==
"%")
1533 $_POST[
"search_string"] =
"";
1535 $msg = $this->lng->txt(
"msg_no_search_result");
1536 if (
$_POST[
"search_string"] !=
"")
1538 $msg .=
" ".$this->lng->txt(
"with").
" '".htmlspecialchars(
$_POST[
"search_string"]).
"'";
1541 $this->ctrl->redirect($this,
"searchUserForm");
1544 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
1547 $this->tpl->setCurrentBlock(
"btn_cell");
1548 $this->tpl->setVariable(
"BTN_LINK",
1549 $this->ctrl->getLinkTarget($this,
"searchUserForm"));
1550 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"search_new"));
1551 $this->tpl->parseCurrentBlock();
1553 $this->data[
"cols"] = array(
"",
"login",
"firstname",
"lastname",
"email",
"active");
1557 $searchActive =
true;
1561 $searchInactive =
true;
1564 foreach ($search_result as
$key => $val)
1566 $val[
"active_text"] = $this->lng->txt(
"inactive");
1569 $val[
"active_text"] = $this->lng->txt(
"active");
1573 $searchStringToLower = strtolower(
$_POST[
"search_string"]);
1574 $displaySearchResult =
false;
1575 if (in_array(
"username",
$_POST[
"search_fields"]))
1576 if (strpos(strtolower($val[
"login"]), strtolower(
$_POST[
"search_string"])) !==
false)
1577 $displaySearchResult =
true;
1578 if (in_array(
"firstname",
$_POST[
"search_fields"]))
1579 if (strpos(strtolower($val[
"firstname"]), strtolower(
$_POST[
"search_string"])) !==
false)
1580 $displaySearchResult =
true;
1581 if (in_array(
"lastname",
$_POST[
"search_fields"]))
1582 if (strpos(strtolower($val[
"lastname"]), strtolower(
$_POST[
"search_string"])) !==
false)
1583 $displaySearchResult =
true;
1584 if (in_array(
"email",
$_POST[
"search_fields"]))
1585 if (strpos(strtolower($val[
"email"]), strtolower(
$_POST[
"search_string"])) !==
false)
1586 $displaySearchResult =
true;
1587 if (($val[
"active"] == 1) && ($searchActive ==
true) ||
1588 ($val[
"active"] == 0) && ($searchInactive ==
true))
1590 if ((strcmp(
$_POST[
"search_string"],
"%") == 0) || $displaySearchResult)
1593 $this->data[
"data"][] = array(
1594 "login" => $val[
"login"],
1595 "firstname" => $val[
"firstname"],
1596 "lastname" => $val[
"lastname"],
1597 "email" => $val[
"email"],
1598 "active" => $val[
"active_text"],
1599 "obj_id" => $val[
"usr_id"]
1604 if (count($this->data[
"data"]) == 0)
1606 ilUtil::sendInfo($this->lng->txt(
"msg_no_search_result").
" ".$this->lng->txt(
"with").
" '".htmlspecialchars(
$_POST[
"search_string"]).
"'",
true);
1608 $this->ctrl->redirect($this,
"searchUserForm");
1611 $this->maxcount = count($this->data[
"data"]);
1614 if (
$_GET[
"sort_by"] ==
"name")
1616 $_GET[
"sort_by"] =
"login";
1621 $this->data[
"data"] = array_slice($this->data[
"data"],
$_GET[
"offset"],
$_GET[
"limit"]);
1624 foreach ($this->data[
"data"] as
$key => $val)
1626 $this->data[
"ctrl"][
$key] = array(
1627 "ref_id" => $this->
id,
1628 "obj_id" => $val[
"obj_id"]
1630 $tmp[] = $val[
"obj_id"];
1631 unset($this->data[
"data"][
$key][
"obj_id"]);
1638 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
1640 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.obj_tbl_rows.html");
1644 $this->ctrl->setParameter($this,
"sort_by",
"name");
1645 $this->ctrl->setParameter($this,
"sort_order",
$_GET[
"sort_order"]);
1646 $this->ctrl->setParameter($this,
"offset",
$_GET[
"offset"]);
1647 $this->tpl->setVariable(
"FORMACTION",
1648 $this->ctrl->getFormAction($this));
1651 include_once
"./Services/Table/classes/class.ilTableGUI.php";
1655 $tbl->setTitle($this->lng->txt(
"search_result"),
"icon_".$this->object->getType().
".gif",$this->lng->txt(
"obj_".$this->object->getType()));
1656 $tbl->setHelp(
"tbl_help.php",
"icon_help.gif",$this->lng->txt(
"help"));
1658 foreach ($this->data[
"cols"] as $val)
1660 $header_names[] = $this->lng->txt($val);
1663 $tbl->setHeaderNames($header_names);
1665 $header_params = $this->ctrl->getParameterArray($this,
"searchUser");
1666 $header_params[
"search_string"] = urlencode(
$_POST[
"search_string"]);
1667 $header_params[
"search_fields"] = urlencode(implode(
",",
$_POST[
"search_fields"]));
1669 $tbl->setHeaderVars($this->data[
"cols"],$header_params);
1670 $tbl->setColumnWidth(array(
"",
"25%",
"25$%",
"25%",
"25%"));
1673 $tbl->enable(
"hits");
1674 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
1675 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
1676 $tbl->setLimit(
$_GET[
"limit"]);
1677 $tbl->setOffset(
$_GET[
"offset"]);
1678 $tbl->setMaxCount($this->maxcount);
1680 $this->tpl->setVariable(
"COLUMN_COUNTS",count($this->data[
"cols"]));
1683 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1688 if (is_array($this->data[
"data"][0]))
1691 for ($i=0; $i < count($this->data[
"data"]); $i++)
1693 $data = $this->data[
"data"][$i];
1694 $ctrl = $this->data[
"ctrl"][$i];
1697 $this->ids[] =
$ctrl[
"obj_id"];
1702 $this->tpl->setCurrentBlock(
"checkbox");
1703 $this->tpl->setVariable(
"CHECKBOX_ID",
$ctrl[
"obj_id"]);
1705 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1706 $this->tpl->parseCurrentBlock();
1708 $this->tpl->setCurrentBlock(
"table_cell");
1709 $this->tpl->setVariable(
"CELLSTYLE",
"tblrow1");
1710 $this->tpl->parseCurrentBlock();
1715 $this->ctrl->setParameterByClass(
"ilobjusergui",
"ref_id",
"7");
1716 $this->ctrl->setParameterByClass(
"ilobjusergui",
"obj_id",
$ctrl[
"obj_id"]);
1717 $link = $this->ctrl->getLinkTargetByClass(
"ilobjusergui",
"view");
1719 if (
$key ==
"login")
1721 $this->tpl->setCurrentBlock(
"begin_link");
1722 $this->tpl->setVariable(
"LINK_TARGET", $link);
1723 $this->tpl->parseCurrentBlock();
1724 $this->tpl->touchBlock(
"end_link");
1727 $this->tpl->setCurrentBlock(
"text");
1728 $this->tpl->setVariable(
"TEXT_CONTENT", $val);
1729 $this->tpl->parseCurrentBlock();
1730 $this->tpl->setCurrentBlock(
"table_cell");
1731 $this->tpl->parseCurrentBlock();
1734 $this->tpl->setCurrentBlock(
"tbl_content");
1735 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1736 $this->tpl->parseCurrentBlock();
1749 global
$tpl, $rbacsystem;
1752 if($this->ctrl->getTargetScript() ==
'repository.php')
1754 $this->tabs_gui->clearTargets();
1757 if (!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
1759 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1763 $tpl->setContent($this->form->getHTML());
1777 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1781 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
1782 $fi =
new ilFileInputGUI($lng->txt(
"import_file"),
"importFile");
1786 $this->form->addItem($fi);
1788 $this->form->addCommandButton(
"importUserRoleAssignment", $lng->txt(
"import"));
1789 $this->form->addCommandButton(
"importCancelled", $lng->txt(
"cancel"));
1791 $this->form->setTitle($lng->txt(
"import_users"));
1792 $this->form->setFormAction($ilCtrl->getFormAction($this));
1806 if (@is_dir($import_dir))
1811 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
1813 $this->ctrl->redirect($this,
"view");
1818 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1831 $importDir =
ilUtil::getDataDir().
'/user_import/usr_'.$ilUser->getId().
'_'.session_id();
1844 if($this->ctrl->getTargetScript() ==
'repository.php')
1846 $this->tabs_gui->clearTargets();
1850 if ($this->form->checkInput())
1852 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
1853 include_once
'./Services/User/classes/class.ilUserImportParser.php';
1855 global $rbacreview, $rbacsystem,
$tree,
$lng;
1858 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_import_roles.html");
1863 if (@is_dir($import_dir))
1875 if (!is_file($_FILES[
"importFile"][
"tmp_name"]))
1878 $this->ilias->raiseError($this->lng->txt(
"no_import_file_found")
1879 , $this->ilias->error_obj->MESSAGE);
1882 $_FILES[
"importFile"][
"name"], $full_path);
1885 if (strtolower($parts[
"extension"]) ==
"zip")
1892 foreach ($file_list as $a_file)
1894 if (substr($a_file[
'entry'],-4) ==
'.xml')
1896 $xml_file = $import_dir.
"/".$a_file[
'entry'];
1900 if (is_null($xml_file))
1902 $subdir = basename($parts[
"basename"],
".".$parts[
"extension"]);
1903 $xml_file = $import_dir.
"/".$subdir.
"/".$subdir.
".xml";
1909 $xml_file = $full_path;
1913 if (!is_file($xml_file))
1916 $this->ilias->raiseError($this->lng->txt(
"no_xml_file_found_in_zip")
1917 .
" ".$subdir.
"/".$subdir.
".xml", $this->ilias->error_obj->MESSAGE);
1920 require_once(
"./Services/User/classes/class.ilUserImportParser.php");
1925 $importParser->startParsing();
1926 switch ($importParser->getErrorLevel())
1931 $this->tpl->setVariable(
"IMPORT_LOG", $importParser->getProtocolAsHTML($lng->txt(
"verification_warning_log")));
1935 $this->ilias->raiseError(
1936 $lng->txt(
"verification_failed").$importParser->getProtocolAsHTML($lng->txt(
"verification_failure_log")),
1937 $this->ilias->error_obj->MESSAGE
1944 $this->tpl->setCurrentBlock(
"role_selection_form");
1945 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1946 $this->tpl->setVariable(
"TXT_IMPORT_USERS", $this->lng->txt(
"import_users"));
1947 $this->tpl->setVariable(
"TXT_IMPORT_FILE", $this->lng->txt(
"import_file"));
1948 $this->tpl->setVariable(
"IMPORT_FILE",
$file_name);
1949 $this->tpl->setVariable(
"TXT_USER_ELEMENT_COUNT", $this->lng->txt(
"num_users"));
1950 $this->tpl->setVariable(
"USER_ELEMENT_COUNT", $importParser->getUserCount());
1951 $this->tpl->setVariable(
"TXT_ROLE_ASSIGNMENT", $this->lng->txt(
"role_assignment"));
1952 $this->tpl->setVariable(
"BTN_IMPORT", $this->lng->txt(
"import"));
1953 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1954 $this->tpl->setVariable(
"XML_FILE_NAME", $xml_file);
1958 $importParser->startParsing();
1959 $roles = $importParser->getCollectedRoles();
1962 $all_gl_roles = $rbacreview->getRoleListByObject(ROLE_FOLDER_ID);
1963 $gl_roles = array();
1964 $roles_of_user = $rbacreview->assignedRoles($ilUser->getId());
1965 foreach ($all_gl_roles as $obj_data)
1976 if ($obj_data[
"obj_id"] != ANONYMOUS_ROLE_ID)
1979 if ($obj_data[
"obj_id"] != SYSTEM_ROLE_ID or in_array(SYSTEM_ROLE_ID,$roles_of_user))
1981 $gl_roles[$obj_data[
"obj_id"]] = $obj_data[
"title"];
1987 $got_globals =
false;
1988 foreach($roles as $role_id => $role)
1990 if ($role[
"type"] ==
"Global")
1994 $got_globals =
true;
1996 $this->tpl->setCurrentBlock(
"global_role_section");
1997 $this->tpl->setVariable(
"TXT_GLOBAL_ROLES_IMPORT", $this->lng->txt(
"roles_of_import_global"));
1998 $this->tpl->setVariable(
"TXT_GLOBAL_ROLES", $this->lng->txt(
"assign_global_role"));
2002 $pre_select = array_search($role[name], $gl_roles);
2005 switch($role[
"name"])
2007 case "Administrator":
2008 $pre_select = array_search(
"Administrator", $gl_roles);
2012 $pre_select = array_search(
"User", $gl_roles);
2016 $pre_select = array_search(
"User", $gl_roles);
2020 $pre_select = array_search(
"Guest", $gl_roles);
2024 $pre_select = array_search(
"User", $gl_roles);
2028 $this->tpl->setCurrentBlock(
"global_role");
2029 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $gl_roles,
false,
true);
2030 $this->tpl->setVariable(
"TXT_IMPORT_GLOBAL_ROLE", $role[
"name"].
" [".$role_id.
"]");
2031 $this->tpl->setVariable(
"SELECT_GLOBAL_ROLE", $role_select);
2032 $this->tpl->parseCurrentBlock();
2037 $got_locals =
false;
2038 foreach($roles as $role_id => $role)
2040 if ($role[
"type"] ==
"Local")
2049 $this->tpl->setCurrentBlock(
"local_role_section");
2050 $this->tpl->setVariable(
"TXT_LOCAL_ROLES_IMPORT", $this->lng->txt(
"roles_of_import_local"));
2051 $this->tpl->setVariable(
"TXT_LOCAL_ROLES", $this->lng->txt(
"assign_local_role"));
2062 $loc_roles = array();
2063 foreach($roles as $role_id => $role)
2065 if ($role[
"type"] ==
"Local")
2067 $searchName = (substr($role[
'name'],0,1) ==
'#') ? $role[
'name'] :
'#'.$role[
'name'];
2068 $matching_role_ids = $rbacreview->searchRolesByMailboxAddressList($searchName);
2069 foreach ($matching_role_ids as $mid) {
2070 if (! in_array($mid, $loc_roles)) {
2071 $loc_roles[] = array(
'obj_id'=>$mid);
2080 $loc_roles = $rbacreview->getAssignableRolesInSubtree($this->object->getRefId());
2085 $l_roles_mailbox_searcharray = array();
2086 foreach ($loc_roles as
$key => $loc_role)
2089 $rolf = $rbacreview->getFoldersAssignedToRole($loc_role[
"obj_id"],
true);
2095 if (!$rbacreview->isDeleted($rolf[0])
2096 && $rbacsystem->checkAccess(
'write',$tree->getParentId($rolf[0]))
2097 && $rolf[0] != ROLE_FOLDER_ID
2111 if ($this->tree->isInTree($rolf[0]))
2115 $tmpPath = $this->tree->getPathFull($rolf[0]);
2116 for ($i = 1,
$n = count($tmpPath) - 1; $i <
$n; $i++)
2120 $path = $path.
' > ';
2122 if ($i < 3 || $i > $n - 3)
2124 $path = $path.$tmpPath[$i][
'title'];
2126 else if ($i == 3 || $i == $n - 3)
2128 $path = $path.
'...';
2131 $isInSubtree |= $tmpPath[$i][
'obj_id'] == $this->
object->getId();
2136 $path =
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$loc_role[
"obj_id"].
")</b>";
2138 $roleMailboxAddress = $rbacreview->getRoleMailboxAddress($loc_role[
'obj_id']);
2139 $l_roles[$loc_role[
'obj_id']] = $roleMailboxAddress.
', '.$path;
2144 natcasesort($l_roles);
2145 $l_roles[
""] = $this->lng->txt(
"usrimport_ignore_role");
2146 foreach($roles as $role_id => $role)
2148 if ($role[
"type"] ==
"Local")
2150 $this->tpl->setCurrentBlock(
"local_role");
2151 $this->tpl->setVariable(
"TXT_IMPORT_LOCAL_ROLE", $role[
"name"]);
2152 $searchName = (substr($role[
'name'],0,1) ==
'#') ? $role[
'name'] :
'#'.$role[
'name'];
2153 $matching_role_ids = $rbacreview->searchRolesByMailboxAddressList($searchName);
2154 $pre_select = count($matching_role_ids) == 1 ? $matching_role_ids[0] :
"";
2159 $selectable_roles = array();
2160 $selectable_roles[
""] = $this->lng->txt(
"usrimport_ignore_role");
2161 foreach ($matching_role_ids as $id)
2163 $selectable_roles[$id] = $l_roles[$id];
2165 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $selectable_roles,
false,
true);
2167 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $l_roles,
false,
true);
2169 $this->tpl->setVariable(
"SELECT_LOCAL_ROLE", $role_select);
2170 $this->tpl->parseCurrentBlock();
2176 $this->tpl->setVariable(
"TXT_CONFLICT_HANDLING", $lng->txt(
"conflict_handling"));
2181 $this->tpl->setVariable(
"TXT_CONFLICT_HANDLING_INFO", str_replace(
'\n',
'<br>',$this->lng->txt(
"usrimport_conflict_handling_info")));
2182 $this->tpl->setVariable(
"TXT_CONFLICT_CHOICE", $lng->txt(
"conflict_handling"));
2186 $this->lng->loadLanguageModule(
"mail");
2187 include_once
'./Services/User/classes/class.ilObjUserFolder.php';
2189 if (trim($amail[
"body"]) !=
"" && trim($amail[
"subject"]) !=
"")
2191 $this->tpl->setCurrentBlock(
"inform_user");
2192 $this->tpl->setVariable(
"TXT_ACCOUNT_MAIL", $lng->txt(
"mail_account_mail"));
2195 $this->tpl->setVariable(
"SEND_MAIL",
" checked=\"checked\"");
2197 $this->tpl->setVariable(
"TXT_INFORM_USER_MAIL",
2198 $this->lng->txt(
"user_send_new_account_mail"));
2199 $this->tpl->parseCurrentBlock();
2204 $this->form->setValuesByPost();
2205 $tpl->setContent($this->form->getHtml());
2214 global $rbacreview,$ilUser;
2217 if($this->ctrl->getTargetScript() ==
'repository.php')
2219 $this->tabs_gui->clearTargets();
2222 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
2223 include_once
'./Services/User/classes/class.ilUserImportParser.php';
2225 global $rbacreview, $rbacsystem,
$tree,
$lng;
2227 switch (
$_POST[
"conflict_handling_choice"])
2229 case "update_on_conflict" :
2232 case "ignore_on_conflict" :
2244 if (
$_POST[
"role_assign"])
2246 $global_roles = $rbacreview->getGlobalRoles();
2247 $roles_of_user = $rbacreview->assignedRoles($ilUser->getId());
2248 foreach (
$_POST[
"role_assign"] as $role_id)
2252 if (in_array($role_id, $global_roles))
2254 if(!in_array(SYSTEM_ROLE_ID,$roles_of_user))
2256 if ($role_id == SYSTEM_ROLE_ID && ! in_array(SYSTEM_ROLE_ID,$roles_of_user)
2262 $this->ilias->raiseError($this->lng->txt(
"usrimport_with_specified_role_not_permitted"),
2263 $this->ilias->error_obj->MESSAGE);
2269 $rolf = $rbacreview->getFoldersAssignedToRole($role_id,
true);
2270 if ($rbacreview->isDeleted($rolf[0])
2271 || ! $rbacsystem->checkAccess(
'write',$tree->getParentId($rolf[0])))
2274 $this->ilias->raiseError($this->lng->txt(
"usrimport_with_specified_role_not_permitted"),
2275 $this->ilias->error_obj->MESSAGE);
2283 $importParser->setRoleAssignment(
$_POST[
"role_assign"]);
2284 $importParser->startParsing();
2289 switch ($importParser->getErrorLevel())
2295 ilUtil::sendInfo($this->lng->txt(
"user_imported_with_warnings").$importParser->getProtocolAsHTML($lng->txt(
"import_warning_log")),
true);
2298 $this->ilias->raiseError(
2299 $this->lng->txt(
"user_import_failed")
2300 .$importParser->getProtocolAsHTML($lng->txt(
"import_failure_log")),
2301 $this->ilias->error_obj->MESSAGE
2306 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
2308 $this->ctrl->redirect($this,
"view");
2313 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
2320 global $rbacsystem,
$ilias;
2324 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
2326 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
2329 if(!count($app_users =& $ilias->account->getAppliedUsers()))
2336 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_applied_users.html");
2337 $this->lng->loadLanguageModule(
'crs');
2340 foreach($app_users as
$usr_id)
2345 $f_result[$counter][] = $tmp_user->getLogin();
2346 $f_result[$counter][] = $tmp_user->getFirstname();
2347 $f_result[$counter][] = $tmp_user->getLastname();
2349 if($tmp_user->getTimeLimitUnlimited())
2351 $f_result[$counter][] =
"<b>".$this->lng->txt(
'crs_unlimited').
"</b>";
2355 $limit =
"<b>".$this->lng->txt(
'crs_from').
'</b> '.strftime(
"%Y-%m-%d %R",$tmp_user->getTimeLimitFrom()).
'<br />';
2356 $limit .=
"<b>".$this->lng->txt(
'crs_to').
'</b> '.strftime(
"%Y-%m-%d %R",$tmp_user->getTimeLimitUntil());
2358 $f_result[$counter][] = $limit;
2372 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
2374 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2377 $this->lng->loadLanguageModule(
'crs');
2381 if(!isset(
$_SESSION[
'error_post_vars']))
2383 ilUtil::sendInfo($this->lng->txt(
'time_limit_add_time_limit_for_selected'));
2386 if(!count(
$_POST[
"users"]))
2402 $title .= $tmp_user->getLogin();
2412 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_edit_applied_users.html");
2413 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2416 $time_limit_unlimited =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_unlimited"] ?
2419 $time_limit_start =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_start"] ?
2422 $time_limit_end =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_end"] ?
2428 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
"obj_usr"));
2430 $this->tpl->setVariable(
"TITLE",
$title);
2431 $this->tpl->setVariable(
"TXT_TIME_LIMIT",$this->lng->txt(
"time_limit"));
2432 $this->tpl->setVariable(
"TXT_TIME_LIMIT_START",$this->lng->txt(
"crs_start"));
2433 $this->tpl->setVariable(
"TXT_TIME_LIMIT_END",$this->lng->txt(
"crs_end"));
2434 $this->tpl->setVariable(
"CMD_SUBMIT",
"updateAppliedUsers");
2435 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
"cancel"));
2436 $this->tpl->setVariable(
"TXT_SUBMIT",$this->lng->txt(
"submit"));
2440 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_DAY",$this->
__getDateSelect(
"day",
"au[time_limit_start][day]",
2441 date(
"d",$time_limit_start)));
2442 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_MONTH",$this->
__getDateSelect(
"month",
"au[time_limit_start][month]",
2443 date(
"m",$time_limit_start)));
2444 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_YEAR",$this->
__getDateSelect(
"year",
"au[time_limit_start][year]",
2445 date(
"Y",$time_limit_start)));
2446 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_HOUR",$this->
__getDateSelect(
"hour",
"au[time_limit_start][hour]",
2447 date(
"G",$time_limit_start)));
2448 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_MINUTE",$this->
__getDateSelect(
"minute",
"au[time_limit_start][minute]",
2449 date(
"i",$time_limit_start)));
2450 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_DAY",$this->
__getDateSelect(
"day",
"au[time_limit_end][day]",
2451 date(
"d",$time_limit_end)));
2452 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_MONTH",$this->
__getDateSelect(
"month",
"au[time_limit_end][month]",
2453 date(
"m",$time_limit_end)));
2454 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_YEAR",$this->
__getDateSelect(
"year",
"au[time_limit_end][year]",
2455 date(
"Y",$time_limit_end)));
2456 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_HOUR",$this->
__getDateSelect(
"hour",
"au[time_limit_end][hour]",
2457 date(
"G",$time_limit_end)));
2458 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_MINUTE",$this->
__getDateSelect(
"minute",
"au[time_limit_end][minute]",
2459 date(
"i",$time_limit_end)));
2460 if($this->ilias->account->getTimeLimitUnlimited())
2462 $this->tpl->setVariable(
"ROWSPAN",3);
2463 $this->tpl->setCurrentBlock(
"unlimited");
2464 $this->tpl->setVariable(
"TXT_TIME_LIMIT_UNLIMITED",$this->lng->txt(
"crs_unlimited"));
2465 $this->tpl->setVariable(
"TIME_LIMIT_UNLIMITED",
ilUtil::formCheckbox($time_limit_unlimited,
"au[time_limit_unlimited]",1));
2466 $this->tpl->parseCurrentBlock();
2470 $this->tpl->setVariable(
"ROWSPAN",2);
2478 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
2480 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2486 if(!
$_POST[
'au'][
'time_limit_unlimited'])
2497 #if(!$this->ilias->account->getTimeLimitUnlimited())
2499 # if($start < $this->ilias->account->getTimeLimitFrom() or
2500 # $end > $this->ilias->account->getTimeLimitUntil())
2502 # $_SESSION['error_post_vars'] = $_POST;
2503 # ilUtil::sendInfo($this->lng->txt('time_limit_not_within_owners'));
2504 # $this->editAppliedUsersObject();
2514 $tmp_user->setTimeLimitUnlimited((
int)
$_POST[
'au'][
'time_limit_unlimited']);
2515 $tmp_user->setTimeLimitFrom(
$start);
2516 $tmp_user->setTimeLimitUntil($end);
2517 $tmp_user->setTimeLimitMessage(0);
2518 $tmp_user->update();
2533 $tpl =& $tbl->getTemplateObject();
2536 $tpl->setCurrentBlock(
"tbl_form_header");
2538 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2539 $tpl->parseCurrentBlock();
2541 $tpl->setCurrentBlock(
"tbl_action_btn");
2542 $tpl->setVariable(
"BTN_NAME",
'editAppliedUsers');
2543 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
'edit'));
2544 $tpl->parseCurrentBlock();
2546 $tpl->setCurrentBlock(
"tbl_action_row");
2547 $tpl->setVariable(
"COLUMN_COUNTS",5);
2549 $tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
2550 $tpl->parseCurrentBlock();
2554 $tbl->setTitle($this->lng->txt(
"time_limit_applied_users"),
"icon_usr_b.gif",$this->lng->txt(
"users"));
2555 $tbl->setHeaderNames(array(
'',
2556 $this->lng->txt(
"login"),
2557 $this->lng->txt(
"firstname"),
2558 $this->lng->txt(
"lastname"),
2559 $this->lng->txt(
"time_limits")));
2560 $header_params = $this->ctrl->getParameterArray($this,
"appliedUsers");
2561 $tbl->setHeaderVars(array(
"",
2566 array($header_params));
2567 $tbl->setColumnWidth(array(
"3%",
"19%",
"19%",
"19%",
"40%"));
2573 $this->tpl->setVariable(
"APPLIED_USERS",$tbl->tpl->get());
2580 include_once
"./Services/Table/classes/class.ilTableGUI.php";
2587 $offset =
$_GET[
"offset"];
2588 $order =
$_GET[
"sort_by"];
2589 $direction =
$_GET[
"sort_order"];
2592 $tbl->setOrderColumn($order);
2593 $tbl->setOrderDirection($direction);
2594 $tbl->setOffset($offset);
2595 $tbl->setLimit(
$_GET[
"limit"]);
2596 $tbl->setMaxCount(count($result_set));
2597 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
2598 $tbl->setData($result_set);
2606 for($i=0;$i<=60;$i++)
2608 $days[$i] = $i < 10 ?
"0".$i : $i;
2613 for($i=0;$i<24;$i++)
2615 $days[$i] = $i < 10 ?
"0".$i : $i;
2620 for($i=1;$i<32;$i++)
2622 $days[$i] = $i < 10 ?
"0".$i : $i;
2627 for($i=1;$i<13;$i++)
2629 $month[$i] = $i < 10 ?
"0".$i : $i;
2634 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
2643 return mktime($a_time_arr[
"hour"],
2644 $a_time_arr[
"minute"],
2645 $a_time_arr[
"second"],
2646 $a_time_arr[
"month"],
2648 $a_time_arr[
"year"]);
2665 $lng->loadLanguageModule(
"administration");
2670 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2673 $this->tabs_gui->setTabActive(
'settings');
2674 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2678 include_once(
"./Services/User/classes/class.ilCustomUserFieldSettingsTableGUI.php");
2680 if($this->confirm_change)
$tab->setConfirmChange();
2681 $tpl->setContent(
$tab->getHTML());
2686 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_list_user_defined.html');
2687 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2689 if ($this->confirm_change == 1)
2691 $this->tpl->setVariable(
"CONFIRM_MESSAGE", $this->lng->txt(
"confirm_message_course_export"));
2692 $this->tpl->setVariable(
"BUTTON_CONFIRM", $this->lng->txt(
"confirm"));
2693 $this->tpl->setVariable(
"BUTTON_CANCEL", $this->lng->txt(
"cancel"));
2696 $this->tpl->setVariable(
"TXT_OVERVIEW",$this->lng->txt(
'user_defined_list'));
2698 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'add_user_defined_field'));
2702 if(!count($definitions = $user_field_definitions->getDefinitions()))
2704 $this->tpl->setCurrentBlock(
"no_content");
2705 $this->tpl->setVariable(
"NO_FIELDS",$this->lng->txt(
'no_user_defined_fields_defined'));
2706 $this->tpl->parseCurrentBlock();
2710 $this->tpl->setVariable(
"BTN_SAVE",$this->lng->txt(
'save'));
2713 foreach($definitions as $field_id => $definition)
2715 $this->tpl->setCurrentBlock(
"user_defined");
2716 $this->tpl->setVariable(
"TXT_VISIBLE", $this->lng->txt(
"visible"));
2717 $this->tpl->setVariable(
"TXT_CHANGE", $this->lng->txt(
"changeable"));
2718 $this->tpl->setVariable(
"TXT_REQUIRED", $this->lng->txt(
"required_field"));
2721 $this->tpl->setVariable(
"TXT_SEARCHABLE", $this->lng->txt(
"header_searchable"));
2723 $this->tpl->setVariable(
"TXT_EXPORT", $this->lng->txt(
"export"));
2724 $this->tpl->setVariable(
"TXT_COURSE_EXPORT", $lng->txt(
"course_export"));
2726 $this->tpl->setVariable(
'TXT_VISIB_REG', $this->lng->txt(
'visible_registration'));
2728 $this->tpl->setVariable(
"NAME",$definition[
'field_name']);
2730 if (
$_POST[
"cmd"][
"updateFields"] !=
"")
2732 $definition[
'visible'] = isset(
$_POST[
'def'][$field_id][
'visible']) ? 1 : 0;
2733 $definition[
'changeable'] = isset(
$_POST[
'def'][$field_id][
'changeable']) ? 1 : 0;
2734 $definition[
'required'] = isset(
$_POST[
'def'][$field_id][
'required']) ? 1 : 0;
2735 $definition[
'searchable'] = isset(
$_POST[
'def'][$field_id][
'searchable']) ? 1 : 0;
2736 $definition[
'export'] = isset(
$_POST[
'def'][$field_id][
'export']) ? 1 : 0;
2737 $definition[
'course_export'] = isset(
$_POST[
'def'][$field_id][
'course_export']) ? 1 : 0;
2740 $this->tpl->setVariable(
"VISIBLE",
ilUtil::formCheckbox($definition[
'visible'],
"def[$field_id][visible]",1));
2741 $this->tpl->setVariable(
"CHANGE",
ilUtil::formCheckbox($definition[
'changeable'],
"def[$field_id][changeable]",1));
2742 $this->tpl->setVariable(
"REQUIRED",
ilUtil::formCheckbox($definition[
'required'],
"def[$field_id][required]",1));
2745 $this->tpl->setVariable(
"SEARCHABLE",
ilUtil::formCheckbox($definition[
'searchable'],
"def[$field_id][searchable]",1));
2747 $this->tpl->setVariable(
"EXPORT",
ilUtil::formCheckbox($definition[
'export'],
"def[$field_id][export]",1));
2748 $this->tpl->setVariable(
"COURSE_EXPORT",
ilUtil::formCheckbox($definition[
'course_export'],
"def[$field_id][course_export]",1));
2750 $this->tpl->setVariable(
'VISIB_REG',
2753 $this->ctrl->setParameter($this,
'field_id',$field_id);
2756 switch($definition[
'field_type'])
2759 $this->tpl->setVariable(
"EDIT_LINK",$this->ctrl->getLinkTarget($this,
'editTextField'));
2763 $this->tpl->setVariable(
"EDIT_LINK",$this->ctrl->getLinkTarget($this,
'editWysiwygField'));
2767 $this->tpl->setVariable(
"EDIT_LINK",$this->ctrl->getLinkTarget($this,
'editSelectField'));
2770 $this->tpl->setVariable(
"EDIT",$this->lng->txt(
'edit'));
2772 $this->tpl->setVariable(
"DELETE_LINK",$this->ctrl->getLinkTarget($this,
'askDeleteField'));
2773 $this->tpl->setVariable(
"DELETE",$this->lng->txt(
'delete'));
2774 $this->tpl->parseCurrentBlock();
2781 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2783 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2786 $this->ctrl->setParameter($this,
'field_id',(
int) $_GET[
'field_id']);
2789 $this->tabs_gui->setTabActive(
'settings');
2790 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2792 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_update_text_field.html');
2794 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2795 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'udf_update_text_field'));
2796 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
2798 $this->tpl->setVariable(
"FIELD_NAME",$definition[
'field_name']);
2800 $this->tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'cancel'));
2801 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'update'));
2808 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2811 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2813 $udf->setFieldName(ilUtil::stripslashes(
$_POST[
'field_name']));
2814 $udf->setFieldType($definition[
'field_type']);
2815 $udf->setFieldValues($definition[
'field_values']);
2816 $udf->enableVisible($definition[
'visible']);
2817 $udf->enableChangeable($definition[
'changeable']);
2818 $udf->enableRequired($definition[
'required']);
2819 $udf->enableSearchable($definition[
'searchable']);
2820 $udf->enableExport($definition[
'export']);
2821 $udf->enableCourseExport($definition[
'course_export']);
2823 $udf->enableVisibleRegistration($definition[
'visib_reg']);
2825 $udf->update($definition[
'field_id']);
2834 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2836 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2839 $this->ctrl->setParameter($this,
'field_id',(
int) $_GET[
'field_id']);
2842 $this->tabs_gui->setTabActive(
'settings');
2843 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2845 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_update_text_field.html');
2847 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2848 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'udf_update_wysiwyg_field'));
2849 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
2851 $this->tpl->setVariable(
"FIELD_NAME",$definition[
'field_name']);
2853 $this->tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'cancel'));
2854 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'update'));
2861 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2864 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2866 $udf->setFieldName(ilUtil::stripslashes(
$_POST[
'field_name']));
2867 $udf->setFieldType($definition[
'field_type']);
2868 $udf->setFieldValues($definition[
'field_values']);
2869 $udf->enableVisible($definition[
'visible']);
2870 $udf->enableChangeable($definition[
'changeable']);
2871 $udf->enableRequired($definition[
'required']);
2872 $udf->enableSearchable($definition[
'searchable']);
2873 $udf->enableExport($definition[
'export']);
2874 $udf->enableCourseExport($definition[
'course_export']);
2876 $udf->enableVisibleRegistration($definition[
'visib_reg']);
2878 $udf->update($definition[
'field_id']);
2887 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2892 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2895 $this->ctrl->setParameter($this,
'field_id',(
int) $_GET[
'field_id']);
2898 $this->tabs_gui->setTabActive(
'settings');
2899 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2901 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_update_select_field.html');
2904 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2905 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'udf_update_select_field'));
2906 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
2908 $this->tpl->setVariable(
"FIELD_NAME_VALUE",$definition[
'field_name']);
2912 foreach($definition[
'field_values'] as $value)
2914 $this->tpl->setCurrentBlock(
"values");
2915 $this->tpl->setVariable(
"COUNTER",$counter++);
2916 $this->tpl->setVariable(
"TXT_VALUES",$this->lng->txt(
'udf_value').
' '.($counter));
2917 $this->tpl->setVariable(
"FIELD_NAME",$value);
2919 $this->ctrl->setParameter($this,
'value_id',$counter-1);
2920 $this->tpl->setVariable(
"DELETE_LINK",$this->ctrl->getLinkTarget($this,
'deleteValue'));
2921 $this->tpl->setVariable(
"DELETE",$this->lng->txt(
'delete'));
2922 $this->tpl->parseCurrentBlock();
2926 for($i = 0; $i <
$_SESSION[
'select_num_values'];$i++)
2928 $this->tpl->setCurrentBlock(
"new_values");
2929 $this->tpl->setVariable(
"NEW_COUNTER",$counter++);
2930 $this->tpl->setVariable(
"TXT_NEW_VALUES",$this->lng->txt(
'udf_value').
' '.($counter));
2931 $this->tpl->setVariable(
"NEW_FIELD_NAME",
$_POST[
'field_values'][$counter-1]);
2932 $this->tpl->parseCurrentBlock();
2934 $this->tpl->setVariable(
"BTN_NEW_VALUE",$this->lng->txt(
'btn_new_value'));
2935 $this->tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'cancel'));
2936 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'save'));
2943 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2946 $_POST[
'field_values'] = is_array(
$_POST[
'field_values']) ?
$_POST[
'field_values'] : array();
2949 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2952 $udf->setFieldName(ilUtil::stripslashes(
$_POST[
'field_name']));
2953 $udf->setFieldValues(array_merge($definition[
'field_values'],
$_POST[
'field_values']));
2954 $udf->setFieldType($definition[
'field_type']);
2955 $udf->enableVisible($definition[
'visible']);
2956 $udf->enableChangeable($definition[
'changeable']);
2957 $udf->enableRequired($definition[
'required']);
2958 $udf->enableSearchable($definition[
'searchable']);
2959 $udf->enableExport($definition[
'export']);
2960 $udf->enableCourseExport($definition[
'course_export']);
2962 $udf->enableVisibleRegistration($definition[
'visib_reg']);
2964 if(
$error = $udf->validateValues())
2980 $udf->update($definition[
'field_id']);
2990 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2993 $udf->deleteValue((
int)
$_GET[
'field_id'],(
int) $_GET[
'value_id']);
3010 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
3015 $this->tabs_gui->setTabActive(
'settings');
3016 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
3018 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_ask_delete.html');
3020 $this->ctrl->setParameter($this,
'field_id',(
int)
$_GET[
'field_id']);
3021 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3022 $this->tpl->setVariable(
"TXT_DELETE_FIELD",$this->lng->txt(
'udf_delete_header'));
3023 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
3026 $definition = $user_field_definitions->getDefinition((
int) $_GET[
'field_id']);
3028 $this->tpl->setVariable(
"FIELD_NAME",$definition[
'field_name']);
3029 $this->tpl->setVariable(
"BTN_DELETE",$this->lng->txt(
'delete'));
3030 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
'cancel'));
3037 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
3040 $user_field_definitions->delete((
int)
$_GET[
'field_id']);
3058 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
3061 $a_fields = $user_field_definitions->getDefinitions();
3063 foreach($a_fields as $field_id => $definition)
3065 if( isset(
$_POST[
'chb'][
'required_'.$field_id]) && (
int)
$_POST[
'chb'][
'required_'.$field_id] &&
3066 (!isset(
$_POST[
'chb'][
'visib_reg_'.$field_id]) || !(
int)
$_POST[
'chb'][
'visib_reg_'.$field_id]))
3068 $this->confirm_change = 1;
3077 if ($action !=
'save')
3079 include_once
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
3081 if ($privacy->enabledExport() ==
true && $privacy->confirmationRequired() ==
true)
3083 foreach($a_fields as $field_id => $definition)
3085 if ($definition[
'course_export'] == 0 && (
int)
$_POST[
'chb'][
'course_export_'.$field_id] == 1)
3087 $this->confirm_change = 1;
3096 if ($action ==
'save')
3098 include_once(
'Modules/Course/classes/class.ilCourseAgreement.php');
3102 foreach($a_fields as $field_id => $definition)
3104 $user_field_definitions->setFieldName($definition[
'field_name']);
3105 $user_field_definitions->setFieldType($definition[
'field_type']);
3106 $user_field_definitions->setFieldValues($definition[
'field_values']);
3107 $user_field_definitions->enableVisible((
int)
$_POST[
'chb'][
'visible_'.$field_id]);
3108 $user_field_definitions->enableChangeable((
int)
$_POST[
'chb'][
'changeable_'.$field_id]);
3109 $user_field_definitions->enableRequired((
int)
$_POST[
'chb'][
'required_'.$field_id]);
3110 $user_field_definitions->enableSearchable((
int)
$_POST[
'chb'][
'searchable_'.$field_id]);
3111 $user_field_definitions->enableExport((
int)
$_POST[
'chb'][
'export_'.$field_id]);
3112 $user_field_definitions->enableCourseExport((
int)
$_POST[
'chb'][
'course_export_'.$field_id]);
3114 $user_field_definitions->enableVisibleRegistration((
int)
$_POST[
'chb'][
'visib_reg_'.$field_id]);
3116 $user_field_definitions->update($field_id);
3129 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
3135 $this->tabs_gui->setTabActive(
'settings');
3136 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
3138 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
3140 $this->form->setFormAction($this->ctrl->getFormAction($this,
'chooseDefinitions'));
3141 $this->form->setTitle($this->lng->txt(
'add_new_user_defined_field'));
3146 $radg->addOption($op1);
3148 $radg->addOption($op2);
3150 $radg->addOption($op3);
3151 $this->form->addItem($radg);
3152 $this->form->addCommandButton(
"chooseDefinitions", $lng->txt(
"btn_next"));
3153 $this->form->addCommandButton(
"listUserDefinedFields", $lng->txt(
"cancel"));
3154 $this->tpl->setContent($this->form->getHTML());
3163 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
3166 $this->tabs_gui->setTabActive(
'settings');
3167 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
3169 switch($field_type = (
int) $_REQUEST[
'field_type'])
3193 $lng->loadLanguageModule(
"administration");
3194 $lng->loadLanguageModule(
"ps");
3196 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_edit_text_field.html');
3198 include_once(
"Modules/Course/classes/class.ilCourseAgreement.php");
3201 $this->tpl->setCurrentBlock(
'warning_modify');
3202 $this->tpl->setVariable(
'TXT_WARNING', $lng->txt(
'ps_warning_modify'));
3203 $this->tpl->parseCurrentBlock();
3207 $this->ctrl->setParameter($this,
'field_type',(
int) $_REQUEST[
'field_type']);
3208 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3210 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'udf_add_field'));
3211 $this->tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'btn_previous'));
3212 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'add_new_user_defined_text_field'));
3213 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
3214 $this->tpl->setVariable(
"FIELD_NAME",
$_POST[
'field_name']);
3216 $this->tpl->setVariable(
"TXT_VISIBLE", $this->lng->txt(
"visible"));
3217 $this->tpl->setVariable(
"TXT_CHANGE", $this->lng->txt(
"changeable"));
3218 $this->tpl->setVariable(
"TXT_REQUIRED", $this->lng->txt(
"required_field"));
3219 $this->tpl->setVariable(
"TXT_SEARCHABLE", $this->lng->txt(
"header_searchable"));
3220 $this->tpl->setVariable(
"TXT_EXPORT", $this->lng->txt(
"export"));
3221 $this->tpl->setVariable(
"TXT_COURSE_EXPORT", $lng->txt(
"course_export"));
3223 $this->tpl->setVariable(
'TXT_VISIB_REG', $this->lng->txt(
'visible_registration'));
3232 $this->tpl->setVariable(
'VISIB_REG',
3242 $lng->loadLanguageModule(
"administration");
3243 $lng->loadLanguageModule(
"ps");
3245 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_edit_select_field.html');
3247 include_once(
"Modules/Course/classes/class.ilCourseAgreement.php");
3250 $this->tpl->setCurrentBlock(
'warning_modify');
3251 $this->tpl->setVariable(
'TXT_WARNING', $lng->txt(
'ps_warning_modify'));
3252 $this->tpl->parseCurrentBlock();
3256 $this->ctrl->setParameter($this,
'field_type',(
int) $_REQUEST[
'field_type']);
3257 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3258 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'udf_add_field'));
3259 $this->tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'btn_previous'));
3260 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'add_new_user_defined_select_field'));
3261 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
3262 $this->tpl->setVariable(
"FIELD_NAME_VALUE",
$_POST[
'field_name']);
3263 $this->tpl->setVariable(
"TXT_EXPORT", $this->lng->txt(
"export"));
3264 $this->tpl->setVariable(
"TXT_COURSE_EXPORT", $lng->txt(
"course_export"));
3266 $this->tpl->setVariable(
"TXT_VISIBLE", $this->lng->txt(
"visible"));
3267 $this->tpl->setVariable(
"TXT_CHANGE", $this->lng->txt(
"changeable"));
3268 $this->tpl->setVariable(
"TXT_REQUIRED", $this->lng->txt(
"required_field"));
3269 $this->tpl->setVariable(
"TXT_SEARCHABLE", $this->lng->txt(
"header_searchable"));
3271 $this->tpl->setVariable(
'TXT_VISIB_REG', $this->lng->txt(
'visible_registration'));
3280 $this->tpl->setVariable(
'VISIB_REG',
3283 $this->tpl->setVariable(
"BTN_NEW_VALUE",$this->lng->txt(
'btn_new_value'));
3285 for($i = 0; $i <
$_SESSION[
'num_values']; $i++)
3287 $this->tpl->setCurrentBlock(
"values");
3288 $this->tpl->setVariable(
"TXT_VALUES",$this->lng->txt(
'udf_value').
' '.($i+1));
3289 $this->tpl->setVariable(
"COUNTER",$i);
3290 $this->tpl->setVariable(
"FIELD_NAME",
$_POST[
'field_values'][$i]);
3291 $this->tpl->parseCurrentBlock();
3303 $lng->loadLanguageModule(
"administration");
3304 $lng->loadLanguageModule(
"ps");
3306 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_edit_wysiwyg_field.html');
3308 include_once(
"Modules/Course/classes/class.ilCourseAgreement.php");
3311 $this->tpl->setCurrentBlock(
'warning_modify');
3312 $this->tpl->setVariable(
'TXT_WARNING', $lng->txt(
'ps_warning_modify'));
3313 $this->tpl->parseCurrentBlock();
3317 $this->ctrl->setParameter($this,
'field_type',(
int) $_REQUEST[
'field_type']);
3318 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3320 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'udf_add_field'));
3321 $this->tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'btn_previous'));
3322 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'add_new_user_defined_wysiwyg_field'));
3323 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
3324 $this->tpl->setVariable(
"FIELD_NAME",
$_POST[
'field_name']);
3326 $this->tpl->setVariable(
"TXT_VISIBLE", $this->lng->txt(
"visible"));
3327 $this->tpl->setVariable(
"TXT_CHANGE", $this->lng->txt(
"changeable"));
3328 $this->tpl->setVariable(
"TXT_REQUIRED", $this->lng->txt(
"required_field"));
3329 $this->tpl->setVariable(
"TXT_EXPORT", $this->lng->txt(
"export"));
3330 $this->tpl->setVariable(
"TXT_COURSE_EXPORT", $lng->txt(
"course_export"));
3332 $this->tpl->setVariable(
'TXT_VISIB_REG', $this->lng->txt(
'visible_registration'));
3340 $this->tpl->setVariable(
'VISIB_REG',
3356 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
3359 if( isset(
$_POST[
'def'][
'required']) && (
int)
$_POST[
'def'][
'required'] &&
3360 (!isset(
$_POST[
'def'][
'visib_reg']) || !(
int)
$_POST[
'def'][
'visib_reg'])
3362 $this->confirm_change = 1;
3368 if (!strlen($_POST[
'field_name']))
3375 if($user_field_definitions->nameExists($_POST[
'field_name']))
3383 $user_field_definitions->setFieldType($_REQUEST[
'field_type']);
3386 $user_field_definitions->setFieldValues($_POST[
'field_values']);
3387 if(
$error = $user_field_definitions->validateValues())
3404 $user_field_definitions->setFieldName($_POST[
'field_name']);
3405 $user_field_definitions->enableVisible($_POST[
'def'][
'visible']);
3406 $user_field_definitions->enableChangeable($_POST[
'def'][
'changeable']);
3407 $user_field_definitions->enableRequired($_POST[
'def'][
'required']);
3408 $user_field_definitions->enableSearchable($_POST[
'def'][
'searchable']);
3409 $user_field_definitions->enableExport($_POST[
'def'][
'export']);
3410 $user_field_definitions->enableCourseExport($_POST[
'def'][
'course_export']);
3412 $user_field_definitions->enableVisibleRegistration((
int)$_POST[
'def'][
'visib_reg']);
3414 $user_field_definitions->add();
3416 if ((
int) $_POST[
'def'][
'course_export'] == 1)
3418 include_once(
'Modules/Course/classes/class.ilCourseAgreement.php');
3442 include_once
'Services/Search/classes/class.ilUserSearchOptions.php';
3443 $lng->loadLanguageModule(
"administration");
3444 $lng->loadLanguageModule(
"mail");
3448 include_once(
"./Services/User/classes/class.ilUserFieldSettingsTableGUI.php");
3450 if($this->confirm_change)
$tab->setConfirmChange();
3451 $tpl->setContent(
$tab->getHTML());
3457 $profile_fields =& $this->
object->getProfileFields();
3459 $profile_fields [] =
"preferences";
3462 $fixed_required_fields = array(
3469 "hits_per_page" => 0,
3470 "show_users_online" => 0,
3471 "instant_messengers" => 0,
3472 "hide_own_online_status" => 0,
3476 $no_export_fields = array(
3478 "show_users_online",
3479 "hide_own_online_status"
3483 $no_changeable_fields = array(
3488 $no_visible_fields = array(
3493 $disabled_visible_fields= array(
3498 $disabled_changeable_fields= array(
3504 $course_export_fields = array(
3505 "gender" => 1,
"firstname" => 2,
3506 "lastname" => 2,
"title" => 1,
3507 "upload" => 0,
"password" => 0,
3508 "institution" => 1,
"department" => 1,
3509 "street" => 1,
"zipcode" => 1,
3510 "city" => 1,
"country" => 1,
3511 "phone_office" => 1,
"phone_home" => 1,
3512 "phone_mobile" => 1,
"fax" => 1,
3513 "email" => 1,
"hobby" => 1,
3514 "referral_comment" => 0,
"matriculation" => 1,
3515 "language" => 0,
"skin_style" => 0,
3516 "hits_per_page" => 0,
"show_users_online" => 0,
3517 "instant_messengers" => 0,
3520 foreach ($profile_fields as $field)
3522 $this->tpl->setCurrentBlock(
"profile_settings");
3524 $txt = strcasecmp($field,
"upload") == 0 ?
"personal_picture" : $field;
3525 $this->tpl->setVariable(
"TXT_PROFILE_DATA", $this->lng->txt($txt));
3527 $this->tpl->setVariable(
"PROFILE_OPTION_ENABLED",
"enabled_" . $field);
3528 $this->tpl->setVariable(
"PROFILE_OPTION_VISIBLE",
"visible_" . $field);
3529 $this->tpl->setVariable(
"PROFILE_OPTION_REQUIRED",
"required_" . $field);
3532 $this->tpl->setVariable(
"HEADER_PROFILE_DATA", $this->lng->txt(
"usr_settings_header_profile_profile"));
3533 $this->tpl->setVariable(
"HEADER_ENABLED", $this->lng->txt(
"changeable"));
3534 $this->tpl->setVariable(
"HEADER_VISIBLE", $this->lng->txt(
"visible"));
3535 $this->tpl->setVariable(
"HEADER_REQUIRED", $this->lng->txt(
"required_field"));
3536 $this->tpl->setVariable(
"HEADER_EXPORT", $this->lng->txt(
"export"));
3541 $this->tpl->setVariable(
"HEADER_SEARCH",$this->lng->txt(
'header_searchable'));
3542 $checked = (
$_POST[
"cmd"][
"saveGlobalUserSettings"] && $this->confirm_change == 1) ?
3545 "cbh[$field][searchable]",
3549 if(!in_array($field,
3550 array(
'password',
'upload',
'language',
'skin_style',
'hits_per_page',
'show_users_online',
'hide_own_online_status',
'instant_messengers')))
3553 $this->tpl->setVariable(
'HEADER_VISIB_REG', $this->lng->txt(
'header_visible_registration'));
3554 $this->tpl->setVariable(
'PROFILE_OPTION_REGISTRATION',
'visib_reg_'.$field);
3555 if((
int)$ilias->getSetting(
'usr_settings_visib_reg'.$field) ||
3556 ($this->confirm_change == 1 && (int)
$_POST[
'chb'][
'visib_reg'.$field]))
3558 $this->tpl->setVariable(
'CHECKED_REGISTRATION',
' checked="checked"');
3564 if (!in_array($field, $no_changeable_fields) &&
3565 ($ilias->getSetting(
"usr_settings_disable_".$field) !=
"1" ||
3566 ($this->confirm_change == 1 && !
$_POST[
"chb"][
"enabled_" . $field])))
3568 $this->tpl->setVariable(
"CHECKED_ENABLED",
" checked=\"checked\"");
3571 if (in_array($field, $disabled_changeable_fields))
3573 $this->tpl->setVariable(
"DISABLE_ENABLED",
" disabled=\"disabled\"");
3578 if (!in_array($field, $no_visible_fields) &&
3579 ($ilias->getSetting(
"usr_settings_hide_".$field) !=
"1" ||
3580 ($this->confirm_change == 1 && !
$_POST[
"chb"][
"visible_" . $field])))
3582 $this->tpl->setVariable(
"CHECKED_VISIBLE",
" checked=\"checked\"");
3585 if (in_array($field, $disabled_visible_fields))
3587 $this->tpl->setVariable(
"DISABLE_VISIBLE",
" disabled=\"disabled\"");
3591 if (!in_array($field, $no_export_fields))
3593 $this->tpl->setVariable(
"PROFILE_OPTION_EXPORT",
"export_" . $field);
3595 if ($ilias->getSetting(
"usr_settings_export_".$field) ==
"1" ||
3596 ($this->confirm_change == 1 &&
$_POST[
"chb"][
"export_" . $field] ==
"1"))
3598 $this->tpl->setVariable(
"CHECKED_EXPORT",
" checked=\"checked\"");
3603 $is_fixed = array_key_exists($field, $fixed_required_fields);
3604 if ($is_fixed && $fixed_required_fields[$field] || ! $is_fixed &&
3605 ($ilias->getSetting(
"require_".$field) ==
"1" ||
3606 ($this->confirm_change == 1 &&
$_POST[
"chb"][
"required_" . $field] ==
"1")))
3608 $this->tpl->setVariable(
"CHECKED_REQUIRED",
" checked=\"checked\"");
3612 $this->tpl->setVariable(
"DISABLE_REQUIRED",
" disabled=\"disabled\"");
3617 if (is_array($course_export_fields))
3619 if (in_array($field, $course_export_fields) && $course_export_fields[$field] != 0)
3621 $this->tpl->setVariable(
"HEADER_COURSE_EXPORT", $lng->txt(
"course_export"));
3622 $this->tpl->setVariable(
"PROFILE_OPTION_COURSE_EXPORT",
"course_export_" . $field);
3624 if ($course_export_fields[$field] == 2)
3626 $this->tpl->setVariable(
"CHECKED_COURSE_EXPORT",
" checked=\"checked\"");
3627 $this->tpl->setVariable(
"DISABLE_COURSE_EXPORT",
" disabled=\"disabled\"");
3631 if ($ilias->getSetting(
"usr_settings_course_export_".$field) ==
"1" ||
3632 ($this->confirm_change == 1 &&
$_POST[
"chb"][
"course_export_" . $field] ==
"1"))
3634 $this->tpl->setVariable(
"CHECKED_COURSE_EXPORT",
" checked=\"checked\"");
3642 if ($field ==
"hits_per_page")
3644 $this->tpl->setVariable(
"PROFILE_OPTION_DEFAULT_VALUE",
"default_" . $field);
3645 $options = array(2,10,15,20,30,40,50,100,9999);
3646 $selected_option = $ilias->getSetting(
"hits_per_page");
3647 if ($selected_option == null) $selected_option = 10;
3648 $this->tpl->setCurrentBlock(
"default_value_option");
3649 foreach ($options as $option)
3651 if ($option == $selected_option)
3653 $this->tpl->setVariable(
"OPTION_SELECTED",
" selected=\"selected\"");
3656 $this->tpl->setVariable(
"OPTION_VALUE", $option);
3657 $this->tpl->setVariable(
"OPTION_TEXT", ($option == 9999) ? $this->lng->txt(
"no_limit") : $option);
3658 $this->tpl->parseCurrentBlock();
3660 $this->tpl->setCurrentBlock(
"profile_settings");
3661 $this->tpl->setVariable(
"HEADER_DEFAULT_VALUE", $this->lng->txt(
"default_value"));
3666 else if ($field ==
"show_users_online")
3668 $this->tpl->setVariable(
"PROFILE_OPTION_DEFAULT_VALUE",
"default_" . $field);
3669 $options = array(
'y',
'associated',
'n');
3670 $selected_option = $ilias->getSetting(
"show_users_online");
3671 if ($selected_option ==
"") $selected_option =
"y";
3672 $this->tpl->setCurrentBlock(
"default_value_option");
3673 foreach ($options as $option)
3675 if ($option == $selected_option)
3677 $this->tpl->setVariable(
"OPTION_SELECTED",
" selected=\"selected\"");
3680 $this->tpl->setVariable(
"OPTION_VALUE", $option);
3681 $this->tpl->setVariable(
"OPTION_TEXT", $this->lng->txt(
"users_online_show_short_".$option));
3682 $this->tpl->parseCurrentBlock();
3684 $this->tpl->setCurrentBlock(
"profile_settings");
3685 $this->tpl->setVariable(
"HEADER_DEFAULT_VALUE", $this->lng->txt(
"default_value"));
3689 $this->tpl->parseCurrentBlock();
3691 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
3692 $this->tpl->setVariable(
"TXT_HEADER_PROFILE", $this->lng->txt(
"usr_settings_header_profile"));
3693 $this->tpl->setVariable(
"TXT_EXPLANATION_PROFILE", $this->lng->txt(
"usr_settings_explanation_profile"));
3694 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
3696 if ($this->confirm_change == 1)
3698 $this->tpl->setVariable(
"CONFIRM_MESSAGE", $this->lng->txt(
"confirm_message_course_export"));
3699 $this->tpl->setVariable(
"BUTTON_CONFIRM", $this->lng->txt(
"confirm"));
3700 $this->tpl->setVariable(
"BUTTON_CANCEL", $this->lng->txt(
"cancel"));
3712 include_once
'Services/Search/classes/class.ilUserSearchOptions.php';
3713 include_once
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
3717 $profile_fields =& $this->
object->getProfileFields();
3720 foreach ($profile_fields as $field)
3722 if (
$_POST[
"chb"][
"required_".$field] &&
3723 !(
int)
$_POST[
'chb'][
'visib_reg_' . $field]
3734 $this->confirm_change = 1;
3740 $fixed_required_fields = array(
3747 "hits_per_page" => 0,
3748 "show_users_online" => 0,
3749 "hide_own_online_status" => 0
3754 if ($privacy->enabledExport() ==
true &&
3755 $privacy->confirmationRequired() ==
true &&
3758 foreach ($profile_fields as $field)
3760 if (! $ilias->getSetting(
"usr_settings_course_export_" . $field) &&
$_POST[
"chb"][
"course_export_" . $field] ==
"1")
3762 #ilUtil::sendQuestion($this->lng->txt('confirm_message_course_export'));
3763 #$this->confirm_change = 1;
3764 #$this->settingsObject();
3770 if($action ==
'save')
3772 include_once(
'Modules/Course/classes/class.ilCourseAgreement.php');
3776 foreach ($profile_fields as $field)
3784 if (!
$_POST[
"chb"][
"visible_".$field])
3786 $ilias->setSetting(
"usr_settings_hide_".$field,
"1");
3790 $ilias->deleteSetting(
"usr_settings_hide_".$field);
3793 if (!
$_POST[
"chb"][
"changeable_" . $field])
3795 $ilias->setSetting(
"usr_settings_disable_".$field,
"1");
3799 $ilias->deleteSetting(
"usr_settings_disable_".$field);
3803 if ((
int)
$_POST[
'chb'][
'visib_reg_' . $field])
3805 $ilSetting->set(
'usr_settings_visib_reg_'.$field,
'1');
3809 $ilSetting->set(
'usr_settings_visib_reg_'.$field,
'0');
3812 if (
$_POST[
"chb"][
"export_" . $field])
3814 $ilias->setSetting(
"usr_settings_export_".$field,
"1");
3818 $ilias->deleteSetting(
"usr_settings_export_".$field);
3821 if (
$_POST[
"chb"][
"course_export_" . $field])
3823 $ilias->setSetting(
"usr_settings_course_export_".$field,
"1");
3827 $ilias->deleteSetting(
"usr_settings_course_export_".$field);
3830 $is_fixed = array_key_exists($field, $fixed_required_fields);
3831 if ($is_fixed && $fixed_required_fields[$field] || ! $is_fixed &&
$_POST[
"chb"][
"required_".$field])
3833 $ilias->setSetting(
"require_".$field,
"1");
3837 $ilias->deleteSetting(
"require_" . $field);
3841 if (
$_POST[
"select"][
"default_hits_per_page"])
3843 $ilias->setSetting(
"hits_per_page",
$_POST[
"select"][
"default_hits_per_page"]);
3846 if (
$_POST[
"select"][
"default_show_users_online"])
3848 $ilias->setSetting(
"show_users_online",
$_POST[
"select"][
"default_show_users_online"]);
3851 if (
$_POST[
"chb"][
"export_preferences"])
3853 $ilias->setSetting(
"usr_settings_export_preferences",
$_POST[
"chb"][
"export_preferences"]);
3855 $ilias->deleteSetting(
"usr_settings_export_preferences");
3858 $ilias->setSetting(
'mail_incoming_mail', (
int)
$_POST[
'select'][
'default_mail_incoming_mail']);
3870 $action[-1] = $this->lng->txt(
'all_users');
3871 $action[1] = $this->lng->txt(
'usr_active_only');
3872 $action[0] = $this->lng->txt(
'usr_inactive_only');
3873 $action[2] = $this->lng->txt(
'usr_limited_access_only');
3874 $action[3] = $this->lng->txt(
'usr_without_courses');
3875 $action[4] = $this->lng->txt(
'usr_filter_lastlogin');
3876 $action[5] = $this->lng->txt(
"usr_filter_coursemember");
3877 $action[6] = $this->lng->txt(
"usr_filter_groupmember");
3878 $action[7] = $this->lng->txt(
"usr_filter_role");
3891 if(!isset(
$_POST[
"file"]))
3893 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
3896 if (count(
$_POST[
"file"]) > 1)
3898 $this->ilias->raiseError($this->lng->txt(
"select_max_one_item"),$this->ilias->error_obj->MESSAGE);
3902 $export_dir = $this->
object->getExportDirectory();
3912 if(!isset(
$_POST[
"file"]))
3914 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
3924 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
3927 $this->tpl->setCurrentBlock(
"table_header");
3928 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
3929 $this->tpl->parseCurrentBlock();
3935 $this->tpl->setCurrentBlock(
"table_row");
3938 $this->tpl->setVariable(
"TEXT_CONTENT", $file);
3939 $this->tpl->parseCurrentBlock();
3944 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
3945 $buttons = array(
"cancelDeleteExportFile" => $this->lng->txt(
"cancel"),
3946 "deleteExportFile" => $this->lng->txt(
"confirm"));
3947 foreach ($buttons as
$name => $value)
3949 $this->tpl->setCurrentBlock(
"operation_btn");
3950 $this->tpl->setVariable(
"BTN_NAME",
$name);
3951 $this->tpl->setVariable(
"BTN_VALUE",$value);
3952 $this->tpl->parseCurrentBlock();
3962 session_unregister(
"ilExportFiles");
3963 ilUtil::redirect($this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"export"));
3972 $export_dir = $this->
object->getExportDirectory();
3975 $exp_file = $export_dir.
"/".
$file;
3976 if (@is_file($exp_file))
3981 ilUtil::redirect($this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"export"));
3998 if (
$_POST[
"cmd"][
"export"])
4000 $this->
object->buildExportFile(
$_POST[
"export_type"]);
4001 ilUtil::redirect($this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"export"));
4007 $export_types = array(
4008 "userfolder_export_excel_x86",
4009 "userfolder_export_csv",
4010 "userfolder_export_xml"
4014 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
4018 $this->tpl->addBlockfile(
"EXPORT_FILES",
"export_files",
"tpl.table.html");
4021 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.usr_export_file_row.html");
4025 $tbl->setTitle($this->lng->txt(
"userfolder_export_files"));
4027 $tbl->setHeaderNames(array(
"", $this->lng->txt(
"userfolder_export_file"),
4028 $this->lng->txt(
"userfolder_export_file_size"), $this->lng->txt(
"date") ));
4029 $tbl->setHeaderVars(array(), $ilCtrl->getParameterArray($this,
"export"));
4031 $tbl->enabled[
"sort"] =
false;
4032 $tbl->setColumnWidth(array(
"1%",
"49%",
"25%",
"25%"));
4035 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
4036 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
4037 $tbl->setLimit(
$_GET[
"limit"]);
4038 $tbl->setOffset(
$_GET[
"offset"]);
4039 $tbl->setMaxCount($this->maxcount);
4042 $this->tpl->setVariable(
"COLUMN_COUNTS", 4);
4046 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
4047 $this->tpl->setCurrentBlock(
"tbl_action_btn");
4048 $this->tpl->setVariable(
"BTN_NAME",
"confirmDeleteExportFile");
4049 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
4050 $this->tpl->parseCurrentBlock();
4052 $this->tpl->setCurrentBlock(
"tbl_action_btn");
4053 $this->tpl->setVariable(
"BTN_NAME",
"downloadExportFile");
4054 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"download"));
4055 $this->tpl->parseCurrentBlock();
4058 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
4061 $export_files = $this->
object->getExportFiles();
4063 $tbl->setMaxCount(count($export_files));
4064 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
4068 if(count($export_files) > 0)
4071 foreach($export_files as $exp_file)
4073 $this->tpl->setCurrentBlock(
"tbl_content");
4074 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"filename"]);
4077 $this->tpl->setVariable(
"CSS_ROW", $css_row);
4079 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"filesize"]);
4080 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"filename"]);
4082 $file_arr = explode(
"__", $exp_file[
"filename"]);
4085 $this->tpl->parseCurrentBlock();
4088 $this->tpl->setCurrentBlock(
"selectall");
4089 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
4090 $this->tpl->setVariable(
"CSS_ROW", $css_row);
4091 $this->tpl->parseCurrentBlock();
4095 $this->tpl->setCurrentBlock(
"notfound");
4096 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
4097 $this->tpl->setVariable(
"NUM_COLS", 3);
4098 $this->tpl->parseCurrentBlock();
4101 $this->tpl->parseCurrentBlock();
4104 foreach ($export_types as $export_type)
4106 $this->tpl->setCurrentBlock(
"option");
4107 $this->tpl->setVariable(
"OPTION_VALUE", $export_type);
4108 $this->tpl->setVariable(
"OPTION_TEXT", $this->lng->txt($export_type));
4109 $this->tpl->parseCurrentBlock();
4112 $this->tpl->setVariable(
"EXPORT_BUTTON", $this->lng->txt(
"create_export_file"));
4113 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
4124 $this->tabs_gui->setTabActive(
'settings');
4125 $this->tabs_gui->setSubTabActive(
'user_new_account_mail');
4127 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_new_account_mail.html');
4128 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
4131 $lng->loadLanguageModule(
"meta");
4132 $lng->loadLanguageModule(
"mail");
4133 $this->tpl->setVariable(
"TXT_NEW_USER_ACCOUNT_MAIL", $lng->txt(
"user_new_account_mail"));
4134 $this->tpl->setVariable(
"TXT_NEW_USER_ACCOUNT_MAIL_DESC", $lng->txt(
"user_new_account_mail_desc"));
4137 $this->tpl->setVariable(
"TXT_USE_PLACEHOLDERS", $lng->txt(
"mail_nacc_use_placeholder"));
4138 $this->tpl->setVariable(
"TXT_MAIL_SALUTATION", $lng->txt(
"mail_nacc_salutation"));
4139 $this->tpl->setVariable(
"TXT_FIRST_NAME", $lng->txt(
"firstname"));
4140 $this->tpl->setVariable(
"TXT_LAST_NAME", $lng->txt(
"lastname"));
4141 $this->tpl->setVariable(
"TXT_EMAIL", $lng->txt(
"email"));
4142 $this->tpl->setVariable(
"TXT_LOGIN", $lng->txt(
"mail_nacc_login"));
4143 $this->tpl->setVariable(
"TXT_PASSWORD", $lng->txt(
"password"));
4144 $this->tpl->setVariable(
"TXT_PASSWORD_BLOCK", $lng->txt(
"mail_nacc_pw_block"));
4145 $this->tpl->setVariable(
"TXT_NOPASSWORD_BLOCK", $lng->txt(
"mail_nacc_no_pw_block"));
4146 $this->tpl->setVariable(
"TXT_ADMIN_MAIL", $lng->txt(
"mail_nacc_admin_mail"));
4147 $this->tpl->setVariable(
"TXT_ILIAS_URL", $lng->txt(
"mail_nacc_ilias_url"));
4148 $this->tpl->setVariable(
"TXT_CLIENT_NAME", $lng->txt(
"mail_nacc_client_name"));
4149 $this->tpl->setVariable(
"TXT_TARGET", $lng->txt(
"mail_nacc_target"));
4150 $this->tpl->setVariable(
"TXT_TARGET_TITLE", $lng->txt(
"mail_nacc_target_title"));
4151 $this->tpl->setVariable(
"TXT_TARGET_TYPE", $lng->txt(
"mail_nacc_target_type"));
4152 $this->tpl->setVariable(
"TXT_TARGET_BLOCK", $lng->txt(
"mail_nacc_target_block"));
4154 $langs = $lng->getInstalledLanguages();
4155 foreach($langs as $lang_key)
4157 $amail = $this->
object->_lookupNewAccountMail($lang_key);
4158 $this->tpl->setCurrentBlock(
"mail_block");
4160 if ($lang_key == $lng->getDefaultLanguage())
4162 $add =
" (".$lng->txt(
"default").
")";
4164 $this->tpl->setVariable(
"TXT_LANGUAGE",
4165 $lng->txt(
"meta_l_".$lang_key).$add);
4166 $this->tpl->setVariable(
"TXT_BODY", $lng->txt(
"message_content"));
4167 $this->tpl->setVariable(
"TA_BODY",
"body_".$lang_key);
4168 $this->tpl->setVariable(
"VAL_BODY",
4170 $this->tpl->setVariable(
"TXT_SUBJECT", $lng->txt(
"subject"));
4171 $this->tpl->setVariable(
"INPUT_SUBJECT",
"subject_".$lang_key);
4172 $this->tpl->setVariable(
"VAL_SUBJECT",
4174 $this->tpl->setVariable(
"TXT_SAL_G", $lng->txt(
"mail_salutation_general"));
4175 $this->tpl->setVariable(
"INPUT_SAL_G",
"sal_g_".$lang_key);
4176 $this->tpl->setVariable(
"VAL_SAL_G",
4178 $this->tpl->setVariable(
"TXT_SAL_M", $lng->txt(
"mail_salutation_male"));
4179 $this->tpl->setVariable(
"INPUT_SAL_M",
"sal_m_".$lang_key);
4180 $this->tpl->setVariable(
"VAL_SAL_M",
4182 $this->tpl->setVariable(
"TXT_SAL_F", $lng->txt(
"mail_salutation_female"));
4183 $this->tpl->setVariable(
"INPUT_SAL_F",
"sal_f_".$lang_key);
4184 $this->tpl->setVariable(
"VAL_SAL_F",
4186 $this->tpl->parseCurrentBlock();
4188 $this->tpl->setVariable(
"TXT_CANCEL", $lng->txt(
"cancel"));
4189 $this->tpl->setVariable(
"TXT_SAVE", $lng->txt(
"save"));
4194 $this->ctrl->redirect($this,
"settings");
4202 $langs = $lng->getInstalledLanguages();
4203 foreach($langs as $lang_key)
4205 $this->
object->_writeNewAccountMail($lang_key,
4212 $this->ctrl->redirect($this,
"newAccountMail");
4227 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
4231 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
4233 $tabs_gui->addTarget(
"obj_usrf",
4234 $this->ctrl->getLinkTarget($this,
"view"), array(
"view",
"delete",
"resetFilter",
"userAction",
""),
"",
"");
4236 $tabs_gui->addTarget(
"search_user_extended",
4237 $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'startExtended'),
4238 array(
""),
"iladminusersearchgui",
"");
4241 if ($rbacsystem->checkAccess(
"write",$this->object->getRefId()))
4243 $tabs_gui->addTarget(
"settings",
4244 $this->ctrl->getLinkTarget($this,
"settings"), array(
"settings",
"saveGlobalUserSettings"),
"",
"");
4246 $tabs_gui->addTarget(
"export",
4247 $this->ctrl->getLinkTarget($this,
"export"),
"export",
"",
"");
4253 $tabs_gui->addTarget(
"learning_progress",
4254 $this->ctrl->getLinkTarget($this,
"learningProgress"),
"learningProgress",
"",
"");
4258 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
4260 $tabs_gui->addTarget(
"perm_settings",
4261 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
4262 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
4272 global $rbacsystem,$ilUser;
4277 $this->tabs_gui->addSubTabTarget(
"standard_fields",
4278 $this->ctrl->getLinkTarget($this,
'settings'),
4279 array(
"settings",
"saveGlobalUserSettings"), get_class($this));
4280 $this->tabs_gui->addSubTabTarget(
"user_defined_fields",
4281 $this->ctrl->getLinkTarget($this,
'listUserDefinedFields'),
4282 "listUserDefinedFields",get_class($this));
4283 $this->tabs_gui->addSubTabTarget(
"user_new_account_mail",
4284 $this->ctrl->getLinkTarget($this,
'newAccountMail'),
4285 "newAccountMail",get_class($this));
4286 $this->tabs_gui->addSubTabTarget(
'loginname_settings',
4287 $this->ctrl->getLinkTarget($this,
'showLoginnameSettings'),
'showLoginnameSettings', get_class($this));
4298 $this->loginSettingsForm->setValuesByArray(array(
4299 'allow_change_loginname' => (
bool)$ilSetting->get(
'allow_change_loginname'),
4300 'create_history_loginname' => (bool)$ilSetting->get(
'create_history_loginname'),
4301 'prevent_reuse_of_loginnames' => (bool)$ilSetting->get(
'prevent_reuse_of_loginnames'),
4302 'loginname_change_blocking_time' => (int)$ilSetting->get(
'loginname_change_blocking_time')
4305 $this->tpl->setVariable(
'ADM_CONTENT', $this->loginSettingsForm->getHTML());
4311 $this->tabs_gui->setTabActive(
'settings');
4312 $this->tabs_gui->setSubTabActive(
'loginname_settings');
4314 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
4316 $this->loginSettingsForm->
setFormAction($this->ctrl->getFormAction($this,
'saveLoginnameSettings'));
4317 $this->loginSettingsForm->setTitle($this->lng->txt(
'loginname_settings'));
4319 $chbChangeLogin =
new ilCheckboxInputGUI($this->lng->txt(
'allow_change_loginname'),
'allow_change_loginname');
4321 $this->loginSettingsForm->addItem($chbChangeLogin);
4322 $chbCreateHistory =
new ilCheckboxInputGUI($this->lng->txt(
'history_loginname'),
'create_history_loginname');
4323 $chbCreateHistory->
setInfo($this->lng->txt(
'loginname_history_info'));
4324 $chbCreateHistory->setValue(1);
4325 $chbChangeLogin->addSubItem($chbCreateHistory);
4326 $chbReuseLoginnames =
new ilCheckboxInputGUI($this->lng->txt(
'reuse_of_loginnames_contained_in_history'),
'prevent_reuse_of_loginnames');
4328 $chbReuseLoginnames->setInfo($this->lng->txt(
'prevent_reuse_of_loginnames_contained_in_history_info'));
4329 $chbChangeLogin->addSubItem($chbReuseLoginnames);
4330 $chbChangeBlockingTime =
new ilTextInputGUI($this->lng->txt(
'loginname_change_blocking_time'),
'loginname_change_blocking_time');
4331 $chbChangeBlockingTime->
setInfo($this->lng->txt(
'loginname_change_blocking_time_info'));
4332 $chbChangeBlockingTime->setSize(10);
4333 $chbChangeBlockingTime->setMaxLength(10);
4334 $chbChangeLogin->addSubItem($chbChangeBlockingTime);
4336 $this->loginSettingsForm->addCommandButton(
'saveLoginnameSettings', $this->lng->txt(
'save'));
4344 if($this->loginSettingsForm->checkInput())
4348 if(strlen($this->loginSettingsForm->getInput(
'loginname_change_blocking_time')) &&
4349 !preg_match(
'/^[0-9]*$/',
4350 $this->loginSettingsForm->getInput(
'loginname_change_blocking_time')))
4353 $this->loginSettingsForm->getItemByPostVar(
'loginname_change_blocking_time')
4354 ->setAlert($this->lng->txt(
'loginname_change_blocking_time_invalidity_info'));
4359 $ilSetting->set(
'allow_change_loginname', (
int)$this->loginSettingsForm->getInput(
'allow_change_loginname'));
4360 $ilSetting->set(
'create_history_loginname', (
int)$this->loginSettingsForm->getInput(
'create_history_loginname'));
4361 $ilSetting->set(
'prevent_reuse_of_loginnames', (
int)$this->loginSettingsForm->getInput(
'prevent_reuse_of_loginnames'));
4362 $ilSetting->set(
'loginname_change_blocking_time', (
int)$this->loginSettingsForm->getInput(
'loginname_change_blocking_time'));
4375 $this->loginSettingsForm->setValuesByPost();
4377 $this->tpl->setVariable(
'ADM_CONTENT', $this->loginSettingsForm->getHTML());