What I am trying to do is set up a login screen. I collect the user's credentials and verify it using an ldap server before allowing the user to take a quiz.
<?php
session_start();
$user = $_POST['user'];
$domain = 'DOMAIN';
$password = $_POST['password'];
$ldapserver="ldap.example.server";
$ldapport=389;
$ldap = ldap_connect($ldapserver,$ldapport);
if ($bind = @ldap_bind($ldap,"{$user}@{$domain}", $password)){
$_SESSION["user"] = '$user';
header('Location: quiz.php');
}
else {
header('Location: login.html');
}
?>
When I use wireshark to sniff the packets, i can see the username and password clearly. Is there a way to bind to an LDAP server without sending the password in plain text? The site doesnt have https. The owner does not want to buy a SSL certificate, nor is he interest in a self-signed one.