protected function getUserdata() { //get userdata //isEnabled = user has activate account //isBlocked = user can not access the account, default by admin or mod //isRemoved = user or admin has mark this account for removal $sql = \OGM\OGM::getDB()->prepare("\n SELECT loDa.*, usDa.*, usOp.*\n FROM\n " . SYS_DB_TABLE_LOGIN_DATA . " AS loDa\n " . SYS_DB_TABLE_USER_DATA . " AS usDa\n " . SYS_DB_TABLE_USER_OPTION . " AS usOp\n WHERE\n userID = ? AND\n loDa.isEnabled = 1 AND\n loDa.isBlocked = 0 AND\n loDa.isRemoved = 0"); $sql->bindValue(1, $this->userID); $sql->execute(); $this->userdata = \OGM\OGM::getDB()->fetchArray($sql); }
public static function verify($userID) { if (empty($userID)) { throw new \OGM\Exception\SystemException('Invalid userID ' . $userID); } //get data $data = \OGM\OGM::getDB()->prepare("\n SELECT *\n FROM\n " . SYS_DB_TABLE_LOGIN_DATA . "\n WHERE\n userID = ?"); $data->bindValue(1, $userID); $data->execute(); $item = \OGM\OGM::getDB()->fetchArray($data); if ($item['userID'] > 0) { return true; } else { return false; } }