Skip to content
Snippets Groups Projects
Unverified Commit 78dfac80 authored by Tim van Dijen's avatar Tim van Dijen Committed by GitHub
Browse files

Merge branch 'master' into Xnew-ui

parents 7eeaa550 b26c49c3
No related branches found
No related tags found
No related merge requests found
......@@ -1536,7 +1536,7 @@ Updates to `config.php`. Please check for updates in your local modified configu
* Verification of the Receipient attribute in the response. Will improve security if for some reason an IdP is not includeding sufficient Audience restrictions.
* Added hook to let modules tell about themself moduleinfo hook.
* Improved cron mails
* Improved santity check exception handling
* Improved sanity check exception handling
* Preserver line breaks in stack trace UI
* Improvements to WS-Federation support: dynamic realms, logout etc.
* Better handling of presentation of JPEG photos as attributes.
......
This diff is collapsed.
......@@ -18,16 +18,16 @@ $state = \SimpleSAML\Auth\State::loadState($authStateId, \SimpleSAML\Module\core
$source = \SimpleSAML\Auth\Source::getById($state[\SimpleSAML\Module\core\Auth\UserPassBase::AUTHID]);
if ($source === null) {
throw new \Exception('Could not find authentication source with id ' . $state[\SimpleSAML\Module\core\Auth\UserPassBase::AUTHID]);
throw new \Exception('Could not find authentication source with id '.$state[\SimpleSAML\Module\core\Auth\UserPassBase::AUTHID]);
}
if (array_key_exists('username', $_REQUEST)) {
$username = $_REQUEST['username'];
} elseif ($source->getRememberUsernameEnabled() && array_key_exists($source->getAuthId() . '-username', $_COOKIE)) {
$username = $_COOKIE[$source->getAuthId() . '-username'];
} elseif ($source->getRememberUsernameEnabled() && array_key_exists($source->getAuthId().'-username', $_COOKIE)) {
$username = $_COOKIE[$source->getAuthId().'-username'];
} elseif (isset($state['core:username'])) {
$username = (string)$state['core:username'];
$username = (string) $state['core:username'];
} else {
$username = '';
}
......@@ -60,7 +60,7 @@ if (!empty($_REQUEST['username']) || !empty($password)) {
$params = $sessionHandler->getCookieParams();
$params['expire'] = time();
$params['expire'] += (isset($_REQUEST['remember_username']) && $_REQUEST['remember_username'] == 'Yes' ? 31536000 : -300);
\SimpleSAML\Utils\HTTP::setCookie($source->getAuthId() . '-username', $username, $params, false);
\SimpleSAML\Utils\HTTP::setCookie($source->getAuthId().'-username', $username, $params, false);
}
if ($source->isRememberMeEnabled()) {
......@@ -105,7 +105,7 @@ if (array_key_exists('forcedUsername', $state)) {
$t->data['rememberUsernameChecked'] = $source->getRememberUsernameChecked();
$t->data['rememberMeEnabled'] = $source->isRememberMeEnabled();
$t->data['rememberMeChecked'] = $source->isRememberMeChecked();
if (isset($_COOKIE[$source->getAuthId() . '-username'])) {
if (isset($_COOKIE[$source->getAuthId().'-username'])) {
$t->data['rememberUsernameChecked'] = true;
}
}
......@@ -125,4 +125,3 @@ if (isset($state['SPMetadata'])) {
$t->show();
exit();
<?php
function tdate($input) {
function tdate($input)
{
return date(DATE_RFC822, $input);
}
function hours($input) {
function hours($input)
{
if ($input < 60) {
return number_format($input, 2) . ' sec';
} else if ($input < 60*60) {
return number_format(($input/60),2) . ' min';
} else if ($input < 24*60*60) {
return number_format(($input/(60*60)),2) . ' hours';
return number_format($input, 2).' sec';
}
return number_format($input/(24*60*60),2) . ' days';
if ($input < 60 * 60) {
return number_format(($input / 60), 2).' min';
}
if ($input < 24 * 60 * 60) {
return number_format(($input / (60 * 60)), 2).' hours';
}
return number_format($input / (24 * 60 * 60), 2).' days';
}
function humanreadable($input) {
function humanreadable($input)
{
$output = "";
$input = abs($input);
if ($input >= (1024*1024*1024*1024*1024*1024*1024*100)) {
$output = sprintf("%5ldEi", $input / (1024*1024*1024*1024*1024*1024) );
} else if ($input >= (1024*1024*1024*1024*1024*1024*10)) {
$output = sprintf("%5.1fEi", $input / (1024.0*1024.0*1024.0*1024.0*1024.0*1024.0) );
} else if ($input >= (1024*1024*1024*1024*1024*1024)) {
$output = sprintf("%5.2fEi", $input / (1024.0*1024.0*1024.0*1024.0*1024.0*1024.0) );
} else if ($input >= (1024*1024*1024*1024*1024*100)) {
$output = sprintf("%5ldPi", $input / (1024*1024*1024*1024*1024) );
} else if ($input >= (1024*1024*1024*1024*1024*10)) {
$output = sprintf("%5.1fPi", $input / (1024.0*1024.0*1024.0*1024.0*1024.0) );
} else if ($input >= (1024*1024*1024*1024*1024)) {
$output = sprintf("%5.2fPi", $input / (1024.0*1024.0*1024.0*1024.0*1024.0) );
} else if ($input >= (1024*1024*1024*1024*100)) {
$output = sprintf("%5ldTi", $input / (1024*1024*1024*1024) );
} else if ($input >= (1024*1024*1024*1024*10)) {
$output = sprintf("%5.1fTi", $input / (1024.0*1024.0*1024.0*1024.0) );
} else if ($input >= (1024*1024*1024*1024)) {
$output = sprintf("%5.2fTi", $input / (1024.0*1024.0*1024.0*1024.0) );
} else if ($input >= (1024*1024*1024*100)) {
$output = sprintf("%5ldGi", $input / (1024*1024*1024) );
} else if ($input >= (1024*1024*1024*10)) {
$output = sprintf("%5.1fGi", $input / (1024.0*1024.0*1024.0) );
} else if ($input >= (1024*1024*1024)) {
$output = sprintf("%5.2fGi", $input / (1024.0*1024.0*1024.0) );
} else if ($input >= (1024*1024*100)) {
$output = sprintf("%5ldMi", $input / (1024*1024) );
} else if ($input >= (1024*1024*10)) {
$output = sprintf("%5.1fM", $input / (1024.0*1024.0) );
} else if ($input >= (1024*1024)) {
$output = sprintf("%5.2fMi", $input / (1024.0*1024.0) );
if ($input >= (1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 100)) {
$output = sprintf("%5ldEi", $input / (1024 * 1024 * 1024 * 1024 * 1024 * 1024));
} else if ($input >= (1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 10)) {
$output = sprintf("%5.1fEi", $input / (1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0));
} else if ($input >= (1024 * 1024 * 1024 * 1024 * 1024 * 1024)) {
$output = sprintf("%5.2fEi", $input / (1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0));
} else if ($input >= (1024 * 1024 * 1024 * 1024 * 1024 * 100)) {
$output = sprintf("%5ldPi", $input / (1024 * 1024 * 1024 * 1024 * 1024));
} else if ($input >= (1024 * 1024 * 1024 * 1024 * 1024 * 10)) {
$output = sprintf("%5.1fPi", $input / (1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0));
} else if ($input >= (1024 * 1024 * 1024 * 1024 * 1024)) {
$output = sprintf("%5.2fPi", $input / (1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0));
} else if ($input >= (1024 * 1024 * 1024 * 1024 * 100)) {
$output = sprintf("%5ldTi", $input / (1024 * 1024 * 1024 * 1024));
} else if ($input >= (1024 * 1024 * 1024 * 1024 * 10)) {
$output = sprintf("%5.1fTi", $input / (1024.0 * 1024.0 * 1024.0 * 1024.0));
} else if ($input >= (1024 * 1024 * 1024 * 1024)) {
$output = sprintf("%5.2fTi", $input / (1024.0 * 1024.0 * 1024.0 * 1024.0));
} else if ($input >= (1024 * 1024 * 1024 * 100)) {
$output = sprintf("%5ldGi", $input / (1024 * 1024 * 1024));
} else if ($input >= (1024 * 1024 * 1024 * 10)) {
$output = sprintf("%5.1fGi", $input / (1024.0 * 1024.0 * 1024.0));
} else if ($input >= (1024 * 1024 * 1024)) {
$output = sprintf("%5.2fGi", $input / (1024.0 * 1024.0 * 1024.0));
} else if ($input >= (1024 * 1024 * 100)) {
$output = sprintf("%5ldMi", $input / (1024 * 1024));
} else if ($input >= (1024 * 1024 * 10)) {
$output = sprintf("%5.1fM", $input / (1024.0 * 1024.0));
} else if ($input >= (1024 * 1024)) {
$output = sprintf("%5.2fMi", $input / (1024.0 * 1024.0));
} else if ($input >= (1024 * 100)) {
$output = sprintf("%5ldKi", $input / (1024) );
$output = sprintf("%5ldKi", $input / 1024);
} else if ($input >= (1024 * 10)) {
$output = sprintf("%5.1fKi", $input / 1024.0 );
$output = sprintf("%5.1fKi", $input / 1024.0);
} else if ($input >= (1024)) {
$output = sprintf("%5.2fKi", $input / 1024.0 );
$output = sprintf("%5.2fKi", $input / 1024.0);
} else {
$output = sprintf("%5ld", $input );
$output = sprintf("%5ld", $input);
}
return $output;
......
......@@ -21,4 +21,4 @@ $config = array(
// useridattr is the attribute-name that contains the userid as returned from idp
'auth' => 'default-sp',
'useridattr', 'user',
);
\ No newline at end of file
);
......@@ -30,4 +30,4 @@ function oauth_hook_cron(&$croninfo)
\SimpleSAML\Logger::warning($message);
$croninfo['summary'][] = $message;
}
}
\ No newline at end of file
}
......@@ -11,7 +11,7 @@ function sanitycheck_hook_moduleinfo(&$moduleinfo)
$moduleinfo['info']['sanitycheck'] = array(
'name' => array('en' => 'Sanity check'),
'description' => array('en' => 'This module adds functionality for other modules to provide santity checks.'),
'description' => array('en' => 'This module adds functionality for other modules to provide sanity checks.'),
'dependencies' => array('core'),
'uses' => array('cron'),
......
<?php
/**
* Hook to do santity checks
* Hook to do sanity checks
*
* @param array &$hookinfo hookinfo
*/
......
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