1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/9687] Improve display of ban options and update tests

PHPBB3-9687
This commit is contained in:
Marc Alexander
2023-07-30 09:35:06 +02:00
parent 7b551adb2b
commit dcbd4a54aa
7 changed files with 67 additions and 36 deletions

View File

@@ -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;

View File

@@ -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);