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");
123 if($this->
getMode() == self::MODE_USER_FOLDER)
125 $ufs =
$up->getStandardFields();
127 $cols[
"firstname"] = array(
128 "txt" => $lng->txt(
"firstname"),
130 $cols[
"lastname"] = array(
131 "txt" => $lng->txt(
"lastname"),
133 $cols[
"email"] = array(
134 "txt" => $lng->txt(
"email"),
136 $cols[
"access_until"] = array(
137 "txt" => $lng->txt(
"access_until"),
139 $cols[
"last_login"] = array(
140 "txt" => $lng->txt(
"last_login"),
145 $ufs =
$up->getLocalUserAdministrationFields();
149 foreach ($ufs as
$f => $fd)
151 if (!isset($cols[
$f]) && !$fd[
"lists_hide"])
154 "txt" => $lng->txt($f),
160 unset($cols[
"username"]);
175 if($this->
getMode() == self::MODE_USER_FOLDER)
178 include_once
'./Services/User/classes/class.ilLocalUser.php';
183 if($this->filter[
'time_limit_owner'])
185 $user_filter = array($this->filter[
'time_limit_owner']);
190 include_once
'./Services/User/classes/class.ilLocalUser.php';
195 include_once(
"./Services/User/classes/class.ilUserQuery.php");
198 unset($additional_fields[
"firstname"]);
199 unset($additional_fields[
"lastname"]);
200 unset($additional_fields[
"email"]);
201 unset($additional_fields[
"last_login"]);
202 unset($additional_fields[
"access_until"]);
209 $this->filter[
"query"],
210 $this->filter[
"activation"],
211 $this->filter[
"last_login"],
212 $this->filter[
"limited_access"],
213 $this->filter[
"no_courses"],
214 $this->filter[
"course_group"],
215 $this->filter[
"global_role"],
222 if (count($usr_data[
"set"]) == 0 && $this->
getOffset() > 0)
230 $this->filter[
"query"],
231 $this->filter[
"activation"],
232 $this->filter[
"last_login"],
233 $this->filter[
"limited_access"],
234 $this->filter[
"no_courses"],
235 $this->filter[
"course_group"],
236 $this->filter[
"global_role"],
244 foreach ($usr_data[
"set"] as $k => $user)
246 $current_time = time();
249 if ($user[
"time_limit_unlimited"])
251 $txt_access = $lng->txt(
"access_unlimited");
252 $usr_data[
"set"][$k][
"access_class"] =
"smallgreen";
254 elseif ($user[
"time_limit_until"] < $current_time)
256 $txt_access = $lng->txt(
"access_expired");
257 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
262 $usr_data[
"set"][$k][
"access_class"] =
"small";
267 $txt_access = $lng->txt(
"inactive");
268 $usr_data[
"set"][$k][
"access_class"] =
"smallred";
270 $usr_data[
"set"][$k][
"access_until"] = $txt_access;
274 $this->
setData($usr_data[
"set"]);
283 global
$lng, $rbacreview, $ilUser;
287 if($this->
getMode() == self::MODE_LOCAL_USER)
289 include_once
'./Services/User/classes/class.ilLocalUser.php';
292 if(count($parent_ids) > 1)
294 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
299 $opt[0] = $this->lng->txt(
'all_users');
302 foreach($parent_ids as $parent_id)
319 $co->setOptions($opt);
321 $co->readFromSession();
322 $this->filter[
'time_limit_owner'] = $co->getValue();
327 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
328 $ti =
new ilTextInputGUI($lng->txt(
"login").
"/".$lng->txt(
"email").
"/".$lng->txt(
"name"),
"query");
331 $ti->setSubmitFormOnEnter(
true);
333 $ti->readFromSession();
334 $this->filter[
"query"] = $ti->getValue();
337 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
339 "" => $lng->txt(
"user_all"),
340 "active" => $lng->txt(
"active"),
341 "inactive" => $lng->txt(
"inactive"),
343 $si =
new ilSelectInputGUI($this->lng->txt(
"user_activation"),
"activation");
346 $si->readFromSession();
347 $this->filter[
"activation"] = $si->getValue();
350 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
351 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_limited_access"),
"limited_access");
353 $cb->readFromSession();
354 $this->filter[
"limited_access"] = $cb->getChecked();
357 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
358 $di =
new ilDateTimeInputGUI($this->lng->txt(
"user_last_login_before"),
"last_login");
363 $di->readFromSession();
364 $this->filter[
"last_login"] = $di->getDate();
366 if($this->
getMode() == self::MODE_USER_FOLDER)
369 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
372 $cb->readFromSession();
373 $this->filter[
"no_courses"] = $cb->getChecked();
376 include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
379 $rs->setHeaderMessage($lng->txt(
"user_please_select_course_group"));
380 $rs->setClickableTypes(array(
"crs",
"grp"));
382 $rs->readFromSession();
383 $this->filter[
"course_group"] = $rs->getValue();
388 "" => $lng->txt(
"user_any"),
390 $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId());
391 foreach ($roles as $role)
393 $options[$role[
"rol_id"]] = $role[
"title"];
395 $si =
new ilSelectInputGUI($this->lng->txt(
"user_global_role"),
"global_role");
398 $si->readFromSession();
399 $this->filter[
"global_role"] = $si->getValue();
409 $ilCtrl->setParameterByClass(
"ilobjusergui",
"letter",
$_GET[
"letter"]);
414 if ($c ==
"access_until")
416 $this->tpl->setCurrentBlock(
"access_until");
417 $this->tpl->setVariable(
"VAL_ACCESS_UNTIL", $user[
"access_until"]);
418 $this->tpl->setVariable(
"CLASS_ACCESS_UNTIL", $user[
"access_class"]);
420 else if ($c ==
"last_login")
422 $this->tpl->setCurrentBlock(
"last_login");
423 $this->tpl->setVariable(
"VAL_LAST_LOGIN",
426 else if (in_array($c, array(
"email",
"firstname",
"lastname")))
428 $this->tpl->setCurrentBlock($c);
429 $this->tpl->setVariable(
"VAL_".strtoupper($c), (
string) $user[$c]);
433 $this->tpl->setCurrentBlock(
"user_field");
434 $val = (trim($user[$c]) ==
"")
443 $val = $lng->txt(
"gender_".$user[$c]);
447 $this->tpl->setVariable(
"VAL_UF", $val);
450 $this->tpl->parseCurrentBlock();
453 if ($user[
"usr_id"] != 6)
457 $this->tpl->setCurrentBlock(
"checkb");
458 $this->tpl->setVariable(
"ID", $user[
"usr_id"]);
459 $this->tpl->parseCurrentBlock();
465 $this->tpl->setVariable(
"VAL_LOGIN", $user[
"login"]);
466 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id", $user[
"usr_id"]);
467 $this->tpl->setVariable(
"HREF_LOGIN",
468 $ilCtrl->getLinkTargetByClass(
"ilobjusergui",
"view"));
469 $ilCtrl->setParameterByClass(
"ilobjusergui",
"obj_id",
"");
473 $this->tpl->setVariable(
'VAL_LOGIN_PLAIN',$user[
'login']);
476 if($this->
getMode() == self::MODE_LOCAL_USER)
478 $this->tpl->setCurrentBlock(
'context');
480 $this->tpl->parseCurrentBlock();
482 $this->tpl->setCurrentBlock(
'roles');
483 $ilCtrl->setParameter($this->
getParentObject(),
'obj_id',$user[
'usr_id']);
484 $this->tpl->setVariable(
'ROLE_LINK',$ilCtrl->getLinkTarget($this->getParentObject(),
'assignRoles'));
485 $this->tpl->setVariable(
'TXT_ROLES',$this->lng->txt(
'edit'));
487 $this->tpl->parseCurrentBlock();