From: Victor B. <vb...@us...> - 2006-05-05 16:03:33
|
Update of /cvsroot/mantisbt/mantisbt/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27643/admin Modified Files: Tag: BRANCH_1_0_0 install.php Log Message: Fixed #7030: Port: installtion fails - administrator have no rights on db. Fiixed #7031: Port: is_writable never success in install.php. Index: install.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/admin/install.php,v retrieving revision 1.22.10.2 retrieving revision 1.22.10.3 diff -u -d -r1.22.10.2 -r1.22.10.3 --- install.php 18 Feb 2006 04:18:59 -0000 1.22.10.2 +++ install.php 5 May 2006 16:03:25 -0000 1.22.10.3 @@ -142,7 +142,7 @@ <!-- Check PHP Version --> <tr> <td bgcolor="#ffffff"> - Checking PHP Version (Your version is <?php echo phpversion(); ?>) + Checking PHP version (your version is <?php echo phpversion(); ?>) </td> <?php if (phpversion() == '4.0.6') { @@ -152,17 +152,17 @@ if ( version_compare ( phpversion() , '4.0.6', '>=' ) ) { print_test_result( GOOD ); } else { - print_test_result( BAD, true, 'Upgrade the version of PHP to a more recent version' ); + print_test_result( BAD, true, 'Upgrade to a more recent version of PHP' ); } } else { - print_test_result( BAD, true, 'Upgrade the version of PHP to a more recent version' ); + print_test_result( BAD, true, 'Upgrade to a more recent version of PHP' ); } } ?> </tr> <!-- Check Safe Mode --> -<?php print_test( 'Checking If Safe mode is enabled for install script', +<?php print_test( 'Checking if safe mode is enabled for install script', ! ini_get ( 'SAFE_MODE' ), true, 'Disable safe_mode in php.ini before proceeding' ) ?> @@ -203,10 +203,11 @@ $t_support = function_exists('pg_connect'); break; case 'mssql': - case 'odbc_mssql': - case 'ado_mssql': $t_support = function_exists('mssql_connect'); break; + case 'oci8': + $t_support = function_exists('OCILogon'); + break; default: $t_support = false; } @@ -243,8 +244,12 @@ if ( '' !== $f_admin_password ) { print_test_result( GOOD ); } else { - print_test_result( BAD, false, 'admin user password is blank, using database user password instead' ); - $f_admin_password = $f_db_password; + if ( '' != $f_db_password ) { + print_test_result( BAD, false, 'admin user password is blank, using database user password instead' ); + $f_admin_password = $f_db_password; + } else { + print_test_result( GOOD ); + } } ?> </tr> @@ -258,11 +263,11 @@ $g_db = ADONewConnection($f_db_type); $t_result = @$g_db->Connect($f_hostname, $f_admin_username, $f_admin_password); - if ( $t_result == true ) { + if ( $t_result ) { print_test_result( GOOD ); # check if db exists for the admin $t_result = @$g_db->Connect($f_hostname, $f_admin_username, $f_admin_password, $f_database_name); - if ( $t_result == true ) { + if ( $t_result ) { $f_db_exists = true; } } else { @@ -276,7 +281,8 @@ <td bgcolor="#ffffff"> Checking Database Server Version <?php - $t_version_info = $g_db->ServerInfo(); + # due to a bug in ADODB, this call prompts warnings, hence the @ + $t_version_info = @$g_db->ServerInfo(); echo '<br /> Running ' . $f_db_type . ' version ' . $t_version_info['description']; ?> </td> @@ -288,15 +294,13 @@ case 'mysqli': if ( function_exists ( 'version_compare' ) ) { if ( version_compare ( $t_version_info['version'] , '4.1.0', '>' ) ) { - $t_warning = 'Please ensure that you installation supports the new password scheme used in MySQL 4.1.0 and later. See ' . + $t_warning = 'Please ensure that your installation supports the new password scheme used in MySQL 4.1.0 and later. See ' . '<a href="http://dev.mysql.com/doc/mysql/en/password-hashing.html">http://dev.mysql.com/doc/mysql/en/password-hashing.html</a>.'; } } break; case 'pgsql': case 'mssql': - case 'odbc_mssql': - case 'ado_mssql': default: } @@ -348,11 +352,38 @@ </td> <td> <select name="db_type"> - <option value="mysql">MySql (default)</option> - <option value="mysqli">MySqli</option> - <option value="odbc_mssql">Microsoft SQL Server ODBC (experimental)</option> - <option value="ado_mssql">Microsoft SQL Server ADO (experimental)</option> - <option value="pgsql">PGSQL (experimental)</option> + <?php + if ( $f_db_type == 'mysql' ) { + echo '<option value="mysql" selected="selected">MySql (default)</option>'; + } else { + echo '<option value="mysql">MySql (default)</option>'; + } + + if ( $f_db_type == 'mysqli' ) { + echo '<option value="mysqli" selected="selected">MySqli</option>'; + } else { + echo '<option value="mysqli">MySqli</option>'; + } + + if ( $f_db_type == 'mssql' ) { + echo '<option value="mssql" selected="selected">Microsoft SQL Server (experimental)</option>'; + } else { + echo '<option value="mssql">Microsoft SQL Server (experimental)</option>'; + } + + if ( $f_db_type == 'pgsql' ) { + echo '<option value="pgsql" selected="selected">PGSQL (experimental)</option>'; + } else { + echo '<option value="pgsql">PGSQL (experimental)</option>'; + } + + if ( $f_db_type == 'oci8' ) { + echo '<option value="oci8" selected="selected">Oracle - oci8 (Experimental)</option>'; + } else { + echo '<option value="oci8">Oracle - oci8 (Experimental)</option>'; + } + ?> + </select> </td> </tr> @@ -535,7 +566,7 @@ if ( $f_log_queries ) { # add a query to set the database version echo 'INSERT INTO mantis_config_table ( value, type, access_reqd, config_id, project_id, user_id ) VALUES (\'' . $lastid . '\', 1, 90, \'database_version\', 20, 0 );' . "\r\n"; - echo '</pre></br /><p style="color:red">Your database has not been created yet. Please create the database, then install the tables and data using the information above before proceeding</td></tr>'; + echo '</pre></br /><p style="color:red">Your database has not been created yet. Please create the database, then install the tables and data using the information above before proceeding.</td></tr>'; } } @@ -597,8 +628,7 @@ $t_config_filename = $g_absolute_path . 'config_inc.php'; if ( !file_exists ( $t_config_filename ) ) { - if ( is_writable( $t_config_filename ) ) { - $fd = fopen( $t_config_filename, 'x' ); + if ( $fd = @fopen( $t_config_filename, 'x' ) ) { fwrite( $fd, $t_config ); fclose( $fd ); } @@ -627,7 +657,7 @@ <?php if ( true == $t_write_failed ) { echo '<tr><table width="50%" border="0" cellpadding="10" cellspacing="1" align="center">'; - echo '<tr><td>Please add the following lines to ' . $g_absolute_path . 'config_inc.php before continuing to the database upgrade check</td></tr>'; + echo '<tr><td>Please add the following lines to ' . $g_absolute_path . 'config_inc.php before continuing to the database upgrade check:</td></tr>'; echo '<tr><td><pre>' . htmlentities( $t_config ) . '</pre></td></tr></table></tr>'; } ?> @@ -789,4 +819,4 @@ </form> </body> -</html> \ No newline at end of file +</html> |