38 require_once
"./classes/class.ilObjectGUI.php";
51 define(
'USER_FOLDER_ID',7);
54 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
56 $this->lng->loadLanguageModule(
'search');
61 $this->user_owner_id = $a_id;
65 return $this->user_owner_id ? $this->user_owner_id :
USER_FOLDER_ID;
70 $next_class = $this->ctrl->getNextClass($this);
71 $cmd = $this->ctrl->getCmd();
77 case 'ilpermissiongui':
78 include_once(
"./classes/class.ilPermissionGUI.php");
80 $ret =& $this->ctrl->forwardCommand($perm_gui);
83 case 'iladminusersearchgui':
84 include_once(
'./Services/Search/classes/class.ilAdminUserSearchGUI.php');
86 $user_search->setCallbackClass($this);
88 $this->tabs_gui->setTabActive(
'obj_usrf');
89 $this->ctrl->setReturn($this,
'view');
90 $ret =& $this->ctrl->forwardCommand($user_search);
109 global
$ilErr,$rbacsystem;
111 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()))
113 $ilErr->raiseError($this->lng->txt(
"permission_denied"),$ilErr->MESSAGE);
116 include_once
'./classes/class.ilExcelWriterAdapter.php';
125 $workbook =& $pewa->getWorkbook();
131 include_once
'classes/class.ilExcelUtils.php';
133 $workbook =& $pewa->getWorkbook();
134 $worksheet =& $workbook->addWorksheet($this->lng->txt(
'objs_usr'));
137 $worksheet->mergeCells(0,0,0,4);
138 $worksheet->setColumn(1,0,32);
139 $worksheet->setColumn(1,1,32);
140 $worksheet->setColumn(1,2,32);
141 $worksheet->setColumn(1,3,32);
142 $worksheet->setColumn(1,4,32);
144 $title = $this->lng->txt(
'learning_progress');
145 $title .=
' '.$this->lng->txt(
'as_of').
': ';
146 $title .= strftime(
'%Y-%m-%d %R',time());
162 foreach($usr_data as
$user)
164 $worksheet->writeString($counter,0,$user[
'login']);
165 $worksheet->writeString($counter,1,$user[
'lastname']);
166 $worksheet->writeString($counter,2,$user[
'firstname']);
168 $pewa->getFormatDayTime());
169 $worksheet->writeString($counter,4,$user[
'last_login'],
170 $pewa->getFormatDate());
179 include_once
'Services/Tracking/classes/class.ilOnlineTracking.php';
180 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
184 global $ilUser,$rbacsystem;
186 $this->max_count = $ilUser->getPref(
'hits_per_page');
188 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()))
190 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
201 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
204 $this->lng->loadLanguageModule(
'payment');
205 $this->tpl->setCurrentBlock(
"btn_cell");
206 $this->tpl->setVariable(
"BTN_LINK",
207 $this->ctrl->getLinkTarget($this,
"learningProgressExcelExport"));
208 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"excel_export"));
209 $this->tpl->parseCurrentBlock();
212 $data[
"cols"] = array(
"login",
"firstname",
"lastname",
"online_time",
'last_login');
215 $num_users = count($usr_data) - 1;
220 $usr_data = array_slice($usr_data,
$_GET[
"offset"],$this->max_count);
222 foreach ($usr_data as $val)
224 if ($val[
"usr_id"] == ANONYMOUS_USER_ID)
229 $data[
"data"][
"$val[usr_id]"] = array(
230 "login" => $val[
"login"],
231 "firstname" => $val[
"firstname"],
232 "lastname" => $val[
"lastname"],
238 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_list.html");
242 include_once
"./Services/Table/classes/class.ilTableGUI.php";
243 $this->tpl->addBlockfile(
"USR_TABLE",
"user_table",
"tpl.table.html");
244 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.usr_tbl_row.html");
246 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
252 $tbl->setTitle($this->object->getTitle(),
"icon_usr.gif",
253 $this->lng->txt(
"obj_".$this->object->getType()));
255 foreach (
$data[
"cols"] as $val)
257 $header_names[] = $this->lng->txt($val);
260 $tbl->setHeaderNames($header_names);
262 $header_params = $this->ctrl->getParameterArray($this,
"learningProgress");
263 $tbl->setHeaderVars(
$data[
"cols"],$header_params);
264 $tbl->setColumnWidth(array(
"20%",
"20$%",
"20%",
"20%"));
269 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
270 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
271 $tbl->setLimit($this->max_count);
272 $tbl->setOffset(
$_GET[
"offset"]);
273 $tbl->setMaxCount($num_users);
276 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
283 foreach(
$data[
'data'] as $usr_id => $fields)
288 $this->tpl->setVariable(
"CSS_ROW", $css_row);
290 foreach ($fields as $key => $val)
295 $this->ids[] =
$ctrl[
"obj_id"];
297 if ($key ==
"login" and $lp_active)
299 $this->ctrl->setParameterByClass(
"illearningprogressgui",
"ref_id",$this->object->getRefId());
300 $this->ctrl->setParameterByClass(
"illearningprogressgui",
"obj_id", $usr_id);
301 $link = $this->ctrl->getLinkTargetByClass(array(
"ilobjusergui",
'illearningprogressgui'),
"");
303 $this->tpl->setCurrentBlock(
"begin_link");
304 $this->tpl->setVariable(
"LINK_TARGET", $link);
305 $this->tpl->parseCurrentBlock();
306 $this->tpl->touchBlock(
"end_link");
309 $this->tpl->setCurrentBlock(
"text");
310 $this->tpl->setVariable(
"TEXT_CONTENT", $val);
311 $this->tpl->parseCurrentBlock();
312 $this->tpl->setCurrentBlock(
"table_cell");
313 $this->tpl->parseCurrentBlock();
316 $this->tpl->setCurrentBlock(
"tbl_content");
317 $this->tpl->setVariable(
"CSS_ROW", $css_row);
318 $this->tpl->parseCurrentBlock();
343 $_SESSION[
"usergui_cmd_node"] = $this->ctrl->getNodeIdForTargetClass($this->ctrl->getCmdNode(),
"ilobjusergui");
344 $this->ctrl->saveParameter($this,
"user_filter_date_y");
345 $this->ctrl->saveParameter($this,
"user_filter_date_m");
346 $this->ctrl->saveParameter($this,
"user_filter_date_d");
347 $this->ctrl->saveParameter($this,
"selected_course");
348 $this->ctrl->saveParameter($this,
"selected_group");
349 $this->ctrl->saveParameter($this,
"selected_role");
350 $this->ctrl->saveParameterByClass(
"ilAdminUserSearchGUI",
"user_filter_date_y");
351 $this->ctrl->saveParameterByClass(
"ilAdminUserSearchGUI",
"user_filter_date_m");
352 $this->ctrl->saveParameterByClass(
"ilAdminUserSearchGUI",
"user_filter_date_d");
353 $this->ctrl->saveParameterByClass(
"ilAdminUserSearchGUI",
"selected_course");
354 $this->ctrl->saveParameterByClass(
"ilAdminUserSearchGUI",
"selected_group");
355 $this->ctrl->saveParameterByClass(
"ilAdminUserSearchGUI",
"selected_role");
356 if (strlen(
$_GET[
"user_filter_date_y"].
$_GET[
"user_filter_date_m"].
$_GET[
"user_filter_date_d"]))
359 "y" => $_GET[
"user_filter_date_y"],
360 "m" => $_GET[
"user_filter_date_m"],
361 "d" => $_GET[
"user_filter_date_d"],
364 if (strlen($_GET[
"selected_course"]))
366 $_SESSION[
"user_filter_data"] = $_GET[
"selected_course"];
368 if (strlen($_GET[
"selected_group"]))
370 $_SESSION[
"user_filter_data"] = $_GET[
"selected_group"];
372 if (strlen($_GET[
"selected_role"]))
374 $_SESSION[
"user_filter_data"] = $_GET[
"selected_role"];
376 if (isset($_POST[
"user_filter"]))
378 $_SESSION[
"user_filter"] = $_POST[
"user_filter"];
379 switch ($_POST[
"user_filter"])
382 $_SESSION[
"user_filter_data"] = $_POST[
"date"];
383 $this->ctrl->setParameterByClass(
"ilAdminUserSearchGUI",
"user_filter_date_y", $_POST[
"date"][
"y"]);
384 $this->ctrl->setParameterByClass(
"ilAdminUserSearchGUI",
"user_filter_date_m", $_POST[
"date"][
"m"]);
385 $this->ctrl->setParameterByClass(
"ilAdminUserSearchGUI",
"user_filter_date_d", $_POST[
"date"][
"d"]);
386 $this->ctrl->setParameter($this,
"user_filter_date_y", $_POST[
"date"][
"y"]);
387 $this->ctrl->setParameter($this,
"user_filter_date_m", $_POST[
"date"][
"m"]);
388 $this->ctrl->setParameter($this,
"user_filter_date_d", $_POST[
"date"][
"d"]);
391 $_SESSION[
"user_filter_data"] = $_POST[
"courseId"];
392 $this->ctrl->setParameterByClass(
"ilAdminUserSearchGUI",
"selected_course", $_POST[
"courseId"]);
393 $this->ctrl->setParameter($this,
"selected_course", $_POST[
"courseId"]);
396 $_SESSION[
"user_filter_data"] = $_POST[
"groupId"];
397 $this->ctrl->setParameterByClass(
"ilAdminUserSearchGUI",
"selected_group", $_POST[
"groupId"]);
398 $this->ctrl->setParameter($this,
"selected_group", $_POST[
"groupId"]);
401 $_SESSION[
"user_filter_data"] = $_POST[
"roleId"];
402 $this->ctrl->setParameterByClass(
"ilAdminUserSearchGUI",
"selected_role", $_POST[
"roleId"]);
403 $this->ctrl->setParameter($this,
"selected_role", $_POST[
"roleId"]);
414 if (isset(
$_GET[
"sort_by"]))
418 if (isset(
$_GET[
"sort_order"]))
422 if (isset(
$_GET[
"offset"]))
430 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
432 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
436 $this->data = array();
437 $this->data[
"data"] = array();
438 $this->data[
"ctrl"] = array();
440 $this->data[
"cols"] = array(
"",
"login",
"firstname",
"lastname",
"email",
"access_until",
"last_login");
442 $usr_data =
ilObjUser::_getAllUserData(array(
"login",
"firstname",
"lastname",
"email",
"time_limit_until",
"time_limit_unlimited",
"last_login",
"active"),
$_SESSION[
"user_filter"]);
445 $current_time = time();
447 foreach ($usr_data as $val)
449 if ($val[
"usr_id"] == ANONYMOUS_USER_ID)
459 if ($val[
"time_limit_unlimited"])
461 $txt_access = $this->lng->txt(
"access_unlimited");
463 elseif ($val[
"time_limit_until"] < $current_time)
465 $txt_access = $this->lng->txt(
"access_expired");
474 $txt_access = $this->lng->txt(
"inactive");
477 $this->data[
"data"][] = array(
478 "login" => $val[
"login"],
479 "firstname" => $val[
"firstname"],
480 "lastname" => $val[
"lastname"],
481 "email" => $val[
"email"],
482 "access_until" => $txt_access,
483 "last_login" => $val[
"last_login"],
484 "obj_id" => $val[
"usr_id"]
488 $this->maxcount = count($this->data[
"data"]);
490 if (
$_GET[
"offset"] >= $this->maxcount)
496 if (
$_GET[
"sort_by"] ==
"name")
498 $_GET[
"sort_by"] =
"login";
504 $this->data[
"data"] = array_slice($this->data[
"data"],
$_GET[
"offset"],
$_GET[
"limit"]);
507 foreach ($this->data[
"data"] as $key => $val)
509 $this->data[
"ctrl"][$key] = array(
510 "ref_id" => $this->
id,
511 "obj_id" => $val[
"obj_id"]
513 $tmp[] = $val[
"obj_id"];
514 unset($this->data[
"data"][$key][
"obj_id"]);
518 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
521 $this->tpl->setCurrentBlock(
"btn_cell");
522 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'startExtended'));
523 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"search_user_extended"));
524 $this->tpl->parseCurrentBlock();
528 $this->tpl->setCurrentBlock(
"btn_cell");
529 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show'));
530 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"last_search_result"));
531 $this->tpl->parseCurrentBlock();
534 $this->tpl->setCurrentBlock(
"btn_cell");
535 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTarget($this,
"importUserForm"));
536 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"import_users"));
537 $this->tpl->parseCurrentBlock();
539 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_list.html");
544 $this->tpl->setCurrentBlock(
"filter_date");
546 $this->tpl->setVariable(
"TEXT_FILTER_DATE", $this->lng->txt(
"before"));
547 $this->tpl->parseCurrentBlock();
550 $this->tpl->setCurrentBlock(
"filter_course");
554 $this->tpl->setVariable(
"COURSE_SELECTION", $select);
555 $this->tpl->setVariable(
"TEXT_FILTER_COURSE", $this->lng->txt(
"course"));
556 $this->tpl->parseCurrentBlock();
559 $this->tpl->setCurrentBlock(
"filter_group");
563 $this->tpl->setVariable(
"GROUP_SELECTION", $select);
564 $this->tpl->setVariable(
"TEXT_FILTER_GROUP", $this->lng->txt(
"grp"));
565 $this->tpl->parseCurrentBlock();
569 $this->tpl->setCurrentBlock(
"filter_role");
570 $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId());
572 foreach ($roles as $role)
574 $options[$role[
"rol_id"]] = $role[
"title"];
577 $this->tpl->setVariable(
"ROLE_SELECTION", $select);
578 $this->tpl->setVariable(
"TEXT_FILTER_ROLE", $this->lng->txt(
"role"));
579 $this->tpl->parseCurrentBlock();
582 $this->tpl->setCurrentBlock(
"filter");
583 $this->tpl->setVariable(
"FILTER_TXT_FILTER",$this->lng->txt(
'filter'));
585 $this->tpl->setVariable(
"FILTER_ACTION",$this->ctrl->getFormAction($this));
586 $this->tpl->setVariable(
"FILTER_NAME",
'view');
587 $this->tpl->setVariable(
"FILTER_VALUE",$this->lng->txt(
'apply_filter'));
588 $this->tpl->setVariable(
"FILTER_VALUE_RESET",$this->lng->txt(
'reset_filter'));
589 $this->tpl->parseCurrentBlock();
591 $this->tpl->setCurrentBlock(
"search");
592 $this->tpl->setVariable(
"SEARCH_TXT_SEARCH",$this->lng->txt(
'search'));
593 $this->ctrl->setParameterByClass(
"ilAdminUserSearchGUI",
"user_filter",
$_SESSION[
"user_filter"]);
594 $this->tpl->setVariable(
"SEARCH_ACTION",$this->ctrl->getFormActionByClass(
'ilAdminUserSearchGUI',
'startSimple'));
595 $this->tpl->setVariable(
"SEARCH_NAME",
'startSimple');
596 $this->tpl->setVariable(
"SEARCH_VALUE",$this->lng->txt(
'search_users'));
597 $this->tpl->parseCurrentBlock();
612 if (!is_array($this->data[
"data"][0]))
617 include_once
"./Services/Table/classes/class.ilTableGUI.php";
620 $this->tpl->addBlockfile(
"USR_TABLE",
"user_table",
"tpl.table.html");
622 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.obj_tbl_rows.html");
627 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
633 $tbl->setTitle($this->object->getTitle(),
"icon_usr.gif", $this->lng->txt(
"obj_".$this->object->getType()));
635 foreach ($this->data[
"cols"] as $val)
637 $header_names[] = $this->lng->txt($val);
640 $tbl->setHeaderNames($header_names);
642 $header_params = $this->ctrl->getParameterArray($this,
"view");
643 $tbl->setHeaderVars($this->data[
"cols"],$header_params);
644 $tbl->setColumnWidth(array(
"",
"15%",
"15%",
"15%",
"20%",
"15%",
"20%"));
646 $tbl->enable(
"select_all");
647 $tbl->enable(
"numinfo_header");
648 $tbl->setFormName(
"cmd");
649 $tbl->setSelectAllCheckbox(
"id");
652 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
653 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
654 $tbl->setLimit(
$_GET[
"limit"]);
655 $tbl->setOffset(
$_GET[
"offset"]);
656 $tbl->setMaxCount($this->maxcount);
658 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
663 if (is_array($this->data[
"data"][0]))
666 for ($i=0; $i < count($this->data[
"data"]); $i++)
668 $data = $this->data[
"data"][$i];
669 $ctrl = $this->data[
"ctrl"][$i];
674 $this->tpl->setCurrentBlock(
"checkbox");
675 $this->tpl->setVariable(
"CHECKBOX_ID",
$ctrl[
"obj_id"]);
676 $this->tpl->setVariable(
"CSS_ROW", $css_row);
677 $this->tpl->parseCurrentBlock();
679 $this->tpl->setCurrentBlock(
"table_cell");
680 $this->tpl->setVariable(
"CELLSTYLE",
"tblrow1");
681 $this->tpl->parseCurrentBlock();
683 foreach (
$data as $key => $val)
686 $this->ctrl->setParameterByClass(
"ilobjusergui",
"ref_id",
"7");
687 $this->ctrl->setParameterByClass(
"ilobjusergui",
"obj_id",
$ctrl[
"obj_id"]);
688 $link = $this->ctrl->getLinkTargetByClass(
"ilobjusergui",
"view");
691 $this->ids[] =
$ctrl[
"obj_id"];
695 $this->tpl->setCurrentBlock(
"begin_link");
696 $this->tpl->setVariable(
"LINK_TARGET", $link);
697 $this->tpl->parseCurrentBlock();
698 $this->tpl->touchBlock(
"end_link");
701 if ($key ==
"access_until")
703 if ($val == $this->lng->txt(
"access_unlimited"))
705 $val =
"<span class=\"smallgreen\">".$val.
"</span>";
707 elseif ($val == $this->lng->txt(
"access_expired") ||
708 $val == $this->lng->txt(
"inactive"))
710 $val =
"<span class=\"smallred\">".$val.
"</span>";
714 $val =
"<span class=\"small\">".$val.
"</span>";
718 if ($key ==
"last_login")
723 if ($key !=
"access_until")
725 $val =
"<span class=\"small\">".$val.
"</span>";
728 $this->tpl->setCurrentBlock(
"text");
729 $this->tpl->setVariable(
"TEXT_CONTENT", $val);
730 $this->tpl->parseCurrentBlock();
731 $this->tpl->setCurrentBlock(
"table_cell");
732 $this->tpl->parseCurrentBlock();
735 $this->tpl->setCurrentBlock(
"tbl_content");
736 $this->tpl->setVariable(
"CSS_ROW", $css_row);
737 $this->tpl->parseCurrentBlock();
756 $operations = array();
758 if ($this->actions ==
"")
761 "delete" => array(
"name" =>
"delete",
"lng" =>
"delete"),
762 "activate" => array(
"name" =>
"activate",
"lng" =>
"activate"),
763 "deactivate" => array(
"name" =>
"deactivate",
"lng" =>
"deactivate"),
764 "accessRestrict" => array(
"name" =>
"accessRestrict",
"lng" =>
"accessRestrict"),
765 "accessFree" => array(
"name" =>
"accessFree",
"lng" =>
"accessFree"),
766 "export" => array(
"name" =>
"export",
"lng" =>
"export")
775 if ($rbacsystem->checkAccess($row[
"name"],$this->object->getRefId()))
777 $operations[] = $row;
781 if (count($operations) > 0)
783 $select =
"<select name=\"selectedAction\">\n";
784 foreach ($operations as $val)
786 $select .=
"<option value=\"" . $val[
"name"] .
"\"";
787 if (strcmp($_POST[
"selectedAction"], $val[
"name"]) == 0)
789 $select .=
" selected=\"selected\"";
792 $select .= $this->lng->txt($val[
"lng"]);
793 $select .=
"</option>";
795 $select .=
"</select>";
796 $this->tpl->setCurrentBlock(
"tbl_action_select");
797 $this->tpl->setVariable(
"SELECT_ACTION", $select);
798 $this->tpl->setVariable(
"BTN_NAME",
"userAction");
799 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"submit"));
800 $this->tpl->parseCurrentBlock();
803 if ($with_subobjects ===
true)
808 if ((count($operations) > 0) or $subobjs ===
true)
810 $this->tpl->setCurrentBlock(
"tbl_action_row");
811 $this->tpl->setVariable(
"COLUMN_COUNTS",count($this->data[
"cols"]));
813 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
814 $this->tpl->parseCurrentBlock();
828 $d = $this->objDefinition->getCreatableSubObjects($this->object->getType());
830 if (!$rbacsystem->checkAccess(
'create_user',$this->object->getRefId()))
843 for ($i=0; $i<count($this->data[
"ctrl"]); $i++)
845 if ($this->data[
"ctrl"][$i][
"type"] == $row[
"name"])
851 if ($row[
"max"] ==
"" || $count < $row[
"max"])
853 $subobj[] = $row[
"name"];
858 if (is_array($subobj))
862 $this->tpl->setCurrentBlock(
"add_object");
863 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
864 $this->tpl->setVariable(
"BTN_NAME",
"create");
865 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"add"));
866 $this->tpl->parseCurrentBlock();
876 session_unregister(
"saved_post");
878 $this->ctrl->returnToParent($this);
898 global $rbacsystem, $ilUser;
901 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
903 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
912 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
913 $obj->setActive(TRUE, $ilUser->getId());
920 if (
$_SESSION[
'user_activate_search'] ==
true)
922 session_unregister(
"user_activate_search");
923 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show');
928 $this->ctrl->redirect($this,
"view");
949 global $rbacsystem, $ilUser;
952 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
954 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
963 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
964 $obj->setActive(FALSE, $ilUser->getId());
971 if (
$_SESSION[
'user_deactivate_search'] ==
true)
973 session_unregister(
"user_deactivate_search");
974 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show');
979 $this->ctrl->redirect($this,
"view");
990 global $rbacsystem, $ilUser;
993 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
995 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
1001 foreach (
$_SESSION[
"saved_post"] as $id)
1004 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
1005 $obj->setTimeLimitOwner($ilUser->getId());
1006 $obj->setTimeLimitUnlimited(1);
1007 $obj->setTimeLimitFrom(
"");
1008 $obj->setTimeLimitUntil(
"");
1009 $obj->setTimeLimitMessage(0);
1016 if (
$_SESSION[
'user_accessFree_search'] ==
true)
1018 session_unregister(
"user_accessFree_search");
1019 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show');
1024 $this->ctrl->redirect($this,
"view");
1030 include_once
"./classes/class.ilTemplate.php";
1032 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1033 $tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"time_limit_add_time_limit_for_selected"));
1034 $tsTemplate =
new ilTemplate(
"tpl.time.limit.html", TRUE, TRUE);
1035 $from = (array_key_exists(
"from",
$_GET)) ?
$_GET[
"from"] : time();
1036 $until = (array_key_exists(
"until",
$_GET)) ?
$_GET[
"until"] : time();
1037 $fromA = getdate($from);
1038 $untilA = getdate($until);
1043 $tsTemplate->setVariable(
"TEXT_FROM", $this->lng->txt(
"access_from") .
": ");
1044 $tsTemplate->setVariable(
"TEXT_UNTIL", $this->lng->txt(
"access_until") .
": ");
1045 $tsTemplate->setVariable(
"DATE_FROM", $fromDate);
1046 $tsTemplate->setVariable(
"TIME_FROM", $fromTime);
1047 $tsTemplate->setVariable(
"DATE_UNTIL", $untilDate);
1048 $tsTemplate->setVariable(
"TIME_UNTIL", $untilTime);
1049 $tpl->setVariable(
"TXT_CONTENT", $tsTemplate->get());
1050 $tpl->setVariable(
"CMD_CANCEL",
"cancelaccessRestrict");
1051 $tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
1052 $tpl->setVariable(
"CMD_OK",
"confirmaccessRestrict");
1053 $tpl->setVariable(
"TXT_OK", $this->lng->txt(
"confirm"));
1054 $this->tpl->setVariable(
"ADM_CONTENT",
$tpl->get());
1064 $timefrom = mktime($_POST[
"fromTime"][
"h"], $_POST[
"fromTime"][
"m"], 0, $_POST[
"fromDate"][
"m"], $_POST[
"fromDate"][
"d"], $_POST[
"fromDate"][
"y"]);
1065 $timeuntil = mktime($_POST[
"untilTime"][
"h"], $_POST[
"untilTime"][
"m"], 0, $_POST[
"untilDate"][
"m"], $_POST[
"untilDate"][
"d"], $_POST[
"untilDate"][
"y"]);
1066 if ($timeuntil <= $timefrom)
1069 $this->ctrl->setParameter($this,
"from", $timefrom);
1070 $this->ctrl->setParameter($this,
"until", $timeuntil);
1071 $this->ctrl->redirect($this,
"setAccessRestriction");
1074 global $rbacsystem, $ilUser;
1077 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
1079 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
1085 foreach (
$_SESSION[
"saved_post"] as $id)
1088 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
1089 $obj->setTimeLimitOwner($ilUser->getId());
1090 $obj->setTimeLimitUnlimited(0);
1091 $obj->setTimeLimitFrom($timefrom);
1092 $obj->setTimeLimitUntil($timeuntil);
1093 $obj->setTimeLimitMessage(0);
1100 if (
$_SESSION[
'user_accessRestrict_search'] ==
true)
1102 session_unregister(
"user_accessRestrict_search");
1103 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show');
1108 $this->ctrl->redirect($this,
"view");
1132 if (!$rbacsystem->checkAccess(
'delete',$this->object->getRefId()))
1134 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_delete"),$this->ilias->error_obj->WARNING);
1141 $this->ilias->raiseError($this->lng->txt(
"msg_no_delete_yourself"),$this->ilias->error_obj->WARNING);
1145 foreach (
$_SESSION[
"saved_post"] as $id)
1148 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
1156 #unset($_SESSION['saved_post']);
1158 if (
$_SESSION[
'user_delete_search'] ==
true)
1160 session_unregister(
"user_delete_search");
1161 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show');
1166 $this->ctrl->redirect($this,
"view");
1188 session_unregister(
"saved_post");
1189 $this->
object->buildExportFile($_POST[
"export_type"], $user_data_filter);
1190 ilUtil::redirect($this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"export"));
1198 if(!isset($_POST[
"id"]))
1200 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1206 $this->data[
"cols"] = array(
"type",
"title",
"description",
"last_change");
1208 foreach($_POST[
"id"] as $id)
1210 $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($id);
1212 $this->data[
"data"][
"$id"] = array(
1213 "type" => $obj_data->getType(),
1214 "title" => $obj_data->getTitle(),
1215 "desc" => $obj_data->getDescription(),
1216 "last_update" => $obj_data->getLastUpdateDate());
1219 $this->data[
"buttons"] = array(
"cancelDelete" => $this->lng->txt(
"cancel"),
1220 "confirmedDelete" => $this->lng->txt(
"confirm"));
1226 $this->tpl->setVariable(
"FORMACTION",
1227 $this->ctrl->getFormAction($this));
1230 foreach ($this->data[
"cols"] as $key)
1232 $this->tpl->setCurrentBlock(
"table_header");
1233 $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
1234 $this->tpl->parseCurrentBlock();
1241 foreach($this->data[
"data"] as $key => $value)
1244 foreach($value as $key => $cell_data)
1246 $this->tpl->setCurrentBlock(
"table_cell");
1255 $this->tpl->setVariable(
"TEXT_CONTENT",$cell_data);
1257 $this->tpl->parseCurrentBlock();
1260 $this->tpl->setCurrentBlock(
"table_row");
1262 $this->tpl->parseCurrentBlock();
1268 foreach($this->data[
"buttons"] as $name => $value)
1270 $this->tpl->setCurrentBlock(
"operation_btn");
1271 $this->tpl->setVariable(
"BTN_NAME",$name);
1272 $this->tpl->setVariable(
"BTN_VALUE",$value);
1273 $this->tpl->parseCurrentBlock();
1279 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm.html");
1280 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1281 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"export_format_selection"));
1282 $export_types = array(
"userfolder_export_excel_x86",
"userfolder_export_csv",
"userfolder_export_xml");
1284 foreach ($export_types as $type)
1286 $options[$type] = $this->lng->txt($type);
1288 $select =
ilUtil::formSelect(
"userfolder_export_xml",
"export_type" ,$options,
false,
true);
1289 $this->tpl->setVariable(
"TXT_CONTENT", $this->lng->txt(
"export_format") .
": " . $select);
1290 $this->tpl->setVariable(
"CMD_CANCEL",
"cancelexport");
1291 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
1292 $this->tpl->setVariable(
"CMD_OK",
"confirmexport");
1293 $this->tpl->setVariable(
"TXT_OK", $this->lng->txt(
"confirm"));
1294 $this->tpl->parseCurrentBlock();
1302 if(!isset($_POST[
"id"]))
1304 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1313 $this->data[
"cols"] = array(
"type",
"title",
"description",
"last_change");
1315 foreach($_POST[
"id"] as $id)
1317 $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($id);
1319 $this->data[
"data"][
"$id"] = array(
1320 "type" => $obj_data->getType(),
1321 "title" => $obj_data->getTitle(),
1322 "desc" => $obj_data->getDescription(),
1323 "last_update" => $obj_data->getLastUpdateDate());
1326 $this->data[
"buttons"] = array(
"cancel" . $action => $this->lng->txt(
"cancel"),
1327 "confirm" . $action => $this->lng->txt(
"confirm"));
1333 $this->tpl->setVariable(
"FORMACTION",
1334 $this->ctrl->getFormAction($this));
1337 foreach ($this->data[
"cols"] as $key)
1339 $this->tpl->setCurrentBlock(
"table_header");
1340 $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
1341 $this->tpl->parseCurrentBlock();
1348 foreach($this->data[
"data"] as $key => $value)
1351 foreach($value as $key => $cell_data)
1353 $this->tpl->setCurrentBlock(
"table_cell");
1362 $this->tpl->setVariable(
"TEXT_CONTENT",$cell_data);
1364 $this->tpl->parseCurrentBlock();
1367 $this->tpl->setCurrentBlock(
"table_row");
1369 $this->tpl->parseCurrentBlock();
1375 foreach($this->data[
"buttons"] as $name => $value)
1377 $this->tpl->setCurrentBlock(
"operation_btn");
1378 $this->tpl->setVariable(
"BTN_NAME",$name);
1379 $this->tpl->setVariable(
"BTN_VALUE",$value);
1380 $this->tpl->parseCurrentBlock();
1400 $this->tabs_gui->setTabActive(
'obj_usrf');
1402 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_search_form.html");
1404 $this->tpl->setVariable(
"FORMACTION",
1405 $this->ctrl->getFormAction($this));
1406 $this->tpl->setVariable(
"USERNAME_CHECKED",
" checked=\"checked\"");
1407 $this->tpl->setVariable(
"FIRSTNAME_CHECKED",
" checked=\"checked\"");
1408 $this->tpl->setVariable(
"LASTNAME_CHECKED",
" checked=\"checked\"");
1409 $this->tpl->setVariable(
"EMAIL_CHECKED",
" checked=\"checked\"");
1410 $this->tpl->setVariable(
"ACTIVE_CHECKED",
" checked=\"checked\"");
1411 $this->tpl->setVariable(
"TXT_SEARCH_USER",$this->lng->txt(
"search_user"));
1412 $this->tpl->setVariable(
"TXT_SEARCH_IN",$this->lng->txt(
"search_in"));
1413 $this->tpl->setVariable(
"TXT_SEARCH_USERNAME",$this->lng->txt(
"username"));
1414 $this->tpl->setVariable(
"TXT_SEARCH_FIRSTNAME",$this->lng->txt(
"firstname"));
1415 $this->tpl->setVariable(
"TXT_SEARCH_LASTNAME",$this->lng->txt(
"lastname"));
1416 $this->tpl->setVariable(
"TXT_SEARCH_EMAIL",$this->lng->txt(
"email"));
1417 $this->tpl->setVariable(
"TXT_SEARCH_ACTIVE",$this->lng->txt(
"search_active"));
1418 $this->tpl->setVariable(
"TXT_SEARCH_INACTIVE",$this->lng->txt(
"search_inactive"));
1419 $this->tpl->setVariable(
"BUTTON_SEARCH",$this->lng->txt(
"search"));
1420 $this->tpl->setVariable(
"BUTTON_CANCEL",$this->lng->txt(
"cancel"));
1421 $this->tpl->setVariable(
"TXT_SEARCH_NOTE",$this->lng->txt(
"search_note"));
1422 $this->tpl->setVariable(
"ACTIVE_CHECKED",
"checked=\"checked\"");
1432 $this->ctrl->redirect($this,
"view");
1442 $obj_str =
"&obj_id=".$this->obj_id;
1444 $_POST[
"search_string"] = trim($_POST[
"search_string"]) ? trim($_POST[
"search_string"]) : trim(urldecode(
$_GET[
"search_string"]));
1446 $_SESSION[
'us_active'] = isset($_POST[
'active']) ? $_POST[
'active'] :
$_SESSION[
'us_active'];
1448 $_POST[
"search_fields"] = array (
"username",
"firstname",
"lastname",
"email");
1450 if (empty($_POST[
"search_string"]))
1452 $_POST[
"search_string"] =
"%";
1455 if (empty($_POST[
"search_fields"]))
1457 $_POST[
"search_fields"] = array();
1461 if ($_POST[
"search_string"] ==
"%")
1463 $_POST[
"search_string"] =
"";
1465 $msg = $this->lng->txt(
"msg_no_search_result");
1466 if ($_POST[
"search_string"] !=
"")
1468 $msg .=
" ".$this->lng->txt(
"with").
" '".htmlspecialchars($_POST[
"search_string"]).
"'";
1471 $this->ctrl->redirect($this,
"searchUserForm");
1474 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
1477 $this->tpl->setCurrentBlock(
"btn_cell");
1478 $this->tpl->setVariable(
"BTN_LINK",
1479 $this->ctrl->getLinkTarget($this,
"searchUserForm"));
1480 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"search_new"));
1481 $this->tpl->parseCurrentBlock();
1483 $this->data[
"cols"] = array(
"",
"login",
"firstname",
"lastname",
"email",
"active");
1487 $searchActive =
true;
1491 $searchInactive =
true;
1494 foreach ($search_result as $key => $val)
1496 $val[
"active_text"] = $this->lng->txt(
"inactive");
1499 $val[
"active_text"] = $this->lng->txt(
"active");
1503 $searchStringToLower = strtolower($_POST[
"search_string"]);
1504 $displaySearchResult =
false;
1505 if (in_array(
"username", $_POST[
"search_fields"]))
1506 if (strpos(strtolower($val[
"login"]), strtolower($_POST[
"search_string"])) !==
false)
1507 $displaySearchResult =
true;
1508 if (in_array(
"firstname", $_POST[
"search_fields"]))
1509 if (strpos(strtolower($val[
"firstname"]), strtolower($_POST[
"search_string"])) !==
false)
1510 $displaySearchResult =
true;
1511 if (in_array(
"lastname", $_POST[
"search_fields"]))
1512 if (strpos(strtolower($val[
"lastname"]), strtolower($_POST[
"search_string"])) !==
false)
1513 $displaySearchResult =
true;
1514 if (in_array(
"email", $_POST[
"search_fields"]))
1515 if (strpos(strtolower($val[
"email"]), strtolower($_POST[
"search_string"])) !==
false)
1516 $displaySearchResult =
true;
1517 if (($val[
"active"] == 1) && ($searchActive ==
true) ||
1518 ($val[
"active"] == 0) && ($searchInactive ==
true))
1520 if ((strcmp($_POST[
"search_string"],
"%") == 0) || $displaySearchResult)
1523 $this->data[
"data"][] = array(
1524 "login" => $val[
"login"],
1525 "firstname" => $val[
"firstname"],
1526 "lastname" => $val[
"lastname"],
1527 "email" => $val[
"email"],
1528 "active" => $val[
"active_text"],
1529 "obj_id" => $val[
"usr_id"]
1534 if (count($this->data[
"data"]) == 0)
1536 ilUtil::sendInfo($this->lng->txt(
"msg_no_search_result").
" ".$this->lng->txt(
"with").
" '".htmlspecialchars($_POST[
"search_string"]).
"'",
true);
1538 $this->ctrl->redirect($this,
"searchUserForm");
1541 $this->maxcount = count($this->data[
"data"]);
1544 if (
$_GET[
"sort_by"] ==
"name")
1546 $_GET[
"sort_by"] =
"login";
1551 $this->data[
"data"] = array_slice($this->data[
"data"],
$_GET[
"offset"],
$_GET[
"limit"]);
1554 foreach ($this->data[
"data"] as $key => $val)
1556 $this->data[
"ctrl"][$key] = array(
1557 "ref_id" => $this->
id,
1558 "obj_id" => $val[
"obj_id"]
1560 $tmp[] = $val[
"obj_id"];
1561 unset($this->data[
"data"][$key][
"obj_id"]);
1568 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
1570 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.obj_tbl_rows.html");
1574 $this->ctrl->setParameter($this,
"sort_by",
"name");
1575 $this->ctrl->setParameter($this,
"sort_order",
$_GET[
"sort_order"]);
1576 $this->ctrl->setParameter($this,
"offset",
$_GET[
"offset"]);
1577 $this->tpl->setVariable(
"FORMACTION",
1578 $this->ctrl->getFormAction($this));
1581 include_once
"./Services/Table/classes/class.ilTableGUI.php";
1585 $tbl->setTitle($this->lng->txt(
"search_result"),
"icon_".$this->object->getType().
".gif",$this->lng->txt(
"obj_".$this->object->getType()));
1586 $tbl->setHelp(
"tbl_help.php",
"icon_help.gif",$this->lng->txt(
"help"));
1588 foreach ($this->data[
"cols"] as $val)
1590 $header_names[] = $this->lng->txt($val);
1593 $tbl->setHeaderNames($header_names);
1595 $header_params = $this->ctrl->getParameterArray($this,
"searchUser");
1596 $header_params[
"search_string"] = urlencode($_POST[
"search_string"]);
1597 $header_params[
"search_fields"] = urlencode(implode(
",",$_POST[
"search_fields"]));
1599 $tbl->setHeaderVars($this->data[
"cols"],$header_params);
1600 $tbl->setColumnWidth(array(
"",
"25%",
"25$%",
"25%",
"25%"));
1603 $tbl->enable(
"hits");
1604 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
1605 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
1606 $tbl->setLimit(
$_GET[
"limit"]);
1607 $tbl->setOffset(
$_GET[
"offset"]);
1608 $tbl->setMaxCount($this->maxcount);
1610 $this->tpl->setVariable(
"COLUMN_COUNTS",count($this->data[
"cols"]));
1613 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1618 if (is_array($this->data[
"data"][0]))
1621 for ($i=0; $i < count($this->data[
"data"]); $i++)
1623 $data = $this->data[
"data"][$i];
1624 $ctrl = $this->data[
"ctrl"][$i];
1627 $this->ids[] =
$ctrl[
"obj_id"];
1632 $this->tpl->setCurrentBlock(
"checkbox");
1633 $this->tpl->setVariable(
"CHECKBOX_ID",
$ctrl[
"obj_id"]);
1635 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1636 $this->tpl->parseCurrentBlock();
1638 $this->tpl->setCurrentBlock(
"table_cell");
1639 $this->tpl->setVariable(
"CELLSTYLE",
"tblrow1");
1640 $this->tpl->parseCurrentBlock();
1642 foreach (
$data as $key => $val)
1645 $this->ctrl->setParameterByClass(
"ilobjusergui",
"ref_id",
"7");
1646 $this->ctrl->setParameterByClass(
"ilobjusergui",
"obj_id",
$ctrl[
"obj_id"]);
1647 $link = $this->ctrl->getLinkTargetByClass(
"ilobjusergui",
"view");
1649 if ($key ==
"login")
1651 $this->tpl->setCurrentBlock(
"begin_link");
1652 $this->tpl->setVariable(
"LINK_TARGET", $link);
1653 $this->tpl->parseCurrentBlock();
1654 $this->tpl->touchBlock(
"end_link");
1657 $this->tpl->setCurrentBlock(
"text");
1658 $this->tpl->setVariable(
"TEXT_CONTENT", $val);
1659 $this->tpl->parseCurrentBlock();
1660 $this->tpl->setCurrentBlock(
"table_cell");
1661 $this->tpl->parseCurrentBlock();
1664 $this->tpl->setCurrentBlock(
"tbl_content");
1665 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1666 $this->tpl->parseCurrentBlock();
1681 if($this->ctrl->getTargetScript() ==
'repository.php')
1683 $this->tabs_gui->clearTargets();
1686 if (!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
1688 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1692 $this->tabs_gui->setTabActive(
'obj_usrf');
1693 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_import_form.html");
1695 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormaction($this));
1697 $this->tpl->setVariable(
"TXT_IMPORT_USERS", $this->lng->txt(
"import_users"));
1698 $this->tpl->setVariable(
"TXT_IMPORT_FILE", $this->lng->txt(
"import_file"));
1699 $this->tpl->setVariable(
"TXT_IMPORT_ROOT_USER", $this->lng->txt(
"import_root_user"));
1701 $this->tpl->setVariable(
"BTN_IMPORT", $this->lng->txt(
"upload"));
1702 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1715 if (@is_dir($import_dir))
1722 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
1724 $this->ctrl->redirect($this,
"view");
1729 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1742 $importDir =
ilUtil::getDataDir().
'/user_import/usr_'.$ilUser->getId().
'_'.session_id();
1752 global $ilUser,$rbacreview;
1755 if($this->ctrl->getTargetScript() ==
'repository.php')
1757 $this->tabs_gui->clearTargets();
1760 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
1761 include_once
'./Services/User/classes/class.ilUserImportParser.php';
1763 global $rbacreview, $rbacsystem,
$tree,
$lng;
1766 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_import_roles.html");
1771 if (@is_dir($import_dir))
1783 if (!is_file($_FILES[
"importFile"][
"tmp_name"]))
1786 $this->ilias->raiseError($this->lng->txt(
"no_import_file_found")
1787 , $this->ilias->error_obj->MESSAGE);
1790 $_FILES[
"importFile"][
"name"], $full_path);
1793 if (strtolower($parts[
"extension"]) ==
"zip")
1800 foreach ($file_list as $a_file)
1802 if (substr($a_file[
'entry'],-4) ==
'.xml')
1804 $xml_file = $import_dir.
"/".$a_file[
'entry'];
1808 if (is_null($xml_file))
1810 $subdir = basename($parts[
"basename"],
".".$parts[
"extension"]);
1811 $xml_file = $import_dir.
"/".$subdir.
"/".$subdir.
".xml";
1817 $xml_file = $full_path;
1821 if (!is_file($xml_file))
1824 $this->ilias->raiseError($this->lng->txt(
"no_xml_file_found_in_zip")
1825 .
" ".$subdir.
"/".$subdir.
".xml", $this->ilias->error_obj->MESSAGE);
1828 require_once(
"./Services/User/classes/class.ilUserImportParser.php");
1833 $importParser->startParsing();
1834 switch ($importParser->getErrorLevel())
1839 $this->tpl->setVariable(
"IMPORT_LOG", $importParser->getProtocolAsHTML($lng->txt(
"verification_warning_log")));
1843 $this->ilias->raiseError(
1844 $lng->txt(
"verification_failed").$importParser->getProtocolAsHTML($lng->txt(
"verification_failure_log")),
1845 $this->ilias->error_obj->MESSAGE
1852 $this->tpl->setCurrentBlock(
"role_selection_form");
1853 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1854 $this->tpl->setVariable(
"TXT_IMPORT_USERS", $this->lng->txt(
"import_users"));
1855 $this->tpl->setVariable(
"TXT_IMPORT_FILE", $this->lng->txt(
"import_file"));
1856 $this->tpl->setVariable(
"IMPORT_FILE",
$file_name);
1857 $this->tpl->setVariable(
"TXT_USER_ELEMENT_COUNT", $this->lng->txt(
"num_users"));
1858 $this->tpl->setVariable(
"USER_ELEMENT_COUNT", $importParser->getUserCount());
1859 $this->tpl->setVariable(
"TXT_ROLE_ASSIGNMENT", $this->lng->txt(
"role_assignment"));
1860 $this->tpl->setVariable(
"BTN_IMPORT", $this->lng->txt(
"import"));
1861 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1862 $this->tpl->setVariable(
"XML_FILE_NAME", $xml_file);
1866 $importParser->startParsing();
1867 $roles = $importParser->getCollectedRoles();
1870 $all_gl_roles = $rbacreview->getRoleListByObject(ROLE_FOLDER_ID);
1871 $gl_roles = array();
1872 $roles_of_user = $rbacreview->assignedRoles($ilUser->getId());
1873 foreach ($all_gl_roles as $obj_data)
1884 if ($obj_data[
"obj_id"] != ANONYMOUS_ROLE_ID)
1887 if ($obj_data[
"obj_id"] != SYSTEM_ROLE_ID or in_array(SYSTEM_ROLE_ID,$roles_of_user))
1889 $gl_roles[$obj_data[
"obj_id"]] = $obj_data[
"title"];
1895 $got_globals =
false;
1896 foreach($roles as $role_id => $role)
1898 if ($role[
"type"] ==
"Global")
1902 $got_globals =
true;
1904 $this->tpl->setCurrentBlock(
"global_role_section");
1905 $this->tpl->setVariable(
"TXT_GLOBAL_ROLES_IMPORT", $this->lng->txt(
"roles_of_import_global"));
1906 $this->tpl->setVariable(
"TXT_GLOBAL_ROLES", $this->lng->txt(
"assign_global_role"));
1910 $pre_select = array_search($role[name], $gl_roles);
1913 switch($role[
"name"])
1915 case "Administrator":
1916 $pre_select = array_search(
"Administrator", $gl_roles);
1920 $pre_select = array_search(
"User", $gl_roles);
1924 $pre_select = array_search(
"User", $gl_roles);
1928 $pre_select = array_search(
"Guest", $gl_roles);
1932 $pre_select = array_search(
"User", $gl_roles);
1936 $this->tpl->setCurrentBlock(
"global_role");
1937 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $gl_roles,
false,
true);
1938 $this->tpl->setVariable(
"TXT_IMPORT_GLOBAL_ROLE", $role[
"name"].
" [".$role_id.
"]");
1939 $this->tpl->setVariable(
"SELECT_GLOBAL_ROLE", $role_select);
1940 $this->tpl->parseCurrentBlock();
1945 $got_locals =
false;
1946 foreach($roles as $role_id => $role)
1948 if ($role[
"type"] ==
"Local")
1957 $this->tpl->setCurrentBlock(
"local_role_section");
1958 $this->tpl->setVariable(
"TXT_LOCAL_ROLES_IMPORT", $this->lng->txt(
"roles_of_import_local"));
1959 $this->tpl->setVariable(
"TXT_LOCAL_ROLES", $this->lng->txt(
"assign_local_role"));
1970 $loc_roles = array();
1971 foreach($roles as $role_id => $role)
1973 if ($role[
"type"] ==
"Local")
1975 $searchName = (substr($role[
'name'],0,1) ==
'#') ? $role[
'name'] :
'#'.$role[
'name'];
1976 $matching_role_ids = $rbacreview->searchRolesByMailboxAddressList($searchName);
1977 foreach ($matching_role_ids as $mid) {
1978 if (! in_array($mid, $loc_roles)) {
1979 $loc_roles[] = array(
'obj_id'=>$mid);
1988 $loc_roles = $rbacreview->getAssignableRolesInSubtree($this->object->getRefId());
1993 $l_roles_mailbox_searcharray = array();
1994 foreach ($loc_roles as $key => $loc_role)
1997 $rolf = $rbacreview->getFoldersAssignedToRole($loc_role[
"obj_id"],
true);
2003 if (!$rbacreview->isDeleted($rolf[0])
2004 && $rbacsystem->checkAccess(
'write',$tree->getParentId($rolf[0]))
2005 && $rolf[0] != ROLE_FOLDER_ID
2019 if ($this->tree->isInTree($rolf[0]))
2023 $tmpPath = $this->tree->getPathFull($rolf[0]);
2024 for ($i = 1,
$n = count($tmpPath) - 1; $i <
$n; $i++)
2028 $path = $path.
' > ';
2030 if ($i < 3 || $i > $n - 3)
2032 $path = $path.$tmpPath[$i][
'title'];
2034 else if ($i == 3 || $i == $n - 3)
2036 $path = $path.
'...';
2039 $isInSubtree |= $tmpPath[$i][
'obj_id'] == $this->
object->getId();
2044 $path =
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$loc_role[
"obj_id"].
")</b>";
2046 $roleMailboxAddress = $rbacreview->getRoleMailboxAddress($loc_role[
'obj_id']);
2047 $l_roles[$loc_role[
'obj_id']] = $roleMailboxAddress.
', '.$path;
2052 natcasesort($l_roles);
2053 $l_roles[
""] = $this->lng->txt(
"usrimport_ignore_role");
2054 foreach($roles as $role_id => $role)
2056 if ($role[
"type"] ==
"Local")
2058 $this->tpl->setCurrentBlock(
"local_role");
2059 $this->tpl->setVariable(
"TXT_IMPORT_LOCAL_ROLE", $role[
"name"]);
2060 $searchName = (substr($role[
'name'],0,1) ==
'#') ? $role[
'name'] :
'#'.$role[
'name'];
2061 $matching_role_ids = $rbacreview->searchRolesByMailboxAddressList($searchName);
2062 $pre_select = count($matching_role_ids) == 1 ? $matching_role_ids[0] :
"";
2067 $selectable_roles = array();
2068 $selectable_roles[
""] = $this->lng->txt(
"usrimport_ignore_role");
2069 foreach ($matching_role_ids as $id)
2071 $selectable_roles[$id] = $l_roles[$id];
2073 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $selectable_roles,
false,
true);
2075 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $l_roles,
false,
true);
2077 $this->tpl->setVariable(
"SELECT_LOCAL_ROLE", $role_select);
2078 $this->tpl->parseCurrentBlock();
2084 $this->tpl->setVariable(
"TXT_CONFLICT_HANDLING", $lng->txt(
"conflict_handling"));
2089 $this->tpl->setVariable(
"TXT_CONFLICT_HANDLING_INFO", str_replace(
'\n',
'<br>',$this->lng->txt(
"usrimport_conflict_handling_info")));
2090 $this->tpl->setVariable(
"TXT_CONFLICT_CHOICE", $lng->txt(
"conflict_handling"));
2094 $this->lng->loadLanguageModule(
"mail");
2095 include_once
'./Services/User/classes/class.ilObjUserFolder.php';
2097 if (trim($amail[
"body"]) !=
"" && trim($amail[
"subject"]) !=
"")
2099 $this->tpl->setCurrentBlock(
"inform_user");
2100 $this->tpl->setVariable(
"TXT_ACCOUNT_MAIL", $lng->txt(
"mail_account_mail"));
2103 $this->tpl->setVariable(
"SEND_MAIL",
" checked=\"checked\"");
2105 $this->tpl->setVariable(
"TXT_INFORM_USER_MAIL",
2106 $this->lng->txt(
"user_send_new_account_mail"));
2107 $this->tpl->parseCurrentBlock();
2116 global $rbacreview,$ilUser;
2119 if($this->ctrl->getTargetScript() ==
'repository.php')
2121 $this->tabs_gui->clearTargets();
2124 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
2125 include_once
'./Services/User/classes/class.ilUserImportParser.php';
2127 global $rbacreview, $rbacsystem,
$tree,
$lng;
2129 switch ($_POST[
"conflict_handling_choice"])
2131 case "update_on_conflict" :
2134 case "ignore_on_conflict" :
2146 if ($_POST[
"role_assign"])
2148 $global_roles = $rbacreview->getGlobalRoles();
2149 $roles_of_user = $rbacreview->assignedRoles($ilUser->getId());
2150 foreach ($_POST[
"role_assign"] as $role_id)
2154 if (in_array($role_id, $global_roles))
2156 if(!in_array(SYSTEM_ROLE_ID,$roles_of_user))
2158 if ($role_id == SYSTEM_ROLE_ID && ! in_array(SYSTEM_ROLE_ID,$roles_of_user)
2164 $this->ilias->raiseError($this->lng->txt(
"usrimport_with_specified_role_not_permitted"),
2165 $this->ilias->error_obj->MESSAGE);
2171 $rolf = $rbacreview->getFoldersAssignedToRole($role_id,
true);
2172 if ($rbacreview->isDeleted($rolf[0])
2173 || ! $rbacsystem->checkAccess(
'write',$tree->getParentId($rolf[0])))
2176 $this->ilias->raiseError($this->lng->txt(
"usrimport_with_specified_role_not_permitted"),
2177 $this->ilias->error_obj->MESSAGE);
2185 $importParser->setRoleAssignment($_POST[
"role_assign"]);
2186 $importParser->startParsing();
2191 switch ($importParser->getErrorLevel())
2197 ilUtil::sendInfo($this->lng->txt(
"user_imported_with_warnings").$importParser->getProtocolAsHTML($lng->txt(
"import_warning_log")),
true);
2200 $this->ilias->raiseError(
2201 $this->lng->txt(
"user_import_failed")
2202 .$importParser->getProtocolAsHTML($lng->txt(
"import_failure_log")),
2203 $this->ilias->error_obj->MESSAGE
2208 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
2210 $this->ctrl->redirect($this,
"view");
2215 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
2222 global $rbacsystem,
$ilias;
2226 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
2228 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
2231 if(!count($app_users =& $ilias->account->getAppliedUsers()))
2238 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_applied_users.html");
2239 $this->lng->loadLanguageModule(
'crs');
2242 foreach($app_users as $usr_id)
2247 $f_result[$counter][] = $tmp_user->getLogin();
2248 $f_result[$counter][] = $tmp_user->getFirstname();
2249 $f_result[$counter][] = $tmp_user->getLastname();
2251 if($tmp_user->getTimeLimitUnlimited())
2253 $f_result[$counter][] =
"<b>".$this->lng->txt(
'crs_unlimited').
"</b>";
2257 $limit =
"<b>".$this->lng->txt(
'crs_from').
'</b> '.strftime(
"%Y-%m-%d %R",$tmp_user->getTimeLimitFrom()).
'<br />';
2258 $limit .=
"<b>".$this->lng->txt(
'crs_to').
'</b> '.strftime(
"%Y-%m-%d %R",$tmp_user->getTimeLimitUntil());
2260 $f_result[$counter][] = $limit;
2274 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
2276 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2279 $this->lng->loadLanguageModule(
'crs');
2283 if(!isset(
$_SESSION[
'error_post_vars']))
2285 ilUtil::sendInfo($this->lng->txt(
'time_limit_add_time_limit_for_selected'));
2288 if(!count($_POST[
"users"]))
2297 foreach($_POST[
'users'] as $usr_id)
2304 $title .= $tmp_user->getLogin();
2314 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_edit_applied_users.html");
2315 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2318 $time_limit_unlimited =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_unlimited"] ?
2321 $time_limit_start =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_start"] ?
2324 $time_limit_end =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_end"] ?
2330 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
"obj_usr"));
2332 $this->tpl->setVariable(
"TITLE",
$title);
2333 $this->tpl->setVariable(
"TXT_TIME_LIMIT",$this->lng->txt(
"time_limit"));
2334 $this->tpl->setVariable(
"TXT_TIME_LIMIT_START",$this->lng->txt(
"crs_start"));
2335 $this->tpl->setVariable(
"TXT_TIME_LIMIT_END",$this->lng->txt(
"crs_end"));
2336 $this->tpl->setVariable(
"CMD_SUBMIT",
"updateAppliedUsers");
2337 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
"cancel"));
2338 $this->tpl->setVariable(
"TXT_SUBMIT",$this->lng->txt(
"submit"));
2342 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_DAY",$this->
__getDateSelect(
"day",
"au[time_limit_start][day]",
2343 date(
"d",$time_limit_start)));
2344 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_MONTH",$this->
__getDateSelect(
"month",
"au[time_limit_start][month]",
2345 date(
"m",$time_limit_start)));
2346 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_YEAR",$this->
__getDateSelect(
"year",
"au[time_limit_start][year]",
2347 date(
"Y",$time_limit_start)));
2348 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_HOUR",$this->
__getDateSelect(
"hour",
"au[time_limit_start][hour]",
2349 date(
"G",$time_limit_start)));
2350 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_MINUTE",$this->
__getDateSelect(
"minute",
"au[time_limit_start][minute]",
2351 date(
"i",$time_limit_start)));
2352 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_DAY",$this->
__getDateSelect(
"day",
"au[time_limit_end][day]",
2353 date(
"d",$time_limit_end)));
2354 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_MONTH",$this->
__getDateSelect(
"month",
"au[time_limit_end][month]",
2355 date(
"m",$time_limit_end)));
2356 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_YEAR",$this->
__getDateSelect(
"year",
"au[time_limit_end][year]",
2357 date(
"Y",$time_limit_end)));
2358 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_HOUR",$this->
__getDateSelect(
"hour",
"au[time_limit_end][hour]",
2359 date(
"G",$time_limit_end)));
2360 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_MINUTE",$this->
__getDateSelect(
"minute",
"au[time_limit_end][minute]",
2361 date(
"i",$time_limit_end)));
2362 if($this->ilias->account->getTimeLimitUnlimited())
2364 $this->tpl->setVariable(
"ROWSPAN",3);
2365 $this->tpl->setCurrentBlock(
"unlimited");
2366 $this->tpl->setVariable(
"TXT_TIME_LIMIT_UNLIMITED",$this->lng->txt(
"crs_unlimited"));
2367 $this->tpl->setVariable(
"TIME_LIMIT_UNLIMITED",
ilUtil::formCheckbox($time_limit_unlimited,
"au[time_limit_unlimited]",1));
2368 $this->tpl->parseCurrentBlock();
2372 $this->tpl->setVariable(
"ROWSPAN",2);
2380 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
2382 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2385 $start = $this->
__toUnix($_POST[
'au'][
'time_limit_start']);
2386 $end = $this->
__toUnix($_POST[
'au'][
'time_limit_end']);
2388 if(!$_POST[
'au'][
'time_limit_unlimited'])
2399 #if(!$this->ilias->account->getTimeLimitUnlimited())
2401 # if($start < $this->ilias->account->getTimeLimitFrom() or
2402 # $end > $this->ilias->account->getTimeLimitUntil())
2404 # $_SESSION['error_post_vars'] = $_POST;
2405 # ilUtil::sendInfo($this->lng->txt('time_limit_not_within_owners'));
2406 # $this->editAppliedUsersObject();
2412 foreach(
$_SESSION[
'applied_users'] as $usr_id)
2416 $tmp_user->setTimeLimitUnlimited((
int) $_POST[
'au'][
'time_limit_unlimited']);
2417 $tmp_user->setTimeLimitFrom($start);
2418 $tmp_user->setTimeLimitUntil($end);
2419 $tmp_user->setTimeLimitMessage(0);
2420 $tmp_user->update();
2435 $tpl =& $tbl->getTemplateObject();
2438 $tpl->setCurrentBlock(
"tbl_form_header");
2440 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2441 $tpl->parseCurrentBlock();
2443 $tpl->setCurrentBlock(
"tbl_action_btn");
2444 $tpl->setVariable(
"BTN_NAME",
'editAppliedUsers');
2445 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
'edit'));
2446 $tpl->parseCurrentBlock();
2448 $tpl->setCurrentBlock(
"tbl_action_row");
2449 $tpl->setVariable(
"COLUMN_COUNTS",5);
2451 $tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
2452 $tpl->parseCurrentBlock();
2456 $tbl->setTitle($this->lng->txt(
"time_limit_applied_users"),
"icon_usr_b.gif",$this->lng->txt(
"users"));
2457 $tbl->setHeaderNames(array(
'',
2458 $this->lng->txt(
"login"),
2459 $this->lng->txt(
"firstname"),
2460 $this->lng->txt(
"lastname"),
2461 $this->lng->txt(
"time_limits")));
2462 $header_params = $this->ctrl->getParameterArray($this,
"appliedUsers");
2463 $tbl->setHeaderVars(array(
"",
2468 array($header_params));
2469 $tbl->setColumnWidth(array(
"3%",
"19%",
"19%",
"19%",
"40%"));
2475 $this->tpl->setVariable(
"APPLIED_USERS",$tbl->tpl->get());
2482 include_once
"./Services/Table/classes/class.ilTableGUI.php";
2489 $offset =
$_GET[
"offset"];
2490 $order =
$_GET[
"sort_by"];
2491 $direction =
$_GET[
"sort_order"];
2494 $tbl->setOrderColumn($order);
2495 $tbl->setOrderDirection($direction);
2496 $tbl->setOffset($offset);
2497 $tbl->setLimit(
$_GET[
"limit"]);
2498 $tbl->setMaxCount(count($result_set));
2499 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
2500 $tbl->setData($result_set);
2508 for($i=0;$i<=60;$i++)
2510 $days[$i] = $i < 10 ?
"0".$i : $i;
2515 for($i=0;$i<24;$i++)
2517 $days[$i] = $i < 10 ?
"0".$i : $i;
2522 for($i=1;$i<32;$i++)
2524 $days[$i] = $i < 10 ?
"0".$i : $i;
2529 for($i=1;$i<13;$i++)
2531 $month[$i] = $i < 10 ?
"0".$i : $i;
2536 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
2545 return mktime($a_time_arr[
"hour"],
2546 $a_time_arr[
"minute"],
2547 $a_time_arr[
"second"],
2548 $a_time_arr[
"month"],
2550 $a_time_arr[
"year"]);
2565 $lng->loadLanguageModule(
"administration");
2570 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2573 $this->tabs_gui->setTabActive(
'global_settings');
2574 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2576 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_list_user_defined.html');
2577 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2579 if ($this->confirm_change == 1)
2581 $this->tpl->setVariable(
"CONFIRM_MESSAGE", $this->lng->txt(
"confirm_message_course_export"));
2582 $this->tpl->setVariable(
"BUTTON_CONFIRM", $this->lng->txt(
"confirm"));
2583 $this->tpl->setVariable(
"BUTTON_CANCEL", $this->lng->txt(
"cancel"));
2586 $this->tpl->setVariable(
"TXT_OVERVIEW",$this->lng->txt(
'user_defined_list'));
2588 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'add_user_defined_field'));
2592 if(!count($definitions = $user_field_definitions->getDefinitions()))
2594 $this->tpl->setCurrentBlock(
"no_content");
2595 $this->tpl->setVariable(
"NO_FIELDS",$this->lng->txt(
'no_user_defined_fields_defined'));
2596 $this->tpl->parseCurrentBlock();
2600 $this->tpl->setVariable(
"BTN_SAVE",$this->lng->txt(
'save'));
2603 foreach($definitions as $field_id => $definition)
2605 $this->tpl->setCurrentBlock(
"user_defined");
2606 $this->tpl->setVariable(
"TXT_VISIBLE", $this->lng->txt(
"visible"));
2607 $this->tpl->setVariable(
"TXT_CHANGE", $this->lng->txt(
"changeable"));
2608 $this->tpl->setVariable(
"TXT_REQUIRED", $this->lng->txt(
"required_field"));
2609 $this->tpl->setVariable(
"TXT_SEARCHABLE", $this->lng->txt(
"header_searchable"));
2610 $this->tpl->setVariable(
"TXT_EXPORT", $this->lng->txt(
"export"));
2611 $this->tpl->setVariable(
"TXT_COURSE_EXPORT", $lng->txt(
"course_export"));
2613 $this->tpl->setVariable(
"NAME",$definition[
'field_name']);
2615 if ($_POST[
"cmd"][
"updateFields"] !=
"")
2617 $definition[
'visible'] = isset($_POST[
'def'][$field_id][
'visible']) ? 1 : 0;
2618 $definition[
'changeable'] = isset($_POST[
'def'][$field_id][
'changeable']) ? 1 : 0;
2619 $definition[
'required'] = isset($_POST[
'def'][$field_id][
'required']) ? 1 : 0;
2620 $definition[
'searchable'] = isset($_POST[
'def'][$field_id][
'searchable']) ? 1 : 0;
2621 $definition[
'export'] = isset($_POST[
'def'][$field_id][
'export']) ? 1 : 0;
2622 $definition[
'course_export'] = isset($_POST[
'def'][$field_id][
'course_export']) ? 1 : 0;
2625 $this->tpl->setVariable(
"VISIBLE",
ilUtil::formCheckbox($definition[
'visible'],
"def[$field_id][visible]",1));
2626 $this->tpl->setVariable(
"CHANGE",
ilUtil::formCheckbox($definition[
'changeable'],
"def[$field_id][changeable]",1));
2627 $this->tpl->setVariable(
"REQUIRED",
ilUtil::formCheckbox($definition[
'required'],
"def[$field_id][required]",1));
2628 $this->tpl->setVariable(
"SEARCHABLE",
ilUtil::formCheckbox($definition[
'searchable'],
"def[$field_id][searchable]",1));
2629 $this->tpl->setVariable(
"EXPORT",
ilUtil::formCheckbox($definition[
'export'],
"def[$field_id][export]",1));
2630 $this->tpl->setVariable(
"COURSE_EXPORT",
ilUtil::formCheckbox($definition[
'course_export'],
"def[$field_id][course_export]",1));
2632 $this->ctrl->setParameter($this,
'field_id',$field_id);
2635 switch($definition[
'field_type'])
2638 $this->tpl->setVariable(
"EDIT_LINK",$this->ctrl->getLinkTarget($this,
'editTextField'));
2642 $this->tpl->setVariable(
"EDIT_LINK",$this->ctrl->getLinkTarget($this,
'editSelectField'));
2645 $this->tpl->setVariable(
"EDIT",$this->lng->txt(
'edit'));
2647 $this->tpl->setVariable(
"DELETE_LINK",$this->ctrl->getLinkTarget($this,
'askDeleteField'));
2648 $this->tpl->setVariable(
"DELETE",$this->lng->txt(
'delete'));
2649 $this->tpl->parseCurrentBlock();
2655 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2657 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2660 $this->ctrl->setParameter($this,
'field_id',(
int) $_GET[
'field_id']);
2663 $this->tabs_gui->setTabActive(
'global_settings');
2664 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2666 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_update_text_field.html');
2668 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2669 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'udf_update_text_field'));
2670 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
2672 $this->tpl->setVariable(
"FIELD_NAME",$definition[
'field_name']);
2674 $this->tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'cancel'));
2675 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'update'));
2682 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2685 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2687 $udf->setFieldName(ilUtil::stripslashes($_POST[
'field_name']));
2688 $udf->setFieldType($definition[
'field_type']);
2689 $udf->setFieldValues($definition[
'field_values']);
2690 $udf->enableVisible($definition[
'visible']);
2691 $udf->enableChangeable($definition[
'changeable']);
2692 $udf->enableRequired($definition[
'required']);
2693 $udf->enableSearchable($definition[
'searchable']);
2694 $udf->enableExport($definition[
'export']);
2695 $udf->enableCourseExport($definition[
'course_export']);
2697 $udf->update($definition[
'field_id']);
2706 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2711 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2714 $this->ctrl->setParameter($this,
'field_id',(
int) $_GET[
'field_id']);
2717 $this->tabs_gui->setTabActive(
'global_settings');
2718 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2720 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_update_select_field.html');
2723 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2724 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'udf_update_select_field'));
2725 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
2727 $this->tpl->setVariable(
"FIELD_NAME_VALUE",$definition[
'field_name']);
2731 foreach($definition[
'field_values'] as $value)
2733 $this->tpl->setCurrentBlock(
"values");
2734 $this->tpl->setVariable(
"COUNTER",$counter++);
2735 $this->tpl->setVariable(
"TXT_VALUES",$this->lng->txt(
'udf_value').
' '.($counter));
2736 $this->tpl->setVariable(
"FIELD_NAME",$value);
2738 $this->ctrl->setParameter($this,
'value_id',$counter-1);
2739 $this->tpl->setVariable(
"DELETE_LINK",$this->ctrl->getLinkTarget($this,
'deleteValue'));
2740 $this->tpl->setVariable(
"DELETE",$this->lng->txt(
'delete'));
2741 $this->tpl->parseCurrentBlock();
2745 for($i = 0; $i <
$_SESSION[
'select_num_values'];$i++)
2747 $this->tpl->setCurrentBlock(
"new_values");
2748 $this->tpl->setVariable(
"NEW_COUNTER",$counter++);
2749 $this->tpl->setVariable(
"TXT_NEW_VALUES",$this->lng->txt(
'udf_value').
' '.($counter));
2750 $this->tpl->setVariable(
"NEW_FIELD_NAME",$_POST[
'field_values'][$counter-1]);
2751 $this->tpl->parseCurrentBlock();
2753 $this->tpl->setVariable(
"BTN_NEW_VALUE",$this->lng->txt(
'btn_new_value'));
2754 $this->tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'cancel'));
2755 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'save'));
2762 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2765 $_POST[
'field_values'] = is_array($_POST[
'field_values']) ? $_POST[
'field_values'] : array();
2768 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2771 $udf->setFieldName(ilUtil::stripslashes($_POST[
'field_name']));
2772 $udf->setFieldValues(array_merge($definition[
'field_values'],$_POST[
'field_values']));
2773 $udf->setFieldType($definition[
'field_type']);
2774 $udf->enableVisible($definition[
'visible']);
2775 $udf->enableChangeable($definition[
'changeable']);
2776 $udf->enableRequired($definition[
'required']);
2777 $udf->enableSearchable($definition[
'searchable']);
2778 $udf->enableExport($definition[
'export']);
2779 $udf->enableCourseExport($definition[
'course_export']);
2781 if($error = $udf->validateValues())
2797 $udf->update($definition[
'field_id']);
2807 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2810 $udf->deleteValue((
int)
$_GET[
'field_id'],(
int) $_GET[
'value_id']);
2827 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2832 $this->tabs_gui->setTabActive(
'global_settings');
2833 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2835 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_ask_delete.html');
2837 $this->ctrl->setParameter($this,
'field_id',(
int)
$_GET[
'field_id']);
2838 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2839 $this->tpl->setVariable(
"TXT_DELETE_FIELD",$this->lng->txt(
'udf_delete_header'));
2840 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
2843 $definition = $user_field_definitions->getDefinition((
int) $_GET[
'field_id']);
2845 $this->tpl->setVariable(
"FIELD_NAME",$definition[
'field_name']);
2846 $this->tpl->setVariable(
"BTN_DELETE",$this->lng->txt(
'delete'));
2847 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
'cancel'));
2854 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2857 $user_field_definitions->delete((
int)
$_GET[
'field_id']);
2872 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2875 $a_fields = $user_field_definitions->getDefinitions();
2878 if ($action !=
'save')
2880 include_once
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
2882 if ($privacy->enabledExport() ==
true && $privacy->confirmationRequired() ==
true)
2884 foreach($a_fields as $field_id => $definition)
2886 if ($definition[
'course_export'] == 0 && (
int) $_POST[
'def'][$field_id][
'course_export'] == 1)
2888 $this->confirm_change = 1;
2897 if ($action ==
'save')
2899 include_once(
'Modules/Course/classes/class.ilCourseAgreement.php');
2903 foreach($a_fields as $field_id => $definition)
2905 $user_field_definitions->setFieldName($definition[
'field_name']);
2906 $user_field_definitions->setFieldType($definition[
'field_type']);
2907 $user_field_definitions->setFieldValues($definition[
'field_values']);
2908 $user_field_definitions->enableVisible((
int) $_POST[
'def'][$field_id][
'visible']);
2909 $user_field_definitions->enableChangeable((
int) $_POST[
'def'][$field_id][
'changeable']);
2910 $user_field_definitions->enableRequired((
int) $_POST[
'def'][$field_id][
'required']);
2911 $user_field_definitions->enableSearchable((
int) $_POST[
'def'][$field_id][
'searchable']);
2912 $user_field_definitions->enableExport((
int) $_POST[
'def'][$field_id][
'export']);
2913 $user_field_definitions->enableCourseExport((
int) $_POST[
'def'][$field_id][
'course_export']);
2914 $user_field_definitions->update($field_id);
2925 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2931 $this->tabs_gui->setTabActive(
'global_settings');
2932 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2934 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_select_field_type.html');
2935 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this,
'chooseDefinitions'));
2936 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'add_new_user_defined_field'));
2937 $this->tpl->setVariable(
"FIELD_TYPE",$this->lng->txt(
'field_type'));
2940 $this->tpl->setVariable(
"TXT_TEXT",$this->lng->txt(
'udf_type_text'));
2941 $this->tpl->setVariable(
"TXT_SELECT",$this->lng->txt(
'udf_type_select'));
2942 $this->tpl->setVariable(
"BTN_MORE",$this->lng->txt(
'btn_next'));
2943 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
'cancel'));
2950 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2953 $this->tabs_gui->setTabActive(
'global_settings');
2954 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2956 switch($field_type = (
int) $_REQUEST[
'field_type'])
2972 $lng->loadLanguageModule(
"administration");
2973 $lng->loadLanguageModule(
"ps");
2975 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_edit_text_field.html');
2977 include_once(
"Modules/Course/classes/class.ilCourseAgreement.php");
2980 $this->tpl->setCurrentBlock(
'warning_modify');
2981 $this->tpl->setVariable(
'TXT_WARNING', $lng->txt(
'ps_warning_modify'));
2982 $this->tpl->parseCurrentBlock();
2986 $this->ctrl->setParameter($this,
'field_type',(
int) $_REQUEST[
'field_type']);
2987 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2989 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'udf_add_field'));
2990 $this->tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'btn_previous'));
2991 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'add_new_user_defined_text_field'));
2992 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
2993 $this->tpl->setVariable(
"FIELD_NAME",$_POST[
'field_name']);
2995 $this->tpl->setVariable(
"TXT_VISIBLE", $this->lng->txt(
"visible"));
2996 $this->tpl->setVariable(
"TXT_CHANGE", $this->lng->txt(
"changeable"));
2997 $this->tpl->setVariable(
"TXT_REQUIRED", $this->lng->txt(
"required_field"));
2998 $this->tpl->setVariable(
"TXT_SEARCHABLE", $this->lng->txt(
"header_searchable"));
2999 $this->tpl->setVariable(
"TXT_EXPORT", $this->lng->txt(
"export"));
3000 $this->tpl->setVariable(
"TXT_COURSE_EXPORT", $lng->txt(
"course_export"));
3002 $this->tpl->setVariable(
"VISIBLE",
ilUtil::formCheckbox($_POST[
'def'][
'visible'],
"def[visible]",1));
3003 $this->tpl->setVariable(
"CHANGE",
ilUtil::formCheckbox($_POST[
'def'][
'changeable'],
"def[changeable]",1));
3004 $this->tpl->setVariable(
"REQUIRED",
ilUtil::formCheckbox($_POST[
'def'][
'required'],
"def[required]",1));
3005 $this->tpl->setVariable(
"SEARCHABLE",
ilUtil::formCheckbox($_POST[
'def'][
'searchable'],
"def[searchable]",1));
3006 $this->tpl->setVariable(
"EXPORT",
ilUtil::formCheckbox($_POST[
'def'][
'export'],
"def[export]",1));
3007 $this->tpl->setVariable(
"COURSE_EXPORT",
ilUtil::formCheckbox($_POST[
'def'][
'course_export'],
"def[course_export]",1));
3016 $lng->loadLanguageModule(
"administration");
3017 $lng->loadLanguageModule(
"ps");
3019 $tpl =
new ilTemplate(
'tpl.usrf_edit_select_field.html',
true,
true);
3021 include_once(
"Modules/Course/classes/class.ilCourseAgreement.php");
3024 $tpl->setCurrentBlock(
'warning_modify');
3025 $tpl->setVariable(
'TXT_WARNING', $lng->txt(
'ps_warning_modify'));
3026 $tpl->parseCurrentBlock();
3031 $this->ctrl->setParameter($this,
'field_type',(
int) $_REQUEST[
'field_type']);
3032 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3033 $tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'udf_add_field'));
3034 $tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'btn_previous'));
3035 $tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'add_new_user_defined_select_field'));
3036 $tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
3037 $tpl->setVariable(
"FIELD_NAME_VALUE",$_POST[
'field_name']);
3038 $tpl->setVariable(
"TXT_EXPORT", $this->lng->txt(
"export"));
3039 $tpl->setVariable(
"TXT_COURSE_EXPORT", $lng->txt(
"course_export"));
3041 $tpl->setVariable(
"TXT_VISIBLE", $this->lng->txt(
"visible"));
3042 $tpl->setVariable(
"TXT_CHANGE", $this->lng->txt(
"changeable"));
3043 $tpl->setVariable(
"TXT_REQUIRED", $this->lng->txt(
"required_field"));
3044 $tpl->setVariable(
"TXT_SEARCHABLE", $this->lng->txt(
"header_searchable"));
3053 $tpl->setVariable(
"BTN_NEW_VALUE",$this->lng->txt(
'btn_new_value'));
3055 for($i = 0; $i <
$_SESSION[
'num_values']; $i++)
3057 $tpl->setCurrentBlock(
"values");
3058 $tpl->setVariable(
"TXT_VALUES",$this->lng->txt(
'udf_value').
' '.($i+1));
3059 $tpl->setVariable(
"COUNTER",$i);
3060 $tpl->setVariable(
"FIELD_NAME",$_POST[
'field_values'][$i]);
3061 $tpl->parseCurrentBlock();
3064 $this->tpl->setContent(
$tpl->get());
3076 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
3079 if (!strlen($_POST[
'field_name']))
3086 if($user_field_definitions->nameExists($_POST[
'field_name']))
3101 $user_field_definitions->setFieldValues($_POST[
'field_values']);
3102 if($error = $user_field_definitions->validateValues())
3119 $user_field_definitions->setFieldName($_POST[
'field_name']);
3120 $user_field_definitions->enableVisible($_POST[
'def'][
'visible']);
3121 $user_field_definitions->enableChangeable($_POST[
'def'][
'changeable']);
3122 $user_field_definitions->enableRequired($_POST[
'def'][
'required']);
3123 $user_field_definitions->enableSearchable($_POST[
'def'][
'searchable']);
3124 $user_field_definitions->enableExport($_POST[
'def'][
'export']);
3125 $user_field_definitions->enableCourseExport($_POST[
'def'][
'course_export']);
3126 $user_field_definitions->add();
3128 if ((
int) $_POST[
'def'][
'course_export'] == 1)
3130 include_once(
'Modules/Course/classes/class.ilCourseAgreement.php');
3152 include_once
'Services/Search/classes/class.ilUserSearchOptions.php';
3157 $lng->loadLanguageModule(
"administration");
3162 $profile_fields =& $this->
object->getProfileFields();
3164 $profile_fields [] =
"preferences";
3167 $fixed_required_fields = array(
3174 "hits_per_page" => 0,
3175 "show_users_online" => 0,
3176 "instant_messengers" => 0,
3177 "hide_own_online_status" => 0,
3181 $no_export_fields = array(
3183 "show_users_online",
3184 "hide_own_online_status"
3188 $no_changeable_fields = array(
3193 $no_visible_fields = array(
3198 $disabled_visible_fields= array(
3203 $disabled_changeable_fields= array(
3209 $course_export_fields = array(
3210 "gender" => 1,
"firstname" => 2,
3211 "lastname" => 2,
"title" => 1,
3212 "upload" => 0,
"password" => 0,
3213 "institution" => 1,
"department" => 1,
3214 "street" => 1,
"zipcode" => 1,
3215 "city" => 1,
"country" => 1,
3216 "phone_office" => 1,
"phone_home" => 1,
3217 "phone_mobile" => 1,
"fax" => 1,
3218 "email" => 1,
"hobby" => 1,
3219 "referral_comment" => 0,
"matriculation" => 1,
3220 "language" => 0,
"skin_style" => 0,
3221 "hits_per_page" => 0,
"show_users_online" => 0,
3222 "instant_messengers" => 0,
3225 foreach ($profile_fields as $field)
3227 $this->tpl->setCurrentBlock(
"profile_settings");
3229 $txt = strcasecmp($field,
"upload") == 0 ?
"personal_picture" : $field;
3230 $this->tpl->setVariable(
"TXT_PROFILE_DATA", $this->lng->txt($txt));
3232 $this->tpl->setVariable(
"PROFILE_OPTION_ENABLED",
"enabled_" . $field);
3233 $this->tpl->setVariable(
"PROFILE_OPTION_VISIBLE",
"visible_" . $field);
3234 $this->tpl->setVariable(
"PROFILE_OPTION_REQUIRED",
"required_" . $field);
3237 $this->tpl->setVariable(
"HEADER_PROFILE_DATA", $this->lng->txt(
"usr_settings_header_profile_profile"));
3238 $this->tpl->setVariable(
"HEADER_ENABLED", $this->lng->txt(
"changeable"));
3239 $this->tpl->setVariable(
"HEADER_VISIBLE", $this->lng->txt(
"visible"));
3240 $this->tpl->setVariable(
"HEADER_REQUIRED", $this->lng->txt(
"required_field"));
3241 $this->tpl->setVariable(
"HEADER_EXPORT", $this->lng->txt(
"export"));
3246 $this->tpl->setVariable(
"HEADER_SEARCH",$this->lng->txt(
'header_searchable'));
3247 $checked = ($_POST[
"cmd"][
"saveGlobalUserSettings"] && $this->confirm_change == 1) ?
3250 "cbh[$field][searchable]",
3255 if (!in_array($field, $no_changeable_fields) &&
3256 ($ilias->getSetting(
"usr_settings_disable_".$field) !=
"1" ||
3257 ($this->confirm_change == 1 && ! $_POST[
"chb"][
"enabled_" . $field])))
3259 $this->tpl->setVariable(
"CHECKED_ENABLED",
" checked=\"checked\"");
3262 if (in_array($field, $disabled_changeable_fields))
3264 $this->tpl->setVariable(
"DISABLE_ENABLED",
" disabled=\"disabled\"");
3269 if (!in_array($field, $no_visible_fields) &&
3270 ($ilias->getSetting(
"usr_settings_hide_".$field) !=
"1" ||
3271 ($this->confirm_change == 1 && ! $_POST[
"chb"][
"visible_" . $field])))
3273 $this->tpl->setVariable(
"CHECKED_VISIBLE",
" checked=\"checked\"");
3276 if (in_array($field, $disabled_visible_fields))
3278 $this->tpl->setVariable(
"DISABLE_VISIBLE",
" disabled=\"disabled\"");
3282 if (!in_array($field, $no_export_fields))
3284 $this->tpl->setVariable(
"PROFILE_OPTION_EXPORT",
"export_" . $field);
3287 if (($ilias->getSetting(
"usr_settings_export_".$field) == null && $field ==
"preferences")||
3288 $ilias->getSetting(
"usr_settings_export_".$field) ==
"1" ||
3289 ($this->confirm_change == 1 && $_POST[
"chb"][
"export_" . $field] ==
"1"))
3291 $this->tpl->setVariable(
"CHECKED_EXPORT",
" checked=\"checked\"");
3296 $is_fixed = array_key_exists($field, $fixed_required_fields);
3297 if ($is_fixed && $fixed_required_fields[$field] || ! $is_fixed &&
3298 ($ilias->getSetting(
"require_".$field) ==
"1" ||
3299 ($this->confirm_change == 1 && $_POST[
"chb"][
"required_" . $field] ==
"1")))
3301 $this->tpl->setVariable(
"CHECKED_REQUIRED",
" checked=\"checked\"");
3305 $this->tpl->setVariable(
"DISABLE_REQUIRED",
" disabled=\"disabled\"");
3310 if (is_array($course_export_fields))
3312 if (in_array($field, $course_export_fields) && $course_export_fields[$field] != 0)
3314 $this->tpl->setVariable(
"HEADER_COURSE_EXPORT", $lng->txt(
"course_export"));
3315 $this->tpl->setVariable(
"PROFILE_OPTION_COURSE_EXPORT",
"course_export_" . $field);
3317 if ($course_export_fields[$field] == 2)
3319 $this->tpl->setVariable(
"CHECKED_COURSE_EXPORT",
" checked=\"checked\"");
3320 $this->tpl->setVariable(
"DISABLE_COURSE_EXPORT",
" disabled=\"disabled\"");
3324 if ($ilias->getSetting(
"usr_settings_course_export_".$field) ==
"1" ||
3325 ($this->confirm_change == 1 && $_POST[
"chb"][
"course_export_" . $field] ==
"1"))
3327 $this->tpl->setVariable(
"CHECKED_COURSE_EXPORT",
" checked=\"checked\"");
3335 if ($field ==
"hits_per_page")
3337 $this->tpl->setVariable(
"PROFILE_OPTION_DEFAULT_VALUE",
"default_" . $field);
3338 $options = array(2,10,15,20,30,40,50,100,9999);
3339 $selected_option = $ilias->getSetting(
"hits_per_page");
3340 if ($selected_option == null) $selected_option = 10;
3341 $this->tpl->setCurrentBlock(
"default_value_option");
3342 foreach ($options as $option)
3344 if ($option == $selected_option)
3346 $this->tpl->setVariable(
"OPTION_SELECTED",
" selected=\"selected\"");
3349 $this->tpl->setVariable(
"OPTION_VALUE", $option);
3350 $this->tpl->setVariable(
"OPTION_TEXT", ($option == 9999) ? $this->lng->txt(
"no_limit") : $option);
3351 $this->tpl->parseCurrentBlock();
3353 $this->tpl->setCurrentBlock(
"profile_settings");
3354 $this->tpl->setVariable(
"HEADER_DEFAULT_VALUE", $this->lng->txt(
"default_value"));
3359 else if ($field ==
"show_users_online")
3361 $this->tpl->setVariable(
"PROFILE_OPTION_DEFAULT_VALUE",
"default_" . $field);
3362 $options = array(
'y',
'associated',
'n');
3363 $selected_option = $ilias->getSetting(
"show_users_online");
3364 if ($selected_option ==
"") $selected_option =
"y";
3365 $this->tpl->setCurrentBlock(
"default_value_option");
3366 foreach ($options as $option)
3368 if ($option == $selected_option)
3370 $this->tpl->setVariable(
"OPTION_SELECTED",
" selected=\"selected\"");
3373 $this->tpl->setVariable(
"OPTION_VALUE", $option);
3374 $this->tpl->setVariable(
"OPTION_TEXT", $this->lng->txt(
"users_online_show_short_".$option));
3375 $this->tpl->parseCurrentBlock();
3377 $this->tpl->setCurrentBlock(
"profile_settings");
3378 $this->tpl->setVariable(
"HEADER_DEFAULT_VALUE", $this->lng->txt(
"default_value"));
3382 $this->tpl->parseCurrentBlock();
3384 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
3385 $this->tpl->setVariable(
"TXT_HEADER_PROFILE", $this->lng->txt(
"usr_settings_header_profile"));
3386 $this->tpl->setVariable(
"TXT_EXPLANATION_PROFILE", $this->lng->txt(
"usr_settings_explanation_profile"));
3387 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
3389 if ($this->confirm_change == 1)
3391 $this->tpl->setVariable(
"CONFIRM_MESSAGE", $this->lng->txt(
"confirm_message_course_export"));
3392 $this->tpl->setVariable(
"BUTTON_CONFIRM", $this->lng->txt(
"confirm"));
3393 $this->tpl->setVariable(
"BUTTON_CANCEL", $this->lng->txt(
"cancel"));
3404 include_once
'Services/Search/classes/class.ilUserSearchOptions.php';
3405 include_once
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
3409 $profile_fields =& $this->
object->getProfileFields();
3411 $fixed_required_fields = array(
3418 "hits_per_page" => 0,
3419 "show_users_online" => 0,
3420 "hide_own_online_status" => 0
3425 if ($privacy->enabledExport() ==
true &&
3426 $privacy->confirmationRequired() ==
true &&
3429 foreach ($profile_fields as $field)
3431 if (! $ilias->getSetting(
"usr_settings_course_export_" . $field) && $_POST[
"chb"][
"course_export_" . $field] ==
"1")
3433 $this->confirm_change = 1;
3440 if($action ==
'save')
3442 include_once(
'Modules/Course/classes/class.ilCourseAgreement.php');
3446 foreach ($profile_fields as $field)
3454 if (! $_POST[
"chb"][
"visible_".$field])
3456 $ilias->setSetting(
"usr_settings_hide_".$field,
"1");
3460 $ilias->deleteSetting(
"usr_settings_hide_".$field);
3463 if (! $_POST[
"chb"][
"enabled_" . $field])
3465 $ilias->setSetting(
"usr_settings_disable_".$field,
"1");
3469 $ilias->deleteSetting(
"usr_settings_disable_".$field);
3472 if ($_POST[
"chb"][
"export_" . $field])
3474 $ilias->setSetting(
"usr_settings_export_".$field,
"1");
3478 $ilias->deleteSetting(
"usr_settings_export_".$field);
3481 if ($_POST[
"chb"][
"course_export_" . $field])
3483 $ilias->setSetting(
"usr_settings_course_export_".$field,
"1");
3487 $ilias->deleteSetting(
"usr_settings_course_export_".$field);
3490 $is_fixed = array_key_exists($field, $fixed_required_fields);
3491 if ($is_fixed && $fixed_required_fields[$field] || ! $is_fixed && $_POST[
"chb"][
"required_".$field])
3493 $ilias->setSetting(
"require_".$field,
"1");
3497 $ilias->deleteSetting(
"require_" . $field);
3501 if ($_POST[
"select"][
"default_hits_per_page"])
3503 $ilias->setSetting(
"hits_per_page",$_POST[
"select"][
"default_hits_per_page"]);
3506 if ($_POST[
"select"][
"default_show_users_online"])
3508 $ilias->setSetting(
"show_users_online",$_POST[
"select"][
"default_show_users_online"]);
3511 if ($_POST[
"chb"][
"export_preferences"])
3513 $ilias->setSetting(
"usr_settings_export_preferences",$_POST[
"chb"][
"export_preferences"]);
3518 $ilias->setSetting(
"usr_settings_export_preferences",
"0");
3531 $action[-1] = $this->lng->txt(
'all_users');
3532 $action[1] = $this->lng->txt(
'usr_active_only');
3533 $action[0] = $this->lng->txt(
'usr_inactive_only');
3534 $action[2] = $this->lng->txt(
'usr_limited_access_only');
3535 $action[3] = $this->lng->txt(
'usr_without_courses');
3536 $action[4] = $this->lng->txt(
'usr_filter_lastlogin');
3537 $action[5] = $this->lng->txt(
"usr_filter_coursemember");
3538 $action[6] = $this->lng->txt(
"usr_filter_groupmember");
3539 $action[7] = $this->lng->txt(
"usr_filter_role");
3552 if(!isset($_POST[
"file"]))
3554 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
3557 if (count($_POST[
"file"]) > 1)
3559 $this->ilias->raiseError($this->lng->txt(
"select_max_one_item"),$this->ilias->error_obj->MESSAGE);
3563 $export_dir = $this->
object->getExportDirectory();
3573 if(!isset($_POST[
"file"]))
3575 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
3579 $_SESSION[
"ilExportFiles"] = $_POST[
"file"];
3585 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
3588 $this->tpl->setCurrentBlock(
"table_header");
3589 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
3590 $this->tpl->parseCurrentBlock();
3594 foreach($_POST[
"file"] as
$file)
3596 $this->tpl->setCurrentBlock(
"table_row");
3599 $this->tpl->setVariable(
"TEXT_CONTENT", $file);
3600 $this->tpl->parseCurrentBlock();
3605 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
3606 $buttons = array(
"cancelDeleteExportFile" => $this->lng->txt(
"cancel"),
3607 "deleteExportFile" => $this->lng->txt(
"confirm"));
3608 foreach ($buttons as $name => $value)
3610 $this->tpl->setCurrentBlock(
"operation_btn");
3611 $this->tpl->setVariable(
"BTN_NAME",$name);
3612 $this->tpl->setVariable(
"BTN_VALUE",$value);
3613 $this->tpl->parseCurrentBlock();
3623 session_unregister(
"ilExportFiles");
3624 ilUtil::redirect($this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"export"));
3633 $export_dir = $this->
object->getExportDirectory();
3636 $exp_file = $export_dir.
"/".
$file;
3637 if (@is_file($exp_file))
3642 ilUtil::redirect($this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"export"));
3659 if ($_POST[
"cmd"][
"export"])
3661 $this->
object->buildExportFile($_POST[
"export_type"]);
3662 ilUtil::redirect($this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"export"));
3668 $export_types = array(
3669 "userfolder_export_excel_x86",
3670 "userfolder_export_csv",
3671 "userfolder_export_xml"
3675 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
3679 $this->tpl->addBlockfile(
"EXPORT_FILES",
"export_files",
"tpl.table.html");
3682 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.usr_export_file_row.html");
3686 $tbl->setTitle($this->lng->txt(
"userfolder_export_files"));
3688 $tbl->setHeaderNames(array(
"", $this->lng->txt(
"userfolder_export_file"),
3689 $this->lng->txt(
"userfolder_export_file_size"), $this->lng->txt(
"date") ));
3690 $tbl->setHeaderVars(array(), $ilCtrl->getParameterArray($this,
"export"));
3692 $tbl->enabled[
"sort"] =
false;
3693 $tbl->setColumnWidth(array(
"1%",
"49%",
"25%",
"25%"));
3696 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
3697 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
3698 $tbl->setLimit(
$_GET[
"limit"]);
3699 $tbl->setOffset(
$_GET[
"offset"]);
3700 $tbl->setMaxCount($this->maxcount);
3703 $this->tpl->setVariable(
"COLUMN_COUNTS", 4);
3707 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
3708 $this->tpl->setCurrentBlock(
"tbl_action_btn");
3709 $this->tpl->setVariable(
"BTN_NAME",
"confirmDeleteExportFile");
3710 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
3711 $this->tpl->parseCurrentBlock();
3713 $this->tpl->setCurrentBlock(
"tbl_action_btn");
3714 $this->tpl->setVariable(
"BTN_NAME",
"downloadExportFile");
3715 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"download"));
3716 $this->tpl->parseCurrentBlock();
3719 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
3722 $export_files = $this->
object->getExportFiles();
3724 $tbl->setMaxCount(count($export_files));
3725 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
3729 if(count($export_files) > 0)
3732 foreach($export_files as $exp_file)
3734 $this->tpl->setCurrentBlock(
"tbl_content");
3735 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"filename"]);
3738 $this->tpl->setVariable(
"CSS_ROW", $css_row);
3740 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"filesize"]);
3741 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"filename"]);
3743 $file_arr = explode(
"__", $exp_file[
"filename"]);
3746 $this->tpl->parseCurrentBlock();
3749 $this->tpl->setCurrentBlock(
"selectall");
3750 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
3751 $this->tpl->setVariable(
"CSS_ROW", $css_row);
3752 $this->tpl->parseCurrentBlock();
3756 $this->tpl->setCurrentBlock(
"notfound");
3757 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
3758 $this->tpl->setVariable(
"NUM_COLS", 3);
3759 $this->tpl->parseCurrentBlock();
3762 $this->tpl->parseCurrentBlock();
3765 foreach ($export_types as $export_type)
3767 $this->tpl->setCurrentBlock(
"option");
3768 $this->tpl->setVariable(
"OPTION_VALUE", $export_type);
3769 $this->tpl->setVariable(
"OPTION_TEXT", $this->lng->txt($export_type));
3770 $this->tpl->parseCurrentBlock();
3773 $this->tpl->setVariable(
"EXPORT_BUTTON", $this->lng->txt(
"create_export_file"));
3774 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
3785 $this->tabs_gui->setTabActive(
'global_settings');
3786 $this->tabs_gui->setSubTabActive(
'user_new_account_mail');
3788 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_new_account_mail.html');
3789 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
3792 $lng->loadLanguageModule(
"meta");
3793 $lng->loadLanguageModule(
"mail");
3794 $this->tpl->setVariable(
"TXT_NEW_USER_ACCOUNT_MAIL", $lng->txt(
"user_new_account_mail"));
3795 $this->tpl->setVariable(
"TXT_NEW_USER_ACCOUNT_MAIL_DESC", $lng->txt(
"user_new_account_mail_desc"));
3798 $this->tpl->setVariable(
"TXT_USE_PLACEHOLDERS", $lng->txt(
"mail_nacc_use_placeholder"));
3799 $this->tpl->setVariable(
"TXT_MAIL_SALUTATION", $lng->txt(
"mail_nacc_salutation"));
3800 $this->tpl->setVariable(
"TXT_FIRST_NAME", $lng->txt(
"firstname"));
3801 $this->tpl->setVariable(
"TXT_LAST_NAME", $lng->txt(
"lastname"));
3802 $this->tpl->setVariable(
"TXT_EMAIL", $lng->txt(
"email"));
3803 $this->tpl->setVariable(
"TXT_LOGIN", $lng->txt(
"mail_nacc_login"));
3804 $this->tpl->setVariable(
"TXT_PASSWORD", $lng->txt(
"password"));
3805 $this->tpl->setVariable(
"TXT_PASSWORD_BLOCK", $lng->txt(
"mail_nacc_pw_block"));
3806 $this->tpl->setVariable(
"TXT_NOPASSWORD_BLOCK", $lng->txt(
"mail_nacc_no_pw_block"));
3807 $this->tpl->setVariable(
"TXT_ADMIN_MAIL", $lng->txt(
"mail_nacc_admin_mail"));
3808 $this->tpl->setVariable(
"TXT_ILIAS_URL", $lng->txt(
"mail_nacc_ilias_url"));
3809 $this->tpl->setVariable(
"TXT_CLIENT_NAME", $lng->txt(
"mail_nacc_client_name"));
3810 $this->tpl->setVariable(
"TXT_TARGET", $lng->txt(
"mail_nacc_target"));
3811 $this->tpl->setVariable(
"TXT_TARGET_TITLE", $lng->txt(
"mail_nacc_target_title"));
3812 $this->tpl->setVariable(
"TXT_TARGET_TYPE", $lng->txt(
"mail_nacc_target_type"));
3813 $this->tpl->setVariable(
"TXT_TARGET_BLOCK", $lng->txt(
"mail_nacc_target_block"));
3815 $langs = $lng->getInstalledLanguages();
3816 foreach($langs as $lang_key)
3818 $amail = $this->
object->_lookupNewAccountMail($lang_key);
3819 $this->tpl->setCurrentBlock(
"mail_block");
3821 if ($lang_key == $lng->getDefaultLanguage())
3823 $add =
" (".$lng->txt(
"default").
")";
3825 $this->tpl->setVariable(
"TXT_LANGUAGE",
3826 $lng->txt(
"meta_l_".$lang_key).$add);
3827 $this->tpl->setVariable(
"TXT_BODY", $lng->txt(
"message_content"));
3828 $this->tpl->setVariable(
"TA_BODY",
"body_".$lang_key);
3829 $this->tpl->setVariable(
"VAL_BODY",
3831 $this->tpl->setVariable(
"TXT_SUBJECT", $lng->txt(
"subject"));
3832 $this->tpl->setVariable(
"INPUT_SUBJECT",
"subject_".$lang_key);
3833 $this->tpl->setVariable(
"VAL_SUBJECT",
3835 $this->tpl->setVariable(
"TXT_SAL_G", $lng->txt(
"mail_salutation_general"));
3836 $this->tpl->setVariable(
"INPUT_SAL_G",
"sal_g_".$lang_key);
3837 $this->tpl->setVariable(
"VAL_SAL_G",
3839 $this->tpl->setVariable(
"TXT_SAL_M", $lng->txt(
"mail_salutation_male"));
3840 $this->tpl->setVariable(
"INPUT_SAL_M",
"sal_m_".$lang_key);
3841 $this->tpl->setVariable(
"VAL_SAL_M",
3843 $this->tpl->setVariable(
"TXT_SAL_F", $lng->txt(
"mail_salutation_female"));
3844 $this->tpl->setVariable(
"INPUT_SAL_F",
"sal_f_".$lang_key);
3845 $this->tpl->setVariable(
"VAL_SAL_F",
3847 $this->tpl->parseCurrentBlock();
3849 $this->tpl->setVariable(
"TXT_CANCEL", $lng->txt(
"cancel"));
3850 $this->tpl->setVariable(
"TXT_SAVE", $lng->txt(
"save"));
3856 $this->ctrl->redirect($this,
"settings");
3864 $langs = $lng->getInstalledLanguages();
3865 foreach($langs as $lang_key)
3867 $this->
object->_writeNewAccountMail($lang_key,
3874 $this->ctrl->redirect($this,
"newAccountMail");
3889 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
3893 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
3895 $tabs_gui->addTarget(
"obj_usrf",
3896 $this->ctrl->getLinkTarget($this,
"view"), array(
"view",
"delete",
"resetFilter",
"userAction",
""),
"",
"");
3899 if ($rbacsystem->checkAccess(
"write",$this->object->getRefId()))
3901 $tabs_gui->addTarget(
"global_settings",
3902 $this->ctrl->getLinkTarget($this,
"settings"), array(
"settings",
"saveGlobalUserSettings"),
"",
"");
3904 $tabs_gui->addTarget(
"export",
3905 $this->ctrl->getLinkTarget($this,
"export"),
"export",
"",
"");
3911 $tabs_gui->addTarget(
"learning_progress",
3912 $this->ctrl->getLinkTarget($this,
"learningProgress"),
"learningProgress",
"",
"");
3916 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
3918 $tabs_gui->addTarget(
"perm_settings",
3919 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
3920 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
3930 global $rbacsystem,$ilUser;
3935 $this->tabs_gui->addSubTabTarget(
"standard_fields",
3936 $this->ctrl->getLinkTarget($this,
'settings'),
3937 array(
"settings",
"saveGlobalUserSettings"), get_class($this));
3938 $this->tabs_gui->addSubTabTarget(
"user_defined_fields",
3939 $this->ctrl->getLinkTarget($this,
'listUserDefinedFields'),
3940 "listUserDefinedFields",get_class($this));
3941 $this->tabs_gui->addSubTabTarget(
"user_new_account_mail",
3942 $this->ctrl->getLinkTarget($this,
'newAccountMail'),
3943 "newAccountMail",get_class($this));