4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
26 function __construct($a_parent_obj, $a_parent_cmd, $a_mode = self::MODE_USER_FOLDER, $a_load_items =
true)
30 $this->user_folder_id = $a_parent_obj->object->getRefId();
39 $this->
addColumn($this->lng->txt(
"login"),
"login");
43 $this->
addColumn($this->lng->txt($c), $c);
48 $this->
addColumn($this->lng->txt(
'context'),
'time_limit_owner');
49 $this->
addColumn($this->lng->txt(
'role_assignment'));
56 $this->
setFormAction($ilCtrl->getFormAction($this->parent_obj,
"applyFilter"));
69 if($this->
getMode() == self::MODE_USER_FOLDER)
73 $cmds = $a_parent_obj->getUserMultiCommands();
74 foreach($cmds as
$cmd => $caption)
92 $this->mode = $a_mode;
117 include_once(
"./Services/User/classes/class.ilUserProfile.php");
119 $up->skipGroup(
"preferences");
120 $up->skipGroup(
"settings");
126 $cols[
"firstname"] = array(
127 "txt" => $lng->txt(
"firstname"),
129 $cols[
"lastname"] = array(
130 "txt" => $lng->txt(
"lastname"),
135 $ufs = $up->getStandardFields();
137 $cols[
"access_until"] = array(
138 "txt" => $lng->txt(
"access_until"),
140 $cols[
"last_login"] = array(
141 "txt" => $lng->txt(
"last_login"),
146 $ufs = $up->getLocalUserAdministrationFields();
150 if(isset($ufs[
"email"]))
152 $cols[
"email"] = array(
153 "txt" => $lng->txt(
"email"),
158 foreach ($ufs as $f => $fd)
160 if (!isset($cols[$f]) && !$fd[
"lists_hide"])
163 "txt" => $lng->txt($f),
169 unset($cols[
"username"]);
184 if($this->
getMode() == self::MODE_USER_FOLDER)
187 include_once
'./Services/User/classes/class.ilLocalUser.php';
192 if($this->filter[
'time_limit_owner'])
194 $user_filter = array($this->filter[
'time_limit_owner']);
199 include_once
'./Services/User/classes/class.ilLocalUser.php';
204 include_once(
"./Services/User/classes/class.ilUserQuery.php");
207 unset($additional_fields[
"firstname"]);
208 unset($additional_fields[
"lastname"]);
209 unset($additional_fields[
"email"]);
210 unset($additional_fields[
"last_login"]);
211 unset($additional_fields[
"access_until"]);
218 $this->filter[
"query"],
219 $this->filter[
"activation"],
220 $this->filter[
"last_login"],
221 $this->filter[
"limited_access"],
222 $this->filter[
"no_courses"],
223 $this->filter[
"course_group"],
224 $this->filter[
"global_role"],
231 if (count($usr_data[
"set"]) == 0 && $this->
getOffset() > 0)
239 $this->filter[
"query"],
240 $this->filter[
"activation"],
241 $this->filter[
"last_login"],
242 $this->filter[
"limited_access"],
243 $this->filter[
"no_courses"],
244 $this->filter[
"course_group"],
245 $this->filter[
"global_role"],
253 foreach ($usr_data[
"set"] as $k => $user)
255 $current_time = time();
258 if ($user[
"time_limit_unlimited"])
260 $txt_access = $lng->txt(
"access_unlimited");
261 $usr_data[
"set"][$k][
"access_class"] =
"smallgreen";
263 elseif ($user[
"time_limit_until"] < $current_time)
265 $txt_access = $lng->txt(
"access_expired");
266 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
271 $usr_data[
"set"][$k][
"access_class"] =
"small";
276 $txt_access = $lng->txt(
"inactive");
277 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
279 $usr_data[
"set"][$k][
"access_until"] = $txt_access;
283 $this->
setData($usr_data[
"set"]);
288 if($this->
getMode() == self::MODE_USER_FOLDER)
291 include_once
'./Services/User/classes/class.ilLocalUser.php';
296 if($this->filter[
'time_limit_owner'])
298 $user_filter = array($this->filter[
'time_limit_owner']);
303 include_once
'./Services/User/classes/class.ilLocalUser.php';
308 include_once(
"./Services/User/classes/class.ilUserQuery.php");
313 self::getAllCommandLimit(),
314 $this->filter[
"query"],
315 $this->filter[
"activation"],
316 $this->filter[
"last_login"],
317 $this->filter[
"limited_access"],
318 $this->filter[
"no_courses"],
319 $this->filter[
"course_group"],
320 $this->filter[
"global_role"],
328 foreach($usr_data[
"set"] as $item)
331 if($item[
"usr_id"] != SYSTEM_USER_ID)
333 $user_ids[] = $item[
"usr_id"];
349 if($this->
getMode() == self::MODE_LOCAL_USER)
351 include_once
'./Services/User/classes/class.ilLocalUser.php';
354 if(count($parent_ids) > 1)
356 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
361 $opt[0] = $this->lng->txt(
'all_users');
364 foreach($parent_ids as $parent_id)
381 $co->setOptions($opt);
383 $co->readFromSession();
384 $this->filter[
'time_limit_owner'] = $co->getValue();
389 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
390 $ul =
new ilTextInputGUI($lng->txt(
"login").
"/".$lng->txt(
"email").
"/".
391 $lng->txt(
"name"),
"query");
392 $ul->
setDataSource($ilCtrl->getLinkTarget($this->getParentObject(),
393 "addUserAutoComplete",
"",
true));
395 $ul->setSubmitFormOnEnter(
true);
397 $ul->readFromSession();
398 $this->filter[
"query"] = $ul->getValue();
412 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
414 "" => $lng->txt(
"user_all"),
415 "active" => $lng->txt(
"active"),
416 "inactive" => $lng->txt(
"inactive"),
421 $si->readFromSession();
422 $this->filter[
"activation"] = $si->getValue();
425 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
426 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_limited_access"),
"limited_access");
428 $cb->readFromSession();
429 $this->filter[
"limited_access"] = $cb->getChecked();
432 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
433 $di =
new ilDateTimeInputGUI($this->lng->txt(
"user_last_login_before"),
"last_login");
438 $di->readFromSession();
439 $this->filter[
"last_login"] = $di->getDate();
441 if($this->
getMode() == self::MODE_USER_FOLDER)
444 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
447 $cb->readFromSession();
448 $this->filter[
"no_courses"] = $cb->getChecked();
451 include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
454 $rs->setHeaderMessage($lng->txt(
"user_please_select_course_group"));
455 $rs->setClickableTypes(array(
"crs",
"grp"));
457 $rs->readFromSession();
458 $this->filter[
"course_group"] = $rs->getValue();
463 "" => $lng->txt(
"user_any"),
465 $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId());
466 foreach ($roles as $role)
468 $options[$role[
"rol_id"]] = $role[
"title"];
470 $si =
new ilSelectInputGUI($this->lng->txt(
"user_global_role"),
"global_role");
473 $si->readFromSession();
474 $this->filter[
"global_role"] = $si->getValue();
484 $ilCtrl->setParameterByClass(
"ilobjusergui",
"letter",
$_GET[
"letter"]);
489 if ($c ==
"access_until")
491 $this->tpl->setCurrentBlock(
"access_until");
492 $this->tpl->setVariable(
"VAL_ACCESS_UNTIL", $user[
"access_until"]);
493 $this->tpl->setVariable(
"CLASS_ACCESS_UNTIL", $user[
"access_class"]);
495 else if ($c ==
"last_login")
497 $this->tpl->setCurrentBlock(
"last_login");
498 $this->tpl->setVariable(
"VAL_LAST_LOGIN",
501 else if (in_array($c, array(
"firstname",
"lastname")))
503 $this->tpl->setCurrentBlock($c);
504 $this->tpl->setVariable(
"VAL_".strtoupper($c), (
string) $user[$c]);
508 $this->tpl->setCurrentBlock(
"user_field");
509 $val = (trim($user[$c]) ==
"")
522 $val = $lng->txt(
"gender_".$user[$c]);
526 $this->tpl->setVariable(
"VAL_UF", $val);
529 $this->tpl->parseCurrentBlock();
532 if ($user[
"usr_id"] != 6)
536 $this->tpl->setCurrentBlock(
"checkb");
537 $this->tpl->setVariable(
"ID", $user[
"usr_id"]);
538 $this->tpl->parseCurrentBlock();
544 $this->tpl->setVariable(
"VAL_LOGIN", $user[
"login"]);
545 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id", $user[
"usr_id"]);
546 $this->tpl->setVariable(
"HREF_LOGIN",
547 $ilCtrl->getLinkTargetByClass(
"ilobjusergui",
"view"));
548 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id",
"");
552 $this->tpl->setVariable(
'VAL_LOGIN_PLAIN',$user[
'login']);
555 if($this->
getMode() == self::MODE_LOCAL_USER)
557 $this->tpl->setCurrentBlock(
'context');
559 $this->tpl->parseCurrentBlock();
561 $this->tpl->setCurrentBlock(
'roles');
562 $ilCtrl->setParameter($this->
getParentObject(),
'obj_id',$user[
'usr_id']);
563 $this->tpl->setVariable(
'ROLE_LINK',$ilCtrl->getLinkTarget($this->getParentObject(),
'assignRoles'));
564 $this->tpl->setVariable(
'TXT_ROLES',$this->lng->txt(
'edit'));
566 $this->tpl->parseCurrentBlock();