Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $user=$_POST['username'];
- $pass=$_POST['password'];
- $server=$_POST['server'];
- $ds=ldap_connect($server);
- if($ds){
- ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
- $r=ldap_bind($ds, $user, $pass);
- if($r){
- session_start();
- $_SESSION["username"]=$user;
- $_SESSION["server"]=$server;
- $_SESSION["password"]=$pass;
- $_SESSION["auth"]="Y";
- echo "Login successfully.<br>";
- echo "1. <a href='search.php'>search users</a> <br>";
- echo "2. <a href='add.html'>add new users</a><br>";
- ldap_close($ds);
- }else{ echo "can not login"; }
- }else{ echo "unable to connect";}
- ?>
Add Comment
Please, Sign In to add comment