diff options
author | patdenice <patdenice@piwigo.org> | 2010-03-21 21:15:54 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2010-03-21 21:15:54 +0000 |
commit | 54c9ceb0f4890c7f183842f9c3adefaad64c471b (patch) | |
tree | 95cbae46dfba49cdc9c7599e8c2fcaf35b8f6ed3 /install.php | |
parent | 62ce6a7f152439d33b18363daf400818002b9234 (diff) |
feature 1255: add pwg_select_db function.
git-svn-id: http://piwigo.org/svn/trunk@5230 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | install.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/install.php b/install.php index 6a2e4038b..8450c379d 100644 --- a/install.php +++ b/install.php @@ -227,11 +227,20 @@ if (!isset($step)) //---------------------------------------------------------------- form analyze if ( isset( $_POST['install'] )) { + ob_start(); if (($pwg_db_link = pwg_db_connect($_POST['dbhost'], $_POST['dbuser'], - $_POST['dbpasswd'], $_POST['dbname']))!==false) + $_POST['dbpasswd'], $_POST['dbname'], false))!==false) { - - array_push( $infos, l10n('Parameters are correct') ); + if (pwg_select_db($_POST['dbname'], $pwg_db_link, false)!==false) + { + array_push( $infos, l10n('Parameters are correct') ); + } + else + { + array_push( $errors, + l10n('Connection to server succeed, but it was impossible to connect to database') ); + } + ob_end_clean(); $required_version = constant('REQUIRED_'.strtoupper($dblayer).'_VERSION'); if ( version_compare(pwg_get_db_version(), $required_version, '>=') ) @@ -261,8 +270,8 @@ if ( isset( $_POST['install'] )) else { array_push( $errors, l10n('Can\'t connect to server') ); + ob_end_clean(); } - $webmaster = trim(preg_replace( '/\s{2,}/', ' ', $admin_name )); if ( empty($webmaster)) array_push( $errors, l10n('enter a login for webmaster') ); |