diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-04-06 17:15:45 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-04-06 17:15:45 +0000 |
commit | 431e494ae43257bea251a59ed6b2a4bb20eb7fd4 (patch) | |
tree | 66bea58ebc6be0c6a76b5444a73016fd2a97f7ff /phpBB/includes/acp/acp_groups.php | |
parent | 3933f0bab385f7702cd6335842aa42e004b3d195 (diff) | |
download | forums-431e494ae43257bea251a59ed6b2a4bb20eb7fd4.tar forums-431e494ae43257bea251a59ed6b2a4bb20eb7fd4.tar.gz forums-431e494ae43257bea251a59ed6b2a4bb20eb7fd4.tar.bz2 forums-431e494ae43257bea251a59ed6b2a4bb20eb7fd4.tar.xz forums-431e494ae43257bea251a59ed6b2a4bb20eb7fd4.zip |
To all people having their bug status set to fixed: SF pserver CVS access is currently down, therefore the snapshots are still out of date.
- fix a bunch of bugs
- <!-- $Id$ --> is no longer allowed in template (.html) files
- changed layout of private message screens (folders are menu items)
- removed unread mode for private messages
- added new feature to template engine - "jump out of loop" or "loop another loop within my loop" :D (will be documented within the coding guidelines)
- added autologin field to sessions
- check session length checks
- added add_log statement to sessions to track session valid to invalid changes if ip/browser change depending on config settings (only debug)
- added multibyte support for various variables (exception at the moment is usernames which needs some discussion)
- hopefully not broke something. :/
git-svn-id: file:///svn/phpbb/trunk@5765 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/acp_groups.php')
-rw-r--r-- | phpBB/includes/acp/acp_groups.php | 143 |
1 files changed, 72 insertions, 71 deletions
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index aad8997395..b5948115cc 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -315,77 +315,81 @@ class acp_groups } } - // Only set the rank, colour, etc. if it's changed or if we're adding a new - // group. This prevents existing group members being updated if no changes - // were made. - - $group_attributes = array(); - $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit'); - foreach ($test_variables as $test) + if (!sizeof($error)) { - if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test])) + // Only set the rank, colour, etc. if it's changed or if we're adding a new + // group. This prevents existing group members being updated if no changes + // were made. + + $group_attributes = array(); + $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit'); + foreach ($test_variables as $test) { - $group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test]; + if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test])) + { + $group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test]; + } } - } - - if (!($error = group_create($group_id, $group_type, $group_name, $group_desc, $group_attributes, $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies))) - { - $group_perm_from = request_var('group_perm_from', 0); - // Copy permissions? - if ($group_perm_from && $action == 'add') + if (!($error = group_create($group_id, $group_type, $group_name, $group_desc, $group_attributes, $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies))) { - // 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" - - // Copy permisisons from/to the acl groups table (only group_id gets changed) - $sql = 'SELECT forum_id, auth_option_id, auth_role_id, auth_setting - FROM ' . ACL_GROUPS_TABLE . ' - WHERE group_id = ' . $group_perm_from; - $result = $db->sql_query($sql); - - $groups_sql_ary = array(); - while ($row = $db->sql_fetchrow($result)) - { - $groups_sql_ary[] = array( - 'group_id' => (int) $group_id, - 'forum_id' => (int) $row['forum_id'], - 'auth_option_id' => (int) $row['auth_option_id'], - 'auth_role_id' => (int) $row['auth_role_id'], - 'auth_setting' => (int) $row['auth_setting'] - ); - } - $db->sql_freeresult($result); + $group_perm_from = request_var('group_perm_from', 0); - // Now insert the data - if (sizeof($groups_sql_ary)) + // Copy permissions? + if ($group_perm_from && $action == 'add') { - switch (SQL_LAYER) + // 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" + + // Copy permisisons from/to the acl groups table (only group_id gets changed) + $sql = 'SELECT forum_id, auth_option_id, auth_role_id, auth_setting + FROM ' . ACL_GROUPS_TABLE . ' + WHERE group_id = ' . $group_perm_from; + $result = $db->sql_query($sql); + + $groups_sql_ary = array(); + while ($row = $db->sql_fetchrow($result)) { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $groups_sql_ary)); - break; - - default: - foreach ($groups_sql_ary as $ary) - { - $db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; + $groups_sql_ary[] = array( + 'group_id' => (int) $group_id, + 'forum_id' => (int) $row['forum_id'], + 'auth_option_id' => (int) $row['auth_option_id'], + 'auth_role_id' => (int) $row['auth_role_id'], + 'auth_setting' => (int) $row['auth_setting'] + ); } + $db->sql_freeresult($result); + + // Now insert the data + if (sizeof($groups_sql_ary)) + { + switch (SQL_LAYER) + { + case 'mysql': + case 'mysql4': + case 'mysqli': + $db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $groups_sql_ary)); + break; + + default: + foreach ($groups_sql_ary as $ary) + { + $db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); + } + break; + } + } + + $auth->acl_clear_prefetch(); } - $auth->acl_clear_prefetch(); + $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED'; + trigger_error($user->lang[$message] . adm_back_link($this->u_action)); } - - $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED'; - trigger_error($user->lang[$message] . adm_back_link($this->u_action)); } - else + + if (sizeof($error)) { $group_rank = $submit_ary['rank']; @@ -605,20 +609,17 @@ class acp_groups 'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=list&field=usernames") ); - if ($group_row['group_type'] != GROUP_SPECIAL) + foreach ($group_data['leader'] as $row) { - foreach ($group_data['leader'] as $row) - { - $template->assign_block_vars('leader', array( - 'U_USER_EDIT' => $phpbb_admin_path . "index.$phpEx$SID&i=users&action=edit&u={$row['user_id']}", - - 'USERNAME' => $row['username'], - 'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false, - 'JOINED' => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ', - 'USER_POSTS' => $row['user_posts'], - 'USER_ID' => $row['user_id']) - ); - } + $template->assign_block_vars('leader', array( + 'U_USER_EDIT' => $phpbb_admin_path . "index.$phpEx$SID&i=users&action=edit&u={$row['user_id']}", + + 'USERNAME' => $row['username'], + 'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false, + 'JOINED' => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ', + 'USER_POSTS' => $row['user_posts'], + 'USER_ID' => $row['user_id']) + ); } $pending = false; |