diff --git a/lib/functions.php b/lib/functions.php index 198f0b0..05ff9b7 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -341,7 +341,7 @@ function check_config($config_file) { * @return array */ function cmd_control_pane($type) { - if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) + if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs); switch ($type) { @@ -355,14 +355,14 @@ function cmd_control_pane($type) { 'purge'=>array( 'title'=>_('Purge caches'), - 'enable'=>$_SESSION[APPCONFIG]->isCommandAvailable('script','purge_cache'), + 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('script','purge_cache') : false, 'link'=>sprintf('href="cmd.php?cmd=purge_cache" onclick="return ajDISPLAY(\'BODY\',\'cmd=purge_cache\',\'%s\');" title="%s"', _('Clearing cache'),_('Purge caches')), 'image'=>sprintf('',IMGDIR,_('Purge caches'))), 'hide_debug_info'=>array( 'title'=>_('Show Cache'), - 'enable'=>$_SESSION[APPCONFIG]->isCommandAvailable('script','show_cache'), + 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('script','show_cache') : false, 'link'=>sprintf('href="cmd.php?cmd=show_cache" onclick="return ajDISPLAY(\'BODY\',\'cmd=show_cache\',\'%s\');" title="%s"', _('Loading'),_('Show Cache'),_('Show Cache')), 'image'=>sprintf('',IMGDIR,_('Show Cache'))), @@ -374,31 +374,31 @@ function cmd_control_pane($type) { return array( 'forum'=>array( 'title'=>_('Forum'), - 'enable'=>$_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks'), + 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true, 'link'=>sprintf('href="%s" title="%s" target="_blank"',get_href('forum'),_('Forum')), 'image'=>sprintf('',IMGDIR,_('Forum'))), 'feature'=>array( 'title'=>_('Request feature'), - 'enable'=>$_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks'), + 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true, 'link'=>sprintf('href="%s" title="%s" target="_blank"',get_href('add_rfe'),_('Request feature')), 'image'=>sprintf('',IMGDIR,_('Request feature'))), 'bug'=>array( 'title'=>_('Report a bug'), - 'enable'=>$_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks'), + 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true, 'link'=>sprintf('href="%s" title="%s" target="_blank"',get_href('add_bug'),_('Report a bug')), 'image'=>sprintf('',IMGDIR,_('Report a bug'))), 'donation'=>array( 'title'=>_('Donate'), - 'enable'=>$_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks'), + 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true, 'link'=>sprintf('href="%s" title="%s" target="_blank"',get_href('donate'),_('Donate')), 'image'=>sprintf('',IMGDIR,_('Donate'))), 'help'=>array( 'title'=>_('Help'), - 'enable'=>$_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks'), + 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true, 'link'=>sprintf('href="%s" title="%s" target="_blank"',get_href('documentation'),_('Help')), 'image'=>sprintf('',IMGDIR,_('Help'))) ); diff --git a/lib/page.php b/lib/page.php index 01eeeb5..e8f2807 100644 --- a/lib/page.php +++ b/lib/page.php @@ -26,7 +26,7 @@ class page { protected $_default; public function __construct($index=null) { - if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) + if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs); # If we done have a configuration, then our IMGDIR and CSS are not defined @@ -66,7 +66,7 @@ class page { if (isCompress()) { header('Content-Encoding: gzip'); - if (DEBUG_ENABLED) + if (defined('DEBUG_ENABLED') && DEBUG_ENABLED) debug_log('Sent COMPRESSED header to browser and discarded (%s)',129,0,__FILE__,__LINE__,__METHOD__,$preOutput); } @@ -89,7 +89,7 @@ class page { /* Add to the HTML Header */ public function head_add($html) { - if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) + if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs); $this->_head[] .= $html; @@ -97,7 +97,7 @@ class page { /* Print out the HTML header */ private function pageheader_print() { - if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) + if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs); # HTML prepage requirements. @@ -135,7 +135,7 @@ class page { } private function head_print() { - if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) + if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs); if (isset($_SESSION[APPCONFIG])) @@ -171,7 +171,7 @@ class page { } private function control_print() { - if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) + if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs); echo '
%s | %s %s |