4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
26 function __construct($a_parent_obj, $a_parent_cmd, $a_mode = self::MODE_USER_FOLDER)
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)
71 if ($rbacsystem->checkAccess(
'delete', $a_parent_obj->object->getRefId()))
90 $this->mode = $a_mode;
115 include_once(
"./Services/User/classes/class.ilUserProfile.php");
117 $up->skipGroup(
"preferences");
118 $up->skipGroup(
"settings");
124 $cols[
"firstname"] = array(
125 "txt" => $lng->txt(
"firstname"),
127 $cols[
"lastname"] = array(
128 "txt" => $lng->txt(
"lastname"),
133 $ufs = $up->getStandardFields();
135 $cols[
"access_until"] = array(
136 "txt" => $lng->txt(
"access_until"),
138 $cols[
"last_login"] = array(
139 "txt" => $lng->txt(
"last_login"),
144 $ufs = $up->getLocalUserAdministrationFields();
148 if(isset($ufs[
"email"]))
150 $cols[
"email"] = array(
151 "txt" => $lng->txt(
"email"),
156 foreach ($ufs as $f => $fd)
158 if (!isset($cols[$f]) && !$fd[
"lists_hide"])
161 "txt" => $lng->txt($f),
167 unset($cols[
"username"]);
182 if($this->
getMode() == self::MODE_USER_FOLDER)
185 include_once
'./Services/User/classes/class.ilLocalUser.php';
190 if($this->filter[
'time_limit_owner'])
192 $user_filter = array($this->filter[
'time_limit_owner']);
197 include_once
'./Services/User/classes/class.ilLocalUser.php';
202 include_once(
"./Services/User/classes/class.ilUserQuery.php");
205 unset($additional_fields[
"firstname"]);
206 unset($additional_fields[
"lastname"]);
207 unset($additional_fields[
"email"]);
208 unset($additional_fields[
"last_login"]);
209 unset($additional_fields[
"access_until"]);
216 $this->filter[
"query"],
217 $this->filter[
"activation"],
218 $this->filter[
"last_login"],
219 $this->filter[
"limited_access"],
220 $this->filter[
"no_courses"],
221 $this->filter[
"course_group"],
222 $this->filter[
"global_role"],
229 if (count($usr_data[
"set"]) == 0 && $this->
getOffset() > 0)
237 $this->filter[
"query"],
238 $this->filter[
"activation"],
239 $this->filter[
"last_login"],
240 $this->filter[
"limited_access"],
241 $this->filter[
"no_courses"],
242 $this->filter[
"course_group"],
243 $this->filter[
"global_role"],
251 foreach ($usr_data[
"set"] as $k => $user)
253 $current_time = time();
256 if ($user[
"time_limit_unlimited"])
258 $txt_access = $lng->txt(
"access_unlimited");
259 $usr_data[
"set"][$k][
"access_class"] =
"smallgreen";
261 elseif ($user[
"time_limit_until"] < $current_time)
263 $txt_access = $lng->txt(
"access_expired");
264 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
269 $usr_data[
"set"][$k][
"access_class"] =
"small";
274 $txt_access = $lng->txt(
"inactive");
275 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
277 $usr_data[
"set"][$k][
"access_until"] = $txt_access;
281 $this->
setData($usr_data[
"set"]);
290 global
$lng, $rbacreview, $ilUser;
294 if($this->
getMode() == self::MODE_LOCAL_USER)
296 include_once
'./Services/User/classes/class.ilLocalUser.php';
299 if(count($parent_ids) > 1)
301 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
306 $opt[0] = $this->lng->txt(
'all_users');
309 foreach($parent_ids as $parent_id)
326 $co->setOptions($opt);
328 $co->readFromSession();
329 $this->filter[
'time_limit_owner'] = $co->getValue();
334 include_once(
"./Services/Form/classes/class.ilUserLoginAutoCompleteInputGUI.php");
336 $lng->txt(
"login").
"/".$lng->txt(
"email").
"/".$lng->txt(
"name"),
339 "addUserAutoComplete"
342 $ul->setSubmitFormOnEnter(
true);
344 $ul->readFromSession();
345 $this->filter[
"query"] = $ul->getValue();
359 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
361 "" => $lng->txt(
"user_all"),
362 "active" => $lng->txt(
"active"),
363 "inactive" => $lng->txt(
"inactive"),
365 $si =
new ilSelectInputGUI($this->lng->txt(
"user_activation"),
"activation");
368 $si->readFromSession();
369 $this->filter[
"activation"] = $si->getValue();
372 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
373 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_limited_access"),
"limited_access");
375 $cb->readFromSession();
376 $this->filter[
"limited_access"] = $cb->getChecked();
379 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
380 $di =
new ilDateTimeInputGUI($this->lng->txt(
"user_last_login_before"),
"last_login");
385 $di->readFromSession();
386 $this->filter[
"last_login"] = $di->getDate();
388 if($this->
getMode() == self::MODE_USER_FOLDER)
391 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
394 $cb->readFromSession();
395 $this->filter[
"no_courses"] = $cb->getChecked();
398 include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
401 $rs->setHeaderMessage($lng->txt(
"user_please_select_course_group"));
402 $rs->setClickableTypes(array(
"crs",
"grp"));
404 $rs->readFromSession();
405 $this->filter[
"course_group"] = $rs->getValue();
410 "" => $lng->txt(
"user_any"),
412 $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId());
413 foreach ($roles as $role)
415 $options[$role[
"rol_id"]] = $role[
"title"];
417 $si =
new ilSelectInputGUI($this->lng->txt(
"user_global_role"),
"global_role");
420 $si->readFromSession();
421 $this->filter[
"global_role"] = $si->getValue();
431 $ilCtrl->setParameterByClass(
"ilobjusergui",
"letter",
$_GET[
"letter"]);
436 if ($c ==
"access_until")
438 $this->tpl->setCurrentBlock(
"access_until");
439 $this->tpl->setVariable(
"VAL_ACCESS_UNTIL", $user[
"access_until"]);
440 $this->tpl->setVariable(
"CLASS_ACCESS_UNTIL", $user[
"access_class"]);
442 else if ($c ==
"last_login")
444 $this->tpl->setCurrentBlock(
"last_login");
445 $this->tpl->setVariable(
"VAL_LAST_LOGIN",
448 else if (in_array($c, array(
"firstname",
"lastname")))
450 $this->tpl->setCurrentBlock($c);
451 $this->tpl->setVariable(
"VAL_".strtoupper($c), (
string) $user[$c]);
455 $this->tpl->setCurrentBlock(
"user_field");
456 $val = (trim($user[$c]) ==
"")
469 $val = $lng->txt(
"gender_".$user[$c]);
473 $this->tpl->setVariable(
"VAL_UF", $val);
476 $this->tpl->parseCurrentBlock();
479 if ($user[
"usr_id"] != 6)
483 $this->tpl->setCurrentBlock(
"checkb");
484 $this->tpl->setVariable(
"ID", $user[
"usr_id"]);
485 $this->tpl->parseCurrentBlock();
491 $this->tpl->setVariable(
"VAL_LOGIN", $user[
"login"]);
492 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id", $user[
"usr_id"]);
493 $this->tpl->setVariable(
"HREF_LOGIN",
494 $ilCtrl->getLinkTargetByClass(
"ilobjusergui",
"view"));
495 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id",
"");
499 $this->tpl->setVariable(
'VAL_LOGIN_PLAIN',$user[
'login']);
502 if($this->
getMode() == self::MODE_LOCAL_USER)
504 $this->tpl->setCurrentBlock(
'context');
506 $this->tpl->parseCurrentBlock();
508 $this->tpl->setCurrentBlock(
'roles');
509 $ilCtrl->setParameter($this->
getParentObject(),
'obj_id',$user[
'usr_id']);
510 $this->tpl->setVariable(
'ROLE_LINK',$ilCtrl->getLinkTarget($this->getParentObject(),
'assignRoles'));
511 $this->tpl->setVariable(
'TXT_ROLES',$this->lng->txt(
'edit'));
513 $this->tpl->parseCurrentBlock();