]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - install/siteConfig_b.php
Release 6.4.0
[Github/sugarcrm.git] / install / siteConfig_b.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         
47     
48
49         if(!empty($sugar_config['default_theme']))
50       $_SESSION['site_default_theme'] = $sugar_config['default_theme'];
51
52         if(!empty($sugar_config['disable_persistent_connections']))
53                 $_SESSION['disable_persistent_connections'] =
54                 $sugar_config['disable_persistent_connections'];
55         if(!empty($sugar_config['default_language']))
56                 $_SESSION['default_language'] = $sugar_config['default_language'];
57         if(!empty($sugar_config['translation_string_prefix']))
58                 $_SESSION['translation_string_prefix'] = $sugar_config['translation_string_prefix'];
59         if(!empty($sugar_config['default_charset']))
60                 $_SESSION['default_charset'] = $sugar_config['default_charset'];
61
62         if(!empty($sugar_config['default_currency_name']))
63                 $_SESSION['default_currency_name'] = $sugar_config['default_currency_name'];
64         if(!empty($sugar_config['default_currency_symbol']))
65                 $_SESSION['default_currency_symbol'] = $sugar_config['default_currency_symbol'];
66         if(!empty($sugar_config['default_currency_iso4217']))
67                 $_SESSION['default_currency_iso4217'] = $sugar_config['default_currency_iso4217'];
68
69         if(!empty($sugar_config['rss_cache_time']))
70                 $_SESSION['rss_cache_time'] = $sugar_config['rss_cache_time'];
71         if(!empty($sugar_config['languages']))
72         {
73                 // We need to encode the languages in a way that can be retrieved later.
74                 $language_keys = Array();
75                 $language_values = Array();
76
77                 foreach($sugar_config['languages'] as $key=>$value)
78                 {
79                         $language_keys[] = $key;
80                         $language_values[] = $value;
81                 }
82
83                 $_SESSION['language_keys'] = urlencode(implode(",",$language_keys));
84                 $_SESSION['language_values'] = urlencode(implode(",",$language_values));
85         }
86 }
87
88 ////    errors
89 $errors = '';
90 if( isset($validation_errors) ){
91     if( count($validation_errors) > 0 ){
92         $errors  = '<div id="errorMsgs">';
93         $errors .= '<p>'.$mod_strings['LBL_SITECFG_FIX_ERRORS'].'</p><ul>';
94         foreach( $validation_errors as $error ){
95                         $errors .= '<li>' . $error . '</li>';
96         }
97                 $errors .= '</ul></div>';
98     }
99 }
100
101
102 ////    ternaries
103 $sugarUpdates = (isset($_SESSION['setup_site_sugarbeet']) && !empty($_SESSION['setup_site_sugarbeet'])) ? 'checked="checked"' : '';
104 $siteSecurity = (isset($_SESSION['setup_site_defaults']) && !empty($_SESSION['setup_site_defaults'])) ? 'checked="checked"' : '';
105 $customSession = (isset($_SESSION['setup_site_custom_session_path']) && !empty($_SESSION['setup_site_custom_session_path'])) ? 'checked="checked"' : '';
106 $customLog = (isset($_SESSION['setup_site_custom_log_dir']) && !empty($_SESSION['setup_site_custom_log_dir'])) ? 'checked="checked"' : '';
107 $customId = (isset($_SESSION['setup_site_specify_guid']) && !empty($_SESSION['setup_site_specify_guid'])) ? 'checked="checked"' : '';
108
109 ///////////////////////////////////////////////////////////////////////////////
110 ////    START OUTPUT
111 $langHeader = get_language_header();
112 $out =<<<EOQ
113 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
114 <html {$langHeader}>
115 <head>
116    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
117    <meta http-equiv="Content-Script-Type" content="text/javascript">
118    <meta http-equiv="Content-Style-Type" content="text/css">
119    <title>{$mod_strings['LBL_WIZARD_TITLE']} {$mod_strings['LBL_SITECFG_SECURITY_TITLE']}</title>
120    <link REL="SHORTCUT ICON" HREF="include/images/sugar_icon.ico">
121    <link rel="stylesheet" href="install/install.css" type="text/css" />
122    <script type="text/javascript" src="install/installCommon.js"></script>
123    <script type="text/javascript" src="install/siteConfig.js"></script>
124 </head>
125 <body onload="javascript:toggleGUID();toggleSession();toggleLogDir();document.getElementById('button_next2').focus();">
126 <form action="install.php" method="post" name="setConfig" id="form">
127 <input type="hidden" name="current_step" value="{$next_step}">
128 <table cellspacing="0" cellpadding="0" border="0" align="center" class="shell">
129       <tr><td colspan="2" id="help"><a href="{$help_url}" target='_blank'>{$mod_strings['LBL_HELP']} </a></td></tr>
130     <tr>
131       <th width="500">
132                 <p>
133                 <img src="{$sugar_md}" alt="SugarCRM" border="0">
134                 </p>
135    {$mod_strings['LBL_SITECFG_SECURITY_TITLE']}</th>
136    <th width="200" style="text-align: right;"><a href="http://www.sugarcrm.com" target="_blank"><IMG src="include/images/sugarcrm_login.png" width="145" height="30" alt="SugarCRM" border="0"></a></th>
137    </tr>
138 <tr>
139     <td colspan="2">
140     {$errors}
141    <div class="required">{$mod_strings['LBL_REQUIRED']}</div>
142    <table width="100%" cellpadding="0" cellpadding="0" border="0" class="StyleDottedHr">
143    <tr><th colspan="3" align="left">{$mod_strings['LBL_SITECFG_SITE_SECURITY']}</td></tr>
144
145 EOQ;
146 $checked = '';
147 if(!empty($_SESSION['setup_site_sugarbeet_anonymous_stats'])) $checked = 'checked="checked"'; 
148 $out .= "
149    <tr><td></td>       
150        <td><input type='checkbox' class='checkbox' name='setup_site_sugarbeet_anonymous_stats' value='yes' $checked /></td>
151        <td><b>{$mod_strings['LBL_SITECFG_ANONSTATS']}</b><br><i>{$mod_strings['LBL_SITECFG_ANONSTATS_DIRECTIONS']}</i></td></tr>
152        
153 ";
154 $checked = '';
155 if(!empty($_SESSION['setup_site_sugarbeet_automatic_checks'])) $checked = 'checked="checked"'; 
156 $out .= <<<EOQ
157    <tr><td></td>       
158        <td><input type="checkbox" class="checkbox" name="setup_site_sugarbeet_automatic_checks" value="yes" checked="checked" /></td>
159        <td><b>{$mod_strings['LBL_SITECFG_SUGAR_UP']}</b><br><i>{$mod_strings['LBL_SITECFG_SUGAR_UP_DIRECTIONS']}</i><br>&nbsp;</td></tr>
160    <tbody id="setup_site_session_section_pre">
161    <tr><td></td>       
162        <td><input type="checkbox" class="checkbox" name="setup_site_custom_session_path" value="yes" onclick="javascript:toggleSession();" {$customSession} /></td>
163        <td><b>{$mod_strings['LBL_SITECFG_CUSTOM_SESSION']}</b><br>
164             <em>{$mod_strings['LBL_SITECFG_CUSTOM_SESSION_DIRECTIONS']}</em><br>&nbsp;</td>
165    </tr>
166    </tbody>
167    <tbody id="setup_site_session_section">
168    <tr><td></td>
169        <td style="text-align : right;"><span class="required">*</span></td>
170        <td align="left">
171                <div><div style="width:200px;float:left"><b>{$mod_strings['LBL_SITECFG_SESSION_PATH']}</b></div>
172                        <input type="text" name="setup_site_session_path" size='40' value="{$_SESSION['setup_site_session_path']}" /></td>
173                </div>       
174        </td>
175    </tr>
176    </tbody>
177    <tbody id="setup_site_log_dir_pre">
178    <tr><td></td>       
179        <td><input type="checkbox" class="checkbox" name="setup_site_custom_log_dir" value="yes" onclick="javascript:toggleLogDir();" {$customLog} /></td>
180        <td><b>{$mod_strings['LBL_SITECFG_CUSTOM_LOG']}</b><br>
181             <em>{$mod_strings['LBL_SITECFG_CUSTOM_LOG_DIRECTIONS']}</em><br>&nbsp;</td>
182    </tr>
183    </tbody>
184    <tbody id="setup_site_log_dir">
185    <tr><td></td>       
186        <td style="text-align : right;" ><span class="required">*</span></td>
187        <td align="left">
188        <div><div style="width:200px;float:left"><b>{$mod_strings['LBL_SITECFG_LOG_DIR']}</b></div>
189             <input type="text" name="setup_site_log_dir" size='30' value="{$_SESSION['setup_site_log_dir']}" />
190        </div>
191    </tr>
192    </tbody>
193    <tbody id="setup_site_guid_section_pre">
194    <tr><td></td>       
195        <td><input type="checkbox" class="checkbox" name="setup_site_specify_guid" value="yes" onclick="javascript:toggleGUID();" {$customId} /></td>
196        <td><b>{$mod_strings['LBL_SITECFG_CUSTOM_ID']}</b><br>
197             <em>{$mod_strings['LBL_SITECFG_CUSTOM_ID_DIRECTIONS']}</em><br>&nbsp;</td>  
198    </tr>
199    </tbody>
200    <tbody id="setup_site_guid_section">
201    <tr><td></td>
202        <td style="text-align : right;"><span class="required">*</span></td>
203        <td align="left">
204                <div><div style="width:200px;float:left"><b>{$mod_strings['LBL_SITECFG_APP_ID']}</b></div>
205                        <input type="text" name="setup_site_guid" size='30' value="{$_SESSION['setup_site_guid']}" />
206                </div>      
207        </td>       
208    </tr>
209    </tbody>
210 </table>
211 </td>
212 </tr>
213 <tr>
214    <td align="right" colspan="2">
215    <hr>
216    <table cellspacing="0" cellpadding="0" border="0" class="stdTable">
217    <tr>
218     <td>
219         <input class="button" type="button" name="goto" value="{$mod_strings['LBL_BACK']}" id="button_back_siteConfig_b" onclick="document.getElementById('form').submit();" />
220         <input type="hidden" name="goto" value="{$mod_strings['LBL_BACK']}" />
221     </td>
222    <td><input class="button" type="submit" id="button_next2" name="goto" value="{$mod_strings['LBL_NEXT']}" /></td>
223    </tr>
224    </table>
225 </td>
226 </tr>
227 </table>
228 </form>
229 <br>
230 </body>
231 </html>
232
233 EOQ;
234
235 echo $out;
236 ?>