Skip to content
Snippets Groups Projects
Commit f10c9e8a authored by Olav Morken's avatar Olav Morken
Browse files

openidProvider: "Fix" deprecation warnings from OpenID library.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3109 44740490-163a-0410-bde0-09ae8108e29a
parent c0cf3c1d
Branches
Tags
No related merge requests found
<?php <?php
/*
* Disable strict error reporting, since the OpenID library
* used is PHP4-compatible, and not PHP5 strict-standards compatible.
*/
SimpleSAML_Utilities::maskErrors(E_NOTICE | E_STRICT);
if (defined('E_DEPRECATED')) {
/* PHP 5.3 also has E_DEPRECATED. */
SimpleSAML_Utilities::maskErrors(constant('E_DEPRECATED'));
}
/* Add the OpenID library search path. */ /* Add the OpenID library search path. */
set_include_path(get_include_path() . PATH_SEPARATOR . dirname(dirname(dirname(dirname(__FILE__)))) . '/lib'); set_include_path(get_include_path() . PATH_SEPARATOR . dirname(dirname(dirname(dirname(__FILE__)))) . '/lib');
...@@ -77,15 +87,12 @@ class sspmod_openidProvider_Server { ...@@ -77,15 +87,12 @@ class sspmod_openidProvider_Server {
$this->authSource = new SimpleSAML_Auth_Simple($config->getString('auth')); $this->authSource = new SimpleSAML_Auth_Simple($config->getString('auth'));
$this->usernameAttribute = $config->getString('username_attribute'); $this->usernameAttribute = $config->getString('username_attribute');
SimpleSAML_Utilities::maskErrors(E_WARNING | E_STRICT);
try { try {
$store = new Auth_OpenID_FileStore($config->getString('filestore')); $store = new Auth_OpenID_FileStore($config->getString('filestore'));
$this->server = new Auth_OpenID_Server($store, $this->getServerURL()); $this->server = new Auth_OpenID_Server($store, $this->getServerURL());
} catch (Exception $e) { } catch (Exception $e) {
SimpleSAML_Utilities::popErrorMask();
throw $e; throw $e;
} }
SimpleSAML_Utilities::popErrorMask();
$this->trustStoreDir = realpath($config->getString('filestore')) . '/truststore'; $this->trustStoreDir = realpath($config->getString('filestore')) . '/truststore';
if (!is_dir($this->trustStoreDir)) { if (!is_dir($this->trustStoreDir)) {
...@@ -363,8 +370,6 @@ class sspmod_openidProvider_Server { ...@@ -363,8 +370,6 @@ class sspmod_openidProvider_Server {
public function processRequest(array $state) { public function processRequest(array $state) {
assert('isset($state["request"])'); assert('isset($state["request"])');
SimpleSAML_Utilities::maskErrors(E_NOTICE | E_STRICT);
$request = $state['request']; $request = $state['request'];
if (!$this->authSource->isAuthenticated()) { if (!$this->authSource->isAuthenticated()) {
...@@ -416,8 +421,6 @@ class sspmod_openidProvider_Server { ...@@ -416,8 +421,6 @@ class sspmod_openidProvider_Server {
*/ */
public function receiveRequest() { public function receiveRequest() {
SimpleSAML_Utilities::maskErrors(E_NOTICE | E_STRICT);
$request = $this->server->decodeRequest(); $request = $this->server->decodeRequest();
if (!in_array($request->mode, array('checkid_immediate', 'checkid_setup'), TRUE)) { if (!in_array($request->mode, array('checkid_immediate', 'checkid_setup'), TRUE)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment