public function account($managerId) { $users = new User($managerId); $users->getManagerUsers(); $members = $this->ion_auth->getUsersByGroup('members'); $freeusers = $members->getFreeUsersDropdown($managerId); $this->template->set('users', $users); $this->template->set('freeusers', $freeusers); $this->template->set('c_user', $this->c_user); $this->template->set('managerAccount', $managerId); $this->template->render(); }
public function account($managerId) { $limit = $this->config->config['users_on_page']; $page = !empty($_GET['page']) ? $_GET['page'] : 1; if ($page == 1) { $offset = ''; } else { $offset = $limit * ($page - 1); } $users = new User($managerId); $search = Arr::get($_GET, 'search', ''); $filter = Arr::get($_GET, 'filter', ''); $group = $this->config->item('default_group', 'ion_auth'); if ($filter != '' || $search) { $users->search($search, $filter, null, $limit, $offset, $managerId); JsSettings::instance()->add(array('search' => $search, 'filter' => $filter, 'group' => $group)); $searchList = true; } else { $users->getManagerUsers($limit, $offset); $searchList = false; } $groupId = $this->ion_auth->getGroupByName($group)->id; $members = $this->ion_auth->getUsersByGroup($group); if ($members) { $members = $members->getFreeUsersDropdown($managerId, $groupId); } $limit = $this->config->config['users_on_page']; $this->template->set('searchList', $searchList); $this->template->set('limit', $limit); $this->template->set('users', $users); $this->template->set('freeusers', $members); $this->template->set('page', $page); $this->template->set('c_user', $this->c_user); $this->template->set('group', $group); $this->template->set('managerAccount', $managerId); $this->template->render(); }