Skip to content
Snippets Groups Projects
Commit ad0bf099 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Tidy up frontpage code. Indenting etc.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1156 44740490-163a-0410-bde0-09ae8108e29a
parent 6b745354
Branches
Tags
No related merge requests found
...@@ -4,103 +4,104 @@ ...@@ -4,103 +4,104 @@
?> ?>
<div class="enablebox mini"> <div class="enablebox mini">
<table> <table>
<?php
$icon_enabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/accept.png" alt="enabled" />';
$icon_disabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/delete.png" alt="disabled" />';
?>
<tr class="<?php echo $this->data['enablematrix']['saml20-sp'] ? 'enabled' : 'disabled'; ?>"><td>SAML 2.0 SP</td>
<td><?php echo $this->data['enablematrix']['saml20-sp'] ? $icon_enabled : $icon_disabled; ?></td></tr>
<tr class="<?php echo $this->data['enablematrix']['saml20-idp'] ? 'enabled' : 'disabled'; ?>"><td>SAML 2.0 IdP</td> <?php
<td><?php echo $this->data['enablematrix']['saml20-idp'] ? $icon_enabled : $icon_disabled; ?></td></tr> $icon_enabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/accept.png" alt="enabled" />';
$icon_disabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/delete.png" alt="disabled" />';
?>
<tr class="<?php echo $this->data['enablematrix']['shib13-sp'] ? 'enabled' : 'disabled'; ?>"><td>Shib 1.3 SP</td> <tr class="<?php echo $this->data['enablematrix']['saml20-sp'] ? 'enabled' : 'disabled'; ?>"><td>SAML 2.0 SP</td>
<td><?php echo $this->data['enablematrix']['shib13-sp'] ? $icon_enabled : $icon_disabled; ?></td></tr> <td><?php echo $this->data['enablematrix']['saml20-sp'] ? $icon_enabled : $icon_disabled; ?></td></tr>
<tr class="<?php echo $this->data['enablematrix']['saml20-idp'] ? 'enabled' : 'disabled'; ?>"><td>SAML 2.0 IdP</td>
<td><?php echo $this->data['enablematrix']['saml20-idp'] ? $icon_enabled : $icon_disabled; ?></td></tr>
<tr class="<?php echo $this->data['enablematrix']['shib13-sp'] ? 'enabled' : 'disabled'; ?>"><td>Shib 1.3 SP</td>
<td><?php echo $this->data['enablematrix']['shib13-sp'] ? $icon_enabled : $icon_disabled; ?></td></tr>
<tr class="<?php echo $this->data['enablematrix']['shib13-idp'] ? 'enabled' : 'disabled'; ?>"><td>Shib 1.3 IdP</td>
<td><?php echo $this->data['enablematrix']['shib13-idp'] ? $icon_enabled : $icon_disabled; ?></td></tr>
</table>
</div>
<p><?php echo $this->t('intro'); ?></p>
<div>
<code style="background: white; border: 1px solid #ccc; padding: 1em; color: #555" ><?php
echo $this->data['directory'] . ' (' . $this->data['version'] . ')';
?></code>
</div>
<h2><?php echo $this->t('useful_links_header'); ?></h2>
<ul>
<?php
<tr class="<?php echo $this->data['enablematrix']['shib13-idp'] ? 'enabled' : 'disabled'; ?>"><td>Shib 1.3 IdP</td> foreach ($this->data['links'] AS $link) {
<td><?php echo $this->data['enablematrix']['shib13-idp'] ? $icon_enabled : $icon_disabled; ?></td></tr> echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . $this->t($link['text']) . '</a></li>';
}
?>
</ul>
<h2><?php echo $this->t('metadata_header'); ?></h2>
<ul>
<?php
</table> foreach ($this->data['links_meta'] AS $link) {
</div> echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . $this->t($link['text']) . '</a></li>';
}
?>
</ul>
<h2><?php echo $this->t('doc_header'); ?></h2>
<ul>
<?php
foreach ($this->data['links_doc'] AS $link) {
echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . $this->t($link['text']) . '</a></li>';
}
?>
</ul>
<p><?php echo $this->t('intro'); ?></p> <?php
if (array_key_exists('warnings', $this->data) && is_array($this->data['warnings']) && !empty($this->data['warnings'])) {
<div>
<code style="background: white; border: 1px solid #ccc; padding: 1em; color: #555" ><?php
echo $this->data['directory'] . ' (' . $this->data['version'] . ')';
?></code>
</div>
<h2><?php echo $this->t('useful_links_header'); ?></h2>
<ul>
<?php
foreach ($this->data['links'] AS $link) {
echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . $this->t($link['text']) . '</a></li>';
}
?>
</ul>
echo '<h2>' . $this->t('warnings') . '</h2>';
<h2><?php echo $this->t('metadata_header'); ?></h2>
<ul>
<?php
foreach ($this->data['links_meta'] AS $link) {
echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . $this->t($link['text']) . '</a></li>';
}
?>
</ul>
<h2><?php echo $this->t('doc_header'); ?></h2>
<ul>
<?php
foreach ($this->data['links_doc'] AS $link) {
echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . $this->t($link['text']) . '</a></li>';
}
?>
</ul>
<?php
if (array_key_exists('warnings', $this->data) && is_array($this->data['warnings']) && !empty($this->data['warnings'])) {
echo '<h2>' . $this->t('warnings') . '</h2>'; foreach($this->data['warnings'] AS $warning) {
echo '<div class="caution">' . $this->t($warning) . '</div>';
foreach($this->data['warnings'] AS $warning) {
echo '<div class="caution">' . $this->t($warning) . '</div>';
}
}
?>
<h2><?php echo $this->t('checkphp'); ?></h2>
<div class="enablebox">
<table>
<?php
$icon_enabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/accept.png" alt="enabled" />';
$icon_disabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/delete.png" alt="disabled" />';
foreach ($this->data['funcmatrix'] AS $func) {
echo '<tr class="' . ($func['enabled'] ? 'enabled' : 'disabled') . '"><td>' . ($func['enabled'] ? $icon_enabled : $icon_disabled) . '</td>
<td>' . $this->t($func['required']) . '</td><td>' . $func['descr'] . '</td></tr>';
} }
}
?> ?>
<h2><?php echo $this->t('checkphp'); ?></h2>
<div class="enablebox">
<table>
<?php
$icon_enabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/accept.png" alt="enabled" />';
$icon_disabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/delete.png" alt="disabled" />';
foreach ($this->data['funcmatrix'] AS $func) {
echo '<tr class="' . ($func['enabled'] ? 'enabled' : 'disabled') . '"><td>' . ($func['enabled'] ? $icon_enabled : $icon_disabled) . '</td>
<td>' . $this->t($func['required']) . '</td><td>' . $func['descr'] . '</td></tr>';
}
?>
</table>
</div>
</table>
</div>
<h2><?php echo $this->t('about_header'); ?></h2> <h2><?php echo $this->t('about_header'); ?></h2>
<p><?php echo $this->t('about_text'); ?></p> <p><?php echo $this->t('about_text'); ?></p>
<?php $this->includeAtTemplateBase('includes/footer.php'); ?> <?php $this->includeAtTemplateBase('includes/footer.php'); ?>
\ No newline at end of file
...@@ -33,26 +33,29 @@ if ($config->getValue('enable.saml20-sp') === true) ...@@ -33,26 +33,29 @@ if ($config->getValue('enable.saml20-sp') === true)
if ($config->getValue('enable.shib13-sp') === true) if ($config->getValue('enable.shib13-sp') === true)
$links[] = array( $links[] = array(
'href' => 'example-simple/shib13-example.php', 'href' => 'example-simple/shib13-example.php',
'text' => 'link_shib13example'); 'text' => 'link_shib13example'
);
$links[] = array( $links[] = array(
'href' => 'example-simple/hostnames.php?dummy=1', 'href' => 'example-simple/hostnames.php?dummy=1',
'text' => 'link_diagnostics'); 'text' => 'link_diagnostics'
);
$links[] = array( $links[] = array(
'href' => 'admin/phpinfo.php', 'href' => 'admin/phpinfo.php',
'text' => 'link_phpinfo'); 'text' => 'link_phpinfo'
);
$links[] = array( $links[] = array(
'href' => 'admin/config.php', 'href' => 'admin/config.php',
'text' => 'link_configcheck', 'text' => 'link_configcheck',
); );
if($config->getBoolean('idpdisco.enableremember', FALSE)) { if($config->getBoolean('idpdisco.enableremember', FALSE)) {
$links[] = array( $links[] = array(
'href' => 'cleardiscochoices.php', 'href' => 'cleardiscochoices.php',
'text' => 'link_cleardiscochoices', 'text' => 'link_cleardiscochoices',
); );
} }
...@@ -63,18 +66,16 @@ if ($publishURL !== NULL) { ...@@ -63,18 +66,16 @@ if ($publishURL !== NULL) {
'saml20-sp' => 'saml2/sp/metadata.php', 'saml20-sp' => 'saml2/sp/metadata.php',
'shib13-idp' => 'shib13/idp/metadata.php', 'shib13-idp' => 'shib13/idp/metadata.php',
'shib13-sp' => 'shib13/sp/metadata.php', 'shib13-sp' => 'shib13/sp/metadata.php',
); );
foreach($metadataSources as $name => $url) { foreach($metadataSources as $name => $url) {
if(!$config->getBoolean('enable.' . $name, FALSE)) { if(!$config->getBoolean('enable.' . $name, FALSE)) continue;
continue;
}
$url = SimpleSAML_Utilities::resolveURL($url); $url = SimpleSAML_Utilities::resolveURL($url);
$linkTarget = SimpleSAML_Utilities::addURLparameter($publishURL, array('url' => $url)); $linkTarget = SimpleSAML_Utilities::addURLparameter($publishURL, array('url' => $url));
$links[] = array( $links[] = array(
'href' => $linkTarget, 'href' => $linkTarget,
'text' => 'link_publish_' . $name, 'text' => 'link_publish_' . $name,
); );
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment