PageRenderTime 54ms CodeModel.GetById 8ms RepoModel.GetById 1ms app.codeStats 0ms

/install/siteConfig_b.php

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