4 require_once
"./classes/class.ilObjectGUI.php";
31 define(
'USER_FOLDER_ID',7);
34 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
36 $this->lng->loadLanguageModule(
'search');
37 $this->lng->loadLanguageModule(
"user");
39 $ilCtrl->saveParameter($this,
"letter");
44 $this->user_owner_id = $a_id;
48 return $this->user_owner_id ? $this->user_owner_id :
USER_FOLDER_ID;
53 $next_class = $this->ctrl->getNextClass($this);
54 $cmd = $this->ctrl->getCmd();
59 case 'ilusertablegui':
60 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
62 $u_table->initFilter();
63 $this->ctrl->setReturn($this,
'view');
64 $this->ctrl->forwardCommand($u_table);
67 case 'ilpermissiongui':
68 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
70 $ret =& $this->ctrl->forwardCommand($perm_gui);
73 case 'iladminusersearchgui':
74 include_once(
'./Services/Search/classes/class.ilAdminUserSearchGUI.php');
76 $user_search->setCallbackClass($this);
78 $this->tabs_gui->setTabActive(
'search_user_extended');
79 $this->ctrl->setReturn($this,
'view');
80 $ret =& $this->ctrl->forwardCommand($user_search);
101 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()))
103 $ilErr->raiseError($this->lng->txt(
"permission_denied"),$ilErr->MESSAGE);
106 include_once
'./Services/Excel/classes/class.ilExcelWriterAdapter.php';
115 $workbook =& $pewa->getWorkbook();
121 include_once
'Services/Excel/classes/class.ilExcelUtils.php';
123 $workbook =& $pewa->getWorkbook();
124 $worksheet =& $workbook->addWorksheet($this->lng->txt(
'objs_usr'));
127 $worksheet->mergeCells(0,0,0,4);
128 $worksheet->setColumn(1,0,32);
129 $worksheet->setColumn(1,1,32);
130 $worksheet->setColumn(1,2,32);
131 $worksheet->setColumn(1,3,32);
132 $worksheet->setColumn(1,4,32);
134 $title = $this->lng->txt(
'learning_progress');
135 $title .=
' '.$this->lng->txt(
'as_of').
': ';
136 $title .= strftime(
'%Y-%m-%d %R',time());
152 foreach($usr_data as $user)
154 $worksheet->writeString($counter,0,$user[
'login']);
155 $worksheet->writeString($counter,1,$user[
'lastname']);
156 $worksheet->writeString($counter,2,$user[
'firstname']);
158 $pewa->getFormatDayTime());
159 $worksheet->writeString($counter,4,$user[
'last_login'],
160 $pewa->getFormatDate());
169 include_once
'Services/Tracking/classes/class.ilOnlineTracking.php';
170 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
174 global $ilUser,$rbacsystem;
176 $this->max_count = $ilUser->getPref(
'hits_per_page');
178 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()))
180 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
191 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
194 $this->lng->loadLanguageModule(
'payment');
195 $this->tpl->setCurrentBlock(
"btn_cell");
196 $this->tpl->setVariable(
"BTN_LINK",
197 $this->ctrl->getLinkTarget($this,
"learningProgressExcelExport"));
198 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"excel_export"));
199 $this->tpl->parseCurrentBlock();
202 $data[
"cols"] = array(
"login",
"firstname",
"lastname",
"online_time",
'last_login');
205 $num_users = count($usr_data) - 1;
207 $sort_numeric =
false;
208 if(in_array(
$_SESSION[
"usrf_sort_by"], array(
"last_login",
"online_time")))
210 $sort_numeric =
true;
215 foreach ($usr_data as $idx => $val)
217 if ($val[
"usr_id"] == ANONYMOUS_USER_ID)
219 unset($usr_data[$idx]);
223 $usr_data = array_slice($usr_data,
$_GET[
"offset"],$this->max_count);
224 foreach ($usr_data as $val)
226 $data[
"data"][
"$val[usr_id]"] = array(
227 "login" => $val[
"login"],
228 "firstname" => $val[
"firstname"],
229 "lastname" => $val[
"lastname"],
235 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_list.html");
239 include_once
"./Services/Table/classes/class.ilTableGUI.php";
240 $this->tpl->addBlockfile(
"USR_TABLE",
"user_table",
"tpl.table.html");
241 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.usr_tbl_row.html");
243 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
249 $tbl->setTitle($this->object->getTitle(),
"icon_usr.gif",
250 $this->lng->txt(
"obj_".$this->object->getType()));
252 foreach (
$data[
"cols"] as $val)
254 $header_names[] = $this->lng->txt($val);
257 $tbl->setHeaderNames($header_names);
259 $header_params = $this->ctrl->getParameterArray($this,
"learningProgress");
260 $tbl->setHeaderVars(
$data[
"cols"],$header_params);
261 $tbl->setColumnWidth(array(
"20%",
"20%",
"20%",
"20%"));
266 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
267 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
268 $tbl->setLimit($this->max_count);
269 $tbl->setOffset(
$_GET[
"offset"]);
270 $tbl->setMaxCount($num_users);
273 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
285 $this->tpl->setVariable(
"CSS_ROW", $css_row);
287 foreach ($fields as $key => $val)
292 $this->ids[] =
$ctrl[
"obj_id"];
294 if ($key ==
"login" and $lp_active)
296 $this->ctrl->setParameterByClass(
"illearningprogressgui",
"ref_id",$this->object->getRefId());
297 $this->ctrl->setParameterByClass(
"illearningprogressgui",
"obj_id",
$usr_id);
298 $link = $this->ctrl->getLinkTargetByClass(array(
"ilobjusergui",
'illearningprogressgui'),
"");
300 $this->tpl->setCurrentBlock(
"begin_link");
301 $this->tpl->setVariable(
"LINK_TARGET", $link);
302 $this->tpl->parseCurrentBlock();
303 $this->tpl->touchBlock(
"end_link");
306 $this->tpl->setCurrentBlock(
"text");
307 $this->tpl->setVariable(
"TEXT_CONTENT", $val);
308 $this->tpl->parseCurrentBlock();
309 $this->tpl->setCurrentBlock(
"table_cell");
310 $this->tpl->parseCurrentBlock();
313 $this->tpl->setCurrentBlock(
"tbl_content");
314 $this->tpl->setVariable(
"CSS_ROW", $css_row);
315 $this->tpl->parseCurrentBlock();
325 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
327 $utab->resetOffset();
328 $utab->resetFilter();
341 $ilCtrl->setParameterByClass(
"ilobjusergui",
"new_type",
"usr");
342 $ilCtrl->redirectByClass(array(
"iladministrationgui",
"ilobjusergui"),
"create");
353 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
355 $utab->resetOffset();
356 $utab->writeFilterToSession();
358 $ilTabs->activateTab(
"obj_usrf");
371 $ilToolbar->addButton($this->lng->txt(
"usr_add"),
372 $this->ctrl->getLinkTarget($this,
"addUser"));
373 $ilToolbar->addButton($this->lng->txt(
"import_users"),
374 $this->ctrl->getLinkTarget($this,
"importUserForm"));
377 include_once
'./Services/User/classes/class.ilUserAccountSettings.php';
379 if ((
int) $ilSetting->get(
'user_adm_alpha_nav'))
381 $ilToolbar->addSeparator();
384 include_once(
"./Services/Form/classes/class.ilAlphabetInputGUI.php");
386 include_once(
"./Services/User/classes/class.ilObjUser.php");
392 $ai->setParentCommand($this,
"chooseLetter");
393 $ai->setHighlighted(
$_GET[
"letter"]);
394 $ilToolbar->addInputItem($ai,
true);
398 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
400 $tpl->setContent($utab->getHTML());
413 $ilCtrl->redirect($this,
"view");
427 $operations = array();
429 if ($this->actions ==
"")
432 "delete" => array(
"name" =>
"delete",
"lng" =>
"delete"),
433 "activate" => array(
"name" =>
"activate",
"lng" =>
"activate"),
434 "deactivate" => array(
"name" =>
"deactivate",
"lng" =>
"deactivate"),
435 "accessRestrict" => array(
"name" =>
"accessRestrict",
"lng" =>
"accessRestrict"),
436 "accessFree" => array(
"name" =>
"accessFree",
"lng" =>
"accessFree"),
437 "export" => array(
"name" =>
"export",
"lng" =>
"export")
446 if ($rbacsystem->checkAccess($row[
"name"],$this->object->getRefId()))
448 $operations[] =
$row;
452 if (count($operations) > 0)
454 $select =
"<select name=\"selectedAction\">\n";
455 foreach ($operations as $val)
457 $select .=
"<option value=\"" . $val[
"name"] .
"\"";
458 if (strcmp(
$_POST[
"selectedAction"], $val[
"name"]) == 0)
460 $select .=
" selected=\"selected\"";
463 $select .= $this->lng->txt($val[
"lng"]);
464 $select .=
"</option>";
466 $select .=
"</select>";
467 $this->tpl->setCurrentBlock(
"tbl_action_select");
468 $this->tpl->setVariable(
"SELECT_ACTION", $select);
469 $this->tpl->setVariable(
"BTN_NAME",
"userAction");
470 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"submit"));
471 $this->tpl->parseCurrentBlock();
474 if ($with_subobjects ===
true)
479 if ((count($operations) > 0) or $subobjs ===
true)
481 $this->tpl->setCurrentBlock(
"tbl_action_row");
482 $this->tpl->setVariable(
"COLUMN_COUNTS",count($this->data[
"cols"]));
484 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
485 $this->tpl->parseCurrentBlock();
499 $d = $this->objDefinition->getCreatableSubObjects($this->object->getType());
501 if (!$rbacsystem->checkAccess(
'create_usr',$this->object->getRefId()))
514 for ($i=0; $i<count($this->data[
"ctrl"]); $i++)
516 if ($this->data[
"ctrl"][$i][
"type"] == $row[
"name"])
522 if ($row[
"max"] ==
"" || $count < $row[
"max"])
524 $subobj[] = $row[
"name"];
529 if (is_array($subobj))
533 $this->tpl->setCurrentBlock(
"add_object");
534 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
535 $this->tpl->setVariable(
"BTN_NAME",
"create");
536 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"add"));
537 $this->tpl->parseCurrentBlock();
547 session_unregister(
"saved_post");
548 $this->ctrl->returnToParent($this);
568 global $rbacsystem, $ilUser;
571 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
573 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
582 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
583 $obj->setActive(TRUE, $ilUser->getId());
589 if (
$_SESSION[
'user_activate_search'] ==
true)
591 session_unregister(
"user_activate_search");
592 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show',
'',
false,
false);
597 $this->ctrl->redirect($this,
"view");
618 global $rbacsystem, $ilUser;
621 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
623 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
632 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
633 $obj->setActive(FALSE, $ilUser->getId());
640 if (
$_SESSION[
'user_deactivate_search'] ==
true)
642 session_unregister(
"user_deactivate_search");
643 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show',
'',
false,
false);
648 $this->ctrl->redirect($this,
"view");
659 global $rbacsystem, $ilUser;
662 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
664 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
673 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
674 $obj->setTimeLimitOwner($ilUser->getId());
675 $obj->setTimeLimitUnlimited(1);
676 $obj->setTimeLimitFrom(
"");
677 $obj->setTimeLimitUntil(
"");
678 $obj->setTimeLimitMessage(0);
685 if (
$_SESSION[
'user_accessFree_search'] ==
true)
687 session_unregister(
"user_accessFree_search");
688 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show',
'',
false,
false);
693 $this->ctrl->redirect($this,
"view");
699 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm.html");
700 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
701 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"time_limit_add_time_limit_for_selected"));
702 include_once
"./classes/class.ilTemplate.php";
703 $tsTemplate =
new ilTemplate(
"tpl.time.limit.html", TRUE, TRUE);
704 $from = (array_key_exists(
"from",
$_GET)) ?
$_GET[
"from"] : time();
705 $until = (array_key_exists(
"until",
$_GET)) ?
$_GET[
"until"] : time();
706 $fromA = getdate($from);
707 $untilA = getdate($until);
712 $tsTemplate->setVariable(
"TEXT_FROM", $this->lng->txt(
"access_from") .
": ");
713 $tsTemplate->setVariable(
"TEXT_UNTIL", $this->lng->txt(
"access_until") .
": ");
714 $tsTemplate->setVariable(
"DATE_FROM", $fromDate);
715 $tsTemplate->setVariable(
"TIME_FROM", $fromTime);
716 $tsTemplate->setVariable(
"DATE_UNTIL", $untilDate);
717 $tsTemplate->setVariable(
"TIME_UNTIL", $untilTime);
718 $this->tpl->setVariable(
"TXT_CONTENT", $tsTemplate->get());
719 $this->tpl->setVariable(
"CMD_CANCEL",
"cancelaccessRestrict");
720 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
721 $this->tpl->setVariable(
"CMD_OK",
"confirmaccessRestrict");
722 $this->tpl->setVariable(
"TXT_OK", $this->lng->txt(
"confirm"));
723 $this->tpl->parseCurrentBlock();
733 $timefrom = mktime(
$_POST[
"fromTime"][
"h"],
$_POST[
"fromTime"][
"m"], 0,
$_POST[
"fromDate"][
"m"],
$_POST[
"fromDate"][
"d"],
$_POST[
"fromDate"][
"y"]);
734 $timeuntil = mktime(
$_POST[
"untilTime"][
"h"],
$_POST[
"untilTime"][
"m"], 0,
$_POST[
"untilDate"][
"m"],
$_POST[
"untilDate"][
"d"],
$_POST[
"untilDate"][
"y"]);
735 if ($timeuntil <= $timefrom)
738 $this->ctrl->setParameter($this,
"from", $timefrom);
739 $this->ctrl->setParameter($this,
"until", $timeuntil);
740 $this->ctrl->redirect($this,
"setAccessRestriction");
743 global $rbacsystem, $ilUser;
746 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
748 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->WARNING);
757 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
758 $obj->setTimeLimitOwner($ilUser->getId());
759 $obj->setTimeLimitUnlimited(0);
760 $obj->setTimeLimitFrom($timefrom);
761 $obj->setTimeLimitUntil($timeuntil);
762 $obj->setTimeLimitMessage(0);
769 if (
$_SESSION[
'user_accessRestrict_search'] ==
true)
771 session_unregister(
"user_accessRestrict_search");
772 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show',
'',
false,
false);
777 $this->ctrl->redirect($this,
"view");
801 if (!$rbacsystem->checkAccess(
'delete',$this->object->getRefId()))
804 $ilCtrl->redirect($this,
"view");
811 $this->ilias->raiseError($this->lng->txt(
"msg_no_delete_yourself"),$this->ilias->error_obj->WARNING);
818 $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
826 #unset($_SESSION['saved_post']);
828 if (
$_SESSION[
'user_delete_search'] ==
true)
830 session_unregister(
"user_delete_search");
831 $script = $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'show',
'',
false,
false);
836 $this->ctrl->redirect($this,
"view");
858 session_unregister(
"saved_post");
859 $this->
object->buildExportFile(
$_POST[
"export_type"], $user_data_filter);
860 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
870 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
876 $this->data[
"cols"] = array(
"type",
"title",
"description",
"last_change");
878 foreach(
$_POST[
"id"] as $id)
880 $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($id);
882 $this->data[
"data"][
"$id"] = array(
883 "type" => $obj_data->getType(),
884 "title" => $obj_data->getTitle(),
885 "desc" => $obj_data->getDescription(),
886 "last_update" => $obj_data->getLastUpdateDate());
889 $this->data[
"buttons"] = array(
"cancelDelete" => $this->lng->txt(
"cancel"),
890 "confirmedDelete" => $this->lng->txt(
"confirm"));
896 $this->tpl->setVariable(
"FORMACTION",
897 $this->ctrl->getFormAction($this));
900 foreach ($this->data[
"cols"] as $key)
902 $this->tpl->setCurrentBlock(
"table_header");
903 $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
904 $this->tpl->parseCurrentBlock();
911 foreach($this->data[
"data"] as $key => $value)
914 foreach($value as $key => $cell_data)
916 $this->tpl->setCurrentBlock(
"table_cell");
925 $this->tpl->setVariable(
"TEXT_CONTENT",$cell_data);
927 $this->tpl->parseCurrentBlock();
930 $this->tpl->setCurrentBlock(
"table_row");
932 $this->tpl->parseCurrentBlock();
938 foreach($this->data[
"buttons"] as
$name => $value)
940 $this->tpl->setCurrentBlock(
"operation_btn");
941 $this->tpl->setVariable(
"BTN_NAME",
$name);
942 $this->tpl->setVariable(
"BTN_VALUE",$value);
943 $this->tpl->parseCurrentBlock();
949 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm.html");
950 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
951 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"export_format_selection"));
952 $export_types = array(
"userfolder_export_excel_x86",
"userfolder_export_csv",
"userfolder_export_xml");
954 foreach ($export_types as
$type)
956 $options[
$type] = $this->lng->txt($type);
958 $select =
ilUtil::formSelect(
"userfolder_export_xml",
"export_type" ,$options,
false,
true);
959 $this->tpl->setVariable(
"TXT_CONTENT", $this->lng->txt(
"export_format") .
": " . $select);
960 $this->tpl->setVariable(
"CMD_CANCEL",
"cancelexport");
961 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
962 $this->tpl->setVariable(
"CMD_OK",
"confirmexport");
963 $this->tpl->setVariable(
"TXT_OK", $this->lng->txt(
"confirm"));
964 $this->tpl->parseCurrentBlock();
974 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
983 $this->data[
"cols"] = array(
"type",
"title",
"description",
"last_change");
985 foreach(
$_POST[
"id"] as $id)
987 $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($id);
989 $this->data[
"data"][
"$id"] = array(
990 "type" => $obj_data->getType(),
991 "title" => $obj_data->getTitle(),
992 "desc" => $obj_data->getDescription(),
993 "last_update" => $obj_data->getLastUpdateDate());
996 $this->data[
"buttons"] = array(
"cancel" . $action => $this->lng->txt(
"cancel"),
997 "confirm" . $action => $this->lng->txt(
"confirm"));
1003 $this->tpl->setVariable(
"FORMACTION",
1004 $this->ctrl->getFormAction($this));
1007 foreach ($this->data[
"cols"] as $key)
1009 $this->tpl->setCurrentBlock(
"table_header");
1010 $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
1011 $this->tpl->parseCurrentBlock();
1018 foreach($this->data[
"data"] as $key => $value)
1021 foreach($value as $key => $cell_data)
1023 $this->tpl->setCurrentBlock(
"table_cell");
1032 $this->tpl->setVariable(
"TEXT_CONTENT",$cell_data);
1034 $this->tpl->parseCurrentBlock();
1037 $this->tpl->setCurrentBlock(
"table_row");
1039 $this->tpl->parseCurrentBlock();
1045 foreach($this->data[
"buttons"] as
$name => $value)
1047 $this->tpl->setCurrentBlock(
"operation_btn");
1048 $this->tpl->setVariable(
"BTN_NAME",
$name);
1049 $this->tpl->setVariable(
"BTN_VALUE",$value);
1050 $this->tpl->parseCurrentBlock();
1059 $_POST[
"selectedAction"] =
"delete";
1068 $_POST[
"selectedAction"] =
"activate";
1077 $_POST[
"selectedAction"] =
"deactivate";
1086 $_POST[
"selectedAction"] =
"accessRestrict";
1095 $_POST[
"selectedAction"] =
"accessFree";
1104 $_POST[
"selectedAction"] =
"export";
1123 $this->tabs_gui->setTabActive(
'obj_usrf');
1125 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_search_form.html");
1127 $this->tpl->setVariable(
"FORMACTION",
1128 $this->ctrl->getFormAction($this));
1129 $this->tpl->setVariable(
"USERNAME_CHECKED",
" checked=\"checked\"");
1130 $this->tpl->setVariable(
"FIRSTNAME_CHECKED",
" checked=\"checked\"");
1131 $this->tpl->setVariable(
"LASTNAME_CHECKED",
" checked=\"checked\"");
1132 $this->tpl->setVariable(
"EMAIL_CHECKED",
" checked=\"checked\"");
1133 $this->tpl->setVariable(
"ACTIVE_CHECKED",
" checked=\"checked\"");
1134 $this->tpl->setVariable(
"TXT_SEARCH_USER",$this->lng->txt(
"search_user"));
1135 $this->tpl->setVariable(
"TXT_SEARCH_IN",$this->lng->txt(
"search_in"));
1136 $this->tpl->setVariable(
"TXT_SEARCH_USERNAME",$this->lng->txt(
"username"));
1137 $this->tpl->setVariable(
"TXT_SEARCH_FIRSTNAME",$this->lng->txt(
"firstname"));
1138 $this->tpl->setVariable(
"TXT_SEARCH_LASTNAME",$this->lng->txt(
"lastname"));
1139 $this->tpl->setVariable(
"TXT_SEARCH_EMAIL",$this->lng->txt(
"email"));
1140 $this->tpl->setVariable(
"TXT_SEARCH_ACTIVE",$this->lng->txt(
"search_active"));
1141 $this->tpl->setVariable(
"TXT_SEARCH_INACTIVE",$this->lng->txt(
"search_inactive"));
1142 $this->tpl->setVariable(
"BUTTON_SEARCH",$this->lng->txt(
"search"));
1143 $this->tpl->setVariable(
"BUTTON_CANCEL",$this->lng->txt(
"cancel"));
1144 $this->tpl->setVariable(
"TXT_SEARCH_NOTE",$this->lng->txt(
"search_note"));
1145 $this->tpl->setVariable(
"ACTIVE_CHECKED",
"checked=\"checked\"");
1153 $this->ctrl->redirect($this,
"view");
1163 $obj_str =
"&obj_id=".$this->obj_id;
1165 $_POST[
"search_string"] = trim(
$_POST[
"search_string"]) ? trim(
$_POST[
"search_string"]) : trim(urldecode(
$_GET[
"search_string"]));
1169 $_POST[
"search_fields"] = array (
"username",
"firstname",
"lastname",
"email");
1171 if (empty(
$_POST[
"search_string"]))
1173 $_POST[
"search_string"] =
"%";
1176 if (empty(
$_POST[
"search_fields"]))
1178 $_POST[
"search_fields"] = array();
1182 if (
$_POST[
"search_string"] ==
"%")
1184 $_POST[
"search_string"] =
"";
1186 $msg = $this->lng->txt(
"msg_no_search_result");
1187 if (
$_POST[
"search_string"] !=
"")
1189 $msg .=
" ".$this->lng->txt(
"with").
" '".htmlspecialchars(
$_POST[
"search_string"]).
"'";
1192 $this->ctrl->redirect($this,
"searchUserForm");
1195 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
1198 $this->tpl->setCurrentBlock(
"btn_cell");
1199 $this->tpl->setVariable(
"BTN_LINK",
1200 $this->ctrl->getLinkTarget($this,
"searchUserForm"));
1201 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"search_new"));
1202 $this->tpl->parseCurrentBlock();
1204 $this->data[
"cols"] = array(
"",
"login",
"firstname",
"lastname",
"email",
"active");
1208 $searchActive =
true;
1212 $searchInactive =
true;
1215 foreach ($search_result as $key => $val)
1217 $val[
"active_text"] = $this->lng->txt(
"inactive");
1220 $val[
"active_text"] = $this->lng->txt(
"active");
1224 $searchStringToLower = strtolower(
$_POST[
"search_string"]);
1225 $displaySearchResult =
false;
1226 if (in_array(
"username",
$_POST[
"search_fields"]))
1227 if (strpos(strtolower($val[
"login"]), strtolower(
$_POST[
"search_string"])) !==
false)
1228 $displaySearchResult =
true;
1229 if (in_array(
"firstname",
$_POST[
"search_fields"]))
1230 if (strpos(strtolower($val[
"firstname"]), strtolower(
$_POST[
"search_string"])) !==
false)
1231 $displaySearchResult =
true;
1232 if (in_array(
"lastname",
$_POST[
"search_fields"]))
1233 if (strpos(strtolower($val[
"lastname"]), strtolower(
$_POST[
"search_string"])) !==
false)
1234 $displaySearchResult =
true;
1235 if (in_array(
"email",
$_POST[
"search_fields"]))
1236 if (strpos(strtolower($val[
"email"]), strtolower(
$_POST[
"search_string"])) !==
false)
1237 $displaySearchResult =
true;
1238 if (($val[
"active"] == 1) && ($searchActive ==
true) ||
1239 ($val[
"active"] == 0) && ($searchInactive ==
true))
1241 if ((strcmp(
$_POST[
"search_string"],
"%") == 0) || $displaySearchResult)
1244 $this->data[
"data"][] = array(
1245 "login" => $val[
"login"],
1246 "firstname" => $val[
"firstname"],
1247 "lastname" => $val[
"lastname"],
1248 "email" => $val[
"email"],
1249 "active" => $val[
"active_text"],
1250 "obj_id" => $val[
"usr_id"]
1255 if (count($this->data[
"data"]) == 0)
1257 ilUtil::sendInfo($this->lng->txt(
"msg_no_search_result").
" ".$this->lng->txt(
"with").
" '".htmlspecialchars(
$_POST[
"search_string"]).
"'",
true);
1259 $this->ctrl->redirect($this,
"searchUserForm");
1262 $this->maxcount = count($this->data[
"data"]);
1265 if (
$_GET[
"sort_by"] ==
"name")
1267 $_GET[
"sort_by"] =
"login";
1272 $this->data[
"data"] = array_slice($this->data[
"data"],
$_GET[
"offset"],
$_GET[
"limit"]);
1275 foreach ($this->data[
"data"] as $key => $val)
1277 $this->data[
"ctrl"][$key] = array(
1278 "ref_id" => $this->
id,
1279 "obj_id" => $val[
"obj_id"]
1281 $tmp[] = $val[
"obj_id"];
1282 unset($this->data[
"data"][$key][
"obj_id"]);
1289 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
1291 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.obj_tbl_rows.html");
1295 $this->ctrl->setParameter($this,
"sort_by",
"name");
1296 $this->ctrl->setParameter($this,
"sort_order",
$_GET[
"sort_order"]);
1297 $this->ctrl->setParameter($this,
"offset",
$_GET[
"offset"]);
1298 $this->tpl->setVariable(
"FORMACTION",
1299 $this->ctrl->getFormAction($this));
1302 include_once
"./Services/Table/classes/class.ilTableGUI.php";
1306 $tbl->setTitle($this->lng->txt(
"search_result"),
"icon_".$this->object->getType().
".gif",$this->lng->txt(
"obj_".$this->object->getType()));
1307 $tbl->setHelp(
"tbl_help.php",
"icon_help.gif",$this->lng->txt(
"help"));
1309 foreach ($this->data[
"cols"] as $val)
1311 $header_names[] = $this->lng->txt($val);
1314 $tbl->setHeaderNames($header_names);
1316 $header_params = $this->ctrl->getParameterArray($this,
"searchUser");
1317 $header_params[
"search_string"] = urlencode(
$_POST[
"search_string"]);
1318 $header_params[
"search_fields"] = urlencode(implode(
",",
$_POST[
"search_fields"]));
1320 $tbl->setHeaderVars($this->data[
"cols"],$header_params);
1321 $tbl->setColumnWidth(array(
"",
"25%",
"25$%",
"25%",
"25%"));
1324 $tbl->enable(
"hits");
1325 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
1326 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
1327 $tbl->setLimit(
$_GET[
"limit"]);
1328 $tbl->setOffset(
$_GET[
"offset"]);
1329 $tbl->setMaxCount($this->maxcount);
1331 $this->tpl->setVariable(
"COLUMN_COUNTS",count($this->data[
"cols"]));
1334 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1339 if (is_array($this->data[
"data"][0]))
1342 for ($i=0; $i < count($this->data[
"data"]); $i++)
1344 $data = $this->data[
"data"][$i];
1345 $ctrl = $this->data[
"ctrl"][$i];
1348 $this->ids[] =
$ctrl[
"obj_id"];
1353 $this->tpl->setCurrentBlock(
"checkbox");
1354 $this->tpl->setVariable(
"CHECKBOX_ID",
$ctrl[
"obj_id"]);
1356 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1357 $this->tpl->parseCurrentBlock();
1359 $this->tpl->setCurrentBlock(
"table_cell");
1360 $this->tpl->setVariable(
"CELLSTYLE",
"tblrow1");
1361 $this->tpl->parseCurrentBlock();
1363 foreach (
$data as $key => $val)
1366 $this->ctrl->setParameterByClass(
"ilobjusergui",
"ref_id",
"7");
1367 $this->ctrl->setParameterByClass(
"ilobjusergui",
"obj_id",
$ctrl[
"obj_id"]);
1368 $link = $this->ctrl->getLinkTargetByClass(
"ilobjusergui",
"view");
1370 if ($key ==
"login")
1372 $this->tpl->setCurrentBlock(
"begin_link");
1373 $this->tpl->setVariable(
"LINK_TARGET", $link);
1374 $this->tpl->parseCurrentBlock();
1375 $this->tpl->touchBlock(
"end_link");
1378 $this->tpl->setCurrentBlock(
"text");
1379 $this->tpl->setVariable(
"TEXT_CONTENT", $val);
1380 $this->tpl->parseCurrentBlock();
1381 $this->tpl->setCurrentBlock(
"table_cell");
1382 $this->tpl->parseCurrentBlock();
1385 $this->tpl->setCurrentBlock(
"tbl_content");
1386 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1387 $this->tpl->parseCurrentBlock();
1400 global
$tpl, $rbacsystem;
1403 if($this->ctrl->getTargetScript() ==
'repository.php')
1405 $this->tabs_gui->clearTargets();
1408 if (!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
1410 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1414 $tpl->setContent($this->form->getHTML());
1428 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1432 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
1433 $fi =
new ilFileInputGUI($lng->txt(
"import_file"),
"importFile");
1437 $this->form->addItem($fi);
1439 $this->form->addCommandButton(
"importUserRoleAssignment", $lng->txt(
"import"));
1440 $this->form->addCommandButton(
"importCancelled", $lng->txt(
"cancel"));
1442 $this->form->setTitle($lng->txt(
"import_users"));
1443 $this->form->setFormAction($ilCtrl->getFormAction($this));
1457 if (@is_dir($import_dir))
1462 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
1464 $this->ctrl->redirect($this,
"view");
1469 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1482 $importDir =
ilUtil::getDataDir().
'/user_import/usr_'.$ilUser->getId().
'_'.session_id();
1495 if($this->ctrl->getTargetScript() ==
'repository.php')
1497 $this->tabs_gui->clearTargets();
1501 if ($this->form->checkInput())
1503 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
1504 include_once
'./Services/User/classes/class.ilUserImportParser.php';
1506 global $rbacreview, $rbacsystem,
$tree,
$lng;
1509 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_import_roles.html");
1514 if (@is_dir($import_dir))
1526 if (!is_file($_FILES[
"importFile"][
"tmp_name"]))
1529 $this->ilias->raiseError($this->lng->txt(
"no_import_file_found")
1530 , $this->ilias->error_obj->MESSAGE);
1533 $_FILES[
"importFile"][
"name"], $full_path);
1536 if (strtolower($parts[
"extension"]) ==
"zip")
1543 foreach ($file_list as $a_file)
1545 if (substr($a_file[
'entry'],-4) ==
'.xml')
1547 $xml_file = $import_dir.
"/".$a_file[
'entry'];
1551 if (is_null($xml_file))
1553 $subdir = basename($parts[
"basename"],
".".$parts[
"extension"]);
1554 $xml_file = $import_dir.
"/".$subdir.
"/".$subdir.
".xml";
1560 $xml_file = $full_path;
1564 if (!is_file($xml_file))
1567 $this->ilias->raiseError($this->lng->txt(
"no_xml_file_found_in_zip")
1568 .
" ".$subdir.
"/".$subdir.
".xml", $this->ilias->error_obj->MESSAGE);
1571 require_once(
"./Services/User/classes/class.ilUserImportParser.php");
1576 $importParser->startParsing();
1577 switch ($importParser->getErrorLevel())
1582 $this->tpl->setVariable(
"IMPORT_LOG", $importParser->getProtocolAsHTML($lng->txt(
"verification_warning_log")));
1586 $this->ilias->raiseError(
1587 $lng->txt(
"verification_failed").$importParser->getProtocolAsHTML($lng->txt(
"verification_failure_log")),
1588 $this->ilias->error_obj->MESSAGE
1595 $this->tpl->setCurrentBlock(
"role_selection_form");
1596 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1597 $this->tpl->setVariable(
"TXT_IMPORT_USERS", $this->lng->txt(
"import_users"));
1598 $this->tpl->setVariable(
"TXT_IMPORT_FILE", $this->lng->txt(
"import_file"));
1599 $this->tpl->setVariable(
"IMPORT_FILE",
$file_name);
1600 $this->tpl->setVariable(
"TXT_USER_ELEMENT_COUNT", $this->lng->txt(
"num_users"));
1601 $this->tpl->setVariable(
"USER_ELEMENT_COUNT", $importParser->getUserCount());
1602 $this->tpl->setVariable(
"TXT_ROLE_ASSIGNMENT", $this->lng->txt(
"role_assignment"));
1603 $this->tpl->setVariable(
"BTN_IMPORT", $this->lng->txt(
"import"));
1604 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1605 $this->tpl->setVariable(
"XML_FILE_NAME", $xml_file);
1609 $importParser->startParsing();
1610 $roles = $importParser->getCollectedRoles();
1613 $all_gl_roles = $rbacreview->getRoleListByObject(ROLE_FOLDER_ID);
1614 $gl_roles = array();
1615 $roles_of_user = $rbacreview->assignedRoles($ilUser->getId());
1616 foreach ($all_gl_roles as $obj_data)
1627 if ($obj_data[
"obj_id"] != ANONYMOUS_ROLE_ID)
1630 if ($obj_data[
"obj_id"] != SYSTEM_ROLE_ID or in_array(SYSTEM_ROLE_ID,$roles_of_user))
1632 $gl_roles[$obj_data[
"obj_id"]] = $obj_data[
"title"];
1638 $got_globals =
false;
1639 foreach($roles as $role_id => $role)
1641 if ($role[
"type"] ==
"Global")
1645 $got_globals =
true;
1647 $this->tpl->setCurrentBlock(
"global_role_section");
1648 $this->tpl->setVariable(
"TXT_GLOBAL_ROLES_IMPORT", $this->lng->txt(
"roles_of_import_global"));
1649 $this->tpl->setVariable(
"TXT_GLOBAL_ROLES", $this->lng->txt(
"assign_global_role"));
1653 $pre_select = array_search($role[name], $gl_roles);
1656 switch($role[
"name"])
1658 case "Administrator":
1659 $pre_select = array_search(
"Administrator", $gl_roles);
1663 $pre_select = array_search(
"User", $gl_roles);
1667 $pre_select = array_search(
"User", $gl_roles);
1671 $pre_select = array_search(
"Guest", $gl_roles);
1675 $pre_select = array_search(
"User", $gl_roles);
1679 $this->tpl->setCurrentBlock(
"global_role");
1680 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $gl_roles,
false,
true);
1681 $this->tpl->setVariable(
"TXT_IMPORT_GLOBAL_ROLE", $role[
"name"].
" [".$role_id.
"]");
1682 $this->tpl->setVariable(
"SELECT_GLOBAL_ROLE", $role_select);
1683 $this->tpl->parseCurrentBlock();
1688 $got_locals =
false;
1689 foreach($roles as $role_id => $role)
1691 if ($role[
"type"] ==
"Local")
1700 $this->tpl->setCurrentBlock(
"local_role_section");
1701 $this->tpl->setVariable(
"TXT_LOCAL_ROLES_IMPORT", $this->lng->txt(
"roles_of_import_local"));
1702 $this->tpl->setVariable(
"TXT_LOCAL_ROLES", $this->lng->txt(
"assign_local_role"));
1713 $loc_roles = array();
1714 foreach($roles as $role_id => $role)
1716 if ($role[
"type"] ==
"Local")
1718 $searchName = (substr($role[
'name'],0,1) ==
'#') ? $role[
'name'] :
'#'.$role[
'name'];
1719 $matching_role_ids = $rbacreview->searchRolesByMailboxAddressList($searchName);
1720 foreach ($matching_role_ids as $mid) {
1721 if (! in_array($mid, $loc_roles)) {
1722 $loc_roles[] = array(
'obj_id'=>$mid);
1731 $loc_roles = $rbacreview->getAssignableRolesInSubtree($this->object->getRefId());
1736 $l_roles_mailbox_searcharray = array();
1737 foreach ($loc_roles as $key => $loc_role)
1740 $rolf = $rbacreview->getFoldersAssignedToRole($loc_role[
"obj_id"],
true);
1746 if (!$rbacreview->isDeleted($rolf[0])
1747 && $rbacsystem->checkAccess(
'write',$tree->getParentId($rolf[0]))
1748 && $rolf[0] != ROLE_FOLDER_ID
1762 if ($this->tree->isInTree($rolf[0]))
1766 $tmpPath = $this->tree->getPathFull($rolf[0]);
1767 for ($i = 1, $n = count($tmpPath) - 1; $i < $n; $i++)
1773 if ($i < 3 || $i > $n - 3)
1777 else if ($i == 3 || $i == $n - 3)
1782 $isInSubtree |= $tmpPath[$i][
'obj_id'] == $this->
object->getId();
1787 $path =
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$loc_role[
"obj_id"].
")</b>";
1789 $roleMailboxAddress = $rbacreview->getRoleMailboxAddress($loc_role[
'obj_id']);
1790 $l_roles[$loc_role[
'obj_id']] = $roleMailboxAddress.
', '.
$path;
1795 natcasesort($l_roles);
1796 $l_roles[
""] = $this->lng->txt(
"usrimport_ignore_role");
1797 foreach($roles as $role_id => $role)
1799 if ($role[
"type"] ==
"Local")
1801 $this->tpl->setCurrentBlock(
"local_role");
1802 $this->tpl->setVariable(
"TXT_IMPORT_LOCAL_ROLE", $role[
"name"]);
1803 $searchName = (substr($role[
'name'],0,1) ==
'#') ? $role[
'name'] :
'#'.$role[
'name'];
1804 $matching_role_ids = $rbacreview->searchRolesByMailboxAddressList($searchName);
1805 $pre_select = count($matching_role_ids) == 1 ? $matching_role_ids[0] :
"";
1810 $selectable_roles = array();
1811 $selectable_roles[
""] = $this->lng->txt(
"usrimport_ignore_role");
1812 foreach ($matching_role_ids as $id)
1814 $selectable_roles[$id] = $l_roles[$id];
1816 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $selectable_roles,
false,
true);
1818 $role_select =
ilUtil::formSelect($pre_select,
"role_assign[".$role_id.
"]", $l_roles,
false,
true);
1820 $this->tpl->setVariable(
"SELECT_LOCAL_ROLE", $role_select);
1821 $this->tpl->parseCurrentBlock();
1827 $this->tpl->setVariable(
"TXT_CONFLICT_HANDLING", $lng->txt(
"conflict_handling"));
1832 $this->tpl->setVariable(
"TXT_CONFLICT_HANDLING_INFO", str_replace(
'\n',
'<br>',$this->lng->txt(
"usrimport_conflict_handling_info")));
1833 $this->tpl->setVariable(
"TXT_CONFLICT_CHOICE", $lng->txt(
"conflict_handling"));
1837 $this->lng->loadLanguageModule(
"mail");
1838 include_once
'./Services/User/classes/class.ilObjUserFolder.php';
1840 if (trim($amail[
"body"]) !=
"" && trim($amail[
"subject"]) !=
"")
1842 $this->tpl->setCurrentBlock(
"inform_user");
1843 $this->tpl->setVariable(
"TXT_ACCOUNT_MAIL", $lng->txt(
"mail_account_mail"));
1846 $this->tpl->setVariable(
"SEND_MAIL",
" checked=\"checked\"");
1848 $this->tpl->setVariable(
"TXT_INFORM_USER_MAIL",
1849 $this->lng->txt(
"user_send_new_account_mail"));
1850 $this->tpl->parseCurrentBlock();
1855 $this->form->setValuesByPost();
1856 $tpl->setContent($this->form->getHtml());
1865 global $rbacreview,$ilUser;
1868 if($this->ctrl->getTargetScript() ==
'repository.php')
1870 $this->tabs_gui->clearTargets();
1873 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
1874 include_once
'./Services/User/classes/class.ilUserImportParser.php';
1876 global $rbacreview, $rbacsystem,
$tree,
$lng;
1878 switch (
$_POST[
"conflict_handling_choice"])
1880 case "update_on_conflict" :
1883 case "ignore_on_conflict" :
1895 if (
$_POST[
"role_assign"])
1897 $global_roles = $rbacreview->getGlobalRoles();
1898 $roles_of_user = $rbacreview->assignedRoles($ilUser->getId());
1899 foreach (
$_POST[
"role_assign"] as $role_id)
1903 if (in_array($role_id, $global_roles))
1905 if(!in_array(SYSTEM_ROLE_ID,$roles_of_user))
1907 if ($role_id == SYSTEM_ROLE_ID && ! in_array(SYSTEM_ROLE_ID,$roles_of_user)
1913 $this->ilias->raiseError($this->lng->txt(
"usrimport_with_specified_role_not_permitted"),
1914 $this->ilias->error_obj->MESSAGE);
1920 $rolf = $rbacreview->getFoldersAssignedToRole($role_id,
true);
1921 if ($rbacreview->isDeleted($rolf[0])
1922 || ! $rbacsystem->checkAccess(
'write',$tree->getParentId($rolf[0])))
1925 $this->ilias->raiseError($this->lng->txt(
"usrimport_with_specified_role_not_permitted"),
1926 $this->ilias->error_obj->MESSAGE);
1934 $importParser->setRoleAssignment(
$_POST[
"role_assign"]);
1935 $importParser->startParsing();
1940 switch ($importParser->getErrorLevel())
1946 ilUtil::sendInfo($this->lng->txt(
"user_imported_with_warnings").$importParser->getProtocolAsHTML($lng->txt(
"import_warning_log")),
true);
1949 $this->ilias->raiseError(
1950 $this->lng->txt(
"user_import_failed")
1951 .$importParser->getProtocolAsHTML($lng->txt(
"import_failure_log")),
1952 $this->ilias->error_obj->MESSAGE
1957 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
1959 $this->ctrl->redirect($this,
"view");
1964 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1971 global $rbacsystem,
$ilias;
1975 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
1977 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1980 if(!count($app_users =& $ilias->account->getAppliedUsers()))
1987 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_applied_users.html");
1988 $this->lng->loadLanguageModule(
'crs');
1991 foreach($app_users as
$usr_id)
1996 $f_result[$counter][] = $tmp_user->getLogin();
1997 $f_result[$counter][] = $tmp_user->getFirstname();
1998 $f_result[$counter][] = $tmp_user->getLastname();
2000 if($tmp_user->getTimeLimitUnlimited())
2002 $f_result[$counter][] =
"<b>".$this->lng->txt(
'crs_unlimited').
"</b>";
2006 $limit =
"<b>".$this->lng->txt(
'crs_from').
'</b> '.strftime(
"%Y-%m-%d %R",$tmp_user->getTimeLimitFrom()).
'<br />';
2007 $limit .=
"<b>".$this->lng->txt(
'crs_to').
'</b> '.strftime(
"%Y-%m-%d %R",$tmp_user->getTimeLimitUntil());
2009 $f_result[$counter][] = $limit;
2023 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
2025 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2028 $this->lng->loadLanguageModule(
'crs');
2032 if(!isset(
$_SESSION[
'error_post_vars']))
2034 ilUtil::sendInfo($this->lng->txt(
'time_limit_add_time_limit_for_selected'));
2037 if(!count(
$_POST[
"users"]))
2053 $title .= $tmp_user->getLogin();
2063 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_edit_applied_users.html");
2064 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2067 $time_limit_unlimited =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_unlimited"] ?
2070 $time_limit_start =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_start"] ?
2073 $time_limit_end =
$_SESSION[
"error_post_vars"][
"au"][
"time_limit_end"] ?
2079 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
"obj_usr"));
2081 $this->tpl->setVariable(
"TITLE",
$title);
2082 $this->tpl->setVariable(
"TXT_TIME_LIMIT",$this->lng->txt(
"time_limit"));
2083 $this->tpl->setVariable(
"TXT_TIME_LIMIT_START",$this->lng->txt(
"crs_start"));
2084 $this->tpl->setVariable(
"TXT_TIME_LIMIT_END",$this->lng->txt(
"crs_end"));
2085 $this->tpl->setVariable(
"CMD_SUBMIT",
"updateAppliedUsers");
2086 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
"cancel"));
2087 $this->tpl->setVariable(
"TXT_SUBMIT",$this->lng->txt(
"submit"));
2091 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_DAY",$this->
__getDateSelect(
"day",
"au[time_limit_start][day]",
2092 date(
"d",$time_limit_start)));
2093 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_MONTH",$this->
__getDateSelect(
"month",
"au[time_limit_start][month]",
2094 date(
"m",$time_limit_start)));
2095 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_YEAR",$this->
__getDateSelect(
"year",
"au[time_limit_start][year]",
2096 date(
"Y",$time_limit_start)));
2097 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_HOUR",$this->
__getDateSelect(
"hour",
"au[time_limit_start][hour]",
2098 date(
"G",$time_limit_start)));
2099 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_START_MINUTE",$this->
__getDateSelect(
"minute",
"au[time_limit_start][minute]",
2100 date(
"i",$time_limit_start)));
2101 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_DAY",$this->
__getDateSelect(
"day",
"au[time_limit_end][day]",
2102 date(
"d",$time_limit_end)));
2103 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_MONTH",$this->
__getDateSelect(
"month",
"au[time_limit_end][month]",
2104 date(
"m",$time_limit_end)));
2105 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_YEAR",$this->
__getDateSelect(
"year",
"au[time_limit_end][year]",
2106 date(
"Y",$time_limit_end)));
2107 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_HOUR",$this->
__getDateSelect(
"hour",
"au[time_limit_end][hour]",
2108 date(
"G",$time_limit_end)));
2109 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_END_MINUTE",$this->
__getDateSelect(
"minute",
"au[time_limit_end][minute]",
2110 date(
"i",$time_limit_end)));
2111 if($this->ilias->account->getTimeLimitUnlimited())
2113 $this->tpl->setVariable(
"ROWSPAN",3);
2114 $this->tpl->setCurrentBlock(
"unlimited");
2115 $this->tpl->setVariable(
"TXT_TIME_LIMIT_UNLIMITED",$this->lng->txt(
"crs_unlimited"));
2116 $this->tpl->setVariable(
"TIME_LIMIT_UNLIMITED",
ilUtil::formCheckbox($time_limit_unlimited,
"au[time_limit_unlimited]",1));
2117 $this->tpl->parseCurrentBlock();
2121 $this->tpl->setVariable(
"ROWSPAN",2);
2129 if(!$rbacsystem->checkAccess(
"write", $this->ref_id))
2131 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2137 if(!
$_POST[
'au'][
'time_limit_unlimited'])
2148 #if(!$this->ilias->account->getTimeLimitUnlimited())
2150 # if($start < $this->ilias->account->getTimeLimitFrom() or
2151 # $end > $this->ilias->account->getTimeLimitUntil())
2153 # $_SESSION['error_post_vars'] = $_POST;
2154 # ilUtil::sendInfo($this->lng->txt('time_limit_not_within_owners'));
2155 # $this->editAppliedUsersObject();
2165 $tmp_user->setTimeLimitUnlimited((
int)
$_POST[
'au'][
'time_limit_unlimited']);
2166 $tmp_user->setTimeLimitFrom($start);
2167 $tmp_user->setTimeLimitUntil($end);
2168 $tmp_user->setTimeLimitMessage(0);
2169 $tmp_user->update();
2184 $tpl =& $tbl->getTemplateObject();
2187 $tpl->setCurrentBlock(
"tbl_form_header");
2189 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2190 $tpl->parseCurrentBlock();
2192 $tpl->setCurrentBlock(
"tbl_action_btn");
2193 $tpl->setVariable(
"BTN_NAME",
'editAppliedUsers');
2194 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
'edit'));
2195 $tpl->parseCurrentBlock();
2197 $tpl->setCurrentBlock(
"tbl_action_row");
2198 $tpl->setVariable(
"COLUMN_COUNTS",5);
2200 $tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
2201 $tpl->parseCurrentBlock();
2205 $tbl->setTitle($this->lng->txt(
"time_limit_applied_users"),
"icon_usr_b.gif",$this->lng->txt(
"users"));
2206 $tbl->setHeaderNames(array(
'',
2207 $this->lng->txt(
"login"),
2208 $this->lng->txt(
"firstname"),
2209 $this->lng->txt(
"lastname"),
2210 $this->lng->txt(
"time_limits")));
2211 $header_params = $this->ctrl->getParameterArray($this,
"appliedUsers");
2212 $tbl->setHeaderVars(array(
"",
2217 array($header_params));
2218 $tbl->setColumnWidth(array(
"3%",
"19%",
"19%",
"19%",
"40%"));
2224 $this->tpl->setVariable(
"APPLIED_USERS",$tbl->tpl->get());
2231 include_once
"./Services/Table/classes/class.ilTableGUI.php";
2238 $offset =
$_GET[
"offset"];
2239 $order =
$_GET[
"sort_by"];
2240 $direction =
$_GET[
"sort_order"];
2243 $tbl->setOrderColumn($order);
2244 $tbl->setOrderDirection($direction);
2245 $tbl->setOffset($offset);
2246 $tbl->setLimit(
$_GET[
"limit"]);
2247 $tbl->setMaxCount(count($result_set));
2248 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
2249 $tbl->setData($result_set);
2257 for($i=0;$i<=60;$i++)
2259 $days[$i] = $i < 10 ?
"0".$i : $i;
2264 for($i=0;$i<24;$i++)
2266 $days[$i] = $i < 10 ?
"0".$i : $i;
2271 for($i=1;$i<32;$i++)
2273 $days[$i] = $i < 10 ?
"0".$i : $i;
2278 for($i=1;$i<13;$i++)
2280 $month[$i] = $i < 10 ?
"0".$i : $i;
2285 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
2294 return mktime($a_time_arr[
"hour"],
2295 $a_time_arr[
"minute"],
2296 $a_time_arr[
"second"],
2297 $a_time_arr[
"month"],
2299 $a_time_arr[
"year"]);
2316 $lng->loadLanguageModule(
"administration");
2321 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2324 $this->tabs_gui->setTabActive(
'settings');
2325 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2329 include_once(
"./Services/User/classes/class.ilCustomUserFieldSettingsTableGUI.php");
2331 if($this->confirm_change)
$tab->setConfirmChange();
2332 $tpl->setContent(
$tab->getHTML());
2337 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_list_user_defined.html');
2338 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2340 if ($this->confirm_change == 1)
2342 $this->tpl->setVariable(
"CONFIRM_MESSAGE", $this->lng->txt(
"confirm_message_course_export"));
2343 $this->tpl->setVariable(
"BUTTON_CONFIRM", $this->lng->txt(
"confirm"));
2344 $this->tpl->setVariable(
"BUTTON_CANCEL", $this->lng->txt(
"cancel"));
2347 $this->tpl->setVariable(
"TXT_OVERVIEW",$this->lng->txt(
'user_defined_list'));
2349 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'add_user_defined_field'));
2353 if(!count($definitions = $user_field_definitions->getDefinitions()))
2355 $this->tpl->setCurrentBlock(
"no_content");
2356 $this->tpl->setVariable(
"NO_FIELDS",$this->lng->txt(
'no_user_defined_fields_defined'));
2357 $this->tpl->parseCurrentBlock();
2361 $this->tpl->setVariable(
"BTN_SAVE",$this->lng->txt(
'save'));
2364 foreach($definitions as $field_id => $definition)
2366 $this->tpl->setCurrentBlock(
"user_defined");
2367 $this->tpl->setVariable(
"TXT_VISIBLE", $this->lng->txt(
"visible"));
2368 $this->tpl->setVariable(
"TXT_CHANGE", $this->lng->txt(
"changeable"));
2369 $this->tpl->setVariable(
"TXT_REQUIRED", $this->lng->txt(
"required_field"));
2372 $this->tpl->setVariable(
"TXT_SEARCHABLE", $this->lng->txt(
"header_searchable"));
2374 $this->tpl->setVariable(
"TXT_EXPORT", $this->lng->txt(
"export"));
2375 $this->tpl->setVariable(
"TXT_COURSE_EXPORT", $lng->txt(
"course_export"));
2377 $this->tpl->setVariable(
'TXT_VISIB_REG', $this->lng->txt(
'visible_registration'));
2379 $this->tpl->setVariable(
"NAME",$definition[
'field_name']);
2381 if (
$_POST[
"cmd"][
"updateFields"] !=
"")
2383 $definition[
'visible'] = isset(
$_POST[
'def'][$field_id][
'visible']) ? 1 : 0;
2384 $definition[
'changeable'] = isset(
$_POST[
'def'][$field_id][
'changeable']) ? 1 : 0;
2385 $definition[
'required'] = isset(
$_POST[
'def'][$field_id][
'required']) ? 1 : 0;
2386 $definition[
'searchable'] = isset(
$_POST[
'def'][$field_id][
'searchable']) ? 1 : 0;
2387 $definition[
'export'] = isset(
$_POST[
'def'][$field_id][
'export']) ? 1 : 0;
2388 $definition[
'course_export'] = isset(
$_POST[
'def'][$field_id][
'course_export']) ? 1 : 0;
2391 $this->tpl->setVariable(
"VISIBLE",
ilUtil::formCheckbox($definition[
'visible'],
"def[$field_id][visible]",1));
2392 $this->tpl->setVariable(
"CHANGE",
ilUtil::formCheckbox($definition[
'changeable'],
"def[$field_id][changeable]",1));
2393 $this->tpl->setVariable(
"REQUIRED",
ilUtil::formCheckbox($definition[
'required'],
"def[$field_id][required]",1));
2396 $this->tpl->setVariable(
"SEARCHABLE",
ilUtil::formCheckbox($definition[
'searchable'],
"def[$field_id][searchable]",1));
2398 $this->tpl->setVariable(
"EXPORT",
ilUtil::formCheckbox($definition[
'export'],
"def[$field_id][export]",1));
2399 $this->tpl->setVariable(
"COURSE_EXPORT",
ilUtil::formCheckbox($definition[
'course_export'],
"def[$field_id][course_export]",1));
2401 $this->tpl->setVariable(
'VISIB_REG',
2404 $this->ctrl->setParameter($this,
'field_id',$field_id);
2407 switch($definition[
'field_type'])
2410 $this->tpl->setVariable(
"EDIT_LINK",$this->ctrl->getLinkTarget($this,
'editTextField'));
2414 $this->tpl->setVariable(
"EDIT_LINK",$this->ctrl->getLinkTarget($this,
'editWysiwygField'));
2418 $this->tpl->setVariable(
"EDIT_LINK",$this->ctrl->getLinkTarget($this,
'editSelectField'));
2421 $this->tpl->setVariable(
"EDIT",$this->lng->txt(
'edit'));
2423 $this->tpl->setVariable(
"DELETE_LINK",$this->ctrl->getLinkTarget($this,
'askDeleteField'));
2424 $this->tpl->setVariable(
"DELETE",$this->lng->txt(
'delete'));
2425 $this->tpl->parseCurrentBlock();
2432 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2434 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2437 $this->ctrl->setParameter($this,
'field_id',(
int) $_GET[
'field_id']);
2440 $this->tabs_gui->setTabActive(
'settings');
2441 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2443 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_update_text_field.html');
2445 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2446 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'udf_update_text_field'));
2447 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
2449 $this->tpl->setVariable(
"FIELD_NAME",$definition[
'field_name']);
2451 $this->tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'cancel'));
2452 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'update'));
2459 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2462 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2464 $udf->setFieldName(ilUtil::stripslashes(
$_POST[
'field_name']));
2465 $udf->setFieldType($definition[
'field_type']);
2466 $udf->setFieldValues($definition[
'field_values']);
2467 $udf->enableVisible($definition[
'visible']);
2468 $udf->enableChangeable($definition[
'changeable']);
2469 $udf->enableRequired($definition[
'required']);
2470 $udf->enableSearchable($definition[
'searchable']);
2471 $udf->enableExport($definition[
'export']);
2472 $udf->enableCourseExport($definition[
'course_export']);
2474 $udf->enableVisibleRegistration($definition[
'visib_reg']);
2476 $udf->update($definition[
'field_id']);
2485 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2487 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2490 $this->ctrl->setParameter($this,
'field_id',(
int) $_GET[
'field_id']);
2493 $this->tabs_gui->setTabActive(
'settings');
2494 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2496 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_update_text_field.html');
2498 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2499 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'udf_update_wysiwyg_field'));
2500 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
2502 $this->tpl->setVariable(
"FIELD_NAME",$definition[
'field_name']);
2504 $this->tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'cancel'));
2505 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'update'));
2512 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2515 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2517 $udf->setFieldName(ilUtil::stripslashes(
$_POST[
'field_name']));
2518 $udf->setFieldType($definition[
'field_type']);
2519 $udf->setFieldValues($definition[
'field_values']);
2520 $udf->enableVisible($definition[
'visible']);
2521 $udf->enableChangeable($definition[
'changeable']);
2522 $udf->enableRequired($definition[
'required']);
2523 $udf->enableSearchable($definition[
'searchable']);
2524 $udf->enableExport($definition[
'export']);
2525 $udf->enableCourseExport($definition[
'course_export']);
2527 $udf->enableVisibleRegistration($definition[
'visib_reg']);
2529 $udf->update($definition[
'field_id']);
2538 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2543 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2546 $this->ctrl->setParameter($this,
'field_id',(
int) $_GET[
'field_id']);
2549 $this->tabs_gui->setTabActive(
'settings');
2550 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2552 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_update_select_field.html');
2555 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2556 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'udf_update_select_field'));
2557 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
2559 $this->tpl->setVariable(
"FIELD_NAME_VALUE",$definition[
'field_name']);
2563 foreach($definition[
'field_values'] as $value)
2565 $this->tpl->setCurrentBlock(
"values");
2566 $this->tpl->setVariable(
"COUNTER",$counter++);
2567 $this->tpl->setVariable(
"TXT_VALUES",$this->lng->txt(
'udf_value').
' '.($counter));
2568 $this->tpl->setVariable(
"FIELD_NAME",$value);
2570 $this->ctrl->setParameter($this,
'value_id',$counter-1);
2571 $this->tpl->setVariable(
"DELETE_LINK",$this->ctrl->getLinkTarget($this,
'deleteValue'));
2572 $this->tpl->setVariable(
"DELETE",$this->lng->txt(
'delete'));
2573 $this->tpl->parseCurrentBlock();
2577 for($i = 0; $i <
$_SESSION[
'select_num_values'];$i++)
2579 $this->tpl->setCurrentBlock(
"new_values");
2580 $this->tpl->setVariable(
"NEW_COUNTER",$counter++);
2581 $this->tpl->setVariable(
"TXT_NEW_VALUES",$this->lng->txt(
'udf_value').
' '.($counter));
2582 $this->tpl->setVariable(
"NEW_FIELD_NAME",
$_POST[
'field_values'][$counter-1]);
2583 $this->tpl->parseCurrentBlock();
2585 $this->tpl->setVariable(
"BTN_NEW_VALUE",$this->lng->txt(
'btn_new_value'));
2586 $this->tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'cancel'));
2587 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'save'));
2594 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2597 $_POST[
'field_values'] = is_array(
$_POST[
'field_values']) ?
$_POST[
'field_values'] : array();
2600 $definition = $udf->getDefinition((
int)
$_GET[
'field_id']);
2603 $udf->setFieldName(ilUtil::stripslashes(
$_POST[
'field_name']));
2604 $udf->setFieldValues(array_merge($definition[
'field_values'],
$_POST[
'field_values']));
2605 $udf->setFieldType($definition[
'field_type']);
2606 $udf->enableVisible($definition[
'visible']);
2607 $udf->enableChangeable($definition[
'changeable']);
2608 $udf->enableRequired($definition[
'required']);
2609 $udf->enableSearchable($definition[
'searchable']);
2610 $udf->enableExport($definition[
'export']);
2611 $udf->enableCourseExport($definition[
'course_export']);
2613 $udf->enableVisibleRegistration($definition[
'visib_reg']);
2615 if(
$error = $udf->validateValues())
2631 $udf->update($definition[
'field_id']);
2641 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2644 $udf->deleteValue((
int)
$_GET[
'field_id'],(
int) $_GET[
'value_id']);
2661 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2666 $this->tabs_gui->setTabActive(
'settings');
2667 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2669 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_ask_delete.html');
2671 $this->ctrl->setParameter($this,
'field_id',(
int)
$_GET[
'field_id']);
2672 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2673 $this->tpl->setVariable(
"TXT_DELETE_FIELD",$this->lng->txt(
'udf_delete_header'));
2674 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
2677 $definition = $user_field_definitions->getDefinition((
int) $_GET[
'field_id']);
2679 $this->tpl->setVariable(
"FIELD_NAME",$definition[
'field_name']);
2680 $this->tpl->setVariable(
"BTN_DELETE",$this->lng->txt(
'delete'));
2681 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
'cancel'));
2688 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2691 $user_field_definitions->delete((
int)
$_GET[
'field_id']);
2709 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2712 $a_fields = $user_field_definitions->getDefinitions();
2714 foreach($a_fields as $field_id => $definition)
2716 if( isset(
$_POST[
'chb'][
'required_'.$field_id]) && (
int)
$_POST[
'chb'][
'required_'.$field_id] &&
2717 (!isset(
$_POST[
'chb'][
'visib_reg_'.$field_id]) || !(
int)
$_POST[
'chb'][
'visib_reg_'.$field_id]))
2719 $this->confirm_change = 1;
2754 foreach($a_fields as $field_id => $definition)
2756 $user_field_definitions->setFieldName($definition[
'field_name']);
2757 $user_field_definitions->setFieldType($definition[
'field_type']);
2758 $user_field_definitions->setFieldValues($definition[
'field_values']);
2759 $user_field_definitions->enableVisible((
int)
$_POST[
'chb'][
'visible_'.$field_id]);
2760 $user_field_definitions->enableChangeable((
int)
$_POST[
'chb'][
'changeable_'.$field_id]);
2761 $user_field_definitions->enableRequired((
int)
$_POST[
'chb'][
'required_'.$field_id]);
2762 $user_field_definitions->enableSearchable((
int)
$_POST[
'chb'][
'searchable_'.$field_id]);
2763 $user_field_definitions->enableExport((
int)
$_POST[
'chb'][
'export_'.$field_id]);
2764 $user_field_definitions->enableCourseExport((
int)
$_POST[
'chb'][
'course_export_'.$field_id]);
2765 $user_field_definitions->enableVisibleLocalUserAdministration((
int)
$_POST[
'chb'][
'visib_lua_'.$field_id]);
2766 $user_field_definitions->enableChangeableLocalUserAdministration((
int)
$_POST[
'chb'][
'changeable_lua_'.$field_id]);
2767 $user_field_definitions->enableGroupExport((
int)
$_POST[
'chb'][
'group_export_'.$field_id]);
2768 $user_field_definitions->enableVisibleRegistration((
int)
$_POST[
'chb'][
'visib_reg_'.$field_id]);
2770 $user_field_definitions->update($field_id);
2783 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2789 $this->tabs_gui->setTabActive(
'settings');
2790 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2792 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
2794 $this->form->setFormAction($this->ctrl->getFormAction($this,
'chooseDefinitions'));
2795 $this->form->setTitle($this->lng->txt(
'add_new_user_defined_field'));
2800 $radg->addOption($op1);
2802 $radg->addOption($op2);
2804 $radg->addOption($op3);
2805 $this->form->addItem($radg);
2806 $this->form->addCommandButton(
"chooseDefinitions", $lng->txt(
"btn_next"));
2807 $this->form->addCommandButton(
"listUserDefinedFields", $lng->txt(
"cancel"));
2808 $this->tpl->setContent($this->form->getHTML());
2817 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
2820 $this->tabs_gui->setTabActive(
'settings');
2821 $this->tabs_gui->setSubTabActive(
'user_defined_fields');
2823 switch($field_type = (
int)
$_REQUEST[
'field_type'])
2847 $lng->loadLanguageModule(
"administration");
2848 $lng->loadLanguageModule(
"ps");
2850 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_edit_text_field.html');
2852 include_once(
"Services/Membership/classes/class.ilMemberAgreement.php");
2855 $this->tpl->setCurrentBlock(
'warning_modify');
2856 $this->tpl->setVariable(
'TXT_WARNING', $lng->txt(
'ps_warning_modify'));
2857 $this->tpl->parseCurrentBlock();
2861 $this->ctrl->setParameter($this,
'field_type',(
int)
$_REQUEST[
'field_type']);
2862 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2864 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'udf_add_field'));
2865 $this->tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'btn_previous'));
2866 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'add_new_user_defined_text_field'));
2867 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
2868 $this->tpl->setVariable(
"FIELD_NAME",
$_POST[
'field_name']);
2870 $this->tpl->setVariable(
"TXT_VISIBLE", $this->lng->txt(
"visible"));
2871 $this->tpl->setVariable(
"TXT_CHANGE", $this->lng->txt(
"changeable"));
2872 $this->tpl->setVariable(
"TXT_REQUIRED", $this->lng->txt(
"required_field"));
2873 $this->tpl->setVariable(
"TXT_SEARCHABLE", $this->lng->txt(
"header_searchable"));
2874 $this->tpl->setVariable(
"TXT_EXPORT", $this->lng->txt(
"export"));
2875 $this->tpl->setVariable(
"TXT_COURSE_EXPORT", $lng->txt(
"course_export"));
2876 $this->tpl->setVariable(
'TXT_VISIB_LUA',$lng->txt(
'usr_settings_visib_lua'));
2877 $this->tpl->setVariable(
'TXT_CHANGE_LUA',$lng->txt(
'usr_settings_changeable_lua'));
2878 $this->tpl->setVariable(
'TXT_VISIB_REG', $lng->txt(
'visible_registration'));
2889 $this->tpl->setVariable(
'VISIB_REG',
2899 $lng->loadLanguageModule(
"administration");
2900 $lng->loadLanguageModule(
"ps");
2902 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_edit_select_field.html');
2904 include_once(
"Services/Membership/classes/class.ilMemberAgreement.php");
2907 $this->tpl->setCurrentBlock(
'warning_modify');
2908 $this->tpl->setVariable(
'TXT_WARNING', $lng->txt(
'ps_warning_modify'));
2909 $this->tpl->parseCurrentBlock();
2913 $this->ctrl->setParameter($this,
'field_type',(
int)
$_REQUEST[
'field_type']);
2914 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2915 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'udf_add_field'));
2916 $this->tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'btn_previous'));
2917 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'add_new_user_defined_select_field'));
2918 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
2919 $this->tpl->setVariable(
"FIELD_NAME_VALUE",
$_POST[
'field_name']);
2920 $this->tpl->setVariable(
"TXT_EXPORT", $this->lng->txt(
"export"));
2921 $this->tpl->setVariable(
"TXT_COURSE_EXPORT", $lng->txt(
"course_export"));
2923 $this->tpl->setVariable(
"TXT_VISIBLE", $this->lng->txt(
"visible"));
2924 $this->tpl->setVariable(
"TXT_CHANGE", $this->lng->txt(
"changeable"));
2925 $this->tpl->setVariable(
"TXT_REQUIRED", $this->lng->txt(
"required_field"));
2926 $this->tpl->setVariable(
"TXT_SEARCHABLE", $this->lng->txt(
"header_searchable"));
2927 $this->tpl->setVariable(
'TXT_CHANGE_LUA',$lng->txt(
'usr_settings_changeable_lua'));
2928 $this->tpl->setVariable(
'TXT_VISIB_LUA', $this->lng->txt(
'usr_settings_visib_lua'));
2931 $this->tpl->setVariable(
'TXT_VISIB_REG', $this->lng->txt(
'visible_registration'));
2943 $this->tpl->setVariable(
'VISIB_REG',
2946 $this->tpl->setVariable(
"BTN_NEW_VALUE",$this->lng->txt(
'btn_new_value'));
2948 for($i = 0; $i <
$_SESSION[
'num_values']; $i++)
2950 $this->tpl->setCurrentBlock(
"values");
2951 $this->tpl->setVariable(
"TXT_VALUES",$this->lng->txt(
'udf_value').
' '.($i+1));
2952 $this->tpl->setVariable(
"COUNTER",$i);
2953 $this->tpl->setVariable(
"FIELD_NAME",
$_POST[
'field_values'][$i]);
2954 $this->tpl->parseCurrentBlock();
2966 $lng->loadLanguageModule(
"administration");
2967 $lng->loadLanguageModule(
"ps");
2969 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_edit_wysiwyg_field.html');
2971 include_once(
"Services/Membership/classes/class.ilMemberAgreement.php");
2974 $this->tpl->setCurrentBlock(
'warning_modify');
2975 $this->tpl->setVariable(
'TXT_WARNING', $lng->txt(
'ps_warning_modify'));
2976 $this->tpl->parseCurrentBlock();
2980 $this->ctrl->setParameter($this,
'field_type',(
int)
$_REQUEST[
'field_type']);
2981 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2983 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'udf_add_field'));
2984 $this->tpl->setVariable(
"BTN_PREVIOUS",$this->lng->txt(
'btn_previous'));
2985 $this->tpl->setVariable(
"TXT_SELECT_TYPE",$this->lng->txt(
'add_new_user_defined_wysiwyg_field'));
2986 $this->tpl->setVariable(
"TXT_FIELD_NAME",$this->lng->txt(
'field_name'));
2987 $this->tpl->setVariable(
"FIELD_NAME",
$_POST[
'field_name']);
2989 $this->tpl->setVariable(
"TXT_VISIBLE", $this->lng->txt(
"visible"));
2990 $this->tpl->setVariable(
"TXT_CHANGE", $this->lng->txt(
"changeable"));
2991 $this->tpl->setVariable(
"TXT_REQUIRED", $this->lng->txt(
"required_field"));
2992 $this->tpl->setVariable(
"TXT_EXPORT", $this->lng->txt(
"export"));
2993 $this->tpl->setVariable(
"TXT_COURSE_EXPORT", $lng->txt(
"course_export"));
2994 $this->tpl->setVariable(
'TXT_CHANGE_LUA',$lng->txt(
'usr_settings_changeable_lua'));
2995 $this->tpl->setVariable(
'TXT_VISIB_LUA', $this->lng->txt(
'usr_settings_visib_lua'));
2997 $this->tpl->setVariable(
'TXT_VISIB_REG', $this->lng->txt(
'visible_registration'));
3007 $this->tpl->setVariable(
'VISIB_REG',
3023 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
3026 if( isset(
$_POST[
'def'][
'required']) && (
int)
$_POST[
'def'][
'required'] &&
3027 (!isset(
$_POST[
'def'][
'visib_reg']) || !(
int)
$_POST[
'def'][
'visib_reg'])
3029 $this->confirm_change = 1;
3035 if (!strlen($_POST[
'field_name']))
3042 if($user_field_definitions->nameExists($_POST[
'field_name']))
3050 $user_field_definitions->setFieldType(
$_REQUEST[
'field_type']);
3053 $user_field_definitions->setFieldValues($_POST[
'field_values']);
3054 if(
$error = $user_field_definitions->validateValues())
3071 $user_field_definitions->setFieldName($_POST[
'field_name']);
3072 $user_field_definitions->enableVisible($_POST[
'def'][
'visible']);
3073 $user_field_definitions->enableChangeable($_POST[
'def'][
'changeable']);
3074 $user_field_definitions->enableVisibleLocalUserAdministration($_POST[
'def'][
'visible_lua']);
3075 $user_field_definitions->enableChangeableLocalUserAdministration($_POST[
'def'][
'changeable_lua']);
3076 $user_field_definitions->enableRequired($_POST[
'def'][
'required']);
3077 $user_field_definitions->enableSearchable($_POST[
'def'][
'searchable']);
3078 $user_field_definitions->enableExport($_POST[
'def'][
'export']);
3079 $user_field_definitions->enableCourseExport($_POST[
'def'][
'course_export']);
3081 $user_field_definitions->enableVisibleRegistration((
int)$_POST[
'def'][
'visib_reg']);
3083 $user_field_definitions->add();
3085 if ((
int) $_POST[
'def'][
'course_export'] == 1)
3087 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
3107 include_once
'./Services/User/classes/class.ilUserAccountSettings.php';
3109 $this->form->setValuesByArray(
3111 'lua' => $aset->isLocalUserAdministrationEnabled(),
3112 'lrua' => $aset->isUserAccessRestricted(),
3113 'allow_change_loginname' => (bool)$ilSetting->get(
'allow_change_loginname'),
3114 'create_history_loginname' => (bool)$ilSetting->get(
'create_history_loginname'),
3115 'prevent_reuse_of_loginnames' => (bool)$ilSetting->get(
'prevent_reuse_of_loginnames'),
3116 'loginname_change_blocking_time' => (int)$ilSetting->get(
'loginname_change_blocking_time'),
3117 'user_adm_alpha_nav' => (int)$ilSetting->get(
'user_adm_alpha_nav'),
3118 'user_ext_profiles' => (int)$ilSetting->get(
'user_ext_profiles')
3122 $this->tpl->setContent($this->form->getHTML());
3135 if($this->form->checkInput())
3139 if(strlen($this->form->getInput(
'loginname_change_blocking_time')) &&
3140 !preg_match(
'/^[0-9]*$/',
3141 $this->form->getInput(
'loginname_change_blocking_time')))
3144 $this->form->getItemByPostVar(
'loginname_change_blocking_time')
3145 ->setAlert($this->lng->txt(
'loginname_change_blocking_time_invalidity_info'));
3150 include_once
'./Services/User/classes/class.ilUserAccountSettings.php';
3156 $ilSetting->set(
'allow_change_loginname', (
int)$this->form->getInput(
'allow_change_loginname'));
3157 $ilSetting->set(
'create_history_loginname', (
int)$this->form->getInput(
'create_history_loginname'));
3158 $ilSetting->set(
'prevent_reuse_of_loginnames', (
int)$this->form->getInput(
'prevent_reuse_of_loginnames'));
3159 $ilSetting->set(
'loginname_change_blocking_time', (
int)$this->form->getInput(
'loginname_change_blocking_time'));
3160 $ilSetting->set(
'user_adm_alpha_nav', (
int)$this->form->getInput(
'user_adm_alpha_nav'));
3161 $ilSetting->set(
'user_ext_profiles', (
int)$this->form->getInput(
'user_ext_profiles'));
3174 $this->form->setValuesByPost();
3175 $this->tpl->setContent($this->form->getHTML());
3186 $this->tabs_gui->setTabActive(
'settings');
3187 $this->tabs_gui->setSubTabActive(
'general_settings');
3189 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
3191 $this->form->setFormAction($this->ctrl->getFormAction($this,
'saveGeneralSettings'));
3193 $this->form->setTitle($this->lng->txt(
'general_settings'));
3195 $lua =
new ilCheckboxInputGUI($this->lng->txt(
'enable_local_user_administration'),
'lua');
3196 $lua->
setInfo($this->lng->txt(
'enable_local_user_administration_info'));
3198 $this->form->addItem($lua);
3201 $lrua->
setInfo($this->lng->txt(
'restrict_user_access_info'));
3203 $this->form->addItem($lrua);
3206 $alph =
new ilCheckboxInputGUI($this->lng->txt(
'user_adm_enable_alpha_nav'),
'user_adm_alpha_nav');
3209 $this->form->addItem($alph);
3212 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_ext_profiles"),
"user_ext_profiles");
3213 $cb->
setInfo($this->lng->txt(
'user_ext_profiles_desc'));
3214 $this->form->addItem($cb);
3217 $log->setTitle($this->lng->txt(
'loginname_settings'));
3218 $this->form->addItem(
$log);
3220 $chbChangeLogin =
new ilCheckboxInputGUI($this->lng->txt(
'allow_change_loginname'),
'allow_change_loginname');
3222 $this->form->addItem($chbChangeLogin);
3223 $chbCreateHistory =
new ilCheckboxInputGUI($this->lng->txt(
'history_loginname'),
'create_history_loginname');
3224 $chbCreateHistory->
setInfo($this->lng->txt(
'loginname_history_info'));
3225 $chbCreateHistory->setValue(1);
3227 $chbChangeLogin->addSubItem($chbCreateHistory);
3228 $chbReuseLoginnames =
new ilCheckboxInputGUI($this->lng->txt(
'reuse_of_loginnames_contained_in_history'),
'prevent_reuse_of_loginnames');
3230 $chbReuseLoginnames->setInfo($this->lng->txt(
'prevent_reuse_of_loginnames_contained_in_history_info'));
3232 $chbChangeLogin->addSubItem($chbReuseLoginnames);
3233 $chbChangeBlockingTime =
new ilTextInputGUI($this->lng->txt(
'loginname_change_blocking_time'),
'loginname_change_blocking_time');
3234 $chbChangeBlockingTime->
setInfo($this->lng->txt(
'loginname_change_blocking_time_info'));
3235 $chbChangeBlockingTime->setSize(10);
3236 $chbChangeBlockingTime->setMaxLength(10);
3237 $chbChangeLogin->addSubItem($chbChangeBlockingTime);
3239 $this->form->addCommandButton(
'saveGeneralSettings', $this->lng->txt(
'save'));
3259 include_once
'Services/Search/classes/class.ilUserSearchOptions.php';
3260 $lng->loadLanguageModule(
"administration");
3261 $lng->loadLanguageModule(
"mail");
3264 include_once(
"./Services/User/classes/class.ilUserFieldSettingsTableGUI.php");
3266 if($this->confirm_change)
$tab->setConfirmChange();
3267 $tpl->setContent(
$tab->getHTML());
3277 include_once
'Services/Search/classes/class.ilUserSearchOptions.php';
3278 include_once
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
3283 include_once(
"./Services/User/classes/class.ilUserProfile.php");
3285 $up->skipField(
"username");
3286 $field_properties =
$up->getStandardFields();
3287 $profile_fields = array_keys($field_properties);
3290 foreach ($profile_fields as $field)
3292 if (
$_POST[
"chb"][
"required_".$field] &&
3293 !(
int)
$_POST[
'chb'][
'visib_reg_' . $field]
3304 $this->confirm_change = 1;
3310 $fixed_required_fields = array(
3317 "hits_per_page" => 0,
3318 "show_users_online" => 0,
3319 "hide_own_online_status" => 0
3324 if ($privacy->enabledCourseExport() ==
true &&
3325 $privacy->courseConfirmationRequired() ==
true &&
3328 foreach ($profile_fields as $field)
3330 if (! $ilias->getSetting(
"usr_settings_course_export_" . $field) &&
$_POST[
"chb"][
"course_export_" . $field] ==
"1")
3332 #ilUtil::sendQuestion($this->lng->txt('confirm_message_course_export'));
3333 #$this->confirm_change = 1;
3334 #$this->settingsObject();
3340 if($action ==
'save')
3342 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
3346 foreach ($profile_fields as $field)
3354 if (!
$_POST[
"chb"][
"visible_".$field] && !$field_properties[$field][
"visible_hide"])
3356 $ilias->setSetting(
"usr_settings_hide_".$field,
"1");
3360 $ilias->deleteSetting(
"usr_settings_hide_".$field);
3363 if (!
$_POST[
"chb"][
"changeable_" . $field] && !$field_properties[$field][
"changeable_hide"])
3365 $ilias->setSetting(
"usr_settings_disable_".$field,
"1");
3369 $ilias->deleteSetting(
"usr_settings_disable_".$field);
3373 if ((
int)
$_POST[
'chb'][
'visib_reg_' . $field] && !$field_properties[$field][
"visib_reg_hide"])
3375 $ilSetting->set(
'usr_settings_visib_reg_'.$field,
'1');
3379 $ilSetting->set(
'usr_settings_visib_reg_'.$field,
'0');
3382 if ((
int)
$_POST[
'chb'][
'visib_lua_' . $field])
3385 $ilSetting->set(
'usr_settings_visib_lua_'.$field,
'1');
3389 $ilSetting->set(
'usr_settings_visib_lua_'.$field,
'0');
3392 if ((
int)
$_POST[
'chb'][
'changeable_lua_' . $field])
3395 $ilSetting->set(
'usr_settings_changeable_lua_'.$field,
'1');
3399 $ilSetting->set(
'usr_settings_changeable_lua_'.$field,
'0');
3402 if (
$_POST[
"chb"][
"export_" . $field] && !$field_properties[$field][
"export_hide"])
3404 $ilias->setSetting(
"usr_settings_export_".$field,
"1");
3408 $ilias->deleteSetting(
"usr_settings_export_".$field);
3412 if (
$_POST[
"chb"][
"course_export_" . $field] && !$field_properties[$field][
"course_export_hide"])
3414 $ilias->setSetting(
"usr_settings_course_export_".$field,
"1");
3418 $ilias->deleteSetting(
"usr_settings_course_export_".$field);
3421 if (
$_POST[
"chb"][
"group_export_" . $field] && !$field_properties[$field][
"group_export_hide"])
3423 $ilias->setSetting(
"usr_settings_group_export_".$field,
"1");
3427 $ilias->deleteSetting(
"usr_settings_group_export_".$field);
3430 $is_fixed = array_key_exists($field, $fixed_required_fields);
3431 if ($is_fixed && $fixed_required_fields[$field] || ! $is_fixed &&
$_POST[
"chb"][
"required_".$field])
3433 $ilias->setSetting(
"require_".$field,
"1");
3437 $ilias->deleteSetting(
"require_" . $field);
3441 if (
$_POST[
"select"][
"default_hits_per_page"])
3443 $ilias->setSetting(
"hits_per_page",
$_POST[
"select"][
"default_hits_per_page"]);
3446 if (
$_POST[
"select"][
"default_show_users_online"])
3448 $ilias->setSetting(
"show_users_online",
$_POST[
"select"][
"default_show_users_online"]);
3451 if (
$_POST[
"chb"][
"export_preferences"])
3453 $ilias->setSetting(
"usr_settings_export_preferences",
$_POST[
"chb"][
"export_preferences"]);
3455 $ilias->deleteSetting(
"usr_settings_export_preferences");
3458 $ilias->setSetting(
'mail_incoming_mail', (
int)
$_POST[
'select'][
'default_mail_incoming_mail']);
3470 $action[-1] = $this->lng->txt(
'all_users');
3471 $action[1] = $this->lng->txt(
'usr_active_only');
3472 $action[0] = $this->lng->txt(
'usr_inactive_only');
3473 $action[2] = $this->lng->txt(
'usr_limited_access_only');
3474 $action[3] = $this->lng->txt(
'usr_without_courses');
3475 $action[4] = $this->lng->txt(
'usr_filter_lastlogin');
3476 $action[5] = $this->lng->txt(
"usr_filter_coursemember");
3477 $action[6] = $this->lng->txt(
"usr_filter_groupmember");
3478 $action[7] = $this->lng->txt(
"usr_filter_role");
3491 if(!isset(
$_POST[
"file"]))
3493 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
3496 if (count(
$_POST[
"file"]) > 1)
3498 $this->ilias->raiseError($this->lng->txt(
"select_max_one_item"),$this->ilias->error_obj->MESSAGE);
3502 $export_dir = $this->
object->getExportDirectory();
3512 if(!isset(
$_POST[
"file"]))
3514 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
3524 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
3527 $this->tpl->setCurrentBlock(
"table_header");
3528 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
3529 $this->tpl->parseCurrentBlock();
3535 $this->tpl->setCurrentBlock(
"table_row");
3538 $this->tpl->setVariable(
"TEXT_CONTENT", $file);
3539 $this->tpl->parseCurrentBlock();
3544 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
3545 $buttons = array(
"cancelDeleteExportFile" => $this->lng->txt(
"cancel"),
3546 "deleteExportFile" => $this->lng->txt(
"confirm"));
3547 foreach ($buttons as
$name => $value)
3549 $this->tpl->setCurrentBlock(
"operation_btn");
3550 $this->tpl->setVariable(
"BTN_NAME",
$name);
3551 $this->tpl->setVariable(
"BTN_VALUE",$value);
3552 $this->tpl->parseCurrentBlock();
3562 session_unregister(
"ilExportFiles");
3563 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
3572 $export_dir = $this->
object->getExportDirectory();
3575 $exp_file = $export_dir.
"/".
$file;
3576 if (@is_file($exp_file))
3581 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
3598 if (
$_POST[
"cmd"][
"export"])
3600 $this->
object->buildExportFile(
$_POST[
"export_type"]);
3601 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"export");
3607 $export_types = array(
3608 "userfolder_export_excel_x86",
3609 "userfolder_export_csv",
3610 "userfolder_export_xml"
3614 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
3618 $this->tpl->addBlockfile(
"EXPORT_FILES",
"export_files",
"tpl.table.html");
3621 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.usr_export_file_row.html");
3625 $tbl->setTitle($this->lng->txt(
"userfolder_export_files"));
3627 $tbl->setHeaderNames(array(
"", $this->lng->txt(
"userfolder_export_file"),
3628 $this->lng->txt(
"userfolder_export_file_size"), $this->lng->txt(
"date") ));
3629 $tbl->setHeaderVars(array(), $ilCtrl->getParameterArray($this,
"export"));
3631 $tbl->enabled[
"sort"] =
false;
3632 $tbl->setColumnWidth(array(
"1%",
"49%",
"25%",
"25%"));
3635 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
3636 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
3637 $tbl->setLimit(
$_GET[
"limit"]);
3638 $tbl->setOffset(
$_GET[
"offset"]);
3639 $tbl->setMaxCount($this->maxcount);
3642 $this->tpl->setVariable(
"COLUMN_COUNTS", 4);
3646 $this->tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
3647 $this->tpl->setCurrentBlock(
"tbl_action_btn");
3648 $this->tpl->setVariable(
"BTN_NAME",
"confirmDeleteExportFile");
3649 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
3650 $this->tpl->parseCurrentBlock();
3652 $this->tpl->setCurrentBlock(
"tbl_action_btn");
3653 $this->tpl->setVariable(
"BTN_NAME",
"downloadExportFile");
3654 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"download"));
3655 $this->tpl->parseCurrentBlock();
3658 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
3661 $export_files = $this->
object->getExportFiles();
3663 $tbl->setMaxCount(count($export_files));
3664 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
3668 if(count($export_files) > 0)
3671 foreach($export_files as $exp_file)
3673 $this->tpl->setCurrentBlock(
"tbl_content");
3674 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"filename"]);
3677 $this->tpl->setVariable(
"CSS_ROW", $css_row);
3679 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"filesize"]);
3680 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"filename"]);
3682 $file_arr = explode(
"__", $exp_file[
"filename"]);
3685 $this->tpl->parseCurrentBlock();
3688 $this->tpl->setCurrentBlock(
"selectall");
3689 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
3690 $this->tpl->setVariable(
"CSS_ROW", $css_row);
3691 $this->tpl->parseCurrentBlock();
3695 $this->tpl->setCurrentBlock(
"notfound");
3696 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
3697 $this->tpl->setVariable(
"NUM_COLS", 3);
3698 $this->tpl->parseCurrentBlock();
3701 $this->tpl->parseCurrentBlock();
3704 foreach ($export_types as $export_type)
3706 $this->tpl->setCurrentBlock(
"option");
3707 $this->tpl->setVariable(
"OPTION_VALUE", $export_type);
3708 $this->tpl->setVariable(
"OPTION_TEXT", $this->lng->txt($export_type));
3709 $this->tpl->parseCurrentBlock();
3712 $this->tpl->setVariable(
"EXPORT_BUTTON", $this->lng->txt(
"create_export_file"));
3713 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
3724 $this->tabs_gui->setTabActive(
'settings');
3725 $this->tabs_gui->setSubTabActive(
'user_new_account_mail');
3727 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usrf_new_account_mail.html');
3728 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
3731 $lng->loadLanguageModule(
"meta");
3732 $lng->loadLanguageModule(
"mail");
3733 $this->tpl->setVariable(
"TXT_NEW_USER_ACCOUNT_MAIL", $lng->txt(
"user_new_account_mail"));
3734 $this->tpl->setVariable(
"TXT_NEW_USER_ACCOUNT_MAIL_DESC", $lng->txt(
"user_new_account_mail_desc"));
3737 $this->tpl->setVariable(
"TXT_USE_PLACEHOLDERS", $lng->txt(
"mail_nacc_use_placeholder"));
3738 $this->tpl->setVariable(
"TXT_MAIL_SALUTATION", $lng->txt(
"mail_nacc_salutation"));
3739 $this->tpl->setVariable(
"TXT_FIRST_NAME", $lng->txt(
"firstname"));
3740 $this->tpl->setVariable(
"TXT_LAST_NAME", $lng->txt(
"lastname"));
3741 $this->tpl->setVariable(
"TXT_EMAIL", $lng->txt(
"email"));
3742 $this->tpl->setVariable(
"TXT_LOGIN", $lng->txt(
"mail_nacc_login"));
3743 $this->tpl->setVariable(
"TXT_PASSWORD", $lng->txt(
"password"));
3744 $this->tpl->setVariable(
"TXT_PASSWORD_BLOCK", $lng->txt(
"mail_nacc_pw_block"));
3745 $this->tpl->setVariable(
"TXT_NOPASSWORD_BLOCK", $lng->txt(
"mail_nacc_no_pw_block"));
3746 $this->tpl->setVariable(
"TXT_ADMIN_MAIL", $lng->txt(
"mail_nacc_admin_mail"));
3747 $this->tpl->setVariable(
"TXT_ILIAS_URL", $lng->txt(
"mail_nacc_ilias_url"));
3748 $this->tpl->setVariable(
"TXT_CLIENT_NAME", $lng->txt(
"mail_nacc_client_name"));
3749 $this->tpl->setVariable(
"TXT_TARGET", $lng->txt(
"mail_nacc_target"));
3750 $this->tpl->setVariable(
"TXT_TARGET_TITLE", $lng->txt(
"mail_nacc_target_title"));
3751 $this->tpl->setVariable(
"TXT_TARGET_TYPE", $lng->txt(
"mail_nacc_target_type"));
3752 $this->tpl->setVariable(
"TXT_TARGET_BLOCK", $lng->txt(
"mail_nacc_target_block"));
3754 $langs = $lng->getInstalledLanguages();
3755 foreach($langs as $lang_key)
3757 $amail = $this->
object->_lookupNewAccountMail($lang_key);
3758 $this->tpl->setCurrentBlock(
"mail_block");
3760 if ($lang_key == $lng->getDefaultLanguage())
3762 $add =
" (".$lng->txt(
"default").
")";
3764 $this->tpl->setVariable(
"TXT_LANGUAGE",
3765 $lng->txt(
"meta_l_".$lang_key).$add);
3766 $this->tpl->setVariable(
"TXT_BODY", $lng->txt(
"message_content"));
3767 $this->tpl->setVariable(
"TA_BODY",
"body_".$lang_key);
3768 $this->tpl->setVariable(
"VAL_BODY",
3770 $this->tpl->setVariable(
"TXT_SUBJECT", $lng->txt(
"subject"));
3771 $this->tpl->setVariable(
"INPUT_SUBJECT",
"subject_".$lang_key);
3772 $this->tpl->setVariable(
"VAL_SUBJECT",
3774 $this->tpl->setVariable(
"TXT_SAL_G", $lng->txt(
"mail_salutation_general"));
3775 $this->tpl->setVariable(
"INPUT_SAL_G",
"sal_g_".$lang_key);
3776 $this->tpl->setVariable(
"VAL_SAL_G",
3778 $this->tpl->setVariable(
"TXT_SAL_M", $lng->txt(
"mail_salutation_male"));
3779 $this->tpl->setVariable(
"INPUT_SAL_M",
"sal_m_".$lang_key);
3780 $this->tpl->setVariable(
"VAL_SAL_M",
3782 $this->tpl->setVariable(
"TXT_SAL_F", $lng->txt(
"mail_salutation_female"));
3783 $this->tpl->setVariable(
"INPUT_SAL_F",
"sal_f_".$lang_key);
3784 $this->tpl->setVariable(
"VAL_SAL_F",
3786 $this->tpl->parseCurrentBlock();
3788 $this->tpl->setVariable(
"TXT_CANCEL", $lng->txt(
"cancel"));
3789 $this->tpl->setVariable(
"TXT_SAVE", $lng->txt(
"save"));
3794 $this->ctrl->redirect($this,
"settings");
3802 $langs = $lng->getInstalledLanguages();
3803 foreach($langs as $lang_key)
3805 $this->
object->_writeNewAccountMail($lang_key,
3812 $this->ctrl->redirect($this,
"newAccountMail");
3827 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
3831 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
3833 $tabs_gui->addTarget(
"obj_usrf",
3834 $this->ctrl->getLinkTarget($this,
"view"), array(
"view",
"delete",
"resetFilter",
"userAction",
""),
"",
"");
3836 $tabs_gui->addTarget(
"search_user_extended",
3837 $this->ctrl->getLinkTargetByClass(
'ilAdminUserSearchGUI',
'startExtended'),
3838 array(
""),
"iladminusersearchgui",
"");
3841 if ($rbacsystem->checkAccess(
"write",$this->object->getRefId()))
3843 $tabs_gui->addTarget(
"settings",
3844 $this->ctrl->getLinkTarget($this,
"generalSettings"),array(
'settings',
'generalSettings',
'listUserDefinedField',
'newAccountMail'));
3846 $tabs_gui->addTarget(
"export",
3847 $this->ctrl->getLinkTarget($this,
"export"),
"export",
"",
"");
3853 $tabs_gui->addTarget(
"learning_progress",
3854 $this->ctrl->getLinkTarget($this,
"learningProgress"),
"learningProgress",
"",
"");
3858 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
3860 $tabs_gui->addTarget(
"perm_settings",
3861 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
3862 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
3872 global $rbacsystem,$ilUser;
3877 $this->tabs_gui->addSubTabTarget(
3879 $this->ctrl->getLinkTarget($this,
'generalSettings'),
'generalSettings', get_class($this));
3880 $this->tabs_gui->addSubTabTarget(
"standard_fields",
3881 $this->ctrl->getLinkTarget($this,
'settings'),
3882 array(
"settings",
"saveGlobalUserSettings"), get_class($this));
3883 $this->tabs_gui->addSubTabTarget(
"user_defined_fields",
3884 $this->ctrl->getLinkTarget($this,
'listUserDefinedFields'),
3885 "listUserDefinedFields",get_class($this));
3886 $this->tabs_gui->addSubTabTarget(
"user_new_account_mail",
3887 $this->ctrl->getLinkTarget($this,
'newAccountMail'),
3888 "newAccountMail",get_class($this));
3899 $this->loginSettingsForm->setValuesByArray(array(
3900 'allow_change_loginname' => (
bool)$ilSetting->get(
'allow_change_loginname'),
3901 'create_history_loginname' => (bool)$ilSetting->get(
'create_history_loginname'),
3902 'prevent_reuse_of_loginnames' => (bool)$ilSetting->get(
'prevent_reuse_of_loginnames'),
3903 'loginname_change_blocking_time' => (int)$ilSetting->get(
'loginname_change_blocking_time')
3906 $this->tpl->setVariable(
'ADM_CONTENT', $this->loginSettingsForm->getHTML());
3912 $this->tabs_gui->setTabActive(
'settings');
3913 $this->tabs_gui->setSubTabActive(
'loginname_settings');
3915 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
3917 $this->loginSettingsForm->
setFormAction($this->ctrl->getFormAction($this,
'saveLoginnameSettings'));
3918 $this->loginSettingsForm->setTitle($this->lng->txt(
'loginname_settings'));
3920 $chbChangeLogin =
new ilCheckboxInputGUI($this->lng->txt(
'allow_change_loginname'),
'allow_change_loginname');
3922 $this->loginSettingsForm->addItem($chbChangeLogin);
3923 $chbCreateHistory =
new ilCheckboxInputGUI($this->lng->txt(
'history_loginname'),
'create_history_loginname');
3924 $chbCreateHistory->
setInfo($this->lng->txt(
'loginname_history_info'));
3925 $chbCreateHistory->setValue(1);
3926 $chbChangeLogin->addSubItem($chbCreateHistory);
3927 $chbReuseLoginnames =
new ilCheckboxInputGUI($this->lng->txt(
'reuse_of_loginnames_contained_in_history'),
'prevent_reuse_of_loginnames');
3929 $chbReuseLoginnames->setInfo($this->lng->txt(
'prevent_reuse_of_loginnames_contained_in_history_info'));
3930 $chbChangeLogin->addSubItem($chbReuseLoginnames);
3931 $chbChangeBlockingTime =
new ilTextInputGUI($this->lng->txt(
'loginname_change_blocking_time'),
'loginname_change_blocking_time');
3932 $chbChangeBlockingTime->
setInfo($this->lng->txt(
'loginname_change_blocking_time_info'));
3933 $chbChangeBlockingTime->setSize(10);
3934 $chbChangeBlockingTime->setMaxLength(10);
3935 $chbChangeLogin->addSubItem($chbChangeBlockingTime);
3937 $this->loginSettingsForm->addCommandButton(
'saveLoginnameSettings', $this->lng->txt(
'save'));
3945 if($this->loginSettingsForm->checkInput())
3949 if(strlen($this->loginSettingsForm->getInput(
'loginname_change_blocking_time')) &&
3950 !preg_match(
'/^[0-9]*$/',
3951 $this->loginSettingsForm->getInput(
'loginname_change_blocking_time')))
3954 $this->loginSettingsForm->getItemByPostVar(
'loginname_change_blocking_time')
3955 ->setAlert($this->lng->txt(
'loginname_change_blocking_time_invalidity_info'));
3960 $ilSetting->set(
'allow_change_loginname', (
int)$this->loginSettingsForm->getInput(
'allow_change_loginname'));
3961 $ilSetting->set(
'create_history_loginname', (
int)$this->loginSettingsForm->getInput(
'create_history_loginname'));
3962 $ilSetting->set(
'prevent_reuse_of_loginnames', (
int)$this->loginSettingsForm->getInput(
'prevent_reuse_of_loginnames'));
3963 $ilSetting->set(
'loginname_change_blocking_time', (
int)$this->loginSettingsForm->getInput(
'loginname_change_blocking_time'));
3976 $this->loginSettingsForm->setValuesByPost();
3978 $this->tpl->setVariable(
'ADM_CONTENT', $this->loginSettingsForm->getHTML());
3990 if ($ilAccess->checkAccess(
"read",
"", $a_target))
3992 ilUtil::redirect(
"ilias.php?baseClass=ilAdministrationGUI&ref_id=".$a_target.
"&jmpToUser=".$a_user);
3997 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
3999 $_GET[
"cmd"] =
"frameset";
4000 $_GET[
"target"] =
"";
4001 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
4004 include(
"repository.php");
4008 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
4020 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id", (
int) $_GET[
"jmpToUser"]);
4021 $ilCtrl->redirectByClass(
"ilobjusergui",
"view");