Location: PHPKode > projects > LDAP Navigator > ldapnavigator-0.9.6/modules/authent/login.php
<?php

include_once( './config.php' );
include_once ( './lib/html.php' );
$navbar = false;
include_once ( './page.header.php' );


$searchScopes = array(
	"subtree" => "Sub tree",
	"onelevel" => "One level",
);


	// prefill form with current settings...
	if( is_array($ldapmanager) ) {

		extract( $ldapmanager);

	// Default settings if no current settings are set
	} elseif( ! isset($host) ) {

		$host = $config->host[0];
		$port = $config->port[0];
		$basedn = $config->basedn[0];
		$filter = $config->filter[0];
		$binddn = "";
		$convertCharset = 1;
		$maxTreeItems = $config->maxtreeitems;
		$searchscope = "subtree";
	}



	////////////////// start of form
	html::form( "index.php", "post" );
	
	
	html::hidden( "A", "logon" );

echo '<div align=center>';
echo '<table cellspacing=0 style="width:400px; border: 1px solid gray;">';
echo '<caption>', "LDAPNavigator Login page", "</caption>\n";

	
	// (optional) error message
	if( isset($errorMsg) && $errorMsg ) {
		FormLine( "", "<span class=error>$errorMsg</span>" );
	}

	////////////////// Host & Port

	if( $config->anyHost  )
		$wHost = new Textinput( "host", $host, $tbM );
	else {
		$wHost = new Popup( "host", $host, $config->host, $sbM );
		$wHost->useHash(false);
	}
	$wPort	= new Textinput( "port", $port, $tbZ );

	FormLine(
		"LDAP server Host:Port",
		$wHost->toString() . " : " . $wPort->toString()
	);



	if( count($config->basedn) <= 1 )
		$w = new Textinput( "basedn", $basedn, $tbM );
	else {
		$w = new Popup( "basedn", $basedn, $config->basedn, $sbL );
		$w->useHash(false);
	}

	FormLine(
		"Base DN",
		$w->toString()
	);

	FormLine(
		"&nbsp;",
		new Button( "Lookup possible DN", "submit", "LookupDN" )
	);

	if( count($config->binddn) <= 1 )
		$w = new Textinput( "binddn", $binddn, $tbM );
	else {
		$w = new Popup( "binddn", $binddn, $config->binddn, $sbM );
		$w->useHash(false);
	}

	FormLine( 
		"User ID or DN",
		$w
	);
	
	FormLine( 
		"Password",
		new Password( "bindpw", $bindpw, $tbS )
	);

/*
	FormLine( 
		"Filter",
		new TextInput( "filter", $filter, $tbM )
	);
*/
	
	FormLine( 
		"Search scope",
		new Popup( "searchscope", @$searchscope, $searchScopes, $sbM )
	);
	
	////////////////// other options
	RowN(
		"",
		array( 
			new Checkbox( "convertCharset", 1, $convertCharset ),
			"convert LDAP data from UTF to ISO (accents)"
		)
	);


	////////////////// Treeview options
	$tb = new Textinput( "maxTreeItems", $maxTreeItems, $tbZ );
	$str = " Display only first " . $tb->toString() . " &nbsp; children per node";
	FormLine( 
		"Tree view",
		$str
	);


	////////////////// 	
	FormLine(
		"",
		new Button( "Start", "submit", "", $btM )
	);

	FormLine(
		"",
		"Contact : <a class=menu href='mailto:$config->adminEmail'>LDAPNavigator Administrator</a>"
	);

	echo "</table></form>";

	include_once( "./page.footer.php" );

?>
Return current item: LDAP Navigator