我正在尝试使用PHP对LDAP用户进行身份验证.我有用户的DN,我检查了正确.我也有密码.这是用户进行身份验证时的正确密码SamAccountName.
我希望这是使用DN进行身份验证时使用的密码.没有针对LDAP的专有名称密码?以下是我使用PHP ldap_bind()函数进行身份验证的代码.我这样做是对的吗?
$ldaphost="ldap://somehost.com:3268";
$dn = "cn=LastName\, FirstName Dept/Country/ext,OU=Accounts,OU=Location,ou=Division,";
$basedn="dc=abc,dc=enterprise";
if (!($connect = ldap_connect($ldaphost))) {
die ("Could not connect to LDAP server");
}
$ldapbind = ldap_bind($connect, "$dn" . "$basedn", $password);
if ($ldapbind) {
echo "LDAP bind successful...";
} else {
echo "LDAP bind failed...";
}
Run Code Online (Sandbox Code Playgroud)
我从上面的代码得到的结果是:
警告:ldap_bind()[function.ldap-bind]:无法绑定到服务器:无效的凭据LDAP绑定失败...
从ldap_bind()发出呼叫的线路:
$ldapbind = ldap_bind($connect, "$dn" . "$basedn", $password);
Run Code Online (Sandbox Code Playgroud)
凭据无效使我相信DN或密码可能存在错误.我已经对DN进行了三次检查,据我所知,没有错误.
有任何想法吗?
我需要在javascript中放置html.具体来说,我想用javascript添加到div标签的HTML链接.
HTML:
<div id="mydivtag"></div>
Run Code Online (Sandbox Code Playgroud)
JavaScript的:
document.getElementById('mydivtag').innerHTML = "<li><a href=\"someLink\">Some Link</a></li> ";
Run Code Online (Sandbox Code Playgroud)
我正在格式化我正在通过javascript正确添加的html链接吗?
尝试在Intellij中创建运行配置对于Java应用程序,并得到警告,提示在模块中找不到类,并且该类未创建运行配置。仅在将项目添加到BitBucket后才发生这种情况。在此之前,它运行良好。
我正在对get和getJSON进行jquery调用,但是无法访问回调函数之外的返回值.如何访问返回的数据?
var firstid;
var nextid;
$.get(callUrl, function(data) { // call to add node
var n = data.indexOf("id-");
var m = data.indexOf("id-");
firstid = data.substr(n+3,m - (n+3));
nextid = data.substr(m+3);
alert("firstid:" + firstid); // returns correct value
});
alert("firstid:" + firstid); // returns undefined for firstid
Run Code Online (Sandbox Code Playgroud)
我怎么能在功能之外得到第一次?
我需要将两个工作表与 Apache POI 进行比较。有没有一种简单的方法可以做到这一点,例如工作表比较功能,或者我必须比较每个单元格?
在一个方法中,我需要调用一些代码但是在方法的返回调用之后.我该怎么做呢?
// this call needs to happen after the return true call
xmlRpcClient.invoke("newDevices", listDeviceDesc);
return true;
Run Code Online (Sandbox Code Playgroud) 有没有办法在Java中告诉程序是在Windows或Linux机器上运行?我有一个.jar文件,我想在这两个文件上运行.
在Android应用程序上工作。它很大而且涉及很多。我需要找到在应用启动时将要执行的类,例如在运行Eclipse时。我如何找到这个班?有一些标准吗?
重写的方法想要返回,Iterable<T>但在我拥有的方法中Iterable<String>.我怎样才能返回Iterable<T>从Iterable<String>,甚至Set<String>?
码:
@Override
public Iterable<T> getAll() {
Set<String> set = getCache().keySet();
Iterable<String> iter = set;
return ?
}
Run Code Online (Sandbox Code Playgroud) 可以使用chartSeries,candleChart或barChart在R中创建日内图表吗?
chartSeries,candleChart和barChart是R的quantmod包的一部分.