[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/install/ -> 3confirmConfig.php (source)

   1  <?php
   2  /*********************************************************************************
   3   * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
   4   * ("License"); You may not use this file except in compliance with the
   5   * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
   6   * Software distributed under the License is distributed on an  "AS IS"  basis,
   7   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
   8   * the specific language governing rights and limitations under the License.
   9   * The Original Code is:  SugarCRM Open Source
  10   * The Initial Developer of the Original Code is SugarCRM, Inc.
  11   * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
  12   * All Rights Reserved.
  13   * Contributor(s): ______________________________________.
  14   ********************************************************************************/
  15  /*********************************************************************************
  16   * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/install/3confirmConfig.php,v 1.14 2005/04/25 09:41:26 samk Exp $
  17   * Description:  Executes a step in the installation process.
  18   ********************************************************************************/
  19  
  20  if (isset($_REQUEST['db_hostname'])) $db_hostname= $_REQUEST['db_hostname'];
  21  if (isset($_REQUEST['db_username'])) $db_username= $_REQUEST['db_username'];
  22  if (isset($_REQUEST['db_password'])) $db_password= $_REQUEST['db_password'];
  23  if (isset($_REQUEST['db_name'])) $db_name= $_REQUEST['db_name'];
  24  if (isset($_REQUEST['db_drop_tables'])) $db_drop_tables = $_REQUEST['db_drop_tables'];
  25  if (isset($_REQUEST['site_URL'])) $site_URL= $_REQUEST['site_URL'];
  26  if (isset($_REQUEST['admin_email'])) $admin_email= $_REQUEST['admin_email'];
  27  if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password'];
  28  if (isset($_REQUEST['currency_name'])) $currency_name = $_REQUEST['currency_name'];
  29  if (isset($_REQUEST['currency_symbol'])) $currency_symbol = $_REQUEST['currency_symbol'];
  30  if (isset($_REQUEST['currency_code'])) $currency_code = $_REQUEST['currency_code'];
  31  if (isset($_REQUEST['cache_dir'])) $cache_dir= $_REQUEST['cache_dir'];
  32  if (isset($_REQUEST['mail_server'])) $mail_server= $_REQUEST['mail_server'];
  33  if (isset($_REQUEST['mail_server_username'])) $mail_server_username= $_REQUEST['mail_server_username'];
  34  if (isset($_REQUEST['mail_server_password'])) $mail_server_password= $_REQUEST['mail_server_password'];
  35  if (isset($_REQUEST['root_directory'])) $root_directory = $_REQUEST['root_directory'];
  36  if (isset($_REQUEST['ftpserver'])) $ftpserver= $_REQUEST['ftpserver'];
  37  if (isset($_REQUEST['ftpuser'])) $ftpuser = $_REQUEST['ftpuser'];
  38  if (isset($_REQUEST['ftppassword'])) $ftppassword= $_REQUEST['ftppassword'];
  39  if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type'];
  40  if (isset($_REQUEST['check_createdb'])) $check_createdb = $_REQUEST['check_createdb'];
  41  if (isset($_REQUEST['root_user'])) $root_user = $_REQUEST['root_user'];
  42  if (isset($_REQUEST['root_password'])) $root_password = $_REQUEST['root_password'];
  43  
  44  $db_type_status = false; // is there a db type?
  45  $db_server_status = false; // does the db server connection exist?
  46  $db_creation_failed = false; // did we try to create a database and fail?
  47  $db_exist_status = false; // does the database exist?
  48  $next = false; // allow installation to continue
  49  
  50  //Checking for database connection parameters
  51  if($db_type)
  52  {
  53      include ('adodb/adodb.inc.php');
  54      $conn = &NewADOConnection($db_type);
  55      $db_type_status = true;
  56      if(@$conn->Connect($db_hostname,$db_username,$db_password))
  57      {
  58          $db_server_status = true;
  59          if($db_type=='mysql')
  60          {
  61              $mysql_conn = mysql_connect($db_hostname,$db_username,$db_password);
  62              $version = explode('-',mysql_get_server_info($mysql_conn));
  63              $mysql_server_version=$version[0];
  64              mysql_close($mysql_conn);
  65          }
  66          if(isset($_REQUEST['check_createdb']) && $_REQUEST['check_createdb'] == 'on')
  67          {
  68              $root_user = $_REQUEST['root_user'];
  69              $root_password = $_REQUEST['root_password'];
  70  
  71              // drop the current database if it exists
  72              $dropdb_conn = &NewADOConnection($db_type);
  73              if(@$dropdb_conn->Connect($db_hostname, $root_user, $root_password, $db_name))
  74              {
  75                  $query = "drop database ".$db_name;
  76                  $dropdb_conn->Execute($query);
  77                  $dropdb_conn->Close();
  78              }
  79  
  80              // create the new database
  81              $db_creation_failed = true;
  82              $createdb_conn = &NewADOConnection($db_type);
  83              if(@$createdb_conn->Connect($db_hostname, $root_user, $root_password)) {
  84                  $query = "create database ".$db_name;
  85                  if($createdb_conn->Execute($query)) {
  86                      $db_creation_failed = false;
  87                  }
  88                  $createdb_conn->Close();
  89              }
  90          }
  91  
  92          // test the connection to the database
  93          if(@$conn->Connect($db_hostname, $db_username, $db_password, $db_name))
  94          {
  95              $db_exist_status = true;
  96          }
  97          $conn->Close();
  98      }
  99  }
 100  
 101  $error_msg = '';
 102  $error_msg_info = '';
 103  
 104  if(!$db_type_status || !$db_server_status)
 105  {
 106      $error_msg = 'Unable to connect to database Server. Invalid mySQL Connection Parameters specified';
 107      $error_msg_info = 'This may be due to the following reasons:<br>
 108              -  specified database user, password, hostname, database type, or port is invalid.<BR>
 109              -  specified database user does not have access to connect to the database server from the host';
 110  }
 111  elseif($db_type == 'mysql' && $mysql_server_version < '4.1')
 112  {
 113      $error_msg = 'MySQL version '.$mysql_server_version.' is not supported, kindly connect to MySQL 4.1.x or above';
 114  }
 115  elseif($db_creation_failed)
 116  {
 117      $error_msg = 'Unable to Create Database '.$db_name;
 118      $error_msg_info = 'Message: The database User "'. $root_user .'" doesn\'t have permission to Create database. Try changing the Database settings';
 119  }
 120  elseif(!$db_exist_status)
 121  {
 122      $error_msg = 'The Database "'.$db_name.'" is not found.Try changing the Database settings';
 123  }
 124  else
 125  {
 126      $next = true;
 127  }
 128  
 129  ?>
 130  
 131  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 132  <html>
 133  <head>
 134      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 135      <title>vtiger CRM 5 - Configuration Wizard - Confirm Settings</title>
 136      <link href="include/install/install.css" rel="stylesheet" type="text/css">
 137  </head>
 138  
 139  <body class="small cwPageBg" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
 140  
 141  <br><br><br>
 142      <!-- Table for cfgwiz starts -->
 143  
 144      <table border=0 cellspacing=0 cellpadding=0 width=80% align=center>
 145      <tr>
 146          <td class="cwHeadBg" align=left><img src="include/install/images/configwizard.gif" alt="Configuration Wizard" hspace="20" title="Configuration Wizard"></td>
 147          <td class="cwHeadBg" align=right><img src="include/install/images/vtigercrm5.gif" alt="vtiger CRM 5" title="vtiger CRM 5"></td>
 148      </tr>
 149      </table>
 150      <table border=0 cellspacing=0 cellpadding=0 width=80% align=center>
 151      <tr>
 152          <td background="include/install/images/topInnerShadow.gif" align=left><img src="include/install/images/topInnerShadow.gif" ></td>
 153  
 154      </tr>
 155      </table>
 156      <table border=0 cellspacing=0 cellpadding=10 width=80% align=center>
 157      <tr>
 158          <td class="small" bgcolor="#4572BE" align=center>
 159              <!-- Master display -->
 160              <table border=0 cellspacing=0 cellpadding=0 width=97%>
 161              <tr>
 162                  <td width=20% valign=top>
 163  
 164                  <!-- Left side tabs -->
 165                      <table border=0 cellspacing=0 cellpadding=10 width=100%>
 166                      <tr><td class="small cwUnSelectedTab" align=right><div align="left">Welcome</div></td></tr>
 167                      <tr><td class="small cwUnSelectedTab" align=right><div align="left">Installation Check</div></td></tr>
 168                      <tr><td class="small cwUnSelectedTab" align=right><div align="left">System Configuration</div></td></tr>
 169                      <tr><td class="small cwSelectedTab" align=right><div align="left"><b>Confirm Settings</b></div></td></tr>
 170                      <tr><td class="small cwUnSelectedTab" align=right><div align="left">Config File Creation</div></td></tr>
 171                      <tr><td class="small cwUnSelectedTab" align=right><div align="left">Database Generation</div></td></tr>
 172                      <tr><td class="small cwUnSelectedTab" align=right><div align="left">Finish</div></td></tr>
 173                      </table>
 174                      
 175                  </td>
 176                  <td width=80% valign=top class="cwContentDisplay" align=left>
 177                  <table border=0 cellspacing=0 cellpadding=10 width=100%>
 178                  <tr><td class=small align=left><img src="include/install/images/confWizConfirmSettings.gif" alt="Confirm Configuration Settings" title="Confirm Configuration Settings"><br>
 179                        <hr noshade size=1></td></tr>
 180                  <tr>
 181                      <td align=left class="small" style="padding-left:20px">
 182                      <?php if($error_msg) : ?>
 183                          <div style="background-color:#ff0000;color:#ffffff;padding:5px">
 184                          <b><?php echo $error_msg ?></b>
 185                          </div>
 186                          <?php if($error_msg_info) : ?>
 187                              <p><? echo $error_msg_info ?><p>
 188                          <?php endif ?>
 189                      <?php endif ?>
 190                      <table width="90%" cellpadding="5" border="0" class="small" style="background-color:#cccccc" cellspacing="1">
 191                      <tr>
 192                          <td colspan=2><strong>Database Configuration</strong></td>
 193                      </tr>
 194                      <tr bgcolor="White">
 195                          <td bgcolor="#F5F5F5" width="40%">Host Name</td>
 196                          <td align="left" nowrap> <font class="dataInput"><?php if (isset($db_hostname)) echo "$db_hostname"; ?></font></td>
 197                      </tr>
 198                      <tr bgcolor="White">
 199                          <td bgcolor="#F5F5F5" width="40%">User Name</td>
 200                          <td align="left" nowrap> <font class="dataInput"><?php if (isset($db_username)) echo "$db_username"; ?></font></td>
 201                      </tr>
 202                      <tr bgcolor="White">
 203                          <td bgcolor="#F5F5F5" width="40%" noWrap>Password</td>
 204                          <td align="left" nowrap> <font class="dataInput"><?php if (isset($db_password)) echo ereg_replace('.', '*', $db_password); ?></font></td>
 205                      </tr>
 206                      <tr bgcolor="White">
 207                          <td noWrap bgcolor="#F5F5F5" width="40%">Database Type</td>
 208                          <td align="left" nowrap> <font class="dataInput"><?php if (isset($db_type)) echo "$db_type"; ?></font></td>
 209                      </tr>
 210                      <tr bgcolor="White">
 211                          <td noWrap bgcolor="#F5F5F5" width="40%">Database Name</td>
 212                          <td align="left" nowrap> <font class="dataInput"><?php if (isset($db_name)) echo "$db_name"; ?></font></td>
 213                      </tr>
 214                      </table>
 215                      <table width="90%" cellpadding="5" border="0" class="small" cellspacing="1" style="background-color:#cccccc">
 216                      <tr>
 217                          <td colspan=2 ><strong>Site Configuration</strong></td>
 218                      </tr>
 219                      <tr bgcolor="White">
 220                          <td bgcolor="#F5F5F5" width="40%">URL</td>
 221                          <td align="left"> <font class="dataInput"><?php if (isset($site_URL)) echo $site_URL; ?></font></td>
 222                      </tr>
 223                      <tr bgcolor="White">
 224                          <td bgcolor="#F5F5F5" width="40%">Path</td>
 225                          <td align="left"><font class="dataInput"><?php if (isset($root_directory)) echo $root_directory; ?></font></td>
 226                      </tr>
 227                      <tr bgcolor="White">
 228                          <td bgcolor="#F5F5F5" width="40%">Cache Path</td>
 229                          <td align="left"> <font class="dataInput"><?php if (isset($cache_dir)) echo $root_directory.''.$cache_dir; ?></font></td>
 230                      </tr>
 231                      </table>    
 232                      <table width="90%" cellpadding="5" border="0" class="small" cellspacing="1" style="background-color:#cccccc">
 233                      <tr>
 234                          <td colspan=2 ><strong>Admin Configuration</strong></td>
 235                      </tr>
 236                      <tr bgcolor="White">
 237                          <td bgcolor="#F5F5F5" width="40%">Username</td>
 238                          <td align="left"> <font class="dataInput">admin</font></td>
 239                      </tr>
 240                      <tr bgcolor="White">
 241                          <td bgcolor="#F5F5F5" width="40%">Password</td>
 242                          <td align="left"> <font class="dataInput"><?php if (isset($admin_password)) echo ereg_replace('.', '*', $admin_password); ?></font></td>
 243                      </tr>
 244                      <tr bgcolor="White">
 245                          <td bgcolor="#F5F5F5" width="40%">Email</td>
 246                          <td align="left"> <font class="dataInput"><?php if (isset($admin_email)) echo $admin_email; ?></font></td>
 247                      </tr>
 248                      </table>
 249                      <table width="90%" cellpadding="5" border="0" class="small" cellspacing="1" style="background-color:#cccccc">
 250                      <tr>
 251                          <td colspan=2 ><strong>Currency Configuration</strong></td>
 252                      </tr>
 253                      <tr bgcolor="White">
 254                          <td bgcolor="#F5F5F5" width="40%">Name</td>
 255                          <td align="left"> <font class="dataInput"><?php if (isset($currency_name)) echo $currency_name; ?></font></td>
 256                      </tr>
 257                      <tr bgcolor="White">
 258                          <td bgcolor="#F5F5F5" width="40%">Symbol</td>
 259                          <td align="left"> <font class="dataInput"><?php if (isset($currency_symbol)) echo $currency_symbol; ?></font></td>
 260                      </tr>
 261                      <tr bgcolor="White">
 262                          <td bgcolor="#F5F5F5" width="40%">Code</td>
 263                          <td align="left"> <font class="dataInput"><?php if (isset($currency_code)) echo $currency_code; ?></font></td>
 264                      </tr>
 265                      </table>
 266  
 267  
 268                      <br><br>
 269                      <table width="90%" cellpadding="5" border="0" class="small" >
 270                      <tr>
 271                      <td align="left" valign="bottom">
 272                      <form action="install.php" method="post" name="form" id="form">
 273                          <input type="hidden" name="file" value="2setConfig.php">
 274                          <input type="hidden" class="dataInput" name="db_type" value="<?php if (isset($db_type)) echo "$db_type"; ?>" />
 275                          <input type="hidden" class="dataInput" name="db_hostname" value="<?php if (isset($db_hostname)) echo "$db_hostname"; ?>" />
 276                          <input type="hidden" class="dataInput" name="db_username" value="<?php if (isset($db_username)) echo "$db_username"; ?>" />
 277                          <input type="hidden" class="dataInput" name="db_password" value="<?php if (isset($db_password)) echo "$db_password"; ?>" />
 278                          <input type="hidden" class="dataInput" name="db_name" value="<?php if (isset($db_name)) echo "$db_name"; ?>" />
 279                          <input type="hidden" class="dataInput" name="db_drop_tables" value="<?php if (isset($db_drop_tables)) echo "$db_drop_tables"; ?>" />
 280                          <input type="hidden" class="dataInput" name="site_URL" value="<?php if (isset($site_URL)) echo "$site_URL"; ?>" />
 281                          <input type="hidden" class="dataInput" name="root_directory" value="<?php if (isset($root_directory)) echo "$root_directory"; ?>" />
 282                          <input type="hidden" class="dataInput" name="admin_email" value="<?php if (isset($admin_email)) echo "$admin_email"; ?>" />
 283                          <input type="hidden" class="dataInput" name="admin_password" value="<?php if (isset($admin_password)) echo "$admin_password"; ?>" />
 284                          <input type="hidden" class="dataInput" name="currency_name" value="<?php if (isset($currency_name)) echo "$currency_name"; ?>" />
 285                          <input type="hidden" class="dataInput" name="currency_symbol" value="<?php if (isset($currency_symbol)) echo "$currency_symbol"; ?>" />
 286                          <input type="hidden" class="dataInput" name="currency_code" value="<?php if (isset($currency_code)) echo "$currency_code"; ?>" />
 287                          <input type="hidden" class="dataInput" name="cache_dir" value="<?php if (isset($cache_dir)) echo $cache_dir; ?>" />
 288                          <input type="hidden" class="dataInput" name="mail_server" value="<?php if (isset($maill_server)) echo $mail_server; ?>" />
 289                          <input type="hidden" class="dataInput" name="mail_server_username" value="<?php if (isset($maill_server_username)) echo $mail_server_username; ?>" />
 290                          <input type="hidden" class="dataInput" name="mail_server_password" value="<?php if (isset($maill_server_password)) echo $mail_server_password; ?>" />
 291                          <input type="hidden" class="dataInput" name="ftpserver" value="<?php if (isset($ftpserver)) echo "$ftpserver"; ?>" />
 292                          <input type="hidden" class="dataInput" name="ftpuser" value="<?php if (isset($ftpuser)) echo "$ftpuser"; ?>" />
 293                          <input type="hidden" class="dataInput" name="ftppassword" value="<?php if (isset($ftppassword)) echo "$ftppassword"; ?>" />
 294                          <input type="hidden" class="dataInput" name="check_createdb" value="<?php if (isset($check_createdb)) echo "$check_createdb"; ?>" />
 295                          <input type="hidden" class="dataInput" name="root_user" value="<?php if (isset($root_user)) echo "$root_user"; ?>" />
 296                          <input type="hidden" class="dataInput" name="root_password" value="<?php if (isset($root_password)) echo "$root_password"; ?>" />
 297                          <input type="image" name="Change" value="Change" title="Change" src="include/install/images/cwBtnChange.gif"/>
 298                      </form>
 299                      </td>
 300  
 301                      <?php if($next) : ?>
 302                      <td align="right" valign="bottom">
 303                      <form action="install.php" method="post" name="form" id="form">
 304                          <input type="hidden" name="file" value="4createConfigFile.php">
 305                              <table class=small>
 306                              <tr>
 307                                  <td><input type="checkbox" class="dataInput" name="db_populate" value="1"></td>
 308                                  <td>Populate database with demo data</td>
 309                              </tr>
 310                              </table>
 311                          <input type="hidden" class="dataInput" name="db_type" value="<?php if (isset($db_type)) echo "$db_type"; ?>" />
 312                          <input type="hidden" class="dataInput" name="db_hostname" value="<?php if (isset($db_hostname)) echo "$db_hostname"; ?>" />
 313                          <input type="hidden" class="dataInput" name="db_username" value="<?php if (isset($db_username)) echo "$db_username"; ?>" />
 314                          <input type="hidden" class="dataInput" name="db_password" value="<?php if (isset($db_password)) echo "$db_password"; ?>" />
 315                          <input type="hidden" class="dataInput" name="db_name" value="<?php if (isset($db_name)) echo "$db_name"; ?>" />
 316                          <input type="hidden" class="dataInput" name="db_drop_tables" value="<?php if (isset($db_drop_tables)) echo "$db_drop_tables"; ?>" />
 317                          <input type="hidden" class="dataInput" name="site_URL" value="<?php if (isset($site_URL)) echo "$site_URL"; ?>" />
 318                          <input type="hidden" class="dataInput" name="root_directory" value="<?php if (isset($root_directory)) echo "$root_directory"; ?>" />
 319                          <input type="hidden" class="dataInput" name="admin_email" value="<?php if (isset($admin_email)) echo "$admin_email"; ?>" />
 320                          <input type="hidden" class="dataInput" name="admin_password" value="<?php if (isset($admin_password)) echo "$admin_password"; ?>" />
 321                          <input type="hidden" class="dataInput" name="currency_name" value="<?php if (isset($currency_name)) echo "$currency_name"; ?>" />
 322                          <input type="hidden" class="dataInput" name="currency_code" value="<?php if (isset($currency_code)) echo "$currency_code"; ?>" />
 323                          <input type="hidden" class="dataInput" name="currency_symbol" value="<?php if (isset($currency_symbol)) echo "$currency_symbol"; ?>" />
 324                          <input type="hidden" class="dataInput" name="cache_dir" value="<?php if (isset($cache_dir)) echo $cache_dir; ?>" />
 325                          <input type="hidden" class="dataInput" name="mail_server" value="<?php if (isset($mail_server)) echo $mail_server; ?>" />
 326                          <input type="hidden" class="dataInput" name="mail_server_username" value="<?php if (isset($mail_server_username)) echo $mail_server_username; ?>" />
 327                          <input type="hidden" class="dataInput" name="mail_server_password" value="<?php if (isset($mail_server_password)) echo $mail_server_password; ?>" />
 328                          <input type="hidden" class="dataInput" name="ftpserver" value="<?php if (isset($ftpserver)) echo "$ftpserver"; ?>" />
 329                          <input type="hidden" class="dataInput" name="ftpuser" value="<?php if (isset($ftpuser)) echo "$ftpuser"; ?>" />
 330                          <input type="hidden" class="dataInput" name="ftppassword" value="<?php if (isset($ftppassword)) echo "$ftppassword"; ?>" />
 331                          <input type="hidden" class="dataInput" name="check_createdb" value="<?php if (isset($check_createdb)) echo "$check_createdb"; ?>" />
 332                          <input type="hidden" class="dataInput" name="root_user" value="<?php if (isset($root_user)) echo "$root_user"; ?>" />
 333                          <input type="hidden" class="dataInput" name="root_password" value="<?php if (isset($root_password)) echo "$root_password"; ?>" />
 334                          <input type="image" src="include/install/images/cwBtnNext.gif" name="next" title="Next" value="Create" onClick="window.location=('install.php')"/>
 335                      </form>
 336                      </td>
 337                      <?php endif ?>
 338                      </tr>
 339                      </table>
 340  
 341                  </td>
 342                  </tr>
 343              </table>
 344  </td>
 345          </tr>
 346      </table>
 347      <!-- Master display stops -->
 348      <br>
 349      </td>
 350      </tr>
 351      </table>
 352      <table border=0 cellspacing=0 cellpadding=0 width=80% align=center>
 353      <tr>
 354  
 355          <td background="include/install/images/bottomGradient.gif"><img src="include/install/images/bottomGradient.gif"></td>
 356      </tr>
 357      </table>
 358      <table border=0 cellspacing=0 cellpadding=0 width=80% align=center>
 359      <tr>
 360          <td align=center><img src="include/install/images/bottomShadow.jpg"></td>
 361      </tr>
 362      </table>
 363      <table border=0 cellspacing=0 cellpadding=0 width=80% align=center>
 364  
 365            <tr>
 366              <td class=small align=center> <a href="http://www.vtiger.com" target="_blank">www.vtiger.com</a></td>
 367            </tr>
 368          </table>    
 369  </body>
 370  </html>


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7