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)
35 $this->user_folder_id = $a_parent_obj->object->getRefId();
41 parent::__construct($a_parent_obj, $a_parent_cmd);
45 $this->
addColumn($this->lng->txt(
"login"),
"login");
50 $this->
addColumn($f[
"txt"], $f[
"sortable"] ? $c :
"");
52 $this->
addColumn($this->lng->txt($c), $c);
56 if ($this->
getMode() == self::MODE_LOCAL_USER) {
57 $this->
addColumn($this->lng->txt(
'context'),
'time_limit_owner');
58 $this->
addColumn($this->lng->txt(
'role_assignment'));
65 $this->
setFormAction($ilCtrl->getFormAction($this->parent_obj,
"applyFilter"));
78 if ($this->
getMode() == self::MODE_USER_FOLDER) {
81 $cmds = $a_parent_obj->getUserMultiCommands();
82 foreach ($cmds as $cmd => $caption) {
96 $this->mode = $a_mode;
114 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
116 foreach ($user_defined_fields->getDefinitions() as $field => $definition) {
117 $this->udf_fields[
"udf_" . $field] =
array(
118 "txt" => $definition[
"field_name"],
120 "options" => $definition[
"field_values"],
121 "type" => $definition[
"field_type"],
134 if (isset($this->udf_fields[$a_key])) {
135 return $this->udf_fields[$a_key];
147 if (substr($a_key, 0, 4) ==
"udf_") {
164 include_once(
"./Services/User/classes/class.ilUserProfile.php");
166 $up->skipGroup(
"preferences");
167 $up->skipGroup(
"interests");
168 $up->skipGroup(
"settings");
175 "txt" => $lng->txt(
"firstname"),
178 "txt" => $lng->txt(
"lastname"),
180 if ($this->
getMode() == self::MODE_USER_FOLDER) {
181 $ufs = $up->getStandardFields();
183 $cols[
"access_until"] =
array(
184 "txt" => $lng->txt(
"access_until"),
186 $cols[
"last_login"] =
array(
187 "txt" => $lng->txt(
"last_login"),
191 $cols[
"create_date"] =
array(
192 "txt" => $lng->txt(
"create_date"));
193 $cols[
"approve_date"] =
array(
194 "txt" => $lng->txt(
"approve_date"));
195 $cols[
"agree_date"] =
array(
196 "txt" => $lng->txt(
"agree_date"));
198 $ufs = $up->getLocalUserAdministrationFields();
202 if (isset($ufs[
"email"])) {
203 $cols[
"email"] =
array(
204 "txt" => $lng->txt(
"email"),
207 if (isset($ufs[
"second_email"])) {
208 $cols[
"second_email"] =
array(
209 "txt" => $lng->txt(
"second_email"),
213 foreach ($ufs as $f => $fd) {
214 if (!isset($cols[$f]) && !$fd[
"lists_hide"]) {
216 $caption = $fd[
"lang_var"]
220 "txt" => $lng->txt($caption),
229 $cols[
"auth_mode"] =
array(
230 "txt" => $lng->txt(
"auth_mode"),
235 if ($this->
getMode() == self::MODE_USER_FOLDER) {
236 foreach ($this->udf_fields as $k => $field) {
242 unset($cols[
"username"]);
257 if ($this->
getMode() == self::MODE_USER_FOLDER) {
259 include_once
'./Services/User/classes/class.ilLocalUser.php';
262 if ($this->filter[
'time_limit_owner']) {
263 $user_filter =
array($this->filter[
'time_limit_owner']);
266 include_once
'./Services/User/classes/class.ilLocalUser.php';
272 if (!count($user_filter)) {
278 include_once(
"./Services/User/classes/class.ilUserQuery.php");
281 unset($additional_fields[
"firstname"]);
282 unset($additional_fields[
"lastname"]);
283 unset($additional_fields[
"email"]);
284 unset($additional_fields[
"second_email"]);
285 unset($additional_fields[
"last_login"]);
286 unset($additional_fields[
"access_until"]);
287 unset($additional_fields[
'org_units']);
289 $udf_filter =
array();
290 foreach ($this->filter as $k => $v) {
291 if (substr($k, 0, 4) ==
"udf_") {
292 $udf_filter[$k] = $v;
301 $query->setTextFilter($this->filter[
'query']);
302 $query->setActionFilter($this->filter[
'activation']);
303 $query->setLastLogin($this->filter[
'last_login']);
304 $query->setLimitedAccessFilter($this->filter[
'limited_access']);
305 $query->setNoCourseFilter($this->filter[
'no_courses']);
306 $query->setNoGroupFilter($this->filter[
'no_groups']);
307 $query->setCourseGroupFilter($this->filter[
'course_group']);
308 $query->setRoleFilter($this->filter[
'global_role']);
309 $query->setAdditionalFields($additional_fields);
310 $query->setUserFolder($user_filter);
311 $query->setUdfFilter($udf_filter);
313 $query->setAuthenticationFilter($this->filter[
'authentication']);
315 $usr_data =
$query->query();
318 if (count($usr_data[
"set"]) == 0 && $this->
getOffset() > 0) {
321 $usr_data =
$query->query();
324 foreach ($usr_data[
"set"] as $k => $user) {
330 $current_time =
time();
331 if ($user[
'active']) {
332 if ($user[
"time_limit_unlimited"]) {
333 $txt_access = $lng->txt(
"access_unlimited");
334 $usr_data[
"set"][$k][
"access_class"] =
"smallgreen";
335 } elseif ($user[
"time_limit_until"] < $current_time) {
336 $txt_access = $lng->txt(
"access_expired");
337 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
340 $usr_data[
"set"][$k][
"access_class"] =
"small";
343 $txt_access = $lng->txt(
"inactive");
344 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
346 $usr_data[
"set"][$k][
"access_until"] = $txt_access;
350 $this->
setData($usr_data[
"set"]);
355 if ($this->
getMode() == self::MODE_USER_FOLDER) {
357 include_once
'./Services/User/classes/class.ilLocalUser.php';
360 if ($this->filter[
'time_limit_owner']) {
361 $user_filter =
array($this->filter[
'time_limit_owner']);
364 include_once
'./Services/User/classes/class.ilLocalUser.php';
369 include_once(
"./Services/User/classes/class.ilUserQuery.php");
372 $query->setLimit(self::getAllCommandLimit());
373 $query->setTextFilter($this->filter[
'query']);
374 $query->setActionFilter($this->filter[
'activation']);
375 $query->setAuthenticationFilter($this->filter[
'authentication']);
376 $query->setLastLogin($this->filter[
'last_login']);
377 $query->setLimitedAccessFilter($this->filter[
'limited_access']);
378 $query->setNoCourseFilter($this->filter[
'no_courses']);
379 $query->setNoGroupFilter($this->filter[
'no_groups']);
380 $query->setCourseGroupFilter($this->filter[
'course_group']);
381 $query->setRoleFilter($this->filter[
'global_role']);
382 $query->setUserFolder($user_filter);
390 $usr_data =
$query->query();
393 foreach ($usr_data[
"set"] as $item) {
395 if ($item[
"usr_id"] != SYSTEM_USER_ID) {
396 $user_ids[] = $item[
"usr_id"];
412 if ($this->
getMode() == self::MODE_LOCAL_USER) {
413 include_once
'./Services/User/classes/class.ilLocalUser.php';
416 if (count($parent_ids) > 1) {
417 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
422 $opt[0] = $this->lng->txt(
'all_users');
425 foreach ($parent_ids as $parent_id) {
429 switch ($parent_id) {
439 $co->setOptions($opt);
441 $co->readFromSession();
442 $this->filter[
'time_limit_owner'] = $co->getValue();
447 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
448 $ul =
new ilTextInputGUI($lng->txt(
"login") .
"/" . $lng->txt(
"email") .
"/" .
449 $lng->txt(
"name"),
"query");
451 $this->getParentObject(),
452 "addUserAutoComplete",
457 $ul->setSubmitFormOnEnter(
true);
459 $ul->readFromSession();
460 $this->filter[
"query"] = $ul->getValue();
474 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
476 "" => $lng->txt(
"user_all"),
477 "active" => $lng->txt(
"active"),
478 "inactive" => $lng->txt(
"inactive"),
483 $si->readFromSession();
484 $this->filter[
"activation"] = $si->getValue();
487 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
488 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_limited_access"),
"limited_access");
490 $cb->readFromSession();
491 $this->filter[
"limited_access"] = $cb->getChecked();
494 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
495 $di =
new ilDateTimeInputGUI($this->lng->txt(
"user_last_login_before"),
"last_login");
500 $di->readFromSession();
501 $this->filter[
"last_login"] = $di->getDate();
503 if ($this->
getMode() == self::MODE_USER_FOLDER) {
505 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
508 $cb->readFromSession();
509 $this->filter[
"no_courses"] = $cb->getChecked();
512 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
515 $ng->readFromSession();
516 $this->filter[
'no_groups'] = $ng->getChecked();
519 include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
522 $rs->setHeaderMessage($lng->txt(
"user_please_select_course_group"));
523 $rs->setClickableTypes(
array(
"crs",
"grp"));
525 $rs->readFromSession();
526 $this->filter[
"course_group"] = $rs->getValue();
531 "" => $lng->txt(
"user_any"),
533 $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId());
534 foreach ($roles as $role) {
535 $options[$role[
"rol_id"]] = $role[
"title"];
537 $si =
new ilSelectInputGUI($this->lng->txt(
"user_global_role"),
"global_role");
540 $si->readFromSession();
541 $this->filter[
"global_role"] = $si->getValue();
546 "" => $lng->txt(
"user_any"),
548 foreach ($auth_methods as $method => $value) {
549 if ($method ==
'default') {
555 $si =
new ilSelectInputGUI($this->lng->txt(
"auth_mode"),
"authentication_method");
558 $si->readFromSession();
559 $this->filter[
"authentication"] = $si->getValue();
562 foreach ($this->udf_fields as
$id => $f) {
581 $caption = $lng->txt(
$id);
584 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
588 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
590 $sel_options =
array(
"" => $this->lng->txt(
"user_all"));
591 foreach ($a_options as $o) {
592 $sel_options[$o] = $o;
594 $item->setOptions($sel_options);
598 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
600 $item->setMaxLength(64);
611 $item->readFromSession();
612 $this->filter[
$id] = $item->getValue();
624 $ilCtrl->setParameterByClass(
"ilobjusergui",
"letter",
$_GET[
"letter"]);
627 if ($c ==
"access_until") {
628 $this->tpl->setCurrentBlock(
"access_until");
629 $this->tpl->setVariable(
"VAL_ACCESS_UNTIL", $user[
"access_until"]);
630 $this->tpl->setVariable(
"CLASS_ACCESS_UNTIL", $user[
"access_class"]);
631 } elseif ($c ==
"last_login") {
632 $this->tpl->setCurrentBlock(
"last_login");
633 $this->tpl->setVariable(
637 } elseif (in_array($c,
array(
"firstname",
"lastname"))) {
638 $this->tpl->setCurrentBlock($c);
639 $this->tpl->setVariable(
"VAL_" . strtoupper($c), (
string) $user[$c]);
640 } elseif ($c ==
'auth_mode') {
641 $this->tpl->setCurrentBlock(
'user_field');
643 $this->tpl->parseCurrentBlock();
645 $this->tpl->setCurrentBlock(
"user_field");
646 $val = (trim($user[$c]) ==
"")
649 if ($user[$c] !=
"") {
656 $val = $lng->txt(
"gender_" . $user[$c]);
667 $this->tpl->setVariable(
"VAL_UF", $val);
670 $this->tpl->parseCurrentBlock();
673 if ($user[
"usr_id"] != 6) {
674 if ($this->
getMode() == self::MODE_USER_FOLDER or $user[
'time_limit_owner'] == $this->
getUserFolderId()) {
675 $this->tpl->setCurrentBlock(
"checkb");
676 $this->tpl->setVariable(
"ID", $user[
"usr_id"]);
677 $this->tpl->parseCurrentBlock();
681 if ($this->
getMode() == self::MODE_USER_FOLDER or $user[
'time_limit_owner'] == $this->
getUserFolderId()) {
682 $this->tpl->setVariable(
"VAL_LOGIN", $user[
"login"]);
683 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id", $user[
"usr_id"]);
684 $this->tpl->setVariable(
686 $ilCtrl->getLinkTargetByClass(
"ilobjusergui",
"view")
688 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id",
"");
690 $this->tpl->setVariable(
'VAL_LOGIN_PLAIN', $user[
'login']);
693 if ($this->
getMode() == self::MODE_LOCAL_USER) {
694 $this->tpl->setCurrentBlock(
'context');
696 $this->tpl->parseCurrentBlock();
698 $this->tpl->setCurrentBlock(
'roles');
699 $ilCtrl->setParameter($this->
getParentObject(),
'obj_id', $user[
'usr_id']);
700 $this->tpl->setVariable(
'ROLE_LINK', $ilCtrl->getLinkTarget($this->getParentObject(),
'assignRoles'));
701 $this->tpl->setVariable(
'TXT_ROLES', $this->lng->txt(
'edit'));
703 $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.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
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()
getOrderDirection()
Get order direction.
static _getAuthMode($a_auth_mode, $a_db_handler='')
static _getAuthModeName($a_auth_key)
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.
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.
Create styles array
The data for the language used.
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.
static getAuthModeTranslation($a_auth_key)
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.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
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.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
setFilterCommand($a_val, $a_caption=null)
Set filter command.