diff --git a/application/dashboard.class.inc.php b/application/dashboard.class.inc.php index db7d905c5..a11b335d2 100644 --- a/application/dashboard.class.inc.php +++ b/application/dashboard.class.inc.php @@ -1266,13 +1266,12 @@ EOF $sOkButtonLabel = Dict::S('UI:Button:Save'); $sCancelButtonLabel = Dict::S('UI:Button:Cancel'); - $sId = utils::HtmlEntities($this->sId); - $sLayoutClass = utils::HtmlEntities($this->sLayoutClass); + $sId = json_encode($this->sId); + $sLayoutClass = json_encode($this->sLayoutClass); $sAutoReload = $this->bAutoReload ? 'true' : 'false'; $sAutoReloadSec = (string) $this->iAutoReloadSec; - $sTitle = utils::HtmlEntities($this->sTitle); - $sFile = utils::HtmlEntities($this->GetDefinitionFile()); - $sFileForJS = json_encode($this->GetDefinitionFile()); + $sTitle = json_encode($this->sTitle); + $sFile = json_encode($this->GetDefinitionFile()); $sUrl = utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php'; $sReloadURL = $this->GetReloadURL(); @@ -1328,15 +1327,15 @@ $('#dashboard_editor').dialog({ }); $('#dashboard_editor .ui-layout-center').runtimedashboard({ - dashboard_id: '$sId', - layout_class: '$sLayoutClass', - title: '$sTitle', + dashboard_id: $sId, + layout_class: $sLayoutClass, + title: $sTitle, auto_reload: $sAutoReload, auto_reload_sec: $sAutoReloadSec, submit_to: '$sUrl', - submit_parameters: {operation: 'save_dashboard', file: {$sFileForJS}, extra_params: $sJSExtraParams, reload_url: '$sReloadURL'}, + submit_parameters: {operation: 'save_dashboard', file: $sFile, extra_params: $sJSExtraParams, reload_url: '$sReloadURL'}, render_to: '$sUrl', - render_parameters: {operation: 'render_dashboard', file: {$sFileForJS}, extra_params: $sJSExtraParams, reload_url: '$sReloadURL'}, + render_parameters: {operation: 'render_dashboard', file: $sFile, extra_params: $sJSExtraParams, reload_url: '$sReloadURL'}, new_dashlet_parameters: {operation: 'new_dashlet'} }); diff --git a/datamodels/2.x/authent-cas/src/CASLoginExtension.php b/datamodels/2.x/authent-cas/src/CASLoginExtension.php index 0fa511610..447b71295 100644 --- a/datamodels/2.x/authent-cas/src/CASLoginExtension.php +++ b/datamodels/2.x/authent-cas/src/CASLoginExtension.php @@ -160,8 +160,7 @@ class CASLoginExtension extends AbstractLoginFSMExtension implements iLogoutExte private static function InitCASClient() { $bCASDebug = Config::Get('cas_debug'); - if ($bCASDebug) - { + if ($bCASDebug) { phpCAS::setLogger(new CASLogger(APPROOT.'log/cas.log')); } @@ -171,18 +170,17 @@ class CASLoginExtension extends AbstractLoginFSMExtension implements iLogoutExte $iCASPort = Config::Get('cas_port'); $sCASContext = Config::Get('cas_context'); $sServiceBaseURL = Config::Get('service_base_url', self::GetServiceBaseURL()); - phpCAS::client($sCASVersion, $sCASHost, $iCASPort, $sCASContext, $sServiceBaseURL, false /* session already started */); + if (!phpCAS::isInitialized()) { + phpCAS::client($sCASVersion, $sCASHost, $iCASPort, $sCASContext, $sServiceBaseURL, false /* session already started */); + } $sCASCACertPath = Config::Get('cas_server_ca_cert_path'); - if (empty($sCASCACertPath)) - { + if (empty($sCASCACertPath)) { // If no certificate authority is provided, do not attempt to validate // the server's certificate // THIS SETTING IS NOT RECOMMENDED FOR PRODUCTION. // VALIDATING THE CAS SERVER IS CRUCIAL TO THE SECURITY OF THE CAS PROTOCOL! phpCAS::setNoCasServerValidation(); - } - else - { + } else { phpCAS::setCasServerCACert($sCASCACertPath); } }