Changeset 5230 for trunk/install.php


Ignore:
Timestamp:
Mar 21, 2010, 10:15:54 PM (14 years ago)
Author:
patdenice
Message:

feature 1255: add pwg_select_db function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/install.php

    r5220 r5230  
    228228if ( isset( $_POST['install'] ))
    229229{
     230  ob_start();
    230231  if (($pwg_db_link = pwg_db_connect($_POST['dbhost'], $_POST['dbuser'],
    231                                      $_POST['dbpasswd'], $_POST['dbname']))!==false)
    232   {
    233 
    234     array_push( $infos, l10n('Parameters are correct') );
     232                                     $_POST['dbpasswd'], $_POST['dbname'], false))!==false)
     233  {
     234    if (pwg_select_db($_POST['dbname'], $pwg_db_link, false)!==false)
     235    {
     236      array_push( $infos, l10n('Parameters are correct') );
     237    }
     238    else
     239    {
     240      array_push( $errors,
     241        l10n('Connection to server succeed, but it was impossible to connect to database') );
     242    }
     243    ob_end_clean();
    235244
    236245    $required_version = constant('REQUIRED_'.strtoupper($dblayer).'_VERSION');
     
    262271  {
    263272    array_push( $errors, l10n('Can\'t connect to server') );
    264   }
    265 
     273    ob_end_clean();
     274  }
    266275  $webmaster = trim(preg_replace( '/\s{2,}/', ' ', $admin_name ));
    267276  if ( empty($webmaster))
Note: See TracChangeset for help on using the changeset viewer.