aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2006-06-20 19:00:30 +0000
committerNils Adermann <naderman@naderman.de>2006-06-20 19:00:30 +0000
commit4448249a4433c9047b886efe2ec06dce6c4276f8 (patch)
treec03475df6cdc346279f33f6931c5214055a8db93 /phpBB/includes
parentc125ae12761e99a0f11703bbbec0defb29ad90c4 (diff)
downloadforums-4448249a4433c9047b886efe2ec06dce6c4276f8.tar
forums-4448249a4433c9047b886efe2ec06dce6c4276f8.tar.gz
forums-4448249a4433c9047b886efe2ec06dce6c4276f8.tar.bz2
forums-4448249a4433c9047b886efe2ec06dce6c4276f8.tar.xz
forums-4448249a4433c9047b886efe2ec06dce6c4276f8.zip
- correctly display subcategories
- use L_TRANSLATION_INFO [Bug #2357] - always begin with ACL_UNSET in permission trace - allow copy permissions when editing a forum - default to parent forum for copying permissions - no duplication of the breadcrumps on registration [Bug #2307] git-svn-id: file:///svn/phpbb/trunk@6107 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_forums.php21
-rw-r--r--phpBB/includes/acp/acp_permissions.php2
-rw-r--r--phpBB/includes/functions_display.php4
-rw-r--r--phpBB/includes/ucp/ucp_remind.php2
4 files changed, 21 insertions, 8 deletions
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index ac4112a773..75395d4b81 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -142,8 +142,20 @@ class acp_forums
$forum_perm_from = request_var('forum_perm_from', 0);
// Copy permissions?
- if ($forum_perm_from && $action == 'add')
+ if ($forum_perm_from)
{
+ // if we edit a forum delete current permissions first
+ if ($action == 'edit')
+ {
+ $sql = 'DELETE FROM ' . ACL_USERS_TABLE . '
+ WHERE forum_id = ' . (int) $forum_data['forum_id'];
+ $db->sql_query($sql);
+
+ $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . '
+ WHERE forum_id = ' . (int) $forum_data['forum_id'];
+ $db->sql_query($sql);
+ }
+
// From the mysql documentation:
// Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14.
// Due to this we stay on the safe side if we do the insertion "the manual way"
@@ -468,8 +480,9 @@ class acp_forums
'U_BACK' => $this->u_action . '&amp;parent_id=' . $this->parent_id,
'U_EDIT_ACTION' => $this->u_action . "&amp;parent_id={$this->parent_id}&amp;action=$action&amp;f=$forum_id",
- 'L_TITLE' => $user->lang[$this->page_title],
- 'ERROR_MSG' => (sizeof($errors)) ? implode('<br />', $errors) : '',
+ 'L_COPY_PERMISSIONS_EXPLAIN' => $user->lang['COPY_PERMISSIONS_' . strtoupper($action) . '_EXPLAIN'],
+ 'L_TITLE' => $user->lang[$this->page_title],
+ 'ERROR_MSG' => (sizeof($errors)) ? implode('<br />', $errors) : '',
'FORUM_NAME' => $forum_data['forum_name'],
'FORUM_DATA_LINK' => $forum_data['forum_link'],
@@ -501,7 +514,7 @@ class acp_forums
'S_STATUS_OPTIONS' => $statuslist,
'S_PARENT_OPTIONS' => $parents_list,
'S_STYLES_OPTIONS' => $styles_list,
- 'S_FORUM_OPTIONS' => make_forum_select(false, false, false),
+ 'S_FORUM_OPTIONS' => make_forum_select(($action == 'add') ? $forum_data['parent_id'] : false, false, false, false, false),
'S_SHOW_DISPLAY_ON_INDEX' => $s_show_display_on_index,
'S_FORUM_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false,
'S_FORUM_ORIG_POST' => (isset($old_forum_type) && $old_forum_type == FORUM_POST) ? true : false,
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index 277281497b..5505794999 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -982,6 +982,7 @@ class acp_permissions
}
$db->sql_freeresult($result);
+ $total = ACL_UNSET;
if (sizeof($groups))
{
// Get group auth settings
@@ -993,7 +994,6 @@ class acp_permissions
}
unset($hold_ary);
- $total = ACL_UNSET;
foreach ($groups as $id => $row)
{
switch ($row['auth_setting'])
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index b095b3e286..94e1e0d5cc 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -156,7 +156,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$parent_id = $forum_id;
$forum_rows[$forum_id] = $row;
- if (!$row['parent_id'] && $row['forum_type'] == FORUM_CAT && $row['parent_id'] == $root_data['forum_id'])
+ if ($row['forum_type'] == FORUM_CAT && $row['parent_id'] == $root_data['forum_id'])
{
$branch_root_id = $forum_id;
}
@@ -228,7 +228,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
foreach ($forum_rows as $row)
{
// Empty category
- if (!$row['parent_id'] && $row['forum_type'] == FORUM_CAT)
+ if ($row['parent_id'] == $root_data['forum_id'] && $row['forum_type'] == FORUM_CAT)
{
$template->assign_block_vars('forumrow', array(
'S_IS_CAT' => true,
diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php
index 9419684725..6117e50c95 100644
--- a/phpBB/includes/ucp/ucp_remind.php
+++ b/phpBB/includes/ucp/ucp_remind.php
@@ -62,7 +62,7 @@ class ucp_remind
$messenger = new messenger(false);
- $messenger->template('user_activate_passwd', $row['user_lang']);
+ $messenger->template('user_activate_passwd', $user_row['user_lang']);
$messenger->replyto($user->data['user_email']);
$messenger->to($user_row['user_email'], $user_row['username']);