install/includes/stages/database.php
changeset 1227 bdac73ed481e
parent 1081 745200a9cc2a
child 1378 e58294b867c1
equal deleted inserted replaced
1226:de56132c008d 1227:bdac73ed481e
    12  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
    12  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
    13  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
    13  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
    14  */
    14  */
    15 
    15 
    16 if ( !defined('IN_ENANO_INSTALL') )
    16 if ( !defined('IN_ENANO_INSTALL') )
    17   die();
    17 	die();
    18 
    18 
    19 echo '<h3>' . $lang->get('database_driver_heading') . '</h3>';
    19 echo '<h3>' . $lang->get('database_driver_heading') . '</h3>';
    20 echo '<p>' . $lang->get('database_driver_intro') . '</p>';
    20 echo '<p>' . $lang->get('database_driver_intro') . '</p>';
    21 if ( @file_exists('/etc/enano-is-virt-appliance') )
    21 if ( @file_exists('/etc/enano-is-virt-appliance') )
    22 {
    22 {
    23   echo '<p>' . $lang->get('database_driver_msg_virt_appliance') . '</p>';
    23 	echo '<p>' . $lang->get('database_driver_msg_virt_appliance') . '</p>';
    24 }
    24 }
    25 
    25 
    26 $mysql_disable_reason = '';
    26 $mysql_disable_reason = '';
    27 $pgsql_disable_reason = '';
    27 $pgsql_disable_reason = '';
    28 $mysql_disable = '';
    28 $mysql_disable = '';
    29 $pgsql_disable = '';
    29 $pgsql_disable = '';
    30 if ( !function_exists('mysql_connect') )
    30 if ( !function_exists('mysql_connect') )
    31 {
    31 {
    32   $mysql_disable = ' disabled="disabled"';
    32 	$mysql_disable = ' disabled="disabled"';
    33   $mysql_disable_reason = $lang->get('database_driver_err_no_mysql');
    33 	$mysql_disable_reason = $lang->get('database_driver_err_no_mysql');
    34 }
    34 }
    35 if ( !function_exists('pg_connect') )
    35 if ( !function_exists('pg_connect') )
    36 {
    36 {
    37   $pgsql_disable = ' disabled="disabled"';
    37 	$pgsql_disable = ' disabled="disabled"';
    38   $pgsql_disable_reason = $lang->get('database_driver_err_no_pgsql');
    38 	$pgsql_disable_reason = $lang->get('database_driver_err_no_pgsql');
    39 }
    39 }
    40 
    40 
    41 echo '<form action="install.php?stage=database" method="post" enctype="multipart/form-data">';
    41 echo '<form action="install.php?stage=database" method="post" enctype="multipart/form-data">';
    42 echo '<input type="hidden" name="language" value="' . $lang_id . '" />';
    42 echo '<input type="hidden" name="language" value="' . $lang_id . '" />';
    43 ?>
    43 ?>
    44 <table border="0" cellspacing="5">
    44 <table border="0" cellspacing="5">
    45   <tr>
    45 	<tr>
    46     <td>
    46 		<td>
    47       <?php 
    47 			<?php 
    48       if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ):
    48 			if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ):
    49       ?>
    49 			?>
    50       <input type="radio" checked="checked" name="driver" value="mysql" <?php echo $mysql_disable; ?>/>
    50 			<input type="radio" checked="checked" name="driver" value="mysql" <?php echo $mysql_disable; ?>/>
    51       <?php
    51 			<?php
    52       else:
    52 			else:
    53       ?>
    53 			?>
    54       <button name="driver" value="mysql"<?php echo $mysql_disable; ?>>
    54 			<button name="driver" value="mysql"<?php echo $mysql_disable; ?>>
    55         <img src="../images/about-powered-mysql.png" />
    55 				<img src="../images/about-powered-mysql.png" />
    56       </button>
    56 			</button>
    57       <?php
    57 			<?php
    58       endif;
    58 			endif;
    59       ?>
    59 			?>
    60     </td>
    60 		</td>
    61     <td<?php if ( $mysql_disable ) echo ' style="opacity: 0.5; filter: alpha(opacity=50);"'; ?>>
    61 		<td<?php if ( $mysql_disable ) echo ' style="opacity: 0.5; filter: alpha(opacity=50);"'; ?>>
    62       <b><?php echo $lang->get('database_driver_mysql'); ?></b><br />
    62 			<b><?php echo $lang->get('database_driver_mysql'); ?></b><br />
    63       <?php echo $lang->get('database_driver_mysql_intro'); ?>
    63 			<?php echo $lang->get('database_driver_mysql_intro'); ?>
    64       <?php
    64 			<?php
    65       if ( $mysql_disable )
    65 			if ( $mysql_disable )
    66       {
    66 			{
    67         echo "<br /><br /><b>$mysql_disable_reason</b>";
    67 				echo "<br /><br /><b>$mysql_disable_reason</b>";
    68       }
    68 			}
    69       ?>
    69 			?>
    70     </td>
    70 		</td>
    71   </tr>
    71 	</tr>
    72   <tr>
    72 	<tr>
    73     <td>
    73 		<td>
    74       <?php
    74 			<?php
    75       if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ):
    75 			if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ):
    76       ?>
    76 			?>
    77       <input type="radio" name="driver" value="mysql" <?php echo $pgsql_disable; ?>/>
    77 			<input type="radio" name="driver" value="mysql" <?php echo $pgsql_disable; ?>/>
    78       <?php
    78 			<?php
    79       else:
    79 			else:
    80       ?>
    80 			?>
    81       <button name="driver" value="postgresql"<?php echo $pgsql_disable; ?>>
    81 			<button name="driver" value="postgresql"<?php echo $pgsql_disable; ?>>
    82         <img src="../images/about-powered-pgsql.png" />
    82 				<img src="../images/about-powered-pgsql.png" />
    83       </button>
    83 			</button>
    84       <?php
    84 			<?php
    85       endif;
    85 			endif;
    86       ?>
    86 			?>
    87     </td>
    87 		</td>
    88     <td<?php if ( $pgsql_disable ) echo ' style="opacity: 0.5; filter: alpha(opacity=50);"'; ?>>
    88 		<td<?php if ( $pgsql_disable ) echo ' style="opacity: 0.5; filter: alpha(opacity=50);"'; ?>>
    89       <b><?php echo $lang->get('database_driver_pgsql'); ?></b><br />
    89 			<b><?php echo $lang->get('database_driver_pgsql'); ?></b><br />
    90       <?php echo $lang->get('database_driver_pgsql_intro'); ?>
    90 			<?php echo $lang->get('database_driver_pgsql_intro'); ?>
    91       <?php
    91 			<?php
    92       if ( $pgsql_disable )
    92 			if ( $pgsql_disable )
    93       {
    93 			{
    94         echo "<br /><br /><b>$pgsql_disable_reason</b>";
    94 				echo "<br /><br /><b>$pgsql_disable_reason</b>";
    95       }
    95 			}
    96       ?>
    96 			?>
    97     </td>
    97 		</td>
    98   </tr>
    98 	</tr>
    99 </table>
    99 </table>
   100 
   100 
   101 <?php
   101 <?php
   102 if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') )
   102 if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') )
   103 {
   103 {
   104   echo '<div style="text-align: center;">
   104 	echo '<div style="text-align: center;">
   105           <input type="submit" />
   105 					<input type="submit" />
   106         </div>';
   106 				</div>';
   107 }
   107 }
   108 
   108 
   109 echo '</form>';
   109 echo '</form>';