/** * @param Gpf_Auth_Info $authInfo * @return Gpf_SqlBuilder_SelectBuilder */ protected function createAuthSelect(Gpf_Auth_Info $authInfo) { $select = new Gpf_SqlBuilder_SelectBuilder(); $select->select->add('u.accountuserid', 'accountuserid'); $select->select->add('r.roletype', 'roletypeid'); $select->select->add('r.roleid', 'roleid'); $select->select->add('au.authid', 'authid'); $select->select->add('au.authtoken', 'authtoken'); $select->select->add('au.username', 'username'); $select->select->add('au.firstname', 'firstname'); $select->select->add('au.lastname', 'lastname'); $select->select->add('au.ip', 'ip'); $select->select->add('u.accountid', 'accountid'); $select->select->add('u.rstatus', 'rstatus'); $select->from->add(Gpf_Db_Table_Users::getName(), 'u'); $select->from->addInnerJoin('qu_g_authusers', 'au', 'u.authid=au.authid'); $select->from->addInnerJoin('qu_g_roles', 'r', 'u.roleid=r.roleid'); $authInfo->addWhere($select); return $select; }
public function addWhere(Gpf_SqlBuilder_SelectBuilder $builder) { parent::addWhere($builder); $builder->where->add('au.username', '=', $this->username); $builder->where->add('au.rpassword', '=', $this->password); }
/** * * @param Gpf_Auth_Info $authInfo * @return Gpf_Data_RecordSet */ public static function getAccounts(Gpf_Auth_Info $authInfo) { $select = new Gpf_SqlBuilder_SelectBuilder(); $select->select->add('a.accountid', 'accountid'); $select->select->add('a.name', 'name'); $select->from->add(Gpf_Db_Table_AuthUsers::getName(), 'au'); $select->from->addInnerJoin(Gpf_Db_Table_Users::getName(), 'u', 'au.authid=u.authid'); $select->from->addInnerJoin(self::getName(), 'a', 'a.accountid=u.accountid'); $select->from->addInnerJoin(Gpf_Db_Table_Roles::getName(), 'r', 'u.roleid=r.roleid'); $authInfo->addWhere($select); $select->where->add('a.rstatus', 'IN', array(Gpf_Db_Account::APPROVED, Gpf_Db_Account::SUSPENDED)); return $select->getAllRows(); }
public function addWhere(Gpf_SqlBuilder_SelectBuilder $builder) { parent::addWhere($builder); $builder->where->add('au.authtoken', '=', $this->authToken); }