From a27ce549bd66654e2a95d67922e945ba9d438ee4 Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Fri, 23 Jun 2006 20:02:16 +0000 Subject: [PATCH] - Extra error handling to deal with a user not specifying a database name - Re-add the move of the manage users module git-svn-id: file:///svn/phpbb/trunk@6119 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_install.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 4ce0b27bfd..ad762daf0f 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1281,8 +1281,7 @@ class install_install extends module } } - // This is a one off move of a single ACP module since the sort algorithm puts it in the wrong place - // Manage Users should ideally be the first thing you see on the Users & groups tab + // Move some of the modules around since the code above will put them in the wrong place if ($module_class == 'acp') { // Move main module 4 up... @@ -1308,6 +1307,18 @@ class install_install extends module $db->sql_freeresult($result); $_module->move_module_by($row, 'move_up', 4); + + // Move manage users screen module 4 up... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_name = 'users' + AND module_class = 'acp' + AND module_mode = 'overview'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_up', 4); } // And now for the special ones @@ -1556,6 +1567,13 @@ class install_install extends module $db = new $sql_db(); $db->sql_return_on_error(true); + // Check that we actually have a database name before going any further..... + if ($dbms != 'sqlite' && $dbname === '') + { + $error[] = $lang['INST_ERR_DB_NO_NAME']; + return false; + } + // Try and connect ... if (is_array($db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false))) {