aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-12-06 22:13:11 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-12-06 22:13:11 +0000
commitb508c57b8046f7372b37e45fd993471303fcfc58 (patch)
tree20e1fe5cccadb28c594334c1585b516621180955 /phpBB
parenta9b2e99974398b6e88dc5a1417c0a711ec3a437c (diff)
downloadforums-b508c57b8046f7372b37e45fd993471303fcfc58.tar
forums-b508c57b8046f7372b37e45fd993471303fcfc58.tar.gz
forums-b508c57b8046f7372b37e45fd993471303fcfc58.tar.bz2
forums-b508c57b8046f7372b37e45fd993471303fcfc58.tar.xz
forums-b508c57b8046f7372b37e45fd993471303fcfc58.zip
minor bugfixing
git-svn-id: file:///svn/phpbb/trunk@6719 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/acp_language.html2
-rw-r--r--phpBB/includes/acp/acp_bots.php70
-rw-r--r--phpBB/includes/acp/acp_language.php3
-rw-r--r--phpBB/includes/acp/acp_modules.php11
-rw-r--r--phpBB/includes/db/dbal.php11
-rw-r--r--phpBB/includes/functions.php2
-rw-r--r--phpBB/includes/session.php15
-rw-r--r--phpBB/includes/ucp/ucp_register.php2
-rw-r--r--phpBB/language/en/acp/common.php2
-rw-r--r--phpBB/styles/subSilver/template/ucp_register.html2
-rw-r--r--phpBB/viewforum.php20
11 files changed, 98 insertions, 42 deletions
diff --git a/phpBB/adm/style/acp_language.html b/phpBB/adm/style/acp_language.html
index 7e4a49f893..d7a4a31901 100644
--- a/phpBB/adm/style/acp_language.html
+++ b/phpBB/adm/style/acp_language.html
@@ -7,7 +7,7 @@
<a href="{U_BACK}" style="float: right">&laquo; {L_BACK}</a>
<h1>{L_SELECT_DOWNLOAD_FORMAT}</h1>
-
+
<form id="selectmethod" method="post" action="{U_ACTION}">
<fieldset>
diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php
index 2dbcc463e9..0b1cdb122f 100644
--- a/phpBB/includes/acp/acp_bots.php
+++ b/phpBB/includes/acp/acp_bots.php
@@ -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);
- }
- $db->sql_transaction('commit');
+ $_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');
+ $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));
+ 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))
+ );
+ }
}
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))
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php
index 6c962d9405..abd01b6263 100644
--- a/phpBB/includes/acp/acp_language.php
+++ b/phpBB/includes/acp/acp_language.php
@@ -116,6 +116,7 @@ class acp_language
'S_UPLOAD' => true,
'NAME' => $method,
'U_ACTION' => $this->u_action . "&amp;id=$lang_id&amp;action=upload_data",
+ 'U_BACK' => $this->u_action . "&amp;id=$lang_id&amp;action=details&amp;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 . '&amp;id=' . $lang_id . '&amp;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 . '&amp;id=' . $lang_id . '&amp;action=details&amp;language_file=' . urlencode($selected_lang_file)), E_USER_WARNING);
}
if ($this->language_directory == 'email')
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index c426e4607d..9b42b7b8ba 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -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))
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index da5efcf55a..f4cbe0e2d4 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -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'], '', '');
+ }
}
}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index ab7bc452a5..1a3cb559f2 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -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))
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index de78969c3f..676b2c9518 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -895,13 +895,26 @@ 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;
+ }
}
return false;
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index 17e421505b..916c1b78d9 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -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']),
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index a45f7af083..40ea5cc8e4 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -220,8 +220,6 @@ $lang = array_merge($lang, array(
'EXPORT_DOWNLOAD' => 'Download',
'EXPORT_STORE' => 'Store',
- 'FORUM_INDEX' => 'Forum index',
-
'GENERAL_OPTIONS' => 'General options',
'GENERAL_SETTINGS' => 'General settings',
'GLOBAL_MASK' => 'Global permission mask',
diff --git a/phpBB/styles/subSilver/template/ucp_register.html b/phpBB/styles/subSilver/template/ucp_register.html
index ccbcb4505f..7d79f93aec 100644
--- a/phpBB/styles/subSilver/template/ucp_register.html
+++ b/phpBB/styles/subSilver/template/ucp_register.html
@@ -50,7 +50,7 @@
<td class="row2"><input class="post" type="text" name="email_confirm" size="25" maxlength="255" value="{EMAIL_CONFIRM}" /></td>
</tr>
<tr>
- <td class="row1"><b class="genmed">{L_NEW_PASSWORD}: </b><br /><span class="gensmall">{L_NEW_PASSWORD_EXPLAIN}</span></td>
+ <td class="row1"><b class="genmed">{L_PASSWORD}: </b><br /><span class="gensmall">{L_PASSWORD_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="password" name="new_password" size="25" maxlength="100" value="{PASSWORD}" /></td>
</tr>
<tr>
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 9d6da5c31c..41ed374c3b 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -241,9 +241,6 @@ $post_alt = ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['FORUM_LO
$s_display_active = ($forum_data['forum_type'] == FORUM_CAT && ($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false;
$template->assign_vars(array(
- 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&amp;$u_sort_param"), $topics_count, $config['topics_per_page'], $start),
- 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start),
- 'TOTAL_TOPICS' => ($s_display_active) ? false : (($topics_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count)),
'MODERATORS' => (!empty($moderators[$forum_id])) ? implode(', ', $moderators[$forum_id]) : '',
'POST_IMG' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', $post_alt) : $user->img('button_topic_new', $post_alt),
@@ -441,6 +438,17 @@ if (sizeof($shadow_topic_list))
{
$orig_topic_id = $shadow_topic_list[$row['topic_id']];
+ // Do not include those topics the user has no permission to access
+ if (!$auth->acl_get('f_read', $row['forum_id']))
+ {
+ // We need to remove any trace regarding this topic. :)
+ unset($rowset[$orig_topic_id]);
+ unset($topic_list[array_search($orig_topic_id, $topic_list)]);
+ $topics_count--;
+
+ continue;
+ }
+
// We want to retain some values
$row = array_merge($row, array(
'topic_moved_id' => $rowset[$orig_topic_id]['topic_moved_id'],
@@ -453,6 +461,12 @@ if (sizeof($shadow_topic_list))
}
unset($shadow_topic_list);
+$template->assign_vars(array(
+ 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&amp;$u_sort_param"), $topics_count, $config['topics_per_page'], $start),
+ 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start),
+ 'TOTAL_TOPICS' => ($s_display_active) ? false : (($topics_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count)))
+);
+
$topic_list = ($store_reverse) ? array_merge($announcement_list, array_reverse($topic_list)) : array_merge($announcement_list, $topic_list);
$topic_tracking_info = $tracking_topics = array();