Home > php教程 > php手册 > 怎么实现用php来修改AD域用户名的密码

怎么实现用php来修改AD域用户名的密码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 19:42:06
Original
2788 people have browsed it

$host = "ldap://10.100.1.10:389"; $domain = "dec.com"; $user =$_POST["username"]; $oldpswd=$_POST["oldpswd"]; $pwdtxt=$_POST["newpswrd"]; $conn = ldap_connect($host) or die("Could not connect!" ); ldap_set_option ( $conn, LDAP_OPT_PROTOCOL

$host = "ldap://10.100.1.10:389";
$domain = "dec.com";
$user =$_POST["username"];

$oldpswd=$_POST["oldpswd"];
$pwdtxt=$_POST["newpswrd"];
$conn = ldap_connect($host) or die("Could not connect!" );

ldap_set_option ( $conn, LDAP_OPT_PROTOCOL_VERSION, 3 );
   ldap_set_option ( $conn, LDAP_OPT_REFERRALS, 0 ); 

   $bd = ldap_bind($conn,$user."@".$domain,$oldpswd);

 if($bd){
       if(ldap_mod_replace($bd,$pwdtxt))           {
             echo"succeded";
          } else {
             echo "failed";
         }

为什么老是失败呢???

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Framework error
From 1970-01-01 08:00:00
0
0
0
Can anyone help me take a look?
From 1970-01-01 08:00:00
0
0
0
Composer cannot install laravel
From 1970-01-01 08:00:00
0
0
0
homestead - laravel new app reports error
From 1970-01-01 08:00:00
0
0
0
composer installation failed
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template