Skip to content
Snippets Groups Projects
Commit 8f81c534 authored by Jaime Pérez's avatar Jaime Pérez
Browse files

Fix some more references to SimpleSAML_Module and SimpleSAML_Logger.

Both have been migrated to use namespaces.
parent f2ee9fed
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ class Translate
// for backwards compatibility - print warning
$backtrace = debug_backtrace();
$where = $backtrace[0]['file'].':'.$backtrace[0]['line'];
\SimpleSAML_Logger::warning(
\SimpleSAML\Logger::warning(
'Deprecated use of new SimpleSAML\Locale\Translate(...) at '.$where.
'. The last parameter is now a dictionary name, which should not end in ".php".'
);
......@@ -96,7 +96,7 @@ class Translate
if ($sepPos !== false) {
$module = substr($name, 0, $sepPos);
$fileName = substr($name, $sepPos + 1);
$dictDir = \SimpleSAML_Module::getModuleDir($module).'/dictionaries/';
$dictDir = \SimpleSAML\Module::getModuleDir($module).'/dictionaries/';
} else {
$dictDir = $this->configuration->getPathValue('dictionarydir', 'dictionaries/');
$fileName = $name;
......@@ -255,14 +255,14 @@ class Translate
// old style call to t(...). Print warning to log
$backtrace = debug_backtrace();
$where = $backtrace[0]['file'].':'.$backtrace[0]['line'];
\SimpleSAML_Logger::warning(
\SimpleSAML\Logger::warning(
'Deprecated use of SimpleSAML_Template::t(...) at '.$where.
'. Please update the code to use the new style of parameters.'
);
// for backwards compatibility
if (!$replacements && $this->getTag($tag) === null) {
\SimpleSAML_Logger::warning(
\SimpleSAML\Logger::warning(
'Code which uses $fallbackdefault === FALSE should be updated to use the getTag() method instead.'
);
return null;
......@@ -277,7 +277,7 @@ class Translate
$tagData = $this->getTag($tag);
if ($tagData === null) {
// tag not found
\SimpleSAML_Logger::info('Template: Looking up ['.$tag.']: not translated at all.');
\SimpleSAML\Logger::info('Template: Looking up ['.$tag.']: not translated at all.');
return $this->getStringNotTranslated($tag, $fallbackdefault);
}
}
......@@ -332,7 +332,7 @@ class Translate
throw new \Exception("Inline translation should be string or array. Is ".gettype($translation)." now!");
}
\SimpleSAML_Logger::debug('Template: Adding inline language translation for tag ['.$tag.']');
\SimpleSAML\Logger::debug('Template: Adding inline language translation for tag ['.$tag.']');
$this->langtext[$tag] = $translation;
}
......@@ -355,7 +355,7 @@ class Translate
}
$lang = $this->readDictionaryFile($filebase.$file);
\SimpleSAML_Logger::debug('Template: Merging language array. Loading ['.$file.']');
\SimpleSAML\Logger::debug('Template: Merging language array. Loading ['.$file.']');
$this->langtext = array_merge($this->langtext, $lang);
}
......@@ -376,7 +376,7 @@ class Translate
$lang = json_decode($fileContent, true);
if (empty($lang)) {
\SimpleSAML_Logger::error('Invalid dictionary definition file ['.$definitionFile.']');
\SimpleSAML\Logger::error('Invalid dictionary definition file ['.$definitionFile.']');
return array();
}
......@@ -426,7 +426,7 @@ class Translate
{
assert('is_string($filename)');
\SimpleSAML_Logger::debug('Template: Reading ['.$filename.']');
\SimpleSAML\Logger::debug('Template: Reading ['.$filename.']');
$jsonFile = $filename.'.definition.json';
if (file_exists($jsonFile)) {
......@@ -438,7 +438,7 @@ class Translate
return $this->readDictionaryPHP($filename);
}
\SimpleSAML_Logger::error(
\SimpleSAML\Logger::error(
$_SERVER['PHP_SELF'].' - Template: Could not find dictionary file at ['.$filename.']'
);
return array();
......
......@@ -118,11 +118,11 @@ class SimpleSAML_XHTML_Template
if ($themeModule !== null) {
// .../module/<themeModule>/themes/<themeName>/<templateModule>/<templateName>
$filename = SimpleSAML_Module::getModuleDir($themeModule).
$filename = SimpleSAML\Module::getModuleDir($themeModule).
'/themes/'.$themeName.'/'.$templateModule.'/'.$templateName;
} elseif ($templateModule !== 'default') {
// .../module/<templateModule>/templates/<themeName>/<templateName>
$filename = SimpleSAML_Module::getModuleDir($templateModule).'/templates/'.$templateName;
$filename = SimpleSAML\Module::getModuleDir($templateModule).'/templates/'.$templateName;
} else {
// .../templates/<theme>/<templateName>
$filename = $this->configuration->getPathValue('templatedir', 'templates/').$templateName;
......@@ -133,7 +133,7 @@ class SimpleSAML_XHTML_Template
}
// not found in current theme
SimpleSAML_Logger::debug(
SimpleSAML\Logger::debug(
$_SERVER['PHP_SELF'].' - Template: Could not find template file ['. $template.'] at ['.
$filename.'] - now trying the base template'
);
......@@ -141,7 +141,7 @@ class SimpleSAML_XHTML_Template
// try default theme
if ($templateModule !== 'default') {
// .../module/<templateModule>/templates/<templateName>
$filename = SimpleSAML_Module::getModuleDir($templateModule).'/templates/'.$templateName;
$filename = SimpleSAML\Module::getModuleDir($templateModule).'/templates/'.$templateName;
} else {
// .../templates/<templateName>
$filename = $this->configuration->getPathValue('templatedir', 'templates/').'/'.$templateName;
......@@ -153,7 +153,7 @@ class SimpleSAML_XHTML_Template
// not found in default template - log error and throw exception
$error = 'Template: Could not find template file ['.$template.'] at ['.$filename.']';
SimpleSAML_Logger::critical($_SERVER['PHP_SELF'].' - '.$error);
SimpleSAML\Logger::critical($_SERVER['PHP_SELF'].' - '.$error);
throw new Exception($error);
}
......
......@@ -77,7 +77,7 @@ class sspmod_authwindowslive_Auth_Source_LiveID extends SimpleSAML_Auth_Source
. '?client_id=' . $this->key
. '&response_type=code'
. '&response_mode=query'
. '&redirect_uri=' . urlencode(SimpleSAML_Module::getModuleUrl('authwindowslive') . '/linkback.php')
. '&redirect_uri=' . urlencode(SimpleSAML\Module::getModuleUrl('authwindowslive') . '/linkback.php')
. '&state=' . urlencode($stateID)
. '&scope=' . urlencode('openid https://graph.microsoft.com/user.read')
;
......@@ -104,7 +104,7 @@ class sspmod_authwindowslive_Auth_Source_LiveID extends SimpleSAML_Auth_Source
. '&client_secret=' . urlencode($this->secret)
. '&scope=' . urlencode('https://graph.microsoft.com/user.read')
. '&grant_type=authorization_code'
. '&redirect_uri=' . urlencode(SimpleSAML_Module::getModuleUrl('authwindowslive') . '/linkback.php')
. '&redirect_uri=' . urlencode(SimpleSAML\Module::getModuleUrl('authwindowslive') . '/linkback.php')
. '&code=' . urlencode($state['authwindowslive:verification_code']);
$context = array(
......
......@@ -22,7 +22,7 @@ class sspmod_core_Stats_Output_Log extends SimpleSAML_Stats_Output {
public function __construct(SimpleSAML_Configuration $config) {
$logLevel = $config->getString('level', 'notice');
$this->logger = array('SimpleSAML_Logger', $logLevel);
$this->logger = array('SimpleSAML\Logger', $logLevel);
if (!is_callable($this->logger)) {
throw new Exception('Invalid log level: ' . var_export($logLevel, TRUE));
}
......
......@@ -227,7 +227,7 @@ if($this->data['nego']['disable_perm']) {
echo '<span id="login-extra-info-uio.no" class="login-extra-info">'
. '<span class="login-extra-info-divider"></span>'
. $this->t('{feide:login:login_uio_negotiate_disabled_session_info}')
. '<br><a href="'.SimpleSAML_Module::getModuleURL('negotiate/retry.php', array('AuthState' => $this->data['nego']['retry_id'])).'">'
. '<br><a href="'.SimpleSAML\Module::getModuleURL('negotiate/retry.php', array('AuthState' => $this->data['nego']['retry_id'])).'">'
. $this->t('{feide:login:login_uio_negotiate_disabled_session_info_link}')
. '</a>'
. '</span>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment