Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Genadii Skaraev Posted January 18, 2020 Posted January 18, 2020 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?
newbie LAC Posted January 19, 2020 Posted January 19, 2020 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(); }
Genadii Skaraev Posted January 19, 2020 Author Posted January 19, 2020 It works. Thank you very much!
bfarber Posted January 20, 2020 Posted January 20, 2020 I've added a bug report to have this checked into, thanks.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.