Skip to content
Snippets Groups Projects
Commit f166cf4c authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Whitespace / indentation

parent f8867e43
No related branches found
No related tags found
No related merge requests found
...@@ -10,19 +10,18 @@ if (!$config->getBoolean('enable.adfs-idp', false)) { ...@@ -10,19 +10,18 @@ if (!$config->getBoolean('enable.adfs-idp', false)) {
// check if valid local session exists // check if valid local session exists
if ($config->getBoolean('admin.protectmetadata', false)) { if ($config->getBoolean('admin.protectmetadata', false)) {
SimpleSAML\Utils\Auth::requireAdmin(); \SimpleSAML\Utils\Auth::requireAdmin();
} }
try { try {
$idpentityid = isset($_GET['idpentityid']) ? $idpentityid = isset($_GET['idpentityid']) ?
$_GET['idpentityid'] : $_GET['idpentityid'] : $metadata->getMetaDataCurrentEntityID('adfs-idp-hosted');
$metadata->getMetaDataCurrentEntityID('adfs-idp-hosted');
$idpmeta = $metadata->getMetaDataConfig($idpentityid, 'adfs-idp-hosted'); $idpmeta = $metadata->getMetaDataConfig($idpentityid, 'adfs-idp-hosted');
$availableCerts = array(); $availableCerts = array();
$keys = array(); $keys = array();
$certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, false, 'new_'); $certInfo = \SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, false, 'new_');
if ($certInfo !== null) { if ($certInfo !== null) {
$availableCerts['new_idp.crt'] = $certInfo; $availableCerts['new_idp.crt'] = $certInfo;
$keys[] = array( $keys[] = array(
...@@ -36,7 +35,7 @@ try { ...@@ -36,7 +35,7 @@ try {
$hasNewCert = false; $hasNewCert = false;
} }
$certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, true); $certInfo = \SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, true);
$availableCerts['idp.crt'] = $certInfo; $availableCerts['idp.crt'] = $certInfo;
$keys[] = array( $keys[] = array(
'type' => 'X509Certificate', 'type' => 'X509Certificate',
...@@ -46,7 +45,7 @@ try { ...@@ -46,7 +45,7 @@ try {
); );
if ($idpmeta->hasValue('https.certificate')) { if ($idpmeta->hasValue('https.certificate')) {
$httpsCert = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, true, 'https.'); $httpsCert = \SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, true, 'https.');
assert(isset($httpsCert['certData'])); assert(isset($httpsCert['certData']));
$availableCerts['https.crt'] = $httpsCert; $availableCerts['https.crt'] = $httpsCert;
$keys[] = array( $keys[] = array(
...@@ -57,7 +56,7 @@ try { ...@@ -57,7 +56,7 @@ try {
); );
} }
$adfs_service_location = SimpleSAML\Module::getModuleURL('adfs').'/idp/prp.php'; $adfs_service_location = \SimpleSAML\Module::getModuleURL('adfs').'/idp/prp.php';
$metaArray = array( $metaArray = array(
'metadata-set' => 'adfs-idp-remote', 'metadata-set' => 'adfs-idp-remote',
'entityid' => $idpentityid, 'entityid' => $idpentityid,
...@@ -149,10 +148,10 @@ try { ...@@ -149,10 +148,10 @@ try {
$t->data['clipboard.js'] = true; $t->data['clipboard.js'] = true;
$t->data['available_certs'] = $availableCerts; $t->data['available_certs'] = $availableCerts;
$certdata = array(); $certdata = array();
foreach(array_keys($availableCerts) as $availableCert) { foreach (array_keys($availableCerts) as $availableCert) {
$certdata[$availableCert]['name'] = $availableCert; $certdata[$availableCert]['name'] = $availableCert;
$certdata[$availableCert]['url'] = SimpleSAML\Module::getModuleURL('saml/idp/certs.php') . '/' . $availableCert; $certdata[$availableCert]['url'] = \SimpleSAML\Module::getModuleURL('saml/idp/certs.php').'/'.$availableCert;
$certdata[$availableCert]['comment'] = ( $availableCerts[$availableCert]['certFingerprint'][0] === 'afe71c28ef740bc87425be13a2263d37971da1f9' ? 'This is the default certificate. Generate a new certificate if this is a production system.' : ''); $certdata[$availableCert]['comment'] = ($availableCerts[$availableCert]['certFingerprint'][0] === 'afe71c28ef740bc87425be13a2263d37971da1f9' ? 'This is the default certificate. Generate a new certificate if this is a production system.' : '');
} }
$t->data['certdata'] = $certdata; $t->data['certdata'] = $certdata;
$t->data['header'] = 'adfs-idp'; // TODO: Replace with headerString in 2.0 $t->data['header'] = 'adfs-idp'; // TODO: Replace with headerString in 2.0
...@@ -173,6 +172,6 @@ try { ...@@ -173,6 +172,6 @@ try {
exit(0); exit(0);
} }
} catch (Exception $exception) { } catch (\Exception $exception) {
throw new \SimpleSAML\Error\Error('METADATA', $exception); throw new \SimpleSAML\Error\Error('METADATA', $exception);
} }
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
*/ */
if (!array_key_exists('AuthState', $_REQUEST)) { if (!array_key_exists('AuthState', $_REQUEST)) {
throw new \SimpleSAML\Error\BadRequest('Missing AuthState parameter.'); throw new \SimpleSAML\Error\BadRequest('Missing AuthState parameter.');
} }
$globalConfig = \SimpleSAML\Configuration::getInstance(); $globalConfig = \SimpleSAML\Configuration::getInstance();
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
* @param array &$links The links on the frontpage, split into sections. * @param array &$links The links on the frontpage, split into sections.
*/ */
function consentAdmin_hook_frontpage(&$links) { function consentAdmin_hook_frontpage(&$links) {
assert(is_array($links)); assert(is_array($links));
assert(array_key_exists('links', $links)); assert(array_key_exists('links', $links));
$links['config'][] = array( $links['config'][] = array(
'href' => SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php'), 'href' => SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php'),
'text' => '{core:frontpage:link_consentAdmin}', 'text' => '{core:frontpage:link_consentAdmin}',
); );
} }
...@@ -9,7 +9,7 @@ if (isset($sources['admin'])) { ...@@ -9,7 +9,7 @@ if (isset($sources['admin'])) {
} }
//if only 1 auth //if only 1 auth
if (count($sources)==1) { if (count($sources) == 1) {
$_REQUEST['as'] = key($sources); $_REQUEST['as'] = key($sources);
} }
...@@ -58,6 +58,6 @@ $t->data['header'] = '{status:header_saml20_sp}'; ...@@ -58,6 +58,6 @@ $t->data['header'] = '{status:header_saml20_sp}';
$t->data['attributes'] = $attributes; $t->data['attributes'] = $attributes;
$t->data['nameid'] = !is_null($as->getAuthData('saml:sp:NameID')) ? $as->getAuthData('saml:sp:NameID') : false; $t->data['nameid'] = !is_null($as->getAuthData('saml:sp:NameID')) ? $as->getAuthData('saml:sp:NameID') : false;
$t->data['logouturl'] = \SimpleSAML\Utils\HTTP::getSelfURLNoQuery().'?as='.urlencode($asId).'&logout'; $t->data['logouturl'] = \SimpleSAML\Utils\HTTP::getSelfURLNoQuery().'?as='.urlencode($asId).'&logout';
$t->data['remaining'] = $session->getAuthData($asId, 'Expire')-time(); $t->data['remaining'] = $session->getAuthData($asId, 'Expire') - time();
$t->show(); $t->show();
...@@ -5,12 +5,11 @@ ...@@ -5,12 +5,11 @@
* @param array &$links The links on the frontpage, split into sections. * @param array &$links The links on the frontpage, split into sections.
*/ */
function cron_hook_frontpage(&$links) { function cron_hook_frontpage(&$links) {
assert(is_array($links)); assert(is_array($links));
assert(array_key_exists('links', $links)); assert(array_key_exists('links', $links));
$links['config'][] = array(
'href' => SimpleSAML\Module::getModuleURL('cron/croninfo.php'),
'text' => '{core:frontpage:link_cron}',
);
$links['config'][] = array(
'href' => SimpleSAML\Module::getModuleURL('cron/croninfo.php'),
'text' => '{core:frontpage:link_cron}',
);
} }
...@@ -286,11 +286,11 @@ class PowerIdPDisco extends \SimpleSAML\XHTML\IdPDisco ...@@ -286,11 +286,11 @@ class PowerIdPDisco extends \SimpleSAML\XHTML\IdPDisco
$search = '<script type="text/javascript"> $search = '<script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$("#tabdiv").tabs({ selected: ' . $t->data['defaulttab'] . ' });'; $("#tabdiv").tabs({ selected: '.$t->data['defaulttab'].' });';
$i = 0; $i = 0;
foreach ($idpList as $tab => $slist) { foreach ($idpList as $tab => $slist) {
$search .= "\n" . '$("#query_' . $tab . '").liveUpdate("#list_' . $tab . '")' . $search .= "\n".'$("#query_'.$tab.'").liveUpdate("#list_'.$tab.'")' .
(($i++ == 0) && (empty($this->data['faventry'])) ? '.focus()' : '') . ';'; (($i++ == 0) && (empty($this->data['faventry'])) ? '.focus()' : '').';';
} }
$search .= "});\n</script>"; $search .= "});\n</script>";
...@@ -308,9 +308,9 @@ class PowerIdPDisco extends \SimpleSAML\XHTML\IdPDisco ...@@ -308,9 +308,9 @@ class PowerIdPDisco extends \SimpleSAML\XHTML\IdPDisco
private function processMetadata($t, $metadata, $favourite) private function processMetadata($t, $metadata, $favourite)
{ {
$basequerystring = '?' . $basequerystring = '?' .
'entityID=' . urlencode($t->data['entityID']) . '&amp;' . 'entityID='.urlencode($t->data['entityID']).'&amp;'.
'return=' . urlencode($t->data['return']) . '&amp;' . 'return='.urlencode($t->data['return']).'&amp;'.
'returnIDParam=' . urlencode($t->data['returnIDParam']) . '&amp;idpentityid='; 'returnIDParam='.urlencode($t->data['returnIDParam']).'&amp;idpentityid=';
foreach ($metadata as $tab => $idps) { foreach ($metadata as $tab => $idps) {
foreach ($idps as $entityid => $entity) { foreach ($idps as $entityid => $entity) {
...@@ -343,14 +343,14 @@ class PowerIdPDisco extends \SimpleSAML\XHTML\IdPDisco ...@@ -343,14 +343,14 @@ class PowerIdPDisco extends \SimpleSAML\XHTML\IdPDisco
// HTML output // HTML output
if ($entity['entityid'] === $favourite) { if ($entity['entityid'] === $favourite) {
$html = '<a class="metaentry favourite" href="' . $basequerystring . urlencode($entity['entityid']) . '">'; $html = '<a class="metaentry favourite" href="'.$basequerystring.urlencode($entity['entityid']).'">';
} else { } else {
$html = '<a class="metaentry" href="' . $basequerystring . urlencode($entity['entityid']) . '">'; $html = '<a class="metaentry" href="'.$basequerystring.urlencode($entity['entityid']).'">';
} }
$html .= $entity['translated']; $html .= $entity['translated'];
if (array_key_exists('icon', $entity) && $entity['icon'] !== null) { if (array_key_exists('icon', $entity) && $entity['icon'] !== null) {
$iconUrl = \SimpleSAML\Utils\HTTP::resolveURL($entity['icon']); $iconUrl = \SimpleSAML\Utils\HTTP::resolveURL($entity['icon']);
$html .= '<img alt="Icon for identity provider" class="entryicon" src="' . htmlspecialchars($iconUrl) . '" />'; $html .= '<img alt="Icon for identity provider" class="entryicon" src="'.htmlspecialchars($iconUrl).'" />';
} }
$html .= '</a>'; $html .= '</a>';
$entity['html'] = $html; $entity['html'] = $html;
......
...@@ -24,20 +24,19 @@ $this->includeAtTemplateBase('includes/header.php'); ...@@ -24,20 +24,19 @@ $this->includeAtTemplateBase('includes/header.php');
<form style="display: inline; margin: 0px; padding: 0px" action="<?php echo htmlspecialchars($this->data['yesTarget']); ?>"> <form style="display: inline; margin: 0px; padding: 0px" action="<?php echo htmlspecialchars($this->data['yesTarget']); ?>">
<?php <?php
// Embed hidden fields... // Embed hidden fields...
foreach ($this->data['yesData'] as $name => $value) { foreach ($this->data['yesData'] as $name => $value) {
echo('<input type="hidden" name="' . htmlspecialchars($name) . '" value="' . htmlspecialchars($value) . '" />'); echo '<input type="hidden" name="'.htmlspecialchars($name).'" value="'.htmlspecialchars($value).'" />';
} }
?> ?>
<h3><?php echo $warning; ?></h3> <h3><?php echo $warning; ?></h3>
<p><?php echo $this->t('{expirycheck:expwarning:expiry_date_text}') . " " . $this->data['expireOnDate']; ?></p> <p><?php echo $this->t('{expirycheck:expwarning:expiry_date_text}')." ".$this->data['expireOnDate']; ?></p>
<input type="submit" name="yes" id="yesbutton" value="<?php echo htmlspecialchars($this->t('{expirycheck:expwarning:btn_continue}')) ?>" /> <input type="submit" name="yes" id="yesbutton" value="<?php echo htmlspecialchars($this->t('{expirycheck:expwarning:btn_continue}')) ?>" />
</form> </form>
<?php <?php
$this->includeAtTemplateBase('includes/footer.php'); $this->includeAtTemplateBase('includes/footer.php');
...@@ -5,12 +5,11 @@ ...@@ -5,12 +5,11 @@
* @param array &$links The links on the frontpage, split into sections. * @param array &$links The links on the frontpage, split into sections.
*/ */
function memcacheMonitor_hook_frontpage(&$links) { function memcacheMonitor_hook_frontpage(&$links) {
assert(is_array($links)); assert(is_array($links));
assert(array_key_exists('links', $links)); assert(array_key_exists('links', $links));
$links['config'][] = array( $links['config'][] = array(
'href' => SimpleSAML\Module::getModuleURL('memcacheMonitor/memcachestat.php'), 'href' => SimpleSAML\Module::getModuleURL('memcacheMonitor/memcachestat.php'),
'text' => '{core:frontpage:link_memcacheMonitor}', 'text' => '{core:frontpage:link_memcacheMonitor}',
); );
} }
...@@ -23,8 +23,7 @@ if ($config->getBoolean('admin.protectmetadata', false)) { ...@@ -23,8 +23,7 @@ if ($config->getBoolean('admin.protectmetadata', false)) {
try { try {
$idpentityid = isset($_GET['idpentityid']) ? $idpentityid = isset($_GET['idpentityid']) ?
$_GET['idpentityid'] : $_GET['idpentityid'] : $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted');
$metadata->getMetaDataCurrentEntityID('saml20-idp-hosted');
$idpmeta = $metadata->getMetaDataConfig($idpentityid, 'saml20-idp-hosted'); $idpmeta = $metadata->getMetaDataConfig($idpentityid, 'saml20-idp-hosted');
$availableCerts = array(); $availableCerts = array();
...@@ -220,10 +219,10 @@ try { ...@@ -220,10 +219,10 @@ try {
$t->data['clipboard.js'] = true; $t->data['clipboard.js'] = true;
$t->data['available_certs'] = $availableCerts; $t->data['available_certs'] = $availableCerts;
$certdata = array(); $certdata = array();
foreach(array_keys($availableCerts) as $availableCert) { foreach (array_keys($availableCerts) as $availableCert) {
$certdata[$availableCert]['name'] = $availableCert; $certdata[$availableCert]['name'] = $availableCert;
$certdata[$availableCert]['url'] = SimpleSAML\Module::getModuleURL('saml/idp/certs.php') . '/' . $availableCert; $certdata[$availableCert]['url'] = SimpleSAML\Module::getModuleURL('saml/idp/certs.php').'/'.$availableCert;
$certdata[$availableCert]['comment'] = ( $availableCerts[$availableCert]['certFingerprint'][0] === 'afe71c28ef740bc87425be13a2263d37971da1f9' ? 'This is the default certificate. Generate a new certificate if this is a production system.' : ''); $certdata[$availableCert]['comment'] = ($availableCerts[$availableCert]['certFingerprint'][0] === 'afe71c28ef740bc87425be13a2263d37971da1f9' ? 'This is the default certificate. Generate a new certificate if this is a production system.' : '');
} }
$t->data['certdata'] = $certdata; $t->data['certdata'] = $certdata;
$t->data['header'] = 'saml20-idp'; // TODO: Replace with headerString in 2.0 $t->data['header'] = 'saml20-idp'; // TODO: Replace with headerString in 2.0
...@@ -234,12 +233,11 @@ try { ...@@ -234,12 +233,11 @@ try {
$t->data['defaultidp'] = $defaultidp; $t->data['defaultidp'] = $defaultidp;
$t->show(); $t->show();
} else { } else {
header('Content-Type: application/xml'); header('Content-Type: application/xml');
echo $metaxml; echo $metaxml;
exit(0); exit(0);
} }
} catch (Exception $exception) { } catch (\Exception $exception) {
throw new \SimpleSAML\Error\Error('METADATA', $exception); throw new \SimpleSAML\Error\Error('METADATA', $exception);
} }
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