Fixes for issues #539, #540, #541 and #542. Thanks to Thijs Kinkhorst for the patches.

git-svn-id: http://simplesamlphp.googlecode.com/svn/trunk@3229 44740490-163a-0410-bde0-09ae8108e29a
This commit is contained in:
jaimepc@gmail.com 2013-03-21 09:04:47 +00:00
parent 1d2c4c3a60
commit e7c7d89c05
13 changed files with 98 additions and 60 deletions

View File

@ -26,7 +26,7 @@ function core_hook_sanitycheck(&$hookinfo) {
if (version_compare(phpversion(), '5.2', '>=')) {
$hookinfo['info'][] = '[core] You are running PHP version ' . phpversion() . '. Great.';
} elseif( version_compare(phpversion(), '5.1.2', '>=')) {
$hookinfo['info'][] = '[core] You are running PHP version ' . phpversion() . '. Its reccomended to upgrade to >= 5.2';
$hookinfo['info'][] = '[core] You are running PHP version ' . phpversion() . '. It\'s recommended to upgrade to >= 5.2';
} else {
$hookinfo['errors'][] = '[core] You are running PHP version ' . phpversion() . '. SimpleSAMLphp requires version >= 5.1.2, and reccomends version >= 5.2. Please upgrade!';
}

View File

@ -7,9 +7,9 @@ $this->includeAtTemplateBase('includes/header.php');
<?php
if ($this->data['isadmin']) {
echo '<p class="float-r">' . $this->t('{core:frontpage:loggedin_as_admin}') . '</p>';
echo '<p class="float-r youareadmin">' . $this->t('{core:frontpage:loggedin_as_admin}') . '</p>';
} else {
echo '<p class="float-r"><a href="' . $this->data['loginurl'] . '">' . $this->t('{core:frontpage:login_as_admin}') . '</a></p>';
echo '<p class="float-r youareadmin"><a href="' . $this->data['loginurl'] . '">' . $this->t('{core:frontpage:login_as_admin}') . '</a></p>';
}
?>

View File

@ -15,9 +15,9 @@ $this->includeAtTemplateBase('includes/header.php');
</ul> -->
<?php
if ($this->data['isadmin']) {
echo '<p class="float-r">' . $this->t('{core:frontpage:loggedin_as_admin}') . '</p>';
echo '<p class="float-r youareadmin">' . $this->t('{core:frontpage:loggedin_as_admin}') . '</p>';
} else {
echo '<p class="float-r"><a href="' . $this->data['loginurl'] . '">' . $this->t('{core:frontpage:login_as_admin}') . '</a></p>';
echo '<p class="float-r youareadmin"><a href="' . $this->data['loginurl'] . '">' . $this->t('{core:frontpage:login_as_admin}') . '</a></p>';
}
?>

View File

@ -15,9 +15,9 @@ $this->includeAtTemplateBase('includes/header.php');
</ul> -->
<?php
if ($this->data['isadmin']) {
echo '<p class="float-r">' . $this->t('{core:frontpage:loggedin_as_admin}') . '</p>';
echo '<p class="float-r youareadmin">' . $this->t('{core:frontpage:loggedin_as_admin}') . '</p>';
} else {
echo '<p class="float-r"><a href="' . $this->data['loginurl'] . '">' . $this->t('{core:frontpage:login_as_admin}') . '</a></p>';
echo '<p class="float-r youareadmin"><a href="' . $this->data['loginurl'] . '">' . $this->t('{core:frontpage:login_as_admin}') . '</a></p>';
}
?>

View File

@ -8,9 +8,9 @@ $this->includeAtTemplateBase('includes/header.php');
<?php
if ($this->data['isadmin']) {
echo '<p class="float-r">' . $this->t('{core:frontpage:loggedin_as_admin}') . '</p>';
echo '<p class="float-r youareadmin">' . $this->t('{core:frontpage:loggedin_as_admin}') . '</p>';
} else {
echo '<p class="float-r"><a href="' . $this->data['loginurl'] . '">' . $this->t('{core:frontpage:login_as_admin}') . '</a></p>';
echo '<p class="float-r youareadmin"><a href="' . $this->data['loginurl'] . '">' . $this->t('{core:frontpage:login_as_admin}') . '</a></p>';
}
?>

View File

@ -14,7 +14,7 @@ $this->includeAtTemplateBase('includes/header.php');
if ($this->data['errorcode'] !== NULL) {
?>
<div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5">
<img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l" style="margin: 15px " />
<img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l erroricon" style="margin: 15px " />
<h2><?php echo $this->t('{login:error_header}'); ?></h2>
<p><b><?php echo htmlspecialchars($this->t('{errors:title_' . $this->data['errorcode'] . '}', $this->data['errorparams'])); ?></b></p>
<p><?php echo htmlspecialchars($this->t('{errors:descr_' . $this->data['errorcode'] . '}', $this->data['errorparams'])); ?></p>
@ -24,12 +24,12 @@ if ($this->data['errorcode'] !== NULL) {
?>
<h2 style="break: both"><?php echo $this->t('{login:user_pass_header}'); ?></h2>
<p><?php echo $this->t('{login:user_pass_text}'); ?></p>
<p class="logintext"><?php echo $this->t('{login:user_pass_text}'); ?></p>
<form action="?" method="post" name="f">
<table>
<tr>
<td rowspan="3"><img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-authentication.48x48.png" alt="" /></td>
<td rowspan="3"><img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-authentication.48x48.png" id="loginicon" alt="" /></td>
<td style="padding: .3em;"><?php echo $this->t('{login:username}'); ?></td>
<td>
<?php
@ -59,7 +59,7 @@ if ($this->data['rememberUsernameEnabled']) {
} else {
$text = $this->t('{login:login_button}');
echo str_repeat("\t", 4);
echo "<input type=\"submit\" tabindex=\"4\" value=\"{$text}\" />";
echo "<input type=\"submit\" tabindex=\"4\" id=\"regularsubmit\" value=\"{$text}\" />";
}
?>
</td>
@ -73,7 +73,7 @@ if ($this->data['rememberUsernameEnabled']) {
$rowspan = (array_key_exists('organizations', $this->data) ? 2 : 1);
?>
<td style="padding: .4em;" rowspan="<?php echo $rowspan; ?>">
<input type="submit" tabindex="5" value="<?php echo $this->t('{login:login_button}'); ?>" />
<input type="submit" tabindex="5" id="regularsubmit" value="<?php echo $this->t('{login:login_button}'); ?>" />
</td>
<?php
}
@ -112,9 +112,10 @@ foreach ($this->data['organizations'] as $orgId => $orgDesc) {
<?php
}
?>
<tr><td></td><td>
<input type="submit" tabindex="5" id="mobilesubmit" value="<?php echo $this->t('{login:login_button}'); ?>" />
</td></tr>
</table>
<?php
foreach ($this->data['stateparams'] as $name => $value) {
echo('<input type="hidden" name="' . htmlspecialchars($name) . '" value="' . htmlspecialchars($value) . '" />');
@ -136,8 +137,8 @@ if(!empty($this->data['links'])) {
echo('<h2>' . $this->t('{login:help_header}') . '</h2>');
echo('<p>' . $this->t('{login:help_text}') . '</p>');
echo('<h2 class="logintext">' . $this->t('{login:help_header}') . '</h2>');
echo('<p class="logintext">' . $this->t('{login:help_text}') . '</p>');
$this->includeAtTemplateBase('includes/footer.php');
?>
?>

View File

@ -163,20 +163,23 @@ if ($orgName !== NULL) {
}
// add technical contact
$email = $config->getString('technicalcontact_email', NULL);
$contact = array('emailAddress' => $email);
$email = $config->getString('technicalcontact_email', 'na@example.org');
if ( $email != 'na@example.org') {
$name = $config->getString('technicalcontact_name', NULL);
if ($name === NULL) {
/* Nothing to do here... */
} elseif (preg_match('@^(.*?)\s*,\s*(.*)$@D', $name, $matches)) {
$contact['surName'] = $matches[1];
$contact['givenName'] = $matches[2];
} elseif (preg_match('@^(.*?)\s+(.*)$@D', $name, $matches)) {
$contact['givenName'] = $matches[1];
$contact['surName'] = $matches[2];
} else {
$contact['givenName'] = $name;
$contact = array('emailAddress' => $email);
$name = $config->getString('technicalcontact_name', NULL);
if ($name === NULL) {
/* Nothing to do here... */
} elseif (preg_match('@^(.*?)\s*,\s*(.*)$@D', $name, $matches)) {
$contact['surName'] = $matches[1];
$contact['givenName'] = $matches[2];
} elseif (preg_match('@^(.*?)\s+(.*)$@D', $name, $matches)) {
$contact['givenName'] = $matches[1];
$contact['surName'] = $matches[2];
} else {
$contact['givenName'] = $name;
}
}
// add certificate
@ -199,7 +202,7 @@ $metaArray20['entityid'] = $entityId;
$metaBuilder = new SimpleSAML_Metadata_SAMLBuilder($entityId);
$metaBuilder->addMetadataSP20($metaArray20, $supported_protocols);
$metaBuilder->addOrganizationInfo($metaArray20);
$metaBuilder->addContact('technical', $contact);
if ( !empty($contact) ) $metaBuilder->addContact('technical', $contact);
$xml = $metaBuilder->getEntityDescriptorText();

View File

@ -9,7 +9,7 @@ function sanitycheck_hook_sanitycheck(&$hookinfo) {
assert('array_key_exists("errors", $hookinfo)');
assert('array_key_exists("info", $hookinfo)');
$hookinfo['info'][] = '[sanitycheck] At least the sanity check it self is working :)';
$hookinfo['info'][] = '[sanitycheck] At least the sanity check itself is working :)';
}
?>
?>

View File

@ -1,18 +1,12 @@
<?php
if(!empty($this->data['htmlinject']['htmlContentPost'])) {
foreach($this->data['htmlinject']['htmlContentPost'] AS $c) {
echo $c;
}
}
?>
</div><!-- #content -->
<div id="footer">
<hr />
<img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/ssplogo-fish-small.png" alt="Small fish logo" style="float: right" />
@ -20,9 +14,9 @@ if(!empty($this->data['htmlinject']['htmlContentPost'])) {
<br style="clear: right" />
</div><!-- #content -->
</div><!-- #footer -->
</div><!-- #wrap -->
</body>
</html>
</html>

View File

@ -43,6 +43,7 @@ header('X-Frame-Options: SAMEORIGIN');
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, height=device-height, initial-scale=1.0" />
<script type="text/javascript" src="/<?php echo $this->data['baseurlpath']; ?>resources/script.js"></script>
<title><?php
if(array_key_exists('header', $this->data)) {

View File

@ -5,10 +5,10 @@
<?php if (isset($this->data['error'])) { ?>
<div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5">
<img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l" style="margin: 15px " />
<img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l erroricon" style="margin: 15px " />
<h2><?php echo $this->t('error_header'); ?></h2>
<p><?php echo htmlspecialchars($this->data['error']); ?> </p>
<p class="logintext"><?php echo htmlspecialchars($this->data['error']); ?> </p>
</div>
<?php } ?>
@ -22,7 +22,7 @@
<table>
<tr>
<td rowspan="3"><img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-authentication.48x48.png" /></td>
<td rowspan="3"><img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-authentication.48x48.png" id="loginicon" /></td>
<td style="padding: .3em;"><?php echo $this->t('username'); ?></td>
<td><input type="text" tabindex="1" name="username"
<?php if (isset($this->data['username'])) {
@ -31,7 +31,7 @@
<td style="padding: .4em;" rowspan="3">
<input type="submit" tabindex="3" value="Login" />
<input type="submit" tabindex="3" id="regularsubmit" value="<?php echo $this->t('login_button'); ?>" />
<input type="hidden" name="RelayState" value="<?php echo htmlspecialchars($this->data['relaystate']); ?>" />
</td>
</tr>
@ -55,17 +55,20 @@
<td style="padding: .3em;"><?php echo $this->t('password'); ?></td>
<td><input type="password" tabindex="2" name="password" /></td>
</tr>
<tr><td></td><td>
<input type="submit" tabindex="5" id="mobilesubmit" value="<?php echo $this->t('login_button'); ?>" />
</td></tr>
</table>
</form>
<h2><?php echo $this->t('help_header'); ?>.</h2>
<h2 class="logintext"><?php echo $this->t('help_header'); ?>.</h2>
<p><?php echo $this->t('help_text'); ?>!</p>
<p class="logintext"><?php echo $this->t('help_text'); ?>!</p>
<?php $this->includeAtTemplateBase('includes/footer.php'); ?>
<?php $this->includeAtTemplateBase('includes/footer.php'); ?>

View File

@ -7,7 +7,7 @@
<?php if (isset($this->data['error'])) { ?>
<div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5">
<img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l" style="margin: 15px " />
<img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l erroricon" style="margin: 15px" />
<h2><?php echo $this->t('error_header'); ?></h2>
<p><?php echo $this->t($this->data['error']); ?> </p>
@ -16,13 +16,13 @@
<h2 style="break: both"><?php echo $this->t('user_pass_header'); ?></h2>
<p><?php echo $this->t('user_pass_text'); ?></p>
<p class="logintext"><?php echo $this->t('user_pass_text'); ?></p>
<form action="?" method="post" name="f">
<table>
<tr>
<td rowspan="2"><img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-authentication.48x48.png" /></td>
<td rowspan="2"><img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-authentication.48x48.png" id="loginicon" /></td>
<td style="padding: .3em;"><?php echo $this->t('username'); ?></td>
@ -45,7 +45,7 @@
</td>
<td style="padding: .4em;" rowspan="2">
<input type="submit" tabindex="3" value="<?php echo $this->t('login_button'); ?>" />
<input type="submit" class="regularsubmit" tabindex="3" value="<?php echo $this->t('login_button'); ?>" />
<input type="hidden" name="RelayState" value="<?php echo htmlspecialchars($this->data['relaystate']); ?>" />
</td>
</tr>
@ -53,16 +53,19 @@
<td style="padding: .3em;"><?php echo $this->t('password'); ?></td>
<td><input id="password" type="password" tabindex="2" name="password" /></td>
</tr>
<tr><td></td><td>
<input type="submit" tabindex="5" id="mobilesubmit" value="<?php echo $this->t('{login_button}'); ?>" />
</td></tr>
</table>
</form>
<h2><?php echo $this->t('help_header'); ?></h2>
<h2 class="logintext"><?php echo $this->t('help_header'); ?></h2>
<p><?php echo $this->t('help_text'); ?></p>
<p class="logintext"><?php echo $this->t('help_text'); ?></p>
<?php $this->includeAtTemplateBase('includes/footer.php'); ?>
<?php $this->includeAtTemplateBase('includes/footer.php'); ?>

View File

@ -119,7 +119,7 @@ dt {
}
#content {
#content, #footer {
padding: 0 20px;
}
@ -348,4 +348,37 @@ caption {
.float-l {
float: left;
}
#mobilesubmit {
display: none;
}
@media handheld, only screen and (max-width: 480px), only screen and (max-device-width: 480px) {
#header, #languagebar, #footer, .erroricon, #loginicon, .logintext, #regularsubmit {
display: none;
}
body {
font-size: 20px;
}
#wrap {
margin: 0;
}
h1,h2,h3,h4 {
font-size: 110%;
}
#content {
margin-bottom: 10px;
padding: 0;
padding-left: 5px;
}
input[type="text"], input[type="password"] {
height: 1.5em;
font-size: 1em;
}
#mobilesubmit {
display: inline;
}
.youareadmin {
font-size: 50%;
}
}