aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-03-28 17:10:07 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-03-28 17:10:07 +0000
commit7e47a8ddb023b3851d9f2d1dd153e535cb41172d (patch)
tree5968fe5a259b63d7f3330c808a6f5026625d3f8f /phpBB
parentfe9590cf5a3946260d61748cfc2ac0e13f10c23b (diff)
downloadforums-7e47a8ddb023b3851d9f2d1dd153e535cb41172d.tar
forums-7e47a8ddb023b3851d9f2d1dd153e535cb41172d.tar.gz
forums-7e47a8ddb023b3851d9f2d1dd153e535cb41172d.tar.bz2
forums-7e47a8ddb023b3851d9f2d1dd153e535cb41172d.tar.xz
forums-7e47a8ddb023b3851d9f2d1dd153e535cb41172d.zip
added ability to hide coppa groups (mainly applied to permission screens)
git-svn-id: file:///svn/phpbb/trunk@5744 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/acp_permission_roles.html5
-rw-r--r--phpBB/includes/acp/acp_board.php1
-rw-r--r--phpBB/includes/acp/acp_groups.php5
-rw-r--r--phpBB/includes/acp/acp_permissions.php5
-rw-r--r--phpBB/includes/functions_admin.php12
-rw-r--r--phpBB/includes/ucp/ucp_register.php2
-rw-r--r--phpBB/install/schemas/schema_data.sql4
-rw-r--r--phpBB/language/en/acp/board.php2
8 files changed, 26 insertions, 10 deletions
diff --git a/phpBB/adm/style/acp_permission_roles.html b/phpBB/adm/style/acp_permission_roles.html
index 972abe35a1..ca50fed187 100644
--- a/phpBB/adm/style/acp_permission_roles.html
+++ b/phpBB/adm/style/acp_permission_roles.html
@@ -186,9 +186,12 @@
<td style="vertical-align: top;"><b>{roles.NAME}</b></td>
<td style="vertical-align: top;">
<!-- IF roles.S_GROUP -->
+ <!-- a href="{roles.groups.U_GROUP}">{roles.groups.GROUP_NAME}</a><br / -->
+ <select name="r_groups">
<!-- BEGIN groups -->
- <a href="{roles.groups.U_GROUP}">{roles.groups.GROUP_NAME}</a><br />
+ <option<!-- IF roles.groups.S_SPECIAL_GROUP --> class="sep"<!-- ENDIF -->>{roles.groups.GROUP_NAME}</option>
<!-- END groups -->
+ </select>
<!-- ELSE -->
{L_EVERY_USER_GROUP}
<!-- ENDIF -->
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 4c002357bd..912e9c9af3 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -74,6 +74,7 @@ class acp_board
'coppa_enable' => array('lang' => 'ENABLE_COPPA', 'type' => 'radio:yes_no', 'explain' => true),
'coppa_mail' => array('lang' => 'COPPA_MAIL', 'type' => 'textarea:5:40', 'explain' => true),
'coppa_fax' => array('lang' => 'COPPA_FAX', 'type' => 'text:25:100', 'explain' => false),
+ 'coppa_hide_groups' => array('lang' => 'COPPA_HIDE_GROUPS', 'type' => 'radio:yes_no', 'explain' => true),
'legend3' => 'REGISTRATION',
'require_activation'=> array('lang' => 'ACC_ACTIVATION', 'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true),
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index f190f151c9..aad8997395 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -564,7 +564,10 @@ class acp_groups
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
$leader = $member = 0;
- $group_data = array();
+ $group_data = array(
+ 'leader' => array(),
+ 'member' => array(),
+ );
while ($row = $db->sql_fetchrow($result))
{
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index b146e09a91..2d855c0c08 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -51,9 +51,12 @@ class acp_permissions
if ($select_all_groups)
{
// Add default groups to selection
+ $sql_and = ($config['coppa_hide_groups']) ? " AND group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : '';
+
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . '
- WHERE group_type = ' . GROUP_SPECIAL;
+ WHERE group_type = ' . GROUP_SPECIAL . "
+ $sql_and";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 8391fcffc4..240336583f 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -209,12 +209,16 @@ function size_select_options($size_compare)
*/
function group_select_options($group_id, $exclude_ids = false)
{
- global $db, $user;
+ global $db, $user, $config;
+
+ $exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE group_id NOT IN (' . implode(', ', array_map('intval', $exclude_ids)) . ')' : '';
+ $sql_and = ($config['coppa_hide_groups']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : '';
$sql = 'SELECT group_id, group_name, group_type
- FROM ' . GROUPS_TABLE . '
- ' . (($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE group_id NOT IN (' . implode(', ', array_map('intval', $exclude_ids)) . ')' : '') . '
- ORDER BY group_type DESC, group_name ASC';
+ FROM ' . GROUPS_TABLE . "
+ $exclude_sql
+ $sql_and
+ ORDER BY group_type DESC, group_name ASC";
$result = $db->sql_query($sql);
$s_group_options = '';
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index 31914917f9..0ac9290c15 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -204,7 +204,7 @@ class ucp_register
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . "
- WHERE group_name = '$group_name'
+ WHERE group_name = '" . $db->sql_escape($group_name) . "'
AND group_type = " . GROUP_SPECIAL;
$result = $db->sql_query($sql);
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 2a78875da9..566b6562e2 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -65,8 +65,9 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_domain', ''
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_name', 'phpbb3');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_path', '/');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_secure', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_enable', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_enable', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_fax', '');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_hide_groups', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_mail', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_dateformat', 'D M d, Y g:i a');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_style', '1');
@@ -78,7 +79,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_function_nam
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '50');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_pm', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_confirm', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_post_confirm', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_pm_icons', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('flood_interval', '15');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('force_server_vars', '0');
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index 59e4edbfe9..aa50104fbc 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -293,6 +293,8 @@ $lang = array_merge($lang, array(
'ENABLE_COPPA' => 'Enable COPPA',
'ENABLE_COPPA_EXPLAIN' => 'This requires users to declare whether they are 13 or over for compliance with the U.S. COPPA act.',
'COPPA_FAX' => 'COPPA Fax Number',
+ 'COPPA_HIDE_GROUPS' => 'Hide COPPA Groups',
+ 'COPPA_HIDE_GROUPS_EXPLAIN' => 'Do not display the special COPPA groups within admin-facing parts',
'COPPA_MAIL' => 'COPPA Mailing Address',
'COPPA_MAIL_EXPLAIN' => 'This is the mailing address where parents will send COPPA registration forms',
'BOARD_PM' => 'Private Messaging',