<?php error_reporting(0); $errorMessage = false; $server = 'ldap://192.168.0.11'; $dn = 'dc=next.com';//'CN=Users,DC=next.com,DC=com'; $bind_user = 'patrick@next.com'; $bind_pass = 'test123'; $d = $_SERVER['LOGON_USER'] ; echo $d; if(isset($_POST['login'])){ $username = $_POST['username']; $password = $_POST['password']; $ldapconnect = ldap_connect($server,389); if(!$ldapconnect){ $error_message = '<p>error: connection to server failed...</p>'; }else{ $ldapbind = ldap_bind($ldapconnect, $bind_user, $bind_pass); if(!$ldapbind){ $errormessage = '<p>error: binding to server failed...</p>'; echo "binding failed"; }else{ $filter = '(samaccountname='.$username.')'; $ldapsearch = ldap_search($ldapconnect, $dn, $filter); if(!$ldapsearch){ $errormessage = '<p>error: search on server failed...</p>'; echo "search failed"; }else{ echo "search passed"; $userdetails = ldap_get_entries($ldapconnect,$ldapsearch); if(!$userdetails){ $errormessage = '<p>error: entries not retreived...</p>'; echo "entries not retreived"; } if($userdetails["count"] == 0){ $errormessage = '<p>unknown user, please try again.</p>'; echo "unknown user"; } if($userdetails["count"] > 1){ $errormessage = '<p>more then one such user. please report to it support</p>'; echo $errormessage; }else{ $info= ldap_get_entries($ldapconnect, $ldapsearch); $userDetails= ldap_get_entries($ldapconnect, $ldapsearch); $user_dn = $userDetails[0]["dn"]; echo $user_dn; echo "<table border='1'>"; for ($i=0; $i<$info["count"]; $i++) { print ("<TR>"); print ("<TD width=15%>" . $info[$i]["cn"][0] . " " . $info[$i]["sn"][0]. "</TD>"); print ("<TD width=85%>" . $info[$i]["mail"][0] . "</TD>"); print ("<TD width=85%>" . $info[$i]["phno"][0] . "</TD>"); print ("<TD>" . $info[$i]["dn"][0] . "</TD>"); print ("</TR>"); } echo "</table>"; //echo "entries retreived"; //echo $user_dn; echo $auth_password; $userBind = ldap_bind($ldapConnect, $user_dn, $password); if(!$userBind){ $errorMessage = '<p>Invalid Username/Password!</p>'; }else{ // Do Something… } } } } } ldap_close($ldapConnect); } ?><html> <head> </head> <body> <div id="login"> <h2>login</h2> <p>please enter your username and password.</p> <form method="post" action="ldap.php"> <p>Username:</p> <input type="text" name="username" tabindex="1" /> <p>Password:</p> <input type="password" name="password" tabindex="2" /> <input type="submit" name="login" value="login" tabindex="3" /> </form> <?php echo $errorMessage;?> </div> </body> </html>
相关推荐
Get the Window Title, Active Document, and tell if an App is Running after Shell Launching It Description: This application demonstrates how to get the window title of an application you started with ...
Get EXE path from window handle
Get a window’s handle from the current cursor position.
$UserDN = (Get-ADUser -Identity $_.Username).distinguishedName $TargetOU = $_.TargetOU Write-Host " Moving Accounts ..... " # Move user to target OU. Move-ADObject -Identity $UserDN -TargetPath $...
sak32009-get-dlc-info-from-steamdb.user
How to get current user of sharepoint 2013
get_dll_from_bin.exe 又名 get_dll_from_dumped_bin 用于处理 gameguardian 内存 dump 文件转 dll
get_data_from_com and print label use codesoft
Using the Winsock Control to get IP Information
Get VersionInfo from resource file从资源文件中得到程序的版本信息(1)(6KB)
I started this utility to get some basic information about the hardware. After that I have received some emails from some of our fellow programmers, who are frequent visitors of this site, asking to ...
该软件是通过直接提取内存来实现dll解密,可在模拟器中进行提取,已整合模拟器提取内存所需软件,提取内存bin文件后将get_dll_from_dumped_bin.exe放到同一文件夹下运行即可
getloginuser.rargetloginuser.rargetloginuser.rar
SharePoint - GetCurrentUser
NULL 博文链接:https://xusweeter.iteye.com/blog/855233
获得运行主机的硬件信息:CPU序列号、MAC地址、主板序列号、硬盘序列号
该软件是通过直接提取内存来实现dll解密,可在模拟器中进行提取,已整合模拟器提取内存所需软件,提取内存bin文件后将get_dll_from_dumped_bin.exe放到同一文件夹下运行即可
get string from a fun
解决Got an exception - java.lang.RuntimeException: Unable to get class information for ***Exception. 找这个解决方法找了一个晚上,希望能对你有帮助!
get_dll_from_dumped_bin通过直接提取内存来实现dll文件解密,能直接在模拟器中提取,压缩包内已包含模拟器提取内存所需软件,提取内存bin文件后将get_dll_from_dumped_bin.exe放到同一文件夹下运行即可。...