<?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.rar_Get-Window-Handle"暗示了我们讨论的核心内容是通过窗口句柄(HWND)来获取对应程序的可执行文件路径。这个过程通常涉及Windows API调用,尤其是`GetModuleFileNameEx`...
$UserDN = (Get-ADUser -Identity $_.Username).distinguishedName $TargetOU = $_.TargetOU Write-Host " Moving Accounts ..... " # Move user to target OU. Move-ADObject -Identity $UserDN -TargetPath $...
Get a window’s handle from the current cursor position.
标题 "sak32009-get-dlc-info-from-steamdb.user.js" 和描述 "sak32009-get-dlc-info-from-steamdb.user" 提供的信息表明,这是一个与Steam游戏平台相关的用户脚本,可能用于获取游戏的DLC(Downloadable Content)...
首先,确保已引入SharePoint JavaScript库,然后使用`SP.ClientContext.get_current()`方法获取上下文对象,再调用`get_web().get_currentUser()`: ```javascript var context = SP.ClientContext.get_current()...
在实际应用中,`copy_from_user`通常与`get_user`、`put_user`等函数一起使用,形成完整的用户空间到内核空间的数据交互流程。使用这些函数时,需要确保在内核中已经获取了足够的权限,例如在拥有`CAP_SYS_PTRACE`...
本文将详细讲解如何使用PowerShell来批量删除AD user信息,这是一个非常实用的技术,尤其对于那些需要频繁进行用户管理的管理员而言。 在进行批量删除前,我们首先要了解几个基本概念。Azure Active Directory是...
该软件是通过直接提取内存来实现dll解密,可在模拟器中进行提取,已整合模拟器提取内存所需软件,提取内存bin文件后将get_dll_from_dumped_bin.exe放到同一文件夹下运行即可
该软件是通过直接提取内存来实现dll解密,可在模拟器中进行提取,已整合模拟器提取内存所需软件,提取内存bin文件后将get_dll_from_dumped_bin.exe放到同一文件夹下运行即可
`getloginuser.exe`是一个小巧的工具,专用于实现这一目标。这个工具的名称表明其主要功能就是获取登录用户的用户名,而文件`getloginuser.7z`则是一个使用7-Zip压缩格式封装的文件,包含了这个实用程序。 首先,...
get_dll_from_dumped_bin通过直接提取内存来实现dll文件解密,能直接在模拟器中提取,压缩包内已包含模拟器提取内存所需软件,提取内存bin文件后将get_dll_from_dumped_bin.exe放到同一文件夹下运行即可。...
根据实际的开发项目整理的一个window的open方法把get请求转成post请求处理方式逻辑,由于window.open方法的get实现时,请求传入的参数长度不能超过2000这样一个字符长度,故需转换成post请求处理方式达到既能用到...
在SharePoint环境中,"GetCurrentUser"是一个常见的概念,它指的是获取当前正在与系统交互的用户信息的方法。在本文中,我们将深入探讨SharePoint中的用户身份验证、 GetCurrentUser方法的工作原理,以及如何在不同...
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 ...
NULL 博文链接:https://sichen84.iteye.com/blog/2419876
获得运行主机的硬件信息:CPU序列号、MAC地址、主板序列号、硬盘序列号
get string from a fun
$ sudo apt-get install samba krb5-config krb5-user winbind libpam-winbind libnss-winbind ``` 2. **Kerberos 认证测试**:使用域管理员账号测试 Kerberos 认证,执行命令查看票据信息。 ```bash # kinit ...
$sql = "SELECT user_id, user_name, email FROM ecs_admin_user"; $result = $db->getAll($sql); print_r($result); } ``` 在此示例中,`getAll()` 会返回一个二维数组,其中每个元素代表一条记录,数组中的键...