Exemplo n.º 1
0
     $info["authsmtpActive"] = isset($_POST['authsmtpactive']) ? "TRUE" : "FALSE";
 }
 // Cas d'un compte Samba
 if ($conf['admin']['what'] == 2 || $conf['admin']['what'] == 3) {
     $userRid = 2 * $info["uidNumber"] + 1000;
     $info["sambaSID"] = $conf['samba']['sid'] . '-' . $userRid;
     if (!empty($_POST['displayname'])) {
         $info["displayName"] = Html::clean($_POST['displayname']);
     }
     $info["smbActive"] = isset($_POST['smbactive']) ? "TRUE" : "FALSE";
     $info["sambaDomainName"] = $conf['samba']['dn'];
     $tmp = getsambagroups('smb');
     $info["sambaPrimaryGroupSID"] = $conf['samba']['sid'] . $tmp[$smbgroup];
     $info["sambaPwdLastSet"] = strtotime("now");
     $info["sambaLMPassword"] = Ldap::sambalm($_POST['pass1']);
     $info["sambaNTPassword"] = Ldap::sambant($_POST['pass1']);
     $info["shadowLastChange"] = floor(strtotime("now") / (3600 * 24));
     $info["sambaPwdCanChange"] = "-2";
     $info["sambaPwdMustChange"] = "2147483647";
     $info["sambaKickoffTime"] = "2147483647";
     $info["sambaAcctFlags"] = "[XU         ]";
     $info["shadowExpire"] = "-1";
     $info["shadowInactive"] = "-1";
     $info["shadowMax"] = "200";
     $info["shadowMin"] = "0";
     $info["shadowWarning"] = "30";
     $info["shadowFlag"] = "-1";
 }
 $info["userPassword"] = "******" . Ldap::ssha($_POST['pass1']);
 $ldapconn = Ldap::lda_connect(LDAP_ADMIN_DN, LDAP_ADMIN_PASS);
 // We use uid attribute for DN