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
2009-06-30 08:10:17 +00:00
$server_id = isset ( $_GET [ 'server_id' ] ) ? $_GET [ 'server_id' ] : null ;
if ( $server_id != null ) {
check_server_id ( $server_id ) or pla_error ( " Bad server_id: " . htmlspecialchars ( $server_id ) );
}
2009-06-30 08:05:37 +00:00
2009-06-30 08:10:17 +00:00
$server = $servers [ $server_id ];
2009-06-30 08:05:37 +00:00
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 )
{
2009-06-30 08:10:17 +00:00
if ( anon_checkbox . checked ) {
anon_checkbox . form .< ? php echo login_attr_enabled ( $server_id ) ? 'uid' : 'login_dn' ; ?> .disabled = true;
2009-06-30 08:05:37 +00:00
anon_checkbox . form . login_pass . disabled = true ;
} else {
2009-06-30 08:10:17 +00:00
anon_checkbox . form .< ? php echo login_attr_enabled ( $server_id ) ? 'uid' : 'login_dn' ; ?> .disabled = false;
2009-06-30 08:05:37 +00:00
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 />
2009-06-30 08:10:17 +00:00
< ? php if ( $_SERVER [ 'SERVER_PORT' ] != HTTPS_PORT ) { ?>
2009-06-30 08:05:37 +00:00
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 >
2009-06-30 08:10:17 +00:00
< td colspan = " 2 " >< small >< label for = " anonymous_bind_checkbox " > Anonymous Bind </ label ></ small > < input type = " checkbox " name = " anonymous_bind " onclick = " toggle_disable_login_fields(this) " id = " anonymous_bind_checkbox " /></ td >
2009-06-30 08:05:37 +00:00
</ tr >
< tr >
2009-06-30 08:10:17 +00:00
< td >< small > Login < ? php if ( ! login_attr_enabled ( $server_id ) ) { echo '<acronym title="Distinguished Name">DN</acronym>' ;} ?> </small></td>
< td >< input type = " text " name = " <?php echo login_attr_enabled( $server_id ) ? 'uid' : 'login_dn'; ?> " 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 >