]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Administration/DisplayWarnings.php
Release 6.5.1
[Github/sugarcrm.git] / modules / Administration / DisplayWarnings.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-2012 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 $db;
41 function displayAdminError($errorString){
42         $output = '<p class="error">' . $errorString .'</p>';
43                 echo $output;
44 }
45
46 if(!empty($_SESSION['display_lotuslive_alert'])){
47     displayAdminError(translate('MSG_RECONNECT_LOTUSLIVE', 'Administration'));
48 }
49
50 //BEGIN SUGARCRM flav=pro
51 if( is_admin($current_user) && file_exists('include/SugarSearchEngine/SugarSearchEngineFactory.php') )
52 {
53     require_once('include/SugarSearchEngine/SugarSearchEngineFactory.php');
54     $ftsType = SugarSearchEngineFactory::getFTSEngineNameFromConfig();
55     if(!empty($ftsType) && isset($GLOBALS['sugar_config']['full_text_engine'][$ftsType]['valid']) && !$GLOBALS['sugar_config']['full_text_engine'][$ftsType]['valid'])
56     {
57         displayAdminError(translate('LBL_FTS_CONNECTION_INVALID', 'Administration'));
58     }
59
60 }
61 if (is_admin($current_user))
62 {
63     if (!empty($GLOBALS['sugar_config']['fts_disable_notification']))
64     {
65         displayAdminError(translate('LBL_FTS_DISABLED', 'Administration'));
66     }
67 }
68 //END SUGARCRM flav=pro
69
70
71
72 if(isset($_SESSION['rebuild_relationships'])){
73         displayAdminError(translate('MSG_REBUILD_RELATIONSHIPS', 'Administration'));
74 }
75
76 if(isset($_SESSION['rebuild_extensions'])){
77         displayAdminError(translate('MSG_REBUILD_EXTENSIONS', 'Administration'));
78 }
79
80 if (empty($license)){
81         $license=new Administration();
82         $license=$license->retrieveSettings('license');
83 }
84
85
86
87 if(!empty($_SESSION['HomeOnly'])){
88         displayAdminError(translate('FATAL_LICENSE_ALTERED', 'Administration'));
89 }
90
91 if(isset($license) && !empty($license->settings['license_msg_all'])){
92         displayAdminError(base64_decode($license->settings['license_msg_all']));
93 }
94 if ( (strpos($_SERVER["SERVER_SOFTWARE"],'Microsoft-IIS') !== false) && (php_sapi_name() == 'cgi-fcgi') && (ini_get('fastcgi.logging') != '0') ) {
95     displayAdminError(translate('LBL_FASTCGI_LOGGING', 'Administration'));
96 }
97 if(is_admin($current_user)){
98 if(!empty($_SESSION['COULD_NOT_CONNECT'])){
99         displayAdminError(translate('LBL_COULD_NOT_CONNECT', 'Administration') . ' '. $timedate->to_display_date_time($_SESSION['COULD_NOT_CONNECT']));
100 }
101 if(!empty($_SESSION['EXCEEDING_OC_LICENSES']) && $_SESSION['EXCEEDING_OC_LICENSES'] == true){
102     displayAdminError(translate('LBL_EXCEEDING_OC_LICENSES', 'Administration'));
103 }
104 if(isset($license) && !empty($license->settings['license_msg_admin'])){
105     // UUDDLRLRBA
106         $GLOBALS['log']->fatal(base64_decode($license->settings['license_msg_admin']));
107     //displayAdminError(base64_decode($license->settings['license_msg_admin']));
108         return;
109 }
110
111 //No SMTP server is set up Error.
112 $smtp_error = false;
113 $admin = new Administration();
114 $admin->retrieveSettings();
115
116 //If sendmail has been configured by setting the config variable ignore this warning
117 $sendMailEnabled = isset($sugar_config['allow_sendmail_outbound']) && $sugar_config['allow_sendmail_outbound'];
118
119 if(trim($admin->settings['mail_smtpserver']) == '' && !$sendMailEnabled) {
120     if($admin->settings['notify_on']) {
121         $smtp_error = true;
122     }
123 }
124
125 if($smtp_error) {
126     displayAdminError(translate('WARN_NO_SMTP_SERVER_AVAILABLE_ERROR','Administration'));
127 }
128
129  if(!empty($dbconfig['db_host_name']) || $sugar_config['sugar_version'] != $sugar_version ){
130                 displayAdminError(translate('WARN_REPAIR_CONFIG', 'Administration'));
131         }
132
133         if( !isset($sugar_config['installer_locked']) || $sugar_config['installer_locked'] == false ){
134                 displayAdminError(translate('WARN_INSTALLER_LOCKED', 'Administration'));
135                 }
136
137
138         if(empty($GLOBALS['sugar_config']['admin_access_control'])){
139                         if(isset($_SESSION['invalid_versions'])){
140                                 $invalid_versions = $_SESSION['invalid_versions'];
141                                 foreach($invalid_versions as $invalid){
142                                         displayAdminError(translate('WARN_UPGRADE', 'Administration'). $invalid['name'] .translate('WARN_UPGRADE2', 'Administration'));
143                                 }
144                         }
145
146                         if (isset($_SESSION['available_version'])){
147                                 if($_SESSION['available_version'] != $sugar_version)
148                                 {
149                                         displayAdminError(translate('WARN_UPGRADENOTE', 'Administration').$_SESSION['available_version_description']);
150                                 }
151                         }
152         }
153
154 //              if (!isset($_SESSION['dst_fixed']) || $_SESSION['dst_fixed'] != true) {
155 //                      $qDst = "SELECT count(*) AS dst FROM versions WHERE name = 'DST Fix'";
156 //                      $rDst = $db->query($qDst);
157 //                      $rowsDst = $db->fetchByAssoc($rDst);
158 //                      if($rowsDst['dst'] > 0) {
159 //                              $_SESSION['dst_fixed'] = true;
160 //                      } else {
161 //                              $_SESSION['dst_fixed'] = false;
162 //                              displayAdminError($app_strings['LBL_DST_NEEDS_FIXIN']);
163 //                      }
164 //
165 //              }
166
167                 if(isset($_SESSION['administrator_error']))
168                 {
169                         // Only print DB errors once otherwise they will still look broken
170                         // after they are fixed.
171                         displayAdminError($_SESSION['administrator_error']);
172                 }
173
174                 unset($_SESSION['administrator_error']);
175 }
176
177 ?>