4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
31 public function __construct($a_parent_obj, $a_parent_cmd, $a_mode = self::MODE_USER_FOLDER, $a_load_items =
true)
37 $ilAccess = $DIC[
'ilAccess'];
39 $rbacsystem = $DIC[
'rbacsystem'];
41 $this->user_folder_id = $a_parent_obj->object->getRefId();
47 parent::__construct($a_parent_obj, $a_parent_cmd);
51 $this->
addColumn($this->lng->txt(
"login"),
"login");
62 if ($this->
getMode() == self::MODE_LOCAL_USER) {
63 $this->
addColumn($this->lng->txt(
'context'),
'time_limit_owner');
64 $this->
addColumn($this->lng->txt(
'role_assignment'));
85 if ($this->
getMode() == self::MODE_USER_FOLDER) {
88 $cmds = $a_parent_obj->getUserMultiCommands();
89 foreach ($cmds as $cmd => $caption) {
103 $this->mode = $a_mode;
121 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
123 foreach ($user_defined_fields->getDefinitions() as $field => $definition) {
124 $this->udf_fields[
"udf_" . $field] = array(
125 "txt" => $definition[
"field_name"],
127 "options" => $definition[
"field_values"],
128 "type" => $definition[
"field_type"],
141 if (isset($this->udf_fields[$a_key])) {
142 return $this->udf_fields[$a_key];
154 if (substr($a_key, 0, 4) ==
"udf_") {
173 include_once(
"./Services/User/classes/class.ilUserProfile.php");
175 $up->skipGroup(
"preferences");
176 $up->skipGroup(
"interests");
177 $up->skipGroup(
"settings");
183 $cols[
"firstname"] = array(
184 "txt" =>
$lng->txt(
"firstname"),
186 $cols[
"lastname"] = array(
187 "txt" =>
$lng->txt(
"lastname"),
189 if ($this->
getMode() == self::MODE_USER_FOLDER) {
190 $ufs = $up->getStandardFields();
192 $cols[
"access_until"] = array(
193 "txt" =>
$lng->txt(
"access_until"),
195 $cols[
"last_login"] = array(
196 "txt" =>
$lng->txt(
"last_login"),
200 $cols[
"create_date"] = array(
201 "txt" =>
$lng->txt(
"create_date"));
202 $cols[
"approve_date"] = array(
203 "txt" =>
$lng->txt(
"approve_date"));
204 $cols[
"agree_date"] = array(
205 "txt" =>
$lng->txt(
"agree_date"));
207 $ufs = $up->getLocalUserAdministrationFields();
211 if (isset($ufs[
"email"])) {
212 $cols[
"email"] = array(
213 "txt" =>
$lng->txt(
"email"),
216 if (isset($ufs[
"second_email"])) {
217 $cols[
"second_email"] = array(
218 "txt" =>
$lng->txt(
"second_email"),
222 foreach ($ufs as
$f => $fd) {
223 if (!isset($cols[
$f]) && !$fd[
"lists_hide"]) {
225 $caption = $fd[
"lang_var"]
229 "txt" =>
$lng->txt($caption),
238 $cols[
"auth_mode"] = array(
239 "txt" =>
$lng->txt(
"auth_mode"),
244 if ($this->
getMode() == self::MODE_USER_FOLDER) {
245 foreach ($this->udf_fields as $k => $field) {
251 unset($cols[
"username"]);
266 if ($this->
getMode() == self::MODE_USER_FOLDER) {
268 include_once
'./Services/User/classes/class.ilLocalUser.php';
271 if ($this->filter[
'time_limit_owner']) {
272 $user_filter = array($this->filter[
'time_limit_owner']);
275 include_once
'./Services/User/classes/class.ilLocalUser.php';
281 if (!count($user_filter)) {
287 include_once(
"./Services/User/classes/class.ilUserQuery.php");
290 unset($additional_fields[
"firstname"]);
291 unset($additional_fields[
"lastname"]);
292 unset($additional_fields[
"email"]);
293 unset($additional_fields[
"second_email"]);
294 unset($additional_fields[
"last_login"]);
295 unset($additional_fields[
"access_until"]);
296 unset($additional_fields[
'org_units']);
298 $udf_filter = array();
299 foreach ($this->filter as $k => $v) {
300 if (substr($k, 0, 4) ==
"udf_") {
301 $udf_filter[$k] = $v;
310 $query->setTextFilter($this->filter[
'query']);
311 $query->setActionFilter($this->filter[
'activation']);
312 $query->setLastLogin($this->filter[
'last_login']);
313 $query->setLimitedAccessFilter($this->filter[
'limited_access']);
314 $query->setNoCourseFilter($this->filter[
'no_courses']);
315 $query->setNoGroupFilter($this->filter[
'no_groups']);
316 $query->setCourseGroupFilter($this->filter[
'course_group']);
317 $query->setRoleFilter($this->filter[
'global_role']);
318 $query->setAdditionalFields($additional_fields);
319 $query->setUserFolder($user_filter);
320 $query->setUdfFilter($udf_filter);
322 $query->setAuthenticationFilter($this->filter[
'authentication']);
323 $usr_data =
$query->query();
325 if (count($usr_data[
"set"]) == 0 && $this->
getOffset() > 0) {
328 $usr_data =
$query->query();
331 foreach ($usr_data[
"set"] as $k =>
$user) {
337 $current_time = time();
338 if (
$user[
'active']) {
339 if (
$user[
"time_limit_unlimited"]) {
340 $txt_access =
$lng->txt(
"access_unlimited");
341 $usr_data[
"set"][$k][
"access_class"] =
"smallgreen";
342 } elseif (
$user[
"time_limit_until"] < $current_time) {
343 $txt_access =
$lng->txt(
"access_expired");
344 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
347 $usr_data[
"set"][$k][
"access_class"] =
"small";
350 $txt_access =
$lng->txt(
"inactive");
351 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
353 $usr_data[
"set"][$k][
"access_until"] = $txt_access;
357 $this->
setData($usr_data[
"set"]);
362 if ($this->
getMode() == self::MODE_USER_FOLDER) {
364 include_once
'./Services/User/classes/class.ilLocalUser.php';
367 if ($this->filter[
'time_limit_owner']) {
368 $user_filter = array($this->filter[
'time_limit_owner']);
371 include_once
'./Services/User/classes/class.ilLocalUser.php';
376 include_once(
"./Services/User/classes/class.ilUserQuery.php");
381 $query->setTextFilter($this->filter[
'query']);
382 $query->setActionFilter($this->filter[
'activation']);
383 $query->setAuthenticationFilter($this->filter[
'authentication']);
384 $query->setLastLogin($this->filter[
'last_login']);
385 $query->setLimitedAccessFilter($this->filter[
'limited_access']);
386 $query->setNoCourseFilter($this->filter[
'no_courses']);
387 $query->setNoGroupFilter($this->filter[
'no_groups']);
388 $query->setCourseGroupFilter($this->filter[
'course_group']);
389 $query->setRoleFilter($this->filter[
'global_role']);
390 $query->setUserFolder($user_filter);
398 $usr_data =
$query->query();
401 foreach ($usr_data[
"set"] as $item) {
403 if ($item[
"usr_id"] != SYSTEM_USER_ID) {
404 $user_ids[] = $item[
"usr_id"];
419 $rbacreview = $DIC[
'rbacreview'];
425 if ($this->
getMode() == self::MODE_LOCAL_USER) {
426 include_once
'./Services/User/classes/class.ilLocalUser.php';
429 if (count($parent_ids) > 1) {
430 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
435 $opt[0] = $this->lng->txt(
'all_users');
438 foreach ($parent_ids as $parent_id) {
442 switch ($parent_id) {
452 $co->setOptions($opt);
454 $co->readFromSession();
455 $this->filter[
'time_limit_owner'] = $co->getValue();
460 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
462 $lng->txt(
"name"),
"query");
464 $this->getParentObject(),
465 "addUserAutoComplete",
470 $ul->setSubmitFormOnEnter(
true);
472 $ul->readFromSession();
473 $this->filter[
"query"] = $ul->getValue();
487 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
489 "" =>
$lng->txt(
"user_all"),
490 "active" =>
$lng->txt(
"active"),
491 "inactive" =>
$lng->txt(
"inactive"),
496 $si->readFromSession();
497 $this->filter[
"activation"] = $si->getValue();
500 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
501 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_limited_access"),
"limited_access");
503 $cb->readFromSession();
504 $this->filter[
"limited_access"] = $cb->getChecked();
507 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
508 $di =
new ilDateTimeInputGUI($this->lng->txt(
"user_last_login_before"),
"last_login");
513 $di->readFromSession();
514 $this->filter[
"last_login"] = $di->getDate();
516 if ($this->
getMode() == self::MODE_USER_FOLDER) {
518 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
521 $cb->readFromSession();
522 $this->filter[
"no_courses"] = $cb->getChecked();
525 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
528 $ng->readFromSession();
529 $this->filter[
'no_groups'] = $ng->getChecked();
532 include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
535 $rs->setHeaderMessage(
$lng->txt(
"user_please_select_course_group"));
536 $rs->setClickableTypes(array(
"crs",
"grp"));
538 $rs->readFromSession();
539 $this->filter[
"course_group"] = $rs->getValue();
544 "" =>
$lng->txt(
"user_any"),
546 $roles = $rbacreview->getRolesByFilter(2,
$ilUser->getId());
547 foreach ($roles as $role) {
548 $options[$role[
"rol_id"]] = $role[
"title"];
550 $si =
new ilSelectInputGUI($this->lng->txt(
"user_global_role"),
"global_role");
553 $si->readFromSession();
554 $this->filter[
"global_role"] = $si->getValue();
559 "" =>
$lng->txt(
"user_any"),
561 foreach ($auth_methods as $method => $value) {
562 if ($method ==
'default') {
568 $si =
new ilSelectInputGUI($this->lng->txt(
"auth_mode"),
"authentication_method");
571 $si->readFromSession();
572 $this->filter[
"authentication"] = $si->getValue();
575 foreach ($this->udf_fields as
$id =>
$f) {
599 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
603 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
605 $sel_options = array(
"" => $this->lng->txt(
"user_all"));
606 foreach ($a_options as $o) {
607 $sel_options[$o] = $o;
609 $item->setOptions($sel_options);
613 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
615 $item->setMaxLength(64);
626 $item->readFromSession();
627 $this->filter[
$id] = $item->getValue();
642 $ilCtrl->setParameterByClass(
"ilobjusergui",
"letter",
$_GET[
"letter"]);
645 if ($c ==
"access_until") {
646 $this->tpl->setCurrentBlock(
"access_until");
647 $this->tpl->setVariable(
"VAL_ACCESS_UNTIL",
$user[
"access_until"]);
648 $this->tpl->setVariable(
"CLASS_ACCESS_UNTIL",
$user[
"access_class"]);
649 } elseif ($c ==
"last_login") {
650 $this->tpl->setCurrentBlock(
"last_login");
651 $this->tpl->setVariable(
655 } elseif (in_array($c, array(
"firstname",
"lastname"))) {
656 $this->tpl->setCurrentBlock($c);
657 $this->tpl->setVariable(
"VAL_" . strtoupper($c), (
string)
$user[$c]);
658 } elseif ($c ==
'auth_mode') {
659 $this->tpl->setCurrentBlock(
'user_field');
661 $this->tpl->parseCurrentBlock();
663 $this->tpl->setCurrentBlock(
"user_field");
664 $val = (trim(
$user[$c]) ==
"")
667 if (
$user[$c] !=
"") {
685 $this->tpl->setVariable(
"VAL_UF", $val);
688 $this->tpl->parseCurrentBlock();
691 if (
$user[
"usr_id"] != 6) {
693 $this->tpl->setCurrentBlock(
"checkb");
694 $this->tpl->setVariable(
"ID",
$user[
"usr_id"]);
695 $this->tpl->parseCurrentBlock();
700 $this->tpl->setVariable(
"VAL_LOGIN",
$user[
"login"]);
701 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id",
$user[
"usr_id"]);
702 $this->tpl->setVariable(
704 $ilCtrl->getLinkTargetByClass(
"ilobjusergui",
"view")
706 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id",
"");
708 $this->tpl->setVariable(
'VAL_LOGIN_PLAIN',
$user[
'login']);
711 if ($this->
getMode() == self::MODE_LOCAL_USER) {
712 $this->tpl->setCurrentBlock(
'context');
714 $this->tpl->parseCurrentBlock();
716 $this->tpl->setCurrentBlock(
'roles');
718 $this->tpl->setVariable(
'ROLE_LINK',
$ilCtrl->getLinkTarget($this->getParentObject(),
'assignRoles'));
719 $this->tpl->setVariable(
'TXT_ROLES', $this->lng->txt(
'edit'));
721 $this->tpl->parseCurrentBlock();
getUserDefinedField($a_key)
Get user defined field.
setExternalSorting($a_val)
Set external sorting.
setDataSource($href, $a_delimiter=null)
set datasource link for js autocomplete
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
static _getInstance()
Get instance.
setExternalSegmentation($a_val)
Set external segmentation.
resetOffset($a_in_determination=false)
Reset offset.
if(!array_key_exists('StateId', $_REQUEST)) $id
getSelectableColumns()
Get selectable columns.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
static _lookupTitle($a_id)
lookup object title
static _getActiveAuthModes()
static getAuthModeTranslation($a_auth_key, $auth_name='')
getOrderDirection()
Get order direction.
static _getAuthMode($a_auth_mode, $a_db_handler='')
static _getAuthModeName($a_auth_key)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
getParentObject()
Get parent object.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
static lookupOrgUnitsRepresentation($a_usr_id)
lokup org unit representation
TableGUI class for user administration.
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
readUserDefinedFieldsDefinitions()
Read user defined fields definitions.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
static _lookupObjId($a_id)
addMultiCommand($a_cmd, $a_text)
Add Command button.
This class represents a text property in a property form.
getSelectedColumns()
Get selected columns.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setEnableAllCommand($a_value)
Enable actions for all entries in current result.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
isUdfColumn($a_key)
Field key.
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
__construct($a_parent_obj, $a_parent_cmd, $a_mode=self::MODE_USER_FOLDER, $a_load_items=true)
Constructor.
fillRow($user)
Fill table row.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
const USER_FOLDER_ID
Class ilObjUserFolder.
setEnableHeader($a_enableheader)
Set Enable Header.
setMaxCount($a_max_count)
set max.
setEnableTitle($a_enabletitle)
Set Enable Title.
getItems()
Get user items.
addFilterItemByUdfType($id, $type, $a_optional=false, $caption=null, $a_options=array())
Add filter by standard type.
setFilterCommand($a_val, $a_caption=null)
Set filter command.