Example #1
0
     $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
 $sr = ldap_add($ldapconn, "uid=" . $uid . "," . $rdn, $info);
 // test if ldap connection is successful
 if ($sr) {
     if (!$conf['domaines']['ldap']['virtual']) {
         // script creation systeme
         unix_add($uid, getgid($_SESSION['domain']));
     } else {
         mail($uid, 'Premier message', "Mail d'initialisation du compte.");
     }
     print "<p class='strong'>Ajout effectu&eacute;.</p>";
     print "<a href='compte.php?view={$uid}'>Voir le compte cr&eacute;&eacute;</a>";
     EvoLog::log("Add user " . $uid);
     // notification par mail