/** * Init * @return */ private function init() { if (ilUserAccountSettings::getInstance()->isUserAccessRestricted()) { include_once './Services/User/classes/class.ilLocalUser.php'; $this->folder_ids = ilLocalUser::_getFolderIds(); } }
function _getAllUserIds($a_filter = 0) { global $ilDB; switch ($a_filter) { case 0: if (ilLocalUser::_getFolderIds()) { $where = "WHERE " . $ilDB->in("time_limit_owner", ilLocalUser::_getFolderIds(), false, "integer") . " "; //$where .= '('; //$where .= implode(",",ilUtil::quoteArray(ilLocalUser::_getFolderIds())); //$where .= ')'; } else { //$where = "WHERE time_limit_owner IN ('')"; return array(); } break; default: $where = "WHERE time_limit_owner = " . $ilDB->quote($a_filter, "integer") . " "; break; } $query = "SELECT usr_id FROM usr_data " . $where; $res = $ilDB->query($query); while ($row = $ilDB->fetchObject($res)) { $users[] = $row->usr_id; } return $users ? $users : array(); }
/** * Init filter */ function initFilter() { global $lng, $rbacreview, $ilUser, $ilCtrl; // Show context filter if ($this->getMode() == self::MODE_LOCAL_USER) { include_once './Services/User/classes/class.ilLocalUser.php'; $parent_ids = ilLocalUser::_getFolderIds(); if (count($parent_ids) > 1) { include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $co = new ilSelectInputGUI($lng->txt('context'), 'time_limit_owner'); $ref_id = $this->getUserFolderId(); $opt[0] = $this->lng->txt('all_users'); $opt[$this->getUserFolderId()] = $lng->txt('users') . ' (' . ilObject::_lookupTitle(ilObject::_lookupObjId($this->getUserFolderId())) . ')'; foreach ($parent_ids as $parent_id) { if ($parent_id == $this->getUserFolderId()) { continue; } switch ($parent_id) { case USER_FOLDER_ID: $opt[USER_FOLDER_ID] = $lng->txt('global_user'); break; default: $opt[$parent_id] = $lng->txt('users') . ' (' . ilObject::_lookupTitle(ilObject::_lookupObjId($parent_id)) . ')'; break; } } $co->setOptions($opt); $this->addFilterItem($co); $co->readFromSession(); $this->filter['time_limit_owner'] = $co->getValue(); } } // User name, login, email filter include_once "./Services/Form/classes/class.ilTextInputGUI.php"; $ul = new ilTextInputGUI($lng->txt("login") . "/" . $lng->txt("email") . "/" . $lng->txt("name"), "query"); $ul->setDataSource($ilCtrl->getLinkTarget($this->getParentObject(), "addUserAutoComplete", "", true)); $ul->setSize(20); $ul->setSubmitFormOnEnter(true); $this->addFilterItem($ul); $ul->readFromSession(); $this->filter["query"] = $ul->getValue(); /* include_once("./Services/Form/classes/class.ilTextInputGUI.php"); $ti = new ilTextInputGUI($lng->txt("login")."/".$lng->txt("email")."/".$lng->txt("name"), "query"); $ti->setMaxLength(64); $ti->setSize(20); $ti->setSubmitFormOnEnter(true); $this->addFilterItem($ti); $ti->readFromSession(); $this->filter["query"] = $ti->getValue(); */ // activation include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $options = array("" => $lng->txt("user_all"), "active" => $lng->txt("active"), "inactive" => $lng->txt("inactive")); $si = new ilSelectInputGUI($this->lng->txt("user_activation"), "activation"); $si->setOptions($options); $this->addFilterItem($si); $si->readFromSession(); $this->filter["activation"] = $si->getValue(); // limited access include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php"; $cb = new ilCheckboxInputGUI($this->lng->txt("user_limited_access"), "limited_access"); $this->addFilterItem($cb); $cb->readFromSession(); $this->filter["limited_access"] = $cb->getChecked(); // last login include_once "./Services/Form/classes/class.ilDateTimeInputGUI.php"; $di = new ilDateTimeInputGUI($this->lng->txt("user_last_login_before"), "last_login"); $default_date = new ilDateTime(time(), IL_CAL_UNIX); $default_date->increment(IL_CAL_DAY, 1); $di->setDate($default_date); $this->addFilterItem($di); $di->readFromSession(); $this->filter["last_login"] = $di->getDate(); if ($this->getMode() == self::MODE_USER_FOLDER) { // no assigned courses include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php"; $cb = new ilCheckboxInputGUI($this->lng->txt("user_no_courses"), "no_courses"); $this->addFilterItem($cb); $cb->readFromSession(); $this->filter["no_courses"] = $cb->getChecked(); // no assigned groups include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php"; $ng = new ilCheckboxInputGUI($this->lng->txt("user_no_groups"), "no_groups"); $this->addFilterItem($ng); $ng->readFromSession(); $this->filter['no_groups'] = $ng->getChecked(); // course/group members include_once "./Services/Form/classes/class.ilRepositorySelectorInputGUI.php"; $rs = new ilRepositorySelectorInputGUI($lng->txt("user_member_of_course_group"), "course_group"); $rs->setSelectText($lng->txt("user_select_course_group")); $rs->setHeaderMessage($lng->txt("user_please_select_course_group")); $rs->setClickableTypes(array("crs", "grp")); $this->addFilterItem($rs); $rs->readFromSession(); $this->filter["course_group"] = $rs->getValue(); } // global roles $options = array("" => $lng->txt("user_any")); $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId()); foreach ($roles as $role) { $options[$role["rol_id"]] = $role["title"]; } $si = new ilSelectInputGUI($this->lng->txt("user_global_role"), "global_role"); $si->setOptions($options); $this->addFilterItem($si); $si->readFromSession(); $this->filter["global_role"] = $si->getValue(); }