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

login-admin module now do not ask for username.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@963 44740490-163a-0410-bde0-09ae8108e29a
parent be28f24b
No related branches found
No related tags found
No related merge requests found
<?php <?php
if (!array_key_exists('icon', $this->data)) $this->data['icon'] = 'lock.png'; if (!array_key_exists('icon', $this->data)) $this->data['icon'] = 'lock.png';
$this->data['autofocus'] = 'username'; if (!isset($this->data['autofocus'])) {
$this->data['autofocus'] = 'username';
}
$this->includeAtTemplateBase('includes/header.php'); $this->includeAtTemplateBase('includes/header.php');
?> ?>
...@@ -23,10 +25,25 @@ ...@@ -23,10 +25,25 @@
<tr> <tr>
<td rowspan="2"><img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/pencil.png" /></td> <td rowspan="2"><img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/pencil.png" /></td>
<td style="padding: .3em;"><?php echo $this->t('username'); ?></td> <td style="padding: .3em;"><?php echo $this->t('username'); ?></td>
<td><input type="text" id="username" tabindex="1" name="username"
<?php if (isset($this->data['username'])) {
echo 'value="' . htmlspecialchars($this->data['username']) . '"'; <td>
} ?> /></td> <?php
if (array_key_exists('admin', $this->data)) {
echo '<strong style="font-size: medium">Administrator</strong>';
} else {
echo '<input type="text" id="username" tabindex="1" name="username" ';
if (isset($this->data['username'])) {
echo 'value="' . htmlspecialchars($this->data['username']) . '"';
}
echo '/></td>';
}
?>
<td style="padding: .4em;" rowspan="2"> <td style="padding: .4em;" rowspan="2">
<input type="submit" tabindex="3" value="<?php echo $this->t('login_button'); ?>" /> <input type="submit" tabindex="3" value="<?php echo $this->t('login_button'); ?>" />
<input type="hidden" name="RelayState" value="<?php echo htmlspecialchars($this->data['relaystate']); ?>" /> <input type="hidden" name="RelayState" value="<?php echo htmlspecialchars($this->data['relaystate']); ?>" />
...@@ -34,7 +51,7 @@ ...@@ -34,7 +51,7 @@
</tr> </tr>
<tr> <tr>
<td style="padding: .3em;"><?php echo $this->t('password'); ?></td> <td style="padding: .3em;"><?php echo $this->t('password'); ?></td>
<td><input type="password" tabindex="2" name="password" /></td> <td><input id="password" type="password" tabindex="2" name="password" /></td>
</tr> </tr>
</table> </table>
......
...@@ -83,6 +83,8 @@ $t = new SimpleSAML_XHTML_Template($config, 'login.php', 'login'); ...@@ -83,6 +83,8 @@ $t = new SimpleSAML_XHTML_Template($config, 'login.php', 'login');
$t->data['header'] = 'simpleSAMLphp: Enter username and password'; $t->data['header'] = 'simpleSAMLphp: Enter username and password';
$t->data['relaystate'] = $relaystate; $t->data['relaystate'] = $relaystate;
$t->data['admin'] = TRUE;
$t->data['autofocus'] = 'password';
$t->data['error'] = $error; $t->data['error'] = $error;
if (isset($error)) { if (isset($error)) {
$t->data['username'] = $username; $t->data['username'] = $username;
......
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