From 19eae916f02c37f2320134caf51858e5faaf92a0 Mon Sep 17 00:00:00 2001 From: Timothee Date: Fri, 22 Nov 2024 09:59:41 +0100 Subject: [PATCH 1/2] =?UTF-8?q?N=C2=B07792=20Do=20not=20initialize=20CAS?= =?UTF-8?q?=20if=20already=20started?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2.x/authent-cas/src/CASLoginExtension.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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); } } From e03033ce529293b64d82d23480ead8eed201403c Mon Sep 17 00:00:00 2001 From: Benjamin Dalsass <95754414+bdalsass@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:40:22 +0100 Subject: [PATCH 2/2] =?UTF-8?q?N=C2=B07219=20-=20Fatal=20error=20following?= =?UTF-8?q?=20dashboard=20modification=20when=20dashboard=20title=20contai?= =?UTF-8?q?ns=20an=20=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/dashboard.class.inc.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/application/dashboard.class.inc.php b/application/dashboard.class.inc.php index 8229a306f..0c311225d 100644 --- a/application/dashboard.class.inc.php +++ b/application/dashboard.class.inc.php @@ -1193,12 +1193,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()); + $sTitle = json_encode($this->sTitle); + $sFile = json_encode($this->GetDefinitionFile()); $sUrl = utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php'; $sReloadURL = $this->GetReloadURL(); @@ -1250,15 +1250,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: '$sFile', 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: '$sFile', 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'} });