0
と認証されていると、ログイン後に誰が認証されるのですか?PHP LDAPが
私のコードは、ログインが含まれていますし、働いている:
HTML:
<form action="index.php" method="POST">
User:
<input type="text" name="username" /><br>
Pwd:
<input type="password" name="password" /><br>
<input type="submit" value="Login">
</form>
PHP:
<?php
$ldapServer = 'ldap://myServer';
$ldapPort = myPort;
$username = $_POST['username']."@myDomain.local";
$password = $_POST['password'];
$connect = ldap_connect($ldapServer, $ldapPort) or die("Connection failed!.");
ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($connect, LDAP_OPT_REFERRALS, 0);
if (@ldap_bind($connect, $username, $password)) {
echo "Authenticated";
}
else {
echo "Wrong Username or Password";
}
私はそれは私に 自民党を示しLDP.EXEのプログラムの開発を開始したとき。 exe:
0 = ldap_set_option(ld, LDAP_OPT_ENCRYPT, 1)
res = ldap_bind_s(ld, NULL, &NtAuthIdentity, NEGOTIATE (1158)); // v.3
{NtAuthIdentity: User='myUserName'; Pwd=<unavailable>; domain = 'myDomain.local'}
Authenticated as: 'MYDOMAIN\myUser'.
質問はどうやって抽出してhtmlページにレンダリングすればいいのですか?私の問題の解決策:レコードの
間でコードを入れきっとあなただけの 'でログインしているユーザーを示すために$ username'をエコーすることができますか? '$ _SESSION'にその値を格納して、他のページでその値を参照します。 – timclutton