public static function get_users($pagination = null) { $term = Input::GET('search'); $results = \Model\Auth_User::query()->related('metadata')->where('username', 'LIKE', '%' . $term . '%')->or_where('email', 'LIKE', '%' . $term . '%')->or_where_open()->where('metadata.value', 'LIKE', '%' . $term . '%')->where('metadata.key', 'fullname')->or_where_close(); if (empty($pagination) === false) { $results = $results->rows_offset($pagination->offset)->rows_limit($pagination->per_page)->get(); } else { $results = $results->count(); } return $results; }
/** * Check for login * * @return bool */ protected function perform_check() { // get the username and login hash from the session $username = \Session::get('username'); $login_hash = \Session::get('login_hash'); // only worth checking if there's both a username and login-hash if (!empty($username) and !empty($login_hash)) { // if we don't have a user, or we're logging in from guest mode if (is_null($this->user) or $this->user->username != $username and $this->user->id == 0) { // find the user $this->user = \Model\Auth_User::query()->select(\Config::get('ormauth.table_columns', array()))->related('metadata')->where('username', '=', $username)->get_one(); } // return true when login was verified, and either the hash matches or multiple logins are allowed if ($this->user and (\Config::get('ormauth.multiple_logins', false) or $this->user['login_hash'] === $login_hash)) { return true; } } elseif (static::$remember_me and $user_id = static::$remember_me->get('user_id', null)) { return $this->force_login($user_id); } //var_dump(static::$remember_me);die(); // force a logout $this->logout(); return false; }