]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - install/license.php
Release 6.4.0
[Github/sugarcrm.git] / install / license.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 global $sugar_version, $js_custom_version;
41 if( !isset( $install_script ) || !$install_script ){
42     die('Unable to process script directly.');
43 }
44
45 // setup session variables (and their defaults) if this page has not yet been submitted
46 if(!isset($_SESSION['license_submitted']) || !$_SESSION['license_submitted']){
47     $_SESSION['setup_license_accept'] = false;
48 }
49
50 $checked = (isset($_SESSION['setup_license_accept']) && !empty($_SESSION['setup_license_accept'])) ? 'checked="on"' : '';
51
52 require_once("install/install_utils.php");
53 $license_file = getLicenseContents("LICENSE.txt");
54 $langHeader = get_language_header();
55 $out =<<<EOQ
56 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
57 <html {$langHeader}>
58 <head>
59    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
60    <meta http-equiv="Content-Style-Type" content="text/css">
61    <title>{$mod_strings['LBL_WIZARD_TITLE']} {$mod_strings['LBL_LICENSE_ACCEPTANCE']}</title>
62    <link REL="SHORTCUT ICON" HREF="include/images/sugar_icon.ico">
63    <link rel="stylesheet" href="install/install.css" type="text/css">
64    <script src="cache/include/javascript/sugar_grp1_yui.js?s={$sugar_version}&c={$js_custom_version}"></script>
65    <script type="text/javascript">
66     <!--
67     if ( YAHOO.env.ua )
68         UA = YAHOO.env.ua;
69     -->
70     </script>
71     <link rel='stylesheet' type='text/css' href='include/javascript/yui/build/container/assets/container.css' />
72    <script type="text/javascript" src="install/license.js"></script>
73 </head>
74
75 <body onload="javascript:toggleNextButton();document.getElementById('button_next2').focus();">
76 <div id='licenseDiv'>
77 <form action="install.php" method="post" name="setConfig" id="form">
78 <form action="welcome.php" method="post" name="setLang" id="langForm">
79   <table cellspacing="0" cellpadding="0" border="0" align="center" class="shell">
80     <tr><td colspan="2" id="help"><a href="{$help_url}" target='_blank'>{$mod_strings['LBL_HELP']} </a></td></tr>
81     <tr>
82       <th width="500">
83                 <p>
84                 <img src="{$sugar_md}" alt="SugarCRM" border="0">
85                 </p>
86       {$mod_strings['LBL_LICENSE_ACCEPTANCE']}</th>
87       <th width="200" height="30" style="text-align: right;"><a href="http://www.sugarcrm.com" target="_blank">
88         <IMG src="include/images/sugarcrm_login.png" width="145" height="30" alt="SugarCRM" border="0"></a>
89       </th>
90     </tr>
91     <tr>
92       <td colspan="2">
93         <textarea cols="80" rows="20" readonly>{$license_file}</textarea>
94       </td>
95     </tr>
96
97     <tr>
98       <td align=left>
99         <input type="checkbox" class="checkbox" name="setup_license_accept" id="button_next2" onClick='toggleNextButton();' {$checked} />
100         <a href='javascript:void(0)' onClick='toggleLicenseAccept();toggleNextButton();'>{$mod_strings['LBL_LICENSE_I_ACCEPT']}</a>
101       </td>
102       <td align=right>
103         <input type="button" class="button" name="print_license" id="button_print_license" value="{$mod_strings['LBL_LICENSE_PRINTABLE']}"
104                 onClick='window.open("install.php?page=licensePrint&language={$current_language}");' />
105       </td>
106     </tr>
107     <tr>
108       <td align="right" colspan="2">
109         <hr>
110         <input type="hidden" name="current_step" value="{$next_step}">
111         <table cellspacing="0" cellpadding="0" border="0" class="stdTable">
112           <tr>
113             <td>
114                 <input class="acceptButton" type="button" name="goto" value="{$mod_strings['LBL_BACK']}"  id="button_back_license" onclick="document.getElementById('form').submit();" />
115                 <input class="acceptButton" type="button" name="goto" value="{$mod_strings['LBL_NEXT']}" id="button_next" disabled="disabled" onclick="callSysCheck();"/>
116                 <input type="hidden" name="goto" id='hidden_goto' value="{$mod_strings['LBL_BACK']}" />
117             </td>
118           </tr>
119         </table>
120       </td>
121     </tr>
122
123   </table>
124 </form>
125 </div>
126
127 <script>
128 var msgPanel;
129 function callSysCheck(){
130
131             //begin main function that will be called
132             ajaxCall = function(msg_panel){
133                 //create success function for callback
134
135                 getPanel = function() {
136                 var args = {    width:"300px",
137                                 modal:true,
138                                 fixedcenter: true,
139                                 constraintoviewport: false,
140                                 underlay:"shadow",
141                                 close:false,
142                                 draggable:true,
143
144                                 effect:{effect:YAHOO.widget.ContainerEffect.FADE, duration:.5}
145                                } ;
146                         msg_panel = new YAHOO.widget.Panel('p_msg', args);
147                         //If we haven't built our panel using existing markup,
148                         //we can set its content via script:
149                         msg_panel.setHeader("{$mod_strings['LBL_LICENSE_CHKENV_HEADER']}");
150                         msg_panel.setBody(document.getElementById("checkingDiv").innerHTML);
151                         msg_panel.render(document.body);
152                         msgPanel = msg_panel;
153                 }
154
155
156                 passed = function(url){
157                     document.setConfig.goto.value="{$mod_strings['LBL_NEXT']}";
158                     document.getElementById('hidden_goto').value="{$mod_strings['LBL_NEXT']}";
159                     document.setConfig.current_step.value="{$next_step}";
160                     document.setConfig.submit();
161                     window.focus();
162                 }
163                 success = function(o) {
164                     if (o.responseText.indexOf('passed')>=0){
165                         if ( YAHOO.util.Selector.query('button', 'p_msg', true) != null )
166                             YAHOO.util.Selector.query('button', 'p_msg', true).style.display = 'none'; 
167                         scsbody =  "<table cellspacing='0' cellpadding='0' border='0' align='center'><tr><td>";
168                         scsbody += "<p>{$mod_strings['LBL_LICENSE_CHECK_PASSED']}</p>";
169                         scsbody += "<div id='cntDown'>{$mod_strings['LBL_THREE']}</div>";
170                         scsbody += "</td></tr></table>";
171                         scsbody += "<script>countdown(3);<\/script>";
172                         msgPanel.setBody(scsbody);
173                         msgPanel.render();
174                         countdown(3);
175                         window.setTimeout('passed("install.php?goto=next")', 2500);
176
177                     }else{
178                         //turn off loading message
179                         msgPanel.hide();
180                         document.getElementById('sysCheckMsg').style.display = '';
181                         document.getElementById('licenseDiv').style.display = 'none';
182                         document.getElementById('sysCheckMsg').innerHTML=o.responseText;
183                     }
184
185
186                 }//end success
187
188                 //set loading message and create url
189                 postData = "checkInstallSystem=true&to_pdf=1&sugar_body_only=1";
190
191                 //if this is a call already in progress, then just return
192                     if(typeof ajxProgress != 'undefined'){
193                         return;
194                     }
195
196                 getPanel();
197                 msgPanel.show;
198                 var ajxProgress = YAHOO.util.Connect.asyncRequest('POST','install.php', {success: success, failure: success}, postData);
199
200
201             };//end ajaxCall method
202               ajaxCall();
203             return;
204 }
205
206     function countdown(num){
207         scsbody =  "<table cellspacing='0' cellpadding='0' border='0' align='center'><tr><td>";
208         scsbody += "<p>{$mod_strings['LBL_LICENSE_CHECK_PASSED']}</p>";
209         scsbody += "<div id='cntDown'>{$mod_strings['LBL_LICENSE_REDIRECT']}"+num+"</div>";
210         scsbody += "</td></tr></table>";
211         msgPanel.setBody(scsbody);
212         msgPanel.render();
213         if(num >0){
214              num = num-1;
215              setTimeout("countdown("+num+")",1000);
216         }
217     }
218
219 </script>
220
221            <div id="checkingDiv" style="display:none">
222            <table cellspacing="0" cellpadding="0" border="0">
223                <tr><td>
224                     <p><img src='install/processing.gif' alt="{$mod_strings['LBL_LICENSE_CHECKING']}"> <br>{$mod_strings['LBL_LICENSE_CHECKING']}</p>
225                 </td></tr>
226             </table>
227             </div>
228
229           <div id='sysCheckMsg'><div>
230
231
232 </body>
233 </html>
234 EOQ;
235
236 echo $out;
237 ?>