1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

minor bugfixing

git-svn-id: file:///svn/phpbb/trunk@6719 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2006-12-06 22:13:11 +00:00
parent a9b2e99974
commit b508c57b80
11 changed files with 100 additions and 44 deletions

View File

@@ -70,42 +70,54 @@ class acp_bots
case 'delete':
if ($bot_id || sizeof($mark))
{
// We need to delete the relevant user, usergroup and bot entries ...
$sql_id = ($bot_id) ? " = $bot_id" : ' IN (' . implode(', ', $mark) . ')';
$sql = 'SELECT bot_name, user_id
FROM ' . BOTS_TABLE . "
WHERE bot_id $sql_id";
$result = $db->sql_query($sql);
$user_id_ary = $bot_name_ary = array();
while ($row = $db->sql_fetchrow($result))
if (confirm_box(true))
{
$user_id_ary[] = (int) $row['user_id'];
$bot_name_ary[] = $row['bot_name'];
}
$db->sql_freeresult($result);
// We need to delete the relevant user, usergroup and bot entries ...
$sql_id = ($bot_id) ? " = $bot_id" : ' IN (' . implode(', ', $mark) . ')';
$db->sql_transaction('begin');
$sql = 'SELECT bot_name, user_id
FROM ' . BOTS_TABLE . "
WHERE bot_id $sql_id";
$result = $db->sql_query($sql);
$sql = 'DELETE FROM ' . BOTS_TABLE . "
WHERE bot_id $sql_id";
$db->sql_query($sql);
$user_id_ary = $bot_name_ary = array();
while ($row = $db->sql_fetchrow($result))
{
$user_id_ary[] = (int) $row['user_id'];
$bot_name_ary[] = $row['bot_name'];
}
$db->sql_freeresult($result);
$_tables = array(USERS_TABLE, USER_GROUP_TABLE);
foreach ($_tables as $table)
{
$sql = "DELETE FROM $table
WHERE " . $db->sql_in_set('user_id', $user_id_ary);
$db->sql_transaction('begin');
$sql = 'DELETE FROM ' . BOTS_TABLE . "
WHERE bot_id $sql_id";
$db->sql_query($sql);
$_tables = array(USERS_TABLE, USER_GROUP_TABLE);
foreach ($_tables as $table)
{
$sql = "DELETE FROM $table
WHERE " . $db->sql_in_set('user_id', $user_id_ary);
$db->sql_query($sql);
}
$db->sql_transaction('commit');
$cache->destroy('bots');
add_log('admin', 'LOG_BOT_DELETE', implode(', ', $bot_name_ary));
trigger_error($user->lang['BOT_DELETED'] . adm_back_link($this->u_action));
}
else
{
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
'mark' => $mark,
'id' => $bot_id,
'mode' => $mode,
'action' => $action))
);
}
$db->sql_transaction('commit');
$cache->destroy('bots');
add_log('admin', 'LOG_BOT_DELETE', implode(', ', $bot_name_ary));
trigger_error($user->lang['BOT_DELETED'] . adm_back_link($this->u_action));
}
break;
@@ -302,7 +314,7 @@ class acp_bots
$sql = 'SELECT b.bot_id, b.bot_name, b.bot_active, u.user_lastvisit
FROM ' . BOTS_TABLE . ' b, ' . USERS_TABLE . ' u
WHERE u.user_id = b.user_id
ORDER BY u.user_lastvisit DESC';
ORDER BY u.user_lastvisit DESC, b.bot_name ASC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))

View File

@@ -116,6 +116,7 @@ class acp_language
'S_UPLOAD' => true,
'NAME' => $method,
'U_ACTION' => $this->u_action . "&id=$lang_id&action=upload_data",
'U_BACK' => $this->u_action . "&id=$lang_id&action=details&language_file=" . urlencode($selected_lang_file),
'HIDDEN' => $hidden_data,
'S_CONNECTION_SUCCESS' => (request_var('test_connection', '') && $test_connection === true) ? true : false,
@@ -203,7 +204,7 @@ class acp_language
if (!$fp)
{
trigger_error(sprintf($user->lang['UNABLE_TO_WRITE_FILE'], $filename) . adm_back_link($this->u_action . '&id=' . $lang_id . '&language_file=' . urlencode($selected_lang_file)), E_USER_WARNING);
trigger_error(sprintf($user->lang['UNABLE_TO_WRITE_FILE'], $filename) . adm_back_link($this->u_action . '&id=' . $lang_id . '&action=details&language_file=' . urlencode($selected_lang_file)), E_USER_WARNING);
}
if ($this->language_directory == 'email')

View File

@@ -67,6 +67,17 @@ class acp_modules
if (confirm_box(true))
{
// Make sure we are not directly within a module
if ($module_id == $this->parent_id)
{
$sql = 'SELECT parent_id
FROM ' . MODULES_TABLE . '
WHERE module_id = ' . $module_id;
$result = $db->sql_query($sql);
$this->parent_id = (int) $db->sql_fetchfield('parent_id');
$db->sql_freeresult($result);
}
$errors = $this->delete_module($module_id);
if (!sizeof($errors))

View File

@@ -438,7 +438,7 @@ class dbal
*/
function sql_error($sql = '')
{
global $auth, $user;
global $auth, $user, $config;
// Set var to retrieve errored status
$this->sql_error_triggered = true;
@@ -472,7 +472,14 @@ class dbal
}
else
{
$message .= '<br /><br />' . $user->lang['SQL_ERROR_OCCURRED'];
if (!empty($config['board_contact']))
{
$message .= '<br /><br />' . sprintf($user->lang['SQL_ERROR_OCCURRED'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>');
}
else
{
$message .= '<br /><br />' . sprintf($user->lang['SQL_ERROR_OCCURRED'], '', '');
}
}
}

View File

@@ -636,7 +636,7 @@ function language_select($default = '')
$sql = 'SELECT lang_iso, lang_local_name
FROM ' . LANG_TABLE . '
ORDER BY lang_english_name';
$result = $db->sql_query($sql, 600);
$result = $db->sql_query($sql);
$lang_options = '';
while ($row = $db->sql_fetchrow($result))

View File

@@ -895,12 +895,25 @@ class session
$quads = explode('.', $ip);
$reverse_ip = $quads[3] . '.' . $quads[2] . '.' . $quads[1] . '.' . $quads[0];
// Need to be listed on all servers...
$listed = true;
$info = array();
foreach ($dnsbl_check as $dnsbl => $lookup)
{
if (phpbb_checkdnsrr($reverse_ip . '.' . $dnsbl . '.', 'A') === true)
{
return array($dnsbl, $lookup . $ip);
$info = array($dnsbl, $lookup . $ip);
}
else
{
$listed = false;
}
}
if ($listed)
{
return $info;
}
}

View File

@@ -490,7 +490,7 @@ class ucp_register
'L_CONFIRM_EXPLAIN' => sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
'L_REG_COND' => $l_reg_cond,
'L_USERNAME_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
'L_NEW_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
'L_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
'S_LANG_OPTIONS' => language_select($data['lang']),
'S_TZ_OPTIONS' => tz_select($data['tz']),