Posted January 18, 20205 yr In external database I have users who I do not want to have access to forum. There is a column named 'status', and it has values from 1 to 9 for active users and 0 or -1 for not activated and banned users. When I write "status > 0" in field Additional clause: happens nothing.... Banned and not active users from external database can still authorise on forum. Tried different spellings, for example: `status` > 0 status = 1 status = 9999 Nothing can stop banned users from logging in. Even creating new field `active` in external database, filled with 0 (and writing "active=1" in additional clause, like in field description) doesn't help. Maybe someone had similar problems? How to handle it?
January 19, 20205 yr It's a bug. Submit a ticket. 17 hours ago, Genadii Skaraev said: How to handle it? system/Login/Handler/ExternalDatabase/ExternalDatabase.php Replace _getRowFromExternalDb method with public function _getRowFromExternalDb( $usernameOrEmail ) { /* Build where clause */ $where = array(); switch ( $this->authType() ) { case \IPS\Login::AUTH_TYPE_USERNAME: $where[] = array( "{$this->settings['db_col_user']}=?", $usernameOrEmail ); break; case \IPS\Login::AUTH_TYPE_EMAIL: $where[] = array( "{$this->settings['db_col_email']}=?", $usernameOrEmail ); break; case \IPS\Login::AUTH_TYPE_USERNAME + \IPS\Login::AUTH_TYPE_EMAIL: $where[] = array( "({$this->settings['db_col_user']}=? OR {$this->settings['db_col_email']}=?)", $usernameOrEmail, $usernameOrEmail ); break; } if ( $this->settings['db_extra'] ) { $where[] = array( $this->settings['db_extra'] ); } /* Fetch */ return $this->_externalDb()->select( '*', $this->settings['db_table'], $where )->first(); }
Archived
This topic is now archived and is closed to further replies.