- 论坛徽章:
- 0
|
谢谢楼上兄弟的回答,问题已经解决:
方法是:我用的是squirrelmail,他里面有一段很精细的代码就是修改smb的密码的。
代码如下:
// and maybe you are using samba/ldap authentication, in this case you
// you will need mkntpwd in order to generate the nt/lm password.
// http://www.samba.org/cgi-bin/cvs ... ldap-tools/mkntpwd/
$change_ldapsmb=0;
$mkntpwd="/usr/bin/mkntpwd";
如果把$change_ldapsmb=0;这个变量至为1,就OK了。
if ($change_ldapsmb) {
$exe = "$mkntpwd " . escapeshellarg($cp_newpass) . " 2>&1" ;
if ($debug) array_push($Messages,$exe);
$ntString = exec ($exe, $retarray, $retval);
if ($debug) $Messages = array_merge($Messages,$retarray);
if ( $retval == "0" && preg_match("/^[0-9A-F]+:[0-9A-F]+$/",$ntString )) {
list($lmPassword, $ntPassword) = explode (":", $ntString);
$newinfo[$ldapsmb_ntpassword] = $ntPassword;
$newinfo[$ldapsmb_lmpassword] = $lmPassword;
} else { //smbpasswd change failed so we must re sync the ldap password back to its original
array_push($Messages, _("SMB Password change was not successful, so LDAP not changed!"));
return $Messages;
} |
|