]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - install/siteConfig_a.php
Release 6.4.0
[Github/sugarcrm.git] / install / siteConfig_a.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
40
41 if( !isset( $install_script ) || !$install_script ){
42     die($mod_strings['ERR_NO_DIRECT_SCRIPT']);
43 }
44
45 if( is_file("config.php") ){
46         if(!empty($sugar_config['default_theme']))
47       $_SESSION['site_default_theme'] = $sugar_config['default_theme'];
48
49         if(!empty($sugar_config['disable_persistent_connections']))
50                 $_SESSION['disable_persistent_connections'] =
51                 $sugar_config['disable_persistent_connections'];
52         if(!empty($sugar_config['default_language']))
53                 $_SESSION['default_language'] = $sugar_config['default_language'];
54         if(!empty($sugar_config['translation_string_prefix']))
55                 $_SESSION['translation_string_prefix'] = $sugar_config['translation_string_prefix'];
56         if(!empty($sugar_config['default_charset']))
57                 $_SESSION['default_charset'] = $sugar_config['default_charset'];
58
59         if(!empty($sugar_config['default_currency_name']))
60                 $_SESSION['default_currency_name'] = $sugar_config['default_currency_name'];
61         if(!empty($sugar_config['default_currency_symbol']))
62                 $_SESSION['default_currency_symbol'] = $sugar_config['default_currency_symbol'];
63         if(!empty($sugar_config['default_currency_iso4217']))
64                 $_SESSION['default_currency_iso4217'] = $sugar_config['default_currency_iso4217'];
65
66         if(!empty($sugar_config['rss_cache_time']))
67                 $_SESSION['rss_cache_time'] = $sugar_config['rss_cache_time'];
68         if(!empty($sugar_config['languages']))
69         {
70                 // We need to encode the languages in a way that can be retrieved later.
71                 $language_keys = Array();
72                 $language_values = Array();
73
74                 foreach($sugar_config['languages'] as $key=>$value)
75                 {
76                         $language_keys[] = $key;
77                         $language_values[] = $value;
78                 }
79
80                 $_SESSION['language_keys'] = urlencode(implode(",",$language_keys));
81                 $_SESSION['language_values'] = urlencode(implode(",",$language_values));
82         }
83 }
84
85 ////    errors
86 $errors = '';
87 if( isset($validation_errors) && is_array($validation_errors)){
88     if( count($validation_errors) > 0 ){
89         $errors  = '<div id="errorMsgs">';
90         $errors .= '<p>'.$mod_strings['LBL_SITECFG_FIX_ERRORS'].'</p><ul>';
91         foreach( $validation_errors as $error ){
92                         $errors .= '<li>' . $error . '</li>';
93         }
94                 $errors .= '</ul></div>';
95     }
96 }
97
98
99 ////    ternaries
100 $sugarUpdates = (isset($_SESSION['setup_site_sugarbeet']) && !empty($_SESSION['setup_site_sugarbeet'])) ? 'checked="checked"' : '';
101 $siteSecurity = (isset($_SESSION['setup_site_defaults']) && !empty($_SESSION['setup_site_defaults'])) ? 'checked="checked"' : '';
102 $customSession = (isset($_SESSION['setup_site_custom_session_path']) && !empty($_SESSION['setup_site_custom_session_path'])) ? 'checked="checked"' : '';
103 $customLog = (isset($_SESSION['setup_site_custom_log_dir']) && !empty($_SESSION['setup_site_custom_log_dir'])) ? 'checked="checked"' : '';
104 $customId = (isset($_SESSION['setup_site_specify_guid']) && !empty($_SESSION['setup_site_specify_guid'])) ? 'checked="checked"' : '';
105
106 ///////////////////////////////////////////////////////////////////////////////
107 ////    START OUTPUT
108 $langHeader = get_language_header();
109 $out =<<<EOQ
110 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
111 <html {$langHeader}>
112 <head>
113    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
114    <meta http-equiv="Content-Script-Type" content="text/javascript">
115    <meta http-equiv="Content-Style-Type" content="text/css">
116    <title>{$mod_strings['LBL_WIZARD_TITLE']}  {$mod_strings['LBL_SITECFG_TITLE']}</title>
117    <link REL="SHORTCUT ICON" HREF="include/images/sugar_icon.ico">
118    <link rel="stylesheet" href="install/install.css" type="text/css" />
119    <script type="text/javascript" src="install/installCommon.js"></script>
120    <script type="text/javascript" src="install/siteConfig.js"></script>
121 </head>
122 <body onload="javascript:document.getElementById('button_next2').focus();">
123 <form action="install.php" method="post" name="setConfig" id="form">
124 <input type="hidden" name="current_step" value="{$next_step}">
125 <table cellspacing="0" cellpadding="0" border="0" align="center" class="shell">
126       <tr><td colspan="2" id="help"><a href="{$help_url}" target='_blank'>{$mod_strings['LBL_HELP']} </a></td></tr>
127     <tr>
128       <th width="500">
129                 <p>
130                 <img src="{$sugar_md}" alt="SugarCRM" border="0">
131                 </p>
132    {$mod_strings['LBL_SITECFG_TITLE']}</th>
133    <th width="200" style="text-align: right;"><a href="http://www.sugarcrm.com" target="_blank">
134                 <IMG src="include/images/sugarcrm_login.png" width="145" height="30" alt="SugarCRM" border="0"></a>
135         </th>
136    </tr>
137 <tr>
138     <td colspan="2">
139     {$errors}
140    <div class="required">{$mod_strings['LBL_REQUIRED']}</div>
141    <table width="100%" cellpadding="0" cellpadding="0" border="0" class="StyleDottedHr">
142    <tr><th colspan="3" align="left">{$mod_strings['LBL_SITECFG_TITLE2']}</td></tr>
143 EOQ;
144
145
146
147 //hide this in typical mode
148 if(!empty($_SESSION['install_type'])  && strtolower($_SESSION['install_type'])=='custom'){
149     $out .=<<<EOQ
150
151    <tr><td colspan="3" align="left"> {$mod_strings['LBL_SITECFG_URL_MSG']}
152    </td></tr>
153    <tr><td><span class="required">*</span></td>
154        <td><b>{$mod_strings['LBL_SITECFG_URL']}</td>
155        <td align="left"><input type="text" name="setup_site_url" id="button_next2" value="{$_SESSION['setup_site_url']}" size="40" /></td></tr>
156     <tr><td colspan="3" align="left"> <br>{$mod_strings['LBL_SITECFG_SYS_NAME_MSG']}</td></tr>
157     <tr><td><span class="required">*</span></td>
158        <td><b>{$mod_strings['LBL_SYSTEM_NAME']}</b></td>
159        <td align="left"><input type="text" name="setup_system_name" value="{$_SESSION['setup_system_name']}" size="40" /><br>&nbsp;</td></tr>
160 EOQ;
161     $db = getDbConnection();
162     if($db->supports("collation")) {
163         $collationOptions = $db->getCollationList();
164     }
165     if(!empty($collationOptions)) {
166         if(isset($_SESSION['setup_db_options']['collation'])) {
167             $default = $_SESSION['setup_db_options']['collation'];
168         } else {
169             $default = $db->getDefaultCollation();
170         }
171         $options = get_select_options_with_id(array_combine($collationOptions, $collationOptions), $default);
172         $out .=<<<EOQ
173        <tr><td colspan="3" align="left"> <br>{$mod_strings['LBL_SITECFG_COLLATION_MSG']}</td></tr>
174         <tr><td><span class="required">*</span></td>
175            <td><b>{$mod_strings['LBL_COLLATION']}</b></td>
176            <td align="left"><select name="setup_db_collation" id="setup_db_collation">$options</select><br>&nbsp;</td></tr>
177 EOQ;
178    }
179 }
180
181 $out .=<<<EOQ
182
183     <tr><td colspan="3" align="left"> {$mod_strings['LBL_SITECFG_PASSWORD_MSG']}</td></tr>
184     <tr><td><span class="required">*</span></td>
185        <td><b>{$mod_strings['LBL_SITECFG_ADMIN_Name']}</b><br>
186        </td>
187        <td align="left"><input type="text" name="setup_site_admin_user_name" value="{$_SESSION['setup_site_admin_user_name']}" size="20" maxlength="60" /></td></tr>
188     <tr><td><span class="required">*</span></td>
189        <td><b>{$mod_strings['LBL_SITECFG_ADMIN_PASS']}</b><br>
190        </td>
191        <td align="left"><input type="password" name="setup_site_admin_password" value="{$_SESSION['setup_site_admin_password']}" size="20" /></td></tr>
192     <tr><td><span class="required">*</span></td>
193        <td><b>{$mod_strings['LBL_SITECFG_ADMIN_PASS_2']}</td>
194        <td align="left"><input type="password" name="setup_site_admin_password_retype" value="{$_SESSION['setup_site_admin_password_retype']}" size="20" /></td></tr>
195
196 EOQ;
197
198 $out .= <<<EOQ
199 </table>
200 </td>
201 </tr>
202 <tr>
203    <td align="right" colspan="2">
204    <hr>
205    <table cellspacing="0" cellpadding="0" border="0" class="stdTable">
206    <tr>
207     <td>
208         <input class="button" type="button" name="goto" value="{$mod_strings['LBL_BACK']}" id="button_back_siteConfig_a" onclick="document.getElementById('form').submit();" />
209         <input type="hidden" name="goto" value="{$mod_strings['LBL_BACK']}" />
210     </td>
211    <td><input class="button" type="submit" name="goto" id="button_next2" value="{$mod_strings['LBL_NEXT']}" /></td>
212    </tr>
213    </table>
214 </td>
215 </tr>
216 </table>
217 </form>
218 <br>
219 </body>
220 </html>
221
222 EOQ;
223
224 echo $out;
225 ?>