aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_ban.php55
-rw-r--r--phpBB/includes/acp/acp_board.php2
-rw-r--r--phpBB/includes/acp/acp_database.php28
-rw-r--r--phpBB/includes/acp/acp_extensions.php12
-rw-r--r--phpBB/includes/acp/acp_forums.php2
-rw-r--r--phpBB/includes/acp/acp_icons.php2
-rw-r--r--phpBB/includes/acp/acp_main.php14
-rw-r--r--phpBB/includes/acp/acp_permission_roles.php6
-rw-r--r--phpBB/includes/acp/acp_permissions.php2
-rw-r--r--phpBB/includes/acp/acp_profile.php4
-rw-r--r--phpBB/includes/acp/acp_prune.php4
-rw-r--r--phpBB/includes/acp/acp_reasons.php2
-rw-r--r--phpBB/includes/acp/acp_styles.php4
-rw-r--r--phpBB/includes/acp/acp_users.php4
-rw-r--r--phpBB/includes/acp/auth.php2
15 files changed, 60 insertions, 83 deletions
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php
index 7cc6741e23..361ef2666c 100644
--- a/phpBB/includes/acp/acp_ban.php
+++ b/phpBB/includes/acp/acp_ban.php
@@ -176,8 +176,6 @@ class acp_ban
$result = $db->sql_query($sql);
$banned_options = $excluded_options = array();
- $ban_length = $ban_reasons = $ban_give_reasons = array();
-
while ($row = $db->sql_fetchrow($result))
{
$option = '<option value="' . $row['ban_id'] . '">' . $row[$field] . '</option>';
@@ -196,60 +194,31 @@ class acp_ban
if ($time_length == 0)
{
// Banned permanently
- $ban_length[$row['ban_id']] = $user->lang['PERMANENT'];
+ $ban_length = $user->lang['PERMANENT'];
}
else if (isset($ban_end_text[$time_length]))
{
// Banned for a given duration
- $ban_length[$row['ban_id']] = sprintf($user->lang['BANNED_UNTIL_DURATION'], $ban_end_text[$time_length], $user->format_date($row['ban_end'], false, true));
+ $ban_length = $user->lang('BANNED_UNTIL_DURATION', $ban_end_text[$time_length], $user->format_date($row['ban_end'], false, true));
}
else
{
// Banned until given date
- $ban_length[$row['ban_id']] = sprintf($user->lang['BANNED_UNTIL_DATE'], $user->format_date($row['ban_end'], false, true));
+ $ban_length = $user->lang('BANNED_UNTIL_DATE', $user->format_date($row['ban_end'], false, true));
}
- $ban_reasons[$row['ban_id']] = $row['ban_reason'];
- $ban_give_reasons[$row['ban_id']] = $row['ban_give_reason'];
+ $template->assign_block_vars('bans', array(
+ 'BAN_ID' => (int) $row['ban_id'],
+ 'LENGTH' => $ban_length,
+ 'A_LENGTH' => addslashes($ban_length),
+ 'REASON' => $row['ban_reason'],
+ 'A_REASON' => addslashes($row['ban_reason']),
+ 'GIVE_REASON' => $row['ban_give_reason'],
+ 'A_GIVE_REASON' => addslashes($row['ban_give_reason']),
+ ));
}
$db->sql_freeresult($result);
- if (sizeof($ban_length))
- {
- foreach ($ban_length as $ban_id => $length)
- {
- $template->assign_block_vars('ban_length', array(
- 'BAN_ID' => (int) $ban_id,
- 'LENGTH' => $length,
- 'A_LENGTH' => addslashes($length),
- ));
- }
- }
-
- if (sizeof($ban_reasons))
- {
- foreach ($ban_reasons as $ban_id => $reason)
- {
- $template->assign_block_vars('ban_reason', array(
- 'BAN_ID' => $ban_id,
- 'REASON' => $reason,
- 'A_REASON' => addslashes($reason),
- ));
- }
- }
-
- if (sizeof($ban_give_reasons))
- {
- foreach ($ban_give_reasons as $ban_id => $reason)
- {
- $template->assign_block_vars('ban_give_reason', array(
- 'BAN_ID' => $ban_id,
- 'REASON' => $reason,
- 'A_REASON' => addslashes($reason),
- ));
- }
- }
-
$options = '';
if ($excluded_options)
{
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 74df9240a1..1811748c2f 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -410,7 +410,7 @@ class acp_board
'ip_check' => array('lang' => 'IP_VALID', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true),
'browser_check' => array('lang' => 'BROWSER_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'forwarded_for_check' => array('lang' => 'FORWARDED_FOR_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'referer_validation' => array('lang' => 'REFERER_VALID', 'validate' => 'int:0:3','type' => 'custom', 'method' => 'select_ref_check', 'explain' => true),
+ 'referer_validation' => array('lang' => 'REFERRER_VALID', 'validate' => 'int:0:3','type' => 'custom', 'method' => 'select_ref_check', 'explain' => true),
'check_dnsbl' => array('lang' => 'CHECK_DNSBL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'email_check_mx' => array('lang' => 'EMAIL_CHECK_MX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'max_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,),
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index 76da43341d..8f9c155ffc 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -90,7 +90,7 @@ class acp_database
$time = time();
$filename = 'backup_' . $time . '_' . unique_id();
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysqli':
case 'mysql4':
@@ -133,7 +133,7 @@ class acp_database
else
{
// We might wanna empty out all that junk :D
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
@@ -320,7 +320,7 @@ class acp_database
break;
}
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
@@ -365,10 +365,10 @@ class acp_database
{
trigger_error($user->lang['RESTORE_FAILURE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- pg_put_line($db->db_connect_id, $sub . "\n");
+ pg_put_line($db->get_db_connect_id(), $sub . "\n");
}
- pg_put_line($db->db_connect_id, "\\.\n");
- pg_end_copy($db->db_connect_id);
+ pg_put_line($db->get_db_connect_id(), "\\.\n");
+ pg_end_copy($db->get_db_connect_id());
}
}
break;
@@ -623,7 +623,7 @@ class mysql_extractor extends base_extractor
if ($new_extract === null)
{
- if ($db->sql_layer === 'mysqli' || version_compare($db->sql_server_info(true), '3.23.20', '>='))
+ if ($db->get_sql_layer() === 'mysqli' || version_compare($db->sql_server_info(true), '3.23.20', '>='))
{
$new_extract = true;
}
@@ -646,7 +646,7 @@ class mysql_extractor extends base_extractor
function write_data($table_name)
{
global $db;
- if ($db->sql_layer === 'mysqli')
+ if ($db->get_sql_layer() === 'mysqli')
{
$this->write_data_mysqli($table_name);
}
@@ -661,7 +661,7 @@ class mysql_extractor extends base_extractor
global $db;
$sql = "SELECT *
FROM $table_name";
- $result = mysqli_query($db->db_connect_id, $sql, MYSQLI_USE_RESULT);
+ $result = mysqli_query($db->get_db_connect_id(), $sql, MYSQLI_USE_RESULT);
if ($result != false)
{
$fields_cnt = mysqli_num_fields($result);
@@ -740,7 +740,7 @@ class mysql_extractor extends base_extractor
global $db;
$sql = "SELECT *
FROM $table_name";
- $result = mysql_unbuffered_query($sql, $db->db_connect_id);
+ $result = mysql_unbuffered_query($sql, $db->get_db_connect_id());
if ($result != false)
{
@@ -993,11 +993,11 @@ class sqlite_extractor extends base_extractor
{
global $db;
- $col_types = sqlite_fetch_column_types($db->db_connect_id, $table_name);
+ $col_types = sqlite_fetch_column_types($db->get_db_connect_id(), $table_name);
$sql = "SELECT *
FROM $table_name";
- $result = sqlite_unbuffered_query($db->db_connect_id, $sql);
+ $result = sqlite_unbuffered_query($db->get_db_connect_id(), $sql);
$rows = sqlite_fetch_all($result, SQLITE_ASSOC);
$sql_insert = 'INSERT INTO ' . $table_name . ' (' . implode(', ', array_keys($col_types)) . ') VALUES (';
foreach ($rows as $row)
@@ -1553,11 +1553,11 @@ class mssql_extractor extends base_extractor
{
global $db;
- if ($db->sql_layer === 'mssql')
+ if ($db->get_sql_layer() === 'mssql')
{
$this->write_data_mssql($table_name);
}
- else if($db->sql_layer === 'mssqlnative')
+ else if($db->get_sql_layer() === 'mssqlnative')
{
$this->write_data_mssqlnative($table_name);
}
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php
index b2a6820461..aba9caaece 100644
--- a/phpBB/includes/acp/acp_extensions.php
+++ b/phpBB/includes/acp/acp_extensions.php
@@ -137,7 +137,7 @@ class acp_extensions
trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- if ($phpbb_extension_manager->enabled($ext_name))
+ if ($phpbb_extension_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
@@ -162,7 +162,7 @@ class acp_extensions
trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- if ($phpbb_extension_manager->enabled($ext_name))
+ if ($phpbb_extension_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
@@ -194,7 +194,7 @@ class acp_extensions
break;
case 'disable_pre':
- if (!$phpbb_extension_manager->enabled($ext_name))
+ if (!$phpbb_extension_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
@@ -209,7 +209,7 @@ class acp_extensions
break;
case 'disable':
- if (!$phpbb_extension_manager->enabled($ext_name))
+ if (!$phpbb_extension_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
@@ -234,7 +234,7 @@ class acp_extensions
break;
case 'delete_data_pre':
- if ($phpbb_extension_manager->enabled($ext_name))
+ if ($phpbb_extension_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
@@ -248,7 +248,7 @@ class acp_extensions
break;
case 'delete_data':
- if ($phpbb_extension_manager->enabled($ext_name))
+ if ($phpbb_extension_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index f8c463e158..adf5de44f5 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -1827,7 +1827,7 @@ class acp_forums
}
$db->sql_freeresult($result);
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql4':
case 'mysqli':
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index b9a6ef17ce..028025b547 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -538,7 +538,7 @@ class acp_icons
// The user has already selected a smilies_pak file
if ($current == 'delete')
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index 247460ec8e..2a28226d6c 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -26,7 +26,7 @@ class acp_main
function main($id, $mode)
{
global $config, $db, $cache, $user, $auth, $template, $request;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
// Show restore permissions notice
if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm'))
@@ -269,7 +269,7 @@ class acp_main
break;
case 'db_track':
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
@@ -374,7 +374,7 @@ class acp_main
foreach ($tables as $table)
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
@@ -445,6 +445,14 @@ class acp_main
));
}
+ /**
+ * Notice admin
+ *
+ * @event core.acp_main_notice
+ * @since 3.1.0-RC3
+ */
+ $phpbb_dispatcher->dispatch('core.acp_main_notice');
+
// Get forum statistics
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];
diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php
index 9715b9bce8..cd3616208d 100644
--- a/phpBB/includes/acp/acp_permission_roles.php
+++ b/phpBB/includes/acp/acp_permission_roles.php
@@ -253,7 +253,7 @@ class acp_permission_roles
{
$sql = 'SELECT auth_option_id, auth_option
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char) . "
+ WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()) . "
AND auth_option <> '{$permission_type}'
ORDER BY auth_option_id";
$result = $db->sql_query($sql);
@@ -315,7 +315,7 @@ class acp_permission_roles
// We need to fill the auth options array with ACL_NO options ;)
$sql = 'SELECT auth_option_id, auth_option
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char) . "
+ WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()) . "
AND auth_option <> '{$permission_type}'
ORDER BY auth_option_id";
$result = $db->sql_query($sql);
@@ -519,7 +519,7 @@ class acp_permission_roles
// Get complete auth array
$sql = 'SELECT auth_option, auth_option_id
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char);
+ WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char());
$result = $db->sql_query($sql);
$auth_settings = array();
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index 6540173433..cb408e304f 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -1238,7 +1238,7 @@ class acp_permissions
$sql = 'SELECT auth_option_id
FROM ' . ACL_OPTIONS_TABLE . '
- WHERE auth_option ' . $db->sql_like_expression($permission_type . $db->any_char);
+ WHERE auth_option ' . $db->sql_like_expression($permission_type . $db->get_any_char());
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index c291ee43c8..fda6ef25ec 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -112,7 +112,7 @@ class acp_profile
$db->sql_query('DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . " WHERE field_id = $field_id");
$db->sql_query('DELETE FROM ' . PROFILE_LANG_TABLE . " WHERE field_id = $field_id");
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
@@ -1196,7 +1196,7 @@ class acp_profile
{
global $db;
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php
index 2ddda28afc..a10b248324 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -436,8 +436,8 @@ class acp_prune
$sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit');
$where_sql = '';
- $where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($username))) : '';
- $where_sql .= ($email) ? ' AND user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : '';
+ $where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($username))) : '';
+ $where_sql .= ($email) ? ' AND user_email ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), $email)) . ' ' : '';
$where_sql .= $joined_sql;
$where_sql .= ($count) ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : '';
diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php
index 9cb5efdbe0..3d7ccf422c 100644
--- a/phpBB/includes/acp/acp_reasons.php
+++ b/phpBB/includes/acp/acp_reasons.php
@@ -219,7 +219,7 @@ class acp_reasons
$other_reason_id = (int) $db->sql_fetchfield('reason_id');
$db->sql_freeresult($result);
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
// The ugly one!
case 'mysqli':
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 4cc93e5670..2a02e3e845 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -804,7 +804,7 @@ class acp_styles
*
* @param array $styles Styles list, passed as reference
* @param string $name Name of parent style
- * @param string $level Styles tree level
+ * @param int $level Styles tree level
*/
protected function show_available_child_styles(&$styles, $name, $level)
{
@@ -888,7 +888,7 @@ class acp_styles
* Show item in styles list
*
* @param array $style style row
- * @param array $level style inheritance level
+ * @param int $level style inheritance level
*/
protected function list_style(&$style, $level)
{
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index d07120a65f..71880c2267 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -2384,7 +2384,7 @@ class acp_users
// Select auth options
$sql = 'SELECT auth_option, is_local, is_global
FROM ' . ACL_OPTIONS_TABLE . '
- WHERE auth_option ' . $db->sql_like_expression($db->any_char . '_') . '
+ WHERE auth_option ' . $db->sql_like_expression($db->get_any_char() . '_') . '
AND is_global = 1
ORDER BY auth_option';
$result = $db->sql_query($sql);
@@ -2404,7 +2404,7 @@ class acp_users
{
$sql = 'SELECT auth_option, is_local, is_global
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option " . $db->sql_like_expression($db->any_char . '_') . "
+ WHERE auth_option " . $db->sql_like_expression($db->get_any_char() . '_') . "
AND is_local = 1
ORDER BY is_global DESC, auth_option";
$result = $db->sql_query($sql);
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index 7bb8e824d6..7ff3212b72 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -1024,7 +1024,7 @@ class auth_admin extends \phpbb\auth\auth
// Get permission type
$sql = 'SELECT auth_option, auth_option_id
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char);
+ WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char());
$result = $db->sql_query($sql);
$auth_id_ary = array();