phpldapadmin/login_form.php

78 lines
2.3 KiB
PHP
Raw Normal View History

2009-06-30 08:05:37 +00:00
<?php
/*
* login_form.php
* Displays the login form for a server for users who specify
* 'form' for their auth_type.
*
* Variables that come in as GET vars:
* - server_id
*/
2009-06-30 08:07:14 +00:00
require 'common.php';
2009-06-30 08:05:37 +00:00
$server_id = $_GET['server_id'];
$server = $servers[$server_id];
check_server_id( $server_id ) or pla_error( "Bad server_id: " . htmlspecialchars( $server_id ) );
2009-06-30 08:09:20 +00:00
include 'header.php'; ?>
2009-06-30 08:05:37 +00:00
<body>
<script language="javascript">
<!--
function toggle_disable_login_fields( anon_checkbox )
{
if( anon_checkbox.checked) {
anon_checkbox.form.login_dn.disabled = true;
anon_checkbox.form.login_pass.disabled = true;
} else {
anon_checkbox.form.login_dn.disabled = false;
anon_checkbox.form.login_pass.disabled = false;
}
}
-->
</script>
<center>
<h3 class="title">Authenticate to server <b><?php echo $servers[$server_id]['name']; ?></b></h3>
<br />
<?php if( $_SERVER['SERVER_PORT'] != 443 ) { ?>
2009-06-30 08:07:14 +00:00
<center>
2009-06-30 08:09:20 +00:00
<span style="color:red">Warning: This web connection is <acronym title="You are not using 'https'. Web browlser will transmit login information in clear text">unencrypted</acronym>.<br />
2009-06-30 08:07:14 +00:00
</span>
2009-06-30 08:05:37 +00:00
<?php } ?>
<br />
<form action="login.php" method="post" name="login_form">
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
2009-06-30 08:09:20 +00:00
<?php if( isset( $_GET['redirect'] ) ) { ?>
2009-06-30 08:05:37 +00:00
<input type="hidden" name="redirect" value="<?php echo rawurlencode( $_GET['redirect'] ) ?>" />
<?php } ?>
<center>
<table class="login">
<tr>
</tr>
<tr>
<td colspan="2"><small>Anonymous Bind</small> <input type="checkbox" name="anonymous_bind" onclick="toggle_disable_login_fields(this)" /></td>
</tr>
<tr>
2009-06-30 08:07:14 +00:00
<td><small>Login <?php if ( $servers[$server_id]['login_attr'] == "dn" || $servers[$server_id]['login_attr'] == "") { echo '<acronym title="Distinguished Name">DN</acronym>';} ?></small></td>
<td><input type="text" name="<?php if ( $servers[$server_id]['login_attr'] == "dn" || $servers[$server_id]['login_attr'] == "" ) {echo 'login_dn';} else {echo 'uid';} ?>" size="40" value="<?php echo $servers[$server_id]['login_dn']; ?>" /></td>
2009-06-30 08:05:37 +00:00
</tr>
<tr>
<td><small>Password</small></td>
<td><input type="password" name="login_pass" size="40" value="" name="login_pass" /></td>
</tr>
<tr>
<td colspan="2"><center><input type="submit" name="submit" value="Authenticate" /></center></td>
</tr>
</table>
</form>
</center>