aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-01-24 11:29:56 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-01-24 11:29:56 +0000
commit9e5c25504e275d8de071f2efafa349ebee21063c (patch)
tree86d37c1ed2b20eca9575084be7668d7b32dcf644 /phpBB/install
parent180a5a243d03803fef0d32a6aaa2d6899a83dfcc (diff)
downloadforums-9e5c25504e275d8de071f2efafa349ebee21063c.tar
forums-9e5c25504e275d8de071f2efafa349ebee21063c.tar.gz
forums-9e5c25504e275d8de071f2efafa349ebee21063c.tar.bz2
forums-9e5c25504e275d8de071f2efafa349ebee21063c.tar.xz
forums-9e5c25504e275d8de071f2efafa349ebee21063c.zip
- added confirm box to ucp zebra (adding fried/foe)
- permission fixes for conversions - use more appropiate error message within convertor if source tables could not be found - other tiny fixes git-svn-id: file:///svn/phpbb/trunk@6925 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install')
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php27
-rw-r--r--phpBB/install/install_convert.php2
2 files changed, 22 insertions, 7 deletions
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php
index 043441c54b..05daae473b 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -390,7 +390,7 @@ function phpbb_get_birthday($birthday = '')
$day = substr($birthday, 2, 2);
$year = substr($birthday, -4);
- return sprintf('%02d-%02d-%04d', $day, $month, $year);
+ return sprintf('%2d-%2d-%4d', $day, $month, $year);
}
else
{
@@ -656,6 +656,13 @@ function phpbb_convert_authentication($mode)
$auth_sql .= ', {ADMINISTRATORS} FROM ' . $convert->src_table_prefix . 'users WHERE user_level = 1';
user_group_auth('administrators', $auth_sql);
+
+ // Put administrators into global moderators group too...
+ $auth_sql = 'SELECT ';
+ $auth_sql .= (!empty($config['increment_user_id'])) ? 'user_id + 1 as user_id' : 'user_id';
+ $auth_sql .= ', {GLOBAL_MODERATORS} FROM ' . $convert->src_table_prefix . 'users WHERE user_level = 1';
+
+ user_group_auth('global_moderators', $auth_sql);
}
else if ($mode == 'first')
{
@@ -801,16 +808,24 @@ function phpbb_convert_authentication($mode)
}
else if ($mode == 'second')
{
- // Assign permission roles
+ // Assign permission roles and other default permissions
- // By default all converted administrators are given full access
- // @todo Review the implications of this - we might want to remove access to clear logs, view phpinfo, etc
- mass_auth('group_role', 0, 'administrators', 'ADMIN_FULL');
- mass_auth('group_role', 0, 'administrators', 'MOD_FULL');
+ // guests having u_download and u_search ability
+ $db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) SELECT ' . get_group_id('guests') . ', 0, auth_option_id, 0, 1 FROM ' . ACL_OPTIONS_TABLE . " WHERE auth_option IN ('u_', 'u_download', 'u_search')");
+
+ // administrators/global mods having full user features
mass_auth('group_role', 0, 'administrators', 'USER_FULL');
+ mass_auth('group_role', 0, 'global_moderators', 'USER_FULL');
+
+ // By default all converted administrators are given standard access (the founder still have full access)
+ mass_auth('group_role', 0, 'administrators', 'ADMIN_STANDARD');
// All registered users are assigned the standard user role
mass_auth('group_role', 0, 'registered', 'USER_STANDARD');
+ mass_auth('group_role', 0, 'registered_coppa', 'USER_STANDARD');
+
+ // Instead of administrators being global moderators we give the MOD_FULL role to global mods (admins already assigned to this group)
+ mass_auth('group_role', 0, 'global_moderators', 'MOD_FULL');
// And now those who have had their avatar rights removed get assigned a more restrictive role
$sql = 'SELECT user_id FROM ' . $convert->src_table_prefix . 'users
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index 3ae6b8be1c..83988ff05f 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -139,7 +139,7 @@ class install_convert extends module
// Let's see if there is a conversion in the works...
$options = array();
- if (isset($config['convert_progress']))
+ if (!empty($config['convert_progress']) && !empty($config['convert_options']))
{
$options = unserialize($config['convert_progress']);
$options = array_merge($options, unserialize($config['convert_options']));