From 7865bfd4f6db78580133ced5e7b56642263c77b3 Mon Sep 17 00:00:00 2001 From: Jaime Perez Crespo <jaime.perez@uninett.no> Date: Wed, 9 Mar 2016 13:24:02 +0100 Subject: [PATCH] Update standalone files and scripts using the old SimpleSAML_Module and SimpleSAML_Logger classes. --- templates/includes/header.php | 2 +- templates/metadata.php | 2 +- www/errorreport.php | 4 ++-- www/index.php | 2 +- www/module.php | 8 ++++---- www/saml2/idp/SSOService.php | 2 +- www/saml2/idp/SingleLogoutService.php | 2 +- www/saml2/idp/initSLO.php | 2 +- www/shib13/idp/SSOService.php | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/templates/includes/header.php b/templates/includes/header.php index f0c4e4df3..30e734832 100644 --- a/templates/includes/header.php +++ b/templates/includes/header.php @@ -24,7 +24,7 @@ if (array_key_exists('pageid', $this->data)) { 'page' => $this->data['pageid'] ); - SimpleSAML_Module::callHooks('htmlinject', $hookinfo); + SimpleSAML\Module::callHooks('htmlinject', $hookinfo); } // - o - o - o - o - o - o - o - o - o - o - o - o - diff --git a/templates/metadata.php b/templates/metadata.php index a30e2cc1d..99f5f60fe 100644 --- a/templates/metadata.php +++ b/templates/metadata.php @@ -44,7 +44,7 @@ if (array_key_exists('available_certs', $this->data)) { ?> <?php foreach (array_keys($this->data['available_certs']) as $certName) { echo '<li><a href="'. - htmlspecialchars(SimpleSAML_Module::getModuleURL('saml/idp/certs.php').'/'.$certName).'">'.$certName. + htmlspecialchars(SimpleSAML\Module::getModuleURL('saml/idp/certs.php').'/'.$certName).'">'.$certName. '</a>'; if ($this->data['available_certs'][$certName]['certFingerprint'][0] === diff --git a/www/errorreport.php b/www/errorreport.php index 723b3e701..d99f313b9 100644 --- a/www/errorreport.php +++ b/www/errorreport.php @@ -22,7 +22,7 @@ try { $session = SimpleSAML_Session::getSessionFromRequest(); $data = $session->getData('core:errorreport', $reportId); } catch (Exception $e) { - SimpleSAML_Logger::error('Error loading error report data: '.var_export($e->getMessage(), true)); + SimpleSAML\Logger::error('Error loading error report data: '.var_export($e->getMessage(), true)); } if ($data === null) { @@ -113,7 +113,7 @@ if ($config->getBoolean('errorreporting', true) && $toAddress !== 'na@example.or $email = new SimpleSAML_XHTML_EMail($toAddress, 'SimpleSAMLphp error report', $from); $email->setBody($message); $email->send(); - SimpleSAML_Logger::error('Report with id '.$reportId.' sent to <'.$toAddress.'>.'); + SimpleSAML\Logger::error('Report with id '.$reportId.' sent to <'.$toAddress.'>.'); } // redirect the user back to this page to clear the POST request diff --git a/www/index.php b/www/index.php index 5d3134049..42344ed94 100644 --- a/www/index.php +++ b/www/index.php @@ -2,4 +2,4 @@ require_once('_include.php'); -\SimpleSAML\Utils\HTTP::redirectTrustedURL(SimpleSAML_Module::getModuleURL('core/frontpage_welcome.php')); +\SimpleSAML\Utils\HTTP::redirectTrustedURL(SimpleSAML\Module::getModuleURL('core/frontpage_welcome.php')); diff --git a/www/module.php b/www/module.php index 66baa3ddd..9c09c6582 100644 --- a/www/module.php +++ b/www/module.php @@ -64,7 +64,7 @@ try { $url = ''; } - if (!SimpleSAML_Module::isModuleEnabled($module)) { + if (!SimpleSAML\Module::isModuleEnabled($module)) { throw new SimpleSAML_Error_NotFound('The module \''.$module.'\' was either not found, or wasn\'t enabled.'); } @@ -78,7 +78,7 @@ try { throw new SimpleSAML_Error_BadRequest('Requested URL contained \'./\'.'); } - $moduleDir = SimpleSAML_Module::getModuleDir($module).'/www/'; + $moduleDir = SimpleSAML\Module::getModuleDir($module).'/www/'; // check for '.php/' in the path, the presence of which indicates that another php-script should handle the request for ($phpPos = strpos($url, '.php/'); $phpPos !== false; $phpPos = strpos($url, '.php/', $phpPos + 1)) { @@ -117,7 +117,7 @@ try { if (!file_exists($path)) { // file not found - SimpleSAML_Logger::info('Could not find file \''.$path.'\'.'); + SimpleSAML\Logger::info('Could not find file \''.$path.'\'.'); throw new SimpleSAML_Error_NotFound('The URL wasn\'t found in the module.'); } @@ -147,7 +147,7 @@ try { $contentType = mime_content_type($path); } else { // mime_content_type doesn't exist. Return a default MIME type - SimpleSAML_Logger::warning('Unable to determine mime content type of file: '.$path); + SimpleSAML\Logger::warning('Unable to determine mime content type of file: '.$path); $contentType = 'application/octet-stream'; } } diff --git a/www/saml2/idp/SSOService.php b/www/saml2/idp/SSOService.php index d10eade1f..c893fb439 100644 --- a/www/saml2/idp/SSOService.php +++ b/www/saml2/idp/SSOService.php @@ -10,7 +10,7 @@ require_once('../../_include.php'); -SimpleSAML_Logger::info('SAML2.0 - IdP.SSOService: Accessing SAML 2.0 IdP endpoint SSOService'); +SimpleSAML\Logger::info('SAML2.0 - IdP.SSOService: Accessing SAML 2.0 IdP endpoint SSOService'); $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); $idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); diff --git a/www/saml2/idp/SingleLogoutService.php b/www/saml2/idp/SingleLogoutService.php index 6305c8e28..3105eea7f 100644 --- a/www/saml2/idp/SingleLogoutService.php +++ b/www/saml2/idp/SingleLogoutService.php @@ -10,7 +10,7 @@ require_once('../../_include.php'); -SimpleSAML_Logger::info('SAML2.0 - IdP.SingleLogoutService: Accessing SAML 2.0 IdP endpoint SingleLogoutService'); +SimpleSAML\Logger::info('SAML2.0 - IdP.SingleLogoutService: Accessing SAML 2.0 IdP endpoint SingleLogoutService'); $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); $idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); diff --git a/www/saml2/idp/initSLO.php b/www/saml2/idp/initSLO.php index a33182fe6..26085a7f7 100644 --- a/www/saml2/idp/initSLO.php +++ b/www/saml2/idp/initSLO.php @@ -5,7 +5,7 @@ $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); $idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); $idp = SimpleSAML_IdP::getById('saml2:'.$idpEntityId); -SimpleSAML_Logger::info('SAML2.0 - IdP.initSLO: Accessing SAML 2.0 IdP endpoint init Single Logout'); +SimpleSAML\Logger::info('SAML2.0 - IdP.initSLO: Accessing SAML 2.0 IdP endpoint init Single Logout'); if (!isset($_GET['RelayState'])) { throw new SimpleSAML_Error_Error('NORELAYSTATE'); diff --git a/www/shib13/idp/SSOService.php b/www/shib13/idp/SSOService.php index c0129c382..000d70a39 100644 --- a/www/shib13/idp/SSOService.php +++ b/www/shib13/idp/SSOService.php @@ -10,7 +10,7 @@ require_once('../../_include.php'); -SimpleSAML_Logger::info('Shib1.3 - IdP.SSOService: Accessing Shibboleth 1.3 IdP endpoint SSOService'); +SimpleSAML\Logger::info('Shib1.3 - IdP.SSOService: Accessing Shibboleth 1.3 IdP endpoint SSOService'); $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); $idpEntityId = $metadata->getMetaDataCurrentEntityID('shib13-idp-hosted'); -- GitLab