mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[ticket/9687] Improve display of ban options and update tests
PHPBB3-9687
This commit is contained in:
@@ -22,6 +22,7 @@ services:
|
||||
class: \phpbb\ban\type\email
|
||||
arguments:
|
||||
- '@dbal.conn'
|
||||
- '%tables.bans%'
|
||||
- '%tables.users%'
|
||||
- '%tables.sessions%'
|
||||
- '%tables.sessions_keys%'
|
||||
@@ -32,6 +33,7 @@ services:
|
||||
class: \phpbb\ban\type\ip
|
||||
arguments:
|
||||
- '@dbal.conn'
|
||||
- '%tables.bans%'
|
||||
- '%tables.users%'
|
||||
- '%tables.sessions%'
|
||||
- '%tables.sessions_keys%'
|
||||
@@ -42,6 +44,7 @@ services:
|
||||
class: \phpbb\ban\type\user
|
||||
arguments:
|
||||
- '@dbal.conn'
|
||||
- '%tables.bans%'
|
||||
- '%tables.users%'
|
||||
- '%tables.sessions%'
|
||||
- '%tables.sessions_keys%'
|
||||
|
@@ -23,6 +23,9 @@ abstract class base implements type_interface
|
||||
/** @var array */
|
||||
protected $excluded;
|
||||
|
||||
/** @var string */
|
||||
protected $bans_table;
|
||||
|
||||
/** @var string */
|
||||
protected $sessions_keys_table;
|
||||
|
||||
@@ -39,11 +42,12 @@ abstract class base implements type_interface
|
||||
* Creates a ban type.
|
||||
*
|
||||
* @param driver_interface $db A phpBB DBAL object
|
||||
* @param string $users_table The users table
|
||||
* @param string $sessions_table The sessions table
|
||||
* @param string $sessions_keys_table The sessions keys table
|
||||
* @param string $bans_table The bans table
|
||||
* @param string $users_table The users table
|
||||
* @param string $sessions_table The sessions table
|
||||
* @param string $sessions_keys_table The sessions keys table
|
||||
*/
|
||||
public function __construct(driver_interface $db, string $users_table, string $sessions_table, string $sessions_keys_table)
|
||||
public function __construct(driver_interface $db, string $bans_table, string $users_table, string $sessions_table, string $sessions_keys_table)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->users_table = $users_table;
|
||||
|
@@ -86,7 +86,7 @@ class user extends base
|
||||
$result = $this->db->sql_query($sql);
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$row['ban_item'] = $row['username'];
|
||||
$row['ban_item'] = $row['username'] ?: $row['ban_item'];
|
||||
$ban_options[] = $row;
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
|
Reference in New Issue
Block a user