Latest SANDPIT - MERGE from CVS (MERGE-GIT)
This commit is contained in:
@@ -1,26 +1,24 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login_form.php,v 1.29.2.7 2008/12/12 12:20:22 wurley Exp $
|
||||
// $Header$
|
||||
|
||||
/**
|
||||
* Displays the login form for a server for users who specify 'cookie' or 'session' for their auth_type.
|
||||
*
|
||||
* @package phpLDAPadmin
|
||||
* @author The phpLDAPadmin development team
|
||||
* @package phpLDAPadmin
|
||||
* @see login.php
|
||||
*/
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
require './common.php';
|
||||
|
||||
if (! in_array($ldapserver->auth_type, array('cookie','session')))
|
||||
error(sprintf(_('Unknown auth_type: %s'),htmlspecialchars($ldapserver->auth_type)),'error','index.php');
|
||||
|
||||
printf('<h3 class="title">%s %s</h3>',_('Authenticate to server'),$ldapserver->name);
|
||||
printf('<h3 class="title">%s %s</h3>',_('Authenticate to server'),$app['server']->getName());
|
||||
echo '<br />';
|
||||
|
||||
# Check for a secure connection
|
||||
if (! isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on') {
|
||||
echo '<br />';
|
||||
echo '<center>';
|
||||
echo '<span style="color:red">';
|
||||
printf('<acronym title="%s"><b>%s: %s.</b></acronym>',
|
||||
@@ -28,13 +26,13 @@ if (! isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on') {
|
||||
_('Warning'),_('This web connection is unencrypted'));
|
||||
echo '</span>';
|
||||
echo '</center>';
|
||||
echo '<br />';
|
||||
}
|
||||
echo '<br />';
|
||||
|
||||
# Login form.
|
||||
echo '<form action="cmd.php" method="post" name="login_form">';
|
||||
echo '<input type="hidden" name="cmd" value="login" />';
|
||||
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
|
||||
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
|
||||
|
||||
if (get_request('redirect','GET',false,false))
|
||||
printf('<input type="hidden" name="redirect" value="%s" />',rawurlencode(get_request('redirect','GET')));
|
||||
@@ -43,11 +41,11 @@ echo '<center>';
|
||||
echo '<table class="forminput">';
|
||||
|
||||
printf('<tr><td><b>%s:</b></td></tr>',
|
||||
$ldapserver->login_attr == 'dn' ? _('Login DN') : $_SESSION[APPCONFIG]->getFriendlyName($ldapserver->login_attr));
|
||||
$app['server']->getValue('login','auth_text') ? $app['server']->getValue('login','auth_text') :
|
||||
($app['server']->getValue('login','attr') == 'dn' ? _('Login DN') : $_SESSION[APPCONFIG]->getFriendlyName($app['server']->getValue('login','attr'))));
|
||||
|
||||
printf('<tr><td><input type="text" id="login" name="%s" size="40" value="%s" /></td></tr>',
|
||||
$ldapserver->login_attr,
|
||||
$ldapserver->login_attr == 'dn' ? $ldapserver->login_dn : '');
|
||||
printf('<tr><td><input type="text" id="login" name="login" size="40" value="%s" /></td></tr>',
|
||||
$app['server']->getValue('login','attr') == 'dn' ? $app['server']->getValue('login','bind_id') : '');
|
||||
|
||||
echo '<tr><td colspan=2> </td></tr>';
|
||||
printf('<tr><td><b>%s:</b></td></tr>',_('Password'));
|
||||
@@ -55,7 +53,7 @@ echo '<tr><td><input type="password" id="password" size="40" value="" name="logi
|
||||
echo '<tr><td colspan=2> </td></tr>';
|
||||
|
||||
# If Anon bind allowed, then disable the form if the user choose to bind anonymously.
|
||||
if ($ldapserver->isAnonBindAllowed())
|
||||
if ($app['server']->isAnonBindAllowed())
|
||||
printf('<tr><td colspan="2"><small><b>%s</b></small> <input type="checkbox" name="anonymous_bind" onclick="toggle_disable_login_fields(this)" id="anonymous_bind_checkbox" /></td></tr>',
|
||||
_('Anonymous'));
|
||||
|
||||
@@ -68,19 +66,20 @@ echo '</form>';
|
||||
|
||||
echo '<script type="text/javascript" language="javascript">document.getElementById(\'login\').focus()</script>';
|
||||
|
||||
if( $ldapserver->isAnonBindAllowed() ) { ?>
|
||||
if ($app['server']->isAnonBindAllowed() ) {
|
||||
?>
|
||||
<script type="text/javascript" language="javascript">
|
||||
<!--
|
||||
function toggle_disable_login_fields(anon_checkbox) {
|
||||
if (anon_checkbox.checked) {
|
||||
anon_checkbox.form.<?php echo $ldapserver->login_attr; ?>.disabled = true;
|
||||
anon_checkbox.form.login_pass.disabled = true;
|
||||
} else {
|
||||
anon_checkbox.form.<?php echo $ldapserver->login_attr; ?>.disabled = false;
|
||||
anon_checkbox.form.<?php echo $ldapserver->login_attr; ?>.focus();
|
||||
anon_checkbox.form.login_pass.disabled = false;
|
||||
}
|
||||
function toggle_disable_login_fields(anon_checkbox) {
|
||||
if (anon_checkbox.checked) {
|
||||
anon_checkbox.form.login.disabled = true;
|
||||
anon_checkbox.form.password.disabled = true;
|
||||
} else {
|
||||
anon_checkbox.form.login.disabled = false;
|
||||
anon_checkbox.form.login.focus();
|
||||
anon_checkbox.form.password.disabled = false;
|
||||
}
|
||||
-->
|
||||
}
|
||||
</script>
|
||||
<?php }
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user