]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - install/systemOptions.php
Release 6.2.2
[Github/sugarcrm.git] / install / systemOptions.php
1 <?php
2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4  * SugarCRM Community Edition is a customer relationship management program developed by
5  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
6  * 
7  * This program is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Affero General Public License version 3 as published by the
9  * Free Software Foundation with the addition of the following permission added
10  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13  * 
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
17  * details.
18  * 
19  * You should have received a copy of the GNU Affero General Public License along with
20  * this program; if not, see http://www.gnu.org/licenses or write to the Free
21  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301 USA.
23  * 
24  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26  * 
27  * The interactive user interfaces in modified source and object code versions
28  * of this program must display Appropriate Legal Notices, as required under
29  * Section 5 of the GNU Affero General Public License version 3.
30  * 
31  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32  * these Appropriate Legal Notices must retain the display of the "Powered by
33  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34  * technical reasons, the Appropriate Legal Notices must display the words
35  * "Powered by SugarCRM".
36  ********************************************************************************/
37
38
39 if( !isset( $install_script ) || !$install_script ){
40     die($mod_strings['ERR_NO_DIRECT_SCRIPT']);
41 }
42 if(!isset($_SESSION['setup_db_type']) || $_SESSION['setup_db_type'] ==''){
43  $_SESSION['setup_db_type'] = 'mysql';   
44 }
45 $setup_db_type = $_SESSION['setup_db_type'];
46
47 $errs = '';
48 if(isset($validation_errors)) {
49         if(count($validation_errors) > 0) {
50                 $errs  = '<div id="errorMsgs">';
51                 $errs .= "<p>{$mod_strings['LBL_SYSOPTS_ERRS_TITLE']}</p>";
52                 $errs .= '<ul>';
53
54                 foreach($validation_errors as $error) {
55                         $errs .= '<li>' . $error . '</li>';
56                 }
57
58                 $errs .= '</ul>';
59                 $errs .= '</div>';
60         }
61 }
62
63 $mysql = '';
64 $oci8 = '';
65 $mssql = '';
66 if($setup_db_type == "mysql")
67         $mysql = 'checked="checked"';
68 else if ($setup_db_type == "mssql")
69         $mssql = 'checked="checked"';
70
71
72 $out=<<<EOQ
73 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
74 <html>
75 <head>
76    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
77    <meta http-equiv="Content-Script-Type" content="text/javascript">
78    <meta http-equiv="Content-Style-Type" content="text/css">
79    <title>{$mod_strings['LBL_WIZARD_TITLE']} {$mod_strings['LBL_SYSOPTS_DB_TITLE']}</title>
80    <link REL="SHORTCUT ICON" HREF="include/images/sugar_icon.ico">
81    <link rel="stylesheet" href="install/install.css" type="text/css" />
82    <script type="text/javascript" src="install/installCommon.js"></script>
83 </head>
84 <body onload="document.getElementById('button_next2').focus();">
85 <form action="install.php" method="post" name="systemOptions" id="form">
86
87 <table cellspacing="0" cellpadding="0" border="0" align="center" class="shell">
88       <tr><td colspan="2" id="help"><a href="{$help_url}" target='_blank'>{$mod_strings['LBL_HELP']} </a></td></tr>
89     <tr>
90       <th width="500">
91                 <p>
92                 <img src="{$sugar_md}" alt="SugarCRM" border="0">
93                 </p>
94     {$mod_strings['LBL_SYSOPTS_DB_TITLE']}</th>
95         <th width="200" style="text-align: right;">
96                 <a href="http://www.sugarcrm.com" target="_blank"><IMG src="include/images/sugarcrm_login.png" width="145" height="30" alt="SugarCRM" border="0"></a>
97         </th>
98 </tr>
99 <tr>
100    <td colspan="2">     
101                 {$errs}
102
103
104 <table width="100%" cellpadding="0" cellpadding="0" border="0" class="StyleDottedHr">
105 <tr><th colspan="3" align="left">{$mod_strings['LBL_SYSOPTS_DB']}</td></tr>
106 <tr><td colspan="3" align="left">{$mod_strings['LBL_SYSOPTS_2']}</td></tr>
107 <tr>
108     <td>&nbsp;</td>
109     <td align="left">
110 EOQ;
111 if(function_exists('mysql_connect') || function_exists('mysqli_connect')){ 
112 $out.=<<<EOQ
113         <input type="radio" class="checkbox" name="setup_db_type" id="setup_db_type" value="mysql" {$mysql} onclick="document.getElementById('ociMsg').style.display='none'"/>{$mod_strings['LBL_MYSQL']}
114 EOQ;
115 //check to see if mysqli is enabled
116 if(function_exists('mysqli_connect')){
117     $_SESSION['mysql_type'] = 'mysqli';
118     $out.=' &nbsp;(MySQLi detected)<br>';
119 }else{
120      $out.= '<br>';
121 }    
122 }
123 if(function_exists('mssql_connect') || function_exists('sqlsrv_connect')){
124 $out.=<<<EOQ
125                 <input type="radio" class="checkbox" name="setup_db_type" id="setup_db_type" value="mssql" {$mssql} onclick="document.getElementById('ociMsg').style.display='none'"/>{$mod_strings['LBL_MSSQL']}
126 EOQ;
127 }
128 //check to see if sqlsrv is enabled
129 if(function_exists('sqlsrv_connect')){
130     $_SESSION['mssql_type'] = 'sqlsrv';
131     $out.=' &nbsp;(Microsoft SQL Server Driver for PHP detected)<br>';
132 }else{
133      $out.= '<br>';
134 }
135
136
137
138
139 $out.=<<<EOQ
140     </td>
141     <td width='350'nowrap>&nbsp;
142     <div name="ociMsg" id="ociMsg" style="display:none">
143     </div>
144 EOQ;
145
146 $out.=<<<EOQ
147     </td>
148         
149 </tr>
150 </table>
151 </td>
152 </tr>
153 <tr>
154 <td align="right" colspan="2">
155 <hr>
156      <input type="hidden" name="current_step" value=" $next_step ">
157      <table cellspacing="0" cellpadding="0" border="0" class="stdTable">
158        <tr>
159          <td>
160             <input class="button" type="button" value="{$mod_strings['LBL_BACK']}" id="button_back_systemOptions" onclick="document.getElementById('form').submit();" />
161             <input type="hidden" name="goto" value="{$mod_strings['LBL_BACK']}" />
162          </td>
163          <td><input class="button" type="submit" id="button_next2" name="goto" value="{$mod_strings['LBL_NEXT']}" /></td>
164        </tr>
165      </table>
166 </td>
167 </tr>
168 </table>
169 </form>
170 </body>
171 </html>
172 EOQ;
173 echo $out;
174 ?>