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.ilTextInputGUI.php");
335 $ti =
new ilTextInputGUI($lng->txt(
"login").
"/".$lng->txt(
"email").
"/".$lng->txt(
"name"),
"query");
338 $ti->setSubmitFormOnEnter(
true);
340 $ti->readFromSession();
341 $this->filter[
"query"] = $ti->getValue();
344 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
346 "" => $lng->txt(
"user_all"),
347 "active" => $lng->txt(
"active"),
348 "inactive" => $lng->txt(
"inactive"),
350 $si =
new ilSelectInputGUI($this->lng->txt(
"user_activation"),
"activation");
353 $si->readFromSession();
354 $this->filter[
"activation"] = $si->getValue();
357 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
358 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_limited_access"),
"limited_access");
360 $cb->readFromSession();
361 $this->filter[
"limited_access"] = $cb->getChecked();
364 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
365 $di =
new ilDateTimeInputGUI($this->lng->txt(
"user_last_login_before"),
"last_login");
370 $di->readFromSession();
371 $this->filter[
"last_login"] = $di->getDate();
373 if($this->
getMode() == self::MODE_USER_FOLDER)
376 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
379 $cb->readFromSession();
380 $this->filter[
"no_courses"] = $cb->getChecked();
383 include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
386 $rs->setHeaderMessage($lng->txt(
"user_please_select_course_group"));
387 $rs->setClickableTypes(array(
"crs",
"grp"));
389 $rs->readFromSession();
390 $this->filter[
"course_group"] = $rs->getValue();
395 "" => $lng->txt(
"user_any"),
397 $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId());
398 foreach ($roles as $role)
400 $options[$role[
"rol_id"]] = $role[
"title"];
402 $si =
new ilSelectInputGUI($this->lng->txt(
"user_global_role"),
"global_role");
405 $si->readFromSession();
406 $this->filter[
"global_role"] = $si->getValue();
416 $ilCtrl->setParameterByClass(
"ilobjusergui",
"letter",
$_GET[
"letter"]);
421 if ($c ==
"access_until")
423 $this->tpl->setCurrentBlock(
"access_until");
424 $this->tpl->setVariable(
"VAL_ACCESS_UNTIL",
$user[
"access_until"]);
425 $this->tpl->setVariable(
"CLASS_ACCESS_UNTIL",
$user[
"access_class"]);
427 else if ($c ==
"last_login")
429 $this->tpl->setCurrentBlock(
"last_login");
430 $this->tpl->setVariable(
"VAL_LAST_LOGIN",
433 else if (in_array($c, array(
"firstname",
"lastname")))
435 $this->tpl->setCurrentBlock($c);
436 $this->tpl->setVariable(
"VAL_".strtoupper($c), (
string)
$user[$c]);
440 $this->tpl->setCurrentBlock(
"user_field");
441 $val = (trim(
$user[$c]) ==
"")
454 $val = $lng->txt(
"gender_".
$user[$c]);
458 $this->tpl->setVariable(
"VAL_UF", $val);
461 $this->tpl->parseCurrentBlock();
464 if (
$user[
"usr_id"] != 6)
468 $this->tpl->setCurrentBlock(
"checkb");
469 $this->tpl->setVariable(
"ID",
$user[
"usr_id"]);
470 $this->tpl->parseCurrentBlock();
476 $this->tpl->setVariable(
"VAL_LOGIN",
$user[
"login"]);
477 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id",
$user[
"usr_id"]);
478 $this->tpl->setVariable(
"HREF_LOGIN",
479 $ilCtrl->getLinkTargetByClass(
"ilobjusergui",
"view"));
480 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id",
"");
484 $this->tpl->setVariable(
'VAL_LOGIN_PLAIN',
$user[
'login']);
487 if($this->
getMode() == self::MODE_LOCAL_USER)
489 $this->tpl->setCurrentBlock(
'context');
491 $this->tpl->parseCurrentBlock();
493 $this->tpl->setCurrentBlock(
'roles');
495 $this->tpl->setVariable(
'ROLE_LINK',$ilCtrl->getLinkTarget($this->getParentObject(),
'assignRoles'));
496 $this->tpl->setVariable(
'TXT_ROLES',$this->lng->txt(
'edit'));
498 $this->tpl->parseCurrentBlock();