Clean commit
This commit is contained in:
parent
e386564c0a
commit
5b5c209948
|
@ -91,9 +91,9 @@ if (isset($_SESSION['login'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$rdn= "ou=people," .LDAP_BASE;
|
$rdn= "ou=people," .LDAP_BASE;
|
||||||
}
|
}
|
||||||
$_SESSION['rdn'] = $rdn;
|
$_SESSION['rdn'] = $rdn;
|
||||||
|
|
||||||
include EVOADMIN_BASE . 'debut.php';
|
include EVOADMIN_BASE . 'debut.php';
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ if (isset($_SESSION['login'])) {
|
||||||
$comptes = array();
|
$comptes = array();
|
||||||
// tableau contenant tous les alias
|
// tableau contenant tous les alias
|
||||||
$aliases = array();
|
$aliases = array();
|
||||||
|
|
||||||
$ldapconn = Ldap::lda_connect(LDAP_ADMIN_DN,LDAP_ADMIN_PASS);
|
$ldapconn = Ldap::lda_connect(LDAP_ADMIN_DN,LDAP_ADMIN_PASS);
|
||||||
|
|
||||||
//$filter="(objectClass=mailAccount)";
|
//$filter="(objectClass=mailAccount)";
|
||||||
|
@ -124,14 +124,14 @@ if (isset($_SESSION['login'])) {
|
||||||
// compatibilite anciens schemas
|
// compatibilite anciens schemas
|
||||||
if ($conf['evoadmin']['version'] == 1) {
|
if ($conf['evoadmin']['version'] == 1) {
|
||||||
$filter="(&(objectClass=mailAlias)(onlyAlias=TRUE))";
|
$filter="(&(objectClass=mailAlias)(onlyAlias=TRUE))";
|
||||||
}
|
}
|
||||||
$sr=ldap_search($ldapconn, $rdn, $filter);
|
$sr=ldap_search($ldapconn, $rdn, $filter);
|
||||||
$info = ldap_get_entries($ldapconn, $sr);
|
$info = ldap_get_entries($ldapconn, $sr);
|
||||||
|
|
||||||
for ($i=0;$i<$info["count"];$i++) {
|
for ($i=0;$i<$info["count"];$i++) {
|
||||||
array_push($aliases,$info[$i]["cn"][0]);
|
array_push($aliases,$info[$i]["cn"][0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ldap_unbind($ldapconn);
|
ldap_unbind($ldapconn);
|
||||||
|
|
||||||
//tri alphanumeriques des tableaux
|
//tri alphanumeriques des tableaux
|
||||||
|
@ -164,9 +164,9 @@ if (isset($_SESSION['login'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (!isset($_POST['viewonly'])) || ($_POST['viewonly']==1) ) {
|
if ( (!isset($_POST['viewonly'])) || ($_POST['viewonly']==1) ) {
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<h3>Liste des comptes :</h3>
|
<h3>Liste des comptes :</h3>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
@ -217,15 +217,15 @@ if (isset($_SESSION['login'])) {
|
||||||
}
|
}
|
||||||
show_my_details($compte,'compte', $letter);
|
show_my_details($compte,'compte', $letter);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
} elseif ( (isset($_POST['viewonly'])) && ($_POST['viewonly']==2) ) {
|
} elseif ( (isset($_POST['viewonly'])) && ($_POST['viewonly']==2) ) {
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<h3>Liste des alias/groupe de diffusion :</h3>
|
<h3>Liste des alias/groupe de diffusion :</h3>
|
||||||
|
|
||||||
<table width="500px" bgcolor="#ddd" border="1">
|
<table width="500px" bgcolor="#ddd" border="1">
|
||||||
<tr>
|
<tr>
|
||||||
<td><strong>Nom de l'alias/groupe de diffusion</strong></td>
|
<td><strong>Nom de l'alias/groupe de diffusion</strong></td>
|
||||||
|
@ -244,7 +244,7 @@ if (isset($_SESSION['login'])) {
|
||||||
</center>
|
</center>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
} else { //if (isset($_SESSION['login']))
|
} else { //if (isset($_SESSION['login']))
|
||||||
header("location: auth.php\n\n");
|
header("location: auth.php\n\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
|
@ -252,4 +252,4 @@ if (isset($_SESSION['login'])) {
|
||||||
|
|
||||||
include EVOADMIN_BASE . 'fin.php';
|
include EVOADMIN_BASE . 'fin.php';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -77,20 +77,20 @@ if (isset($_SESSION['login']))
|
||||||
print "<p>Modification en cours...</p>";
|
print "<p>Modification en cours...</p>";
|
||||||
|
|
||||||
// TODO : contraintes sur cn, sn, etc.
|
// TODO : contraintes sur cn, sn, etc.
|
||||||
if ( $cn != Html::clean($_POST['cn']) ) {
|
if ( $cn != Html::clean($_POST['cn']) ) {
|
||||||
$new["cn"] = Html::justclean(Html::purgeaccents(utf8_decode($_POST['cn'])));
|
$new["cn"] = Html::justclean(Html::purgeaccents(utf8_decode($_POST['cn'])));
|
||||||
|
|
||||||
if ($conf['evoadmin']['version'] == 1) {
|
if ($conf['evoadmin']['version'] == 1) {
|
||||||
$new["sn"] = $new["cn"];
|
$new["sn"] = $new["cn"];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ($conf['evoadmin']['version'] > 1) && (!$conf['domaines']['ldap']['virtual']) && ( $sn != Html::clean($_POST['sn']) ) ) {
|
if ( ($conf['evoadmin']['version'] > 1) && (!$conf['domaines']['ldap']['virtual']) && ( $sn != Html::clean($_POST['sn']) ) ) {
|
||||||
$new["sn"] = Html::justclean(Html::purgeaccents(utf8_decode($_POST['sn'])));
|
$new["sn"] = Html::justclean(Html::purgeaccents(utf8_decode($_POST['sn'])));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (!$conf['domaines']['ldap']['virtual']) && ( $mail != Html::clean($_POST['mail']) )) {
|
if ( (!$conf['domaines']['ldap']['virtual']) && ( $mail != Html::clean($_POST['mail']) )) {
|
||||||
$new["mail"] = Html::clean($_POST['mail']);
|
$new["mail"] = Html::clean($_POST['mail']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,16 +122,16 @@ if (isset($_SESSION['login']))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$postisactive = (isset($_POST['isactive']) ? 'TRUE' : 'FALSE');
|
$postisactive = (isset($_POST['isactive']) ? 'TRUE' : 'FALSE');
|
||||||
if ( $info[0]["isactive"][0] != $postisactive ) {
|
if ( $info[0]["isactive"][0] != $postisactive ) {
|
||||||
$new["isActive"] = $postisactive;
|
$new["isActive"] = $postisactive;
|
||||||
}
|
}
|
||||||
|
|
||||||
$postisadmin = (isset($_POST['isadmin']) ? 'TRUE' : 'FALSE');
|
$postisadmin = (isset($_POST['isadmin']) ? 'TRUE' : 'FALSE');
|
||||||
if ( $info[0]["isadmin"][0] != $postisadmin ) {
|
if ( $info[0]["isadmin"][0] != $postisadmin ) {
|
||||||
$new["isAdmin"] = $postisadmin;
|
$new["isAdmin"] = $postisadmin;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST['loginshell'] != $info[0]['loginshell'][0]) {
|
if ($_POST['loginshell'] != $info[0]['loginshell'][0]) {
|
||||||
$new["loginShell"] = Html::clean($_POST['loginshell']);
|
$new["loginShell"] = Html::clean($_POST['loginshell']);
|
||||||
}
|
}
|
||||||
|
@ -139,23 +139,23 @@ if (isset($_SESSION['login']))
|
||||||
// only for mail mode
|
// only for mail mode
|
||||||
if (($conf['admin']['what'] == 1) || ($conf['admin']['what'] == 3)) {
|
if (($conf['admin']['what'] == 1) || ($conf['admin']['what'] == 3)) {
|
||||||
|
|
||||||
$postaccountactive = (isset($_POST['accountactive']) ? 'TRUE' : 'FALSE');
|
$postaccountactive = (isset($_POST['accountactive']) ? 'TRUE' : 'FALSE');
|
||||||
if ( $info[0]["accountactive"][0] != $postaccountactive ) {
|
if ( $info[0]["accountactive"][0] != $postaccountactive ) {
|
||||||
$new["accountActive"] = $postaccountactive;
|
$new["accountActive"] = $postaccountactive;
|
||||||
}
|
}
|
||||||
|
|
||||||
$postauthsmtpactive = (isset($_POST['authsmtpactive']) ? 'TRUE' : 'FALSE');
|
$postauthsmtpactive = (isset($_POST['authsmtpactive']) ? 'TRUE' : 'FALSE');
|
||||||
if ( $info[0]["authsmtpactive"][0] != $postauthsmtpactive ) {
|
if ( $info[0]["authsmtpactive"][0] != $postauthsmtpactive ) {
|
||||||
$new["authsmtpActive"] = $postauthsmtpactive;
|
$new["authsmtpActive"] = $postauthsmtpactive;
|
||||||
}
|
}
|
||||||
|
|
||||||
$postwebmailactive = (isset($_POST['webmailactive']) ? 'TRUE' : 'FALSE');
|
$postwebmailactive = (isset($_POST['webmailactive']) ? 'TRUE' : 'FALSE');
|
||||||
if ( $info[0]["webmailactive"][0] != $postwebmailactive ) {
|
if ( $info[0]["webmailactive"][0] != $postwebmailactive ) {
|
||||||
$new["webmailActive"] = $postwebmailactive;
|
$new["webmailActive"] = $postwebmailactive;
|
||||||
}
|
}
|
||||||
|
|
||||||
$postcourieractive = (isset($_POST['courieractive']) ? 'TRUE' : 'FALSE');
|
$postcourieractive = (isset($_POST['courieractive']) ? 'TRUE' : 'FALSE');
|
||||||
if ( $info[0]["courieractive"][0] != $postcourieractive ) {
|
if ( $info[0]["courieractive"][0] != $postcourieractive ) {
|
||||||
$new["courierActive"] = $postcourieractive;
|
$new["courierActive"] = $postcourieractive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ if (isset($_SESSION['login']))
|
||||||
}
|
}
|
||||||
|
|
||||||
$newmailaccept = array_pop($_POST['mailaccept']);
|
$newmailaccept = array_pop($_POST['mailaccept']);
|
||||||
if ( ($newmailaccept != NULL) |
|
if ( ($newmailaccept != NULL) |
|
||||||
array_diff($info[0]["mailacceptinggeneralid"],$_POST['mailaccept']) ) {
|
array_diff($info[0]["mailacceptinggeneralid"],$_POST['mailaccept']) ) {
|
||||||
$new["mailacceptinggeneralid"] = $_POST['mailaccept'];
|
$new["mailacceptinggeneralid"] = $_POST['mailaccept'];
|
||||||
$new["mailacceptinggeneralid"][$count]= $newmailaccept;
|
$new["mailacceptinggeneralid"][$count]= $newmailaccept;
|
||||||
|
@ -180,7 +180,7 @@ if (isset($_SESSION['login']))
|
||||||
while ( $new["mailacceptinggeneralid"][0] == NULL ) {
|
while ( $new["mailacceptinggeneralid"][0] == NULL ) {
|
||||||
array_shift($new["mailacceptinggeneralid"]);
|
array_shift($new["mailacceptinggeneralid"]);
|
||||||
|
|
||||||
// on evite une boucle infinie
|
// on evite une boucle infinie
|
||||||
if ( count($new["mailacceptinggeneralid"]) == 0 ) {
|
if ( count($new["mailacceptinggeneralid"]) == 0 ) {
|
||||||
print "Erreur, vous devez avoir au moins un mail entrant\n";
|
print "Erreur, vous devez avoir au moins un mail entrant\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -191,7 +191,7 @@ if (isset($_SESSION['login']))
|
||||||
// idem avec maildrop
|
// idem avec maildrop
|
||||||
$count = array_shift($info[0]["maildrop"]);
|
$count = array_shift($info[0]["maildrop"]);
|
||||||
$newmaildrop = array_pop($_POST['maildrop']);
|
$newmaildrop = array_pop($_POST['maildrop']);
|
||||||
if ( ($newmaildrop != NULL) |
|
if ( ($newmaildrop != NULL) |
|
||||||
array_diff($info[0]["maildrop"],$_POST['maildrop']) ) {
|
array_diff($info[0]["maildrop"],$_POST['maildrop']) ) {
|
||||||
$new["maildrop"] = $_POST['maildrop'];
|
$new["maildrop"] = $_POST['maildrop'];
|
||||||
$new["maildrop"][$count]= $newmaildrop;
|
$new["maildrop"][$count]= $newmaildrop;
|
||||||
|
@ -214,12 +214,12 @@ if (isset($_SESSION['login']))
|
||||||
// only for samba mode
|
// only for samba mode
|
||||||
if (($conf['admin']['what'] == 2) || ($conf['admin']['what'] == 3)) {
|
if (($conf['admin']['what'] == 2) || ($conf['admin']['what'] == 3)) {
|
||||||
|
|
||||||
$postsmbactive = (isset($_POST['smbactive']) ? 'TRUE' : 'FALSE');
|
$postsmbactive = (isset($_POST['smbactive']) ? 'TRUE' : 'FALSE');
|
||||||
if ( $info[0]["smbactive"][0] != $postsmbactive ) {
|
if ( $info[0]["smbactive"][0] != $postsmbactive ) {
|
||||||
$new["smbActive"] = $postsmbactive;
|
$new["smbActive"] = $postsmbactive;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $displayname != Html::clean($_POST['displayname']) ) {
|
if ( $displayname != Html::clean($_POST['displayname']) ) {
|
||||||
$new["displayname"] = Html::clean($_POST['displayname']);
|
$new["displayname"] = Html::clean($_POST['displayname']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -242,7 +242,7 @@ if (isset($_SESSION['login']))
|
||||||
} else {
|
} else {
|
||||||
print "<p class='strong'>Aucune modification nécessaire.</p>";
|
print "<p class='strong'>Aucune modification nécessaire.</p>";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</center>";
|
print "</center>";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -259,7 +259,7 @@ if (isset($_SESSION['login']))
|
||||||
print "<p class='error'>Erreur, compte inexistant</p>";
|
print "<p class='error'>Erreur, compte inexistant</p>";
|
||||||
EvoLog::log("login $uid unknown");
|
EvoLog::log("login $uid unknown");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<center>\n";
|
print "<center>\n";
|
||||||
print "<h4>Modification du compte $uid</h4>\n";
|
print "<h4>Modification du compte $uid</h4>\n";
|
||||||
|
@ -294,7 +294,7 @@ if (isset($_SESSION['login']))
|
||||||
|
|
||||||
// Compatibilite anciens schemas LDAP
|
// Compatibilite anciens schemas LDAP
|
||||||
if ($conf['evoadmin']['version'] == 1) {
|
if ($conf['evoadmin']['version'] == 1) {
|
||||||
|
|
||||||
print "<tr><td align='right'>Mail principal :";
|
print "<tr><td align='right'>Mail principal :";
|
||||||
print "</td><td align='left'>$mail</td></tr>\n";
|
print "</td><td align='left'>$mail</td></tr>\n";
|
||||||
print "<input type='hidden' name='mail' value='$mail' />";
|
print "<input type='hidden' name='mail' value='$mail' />";
|
||||||
|
@ -318,16 +318,16 @@ if (isset($_SESSION['login']))
|
||||||
print "<tr><td align='right'>Nom dans Samba :</td>
|
print "<tr><td align='right'>Nom dans Samba :</td>
|
||||||
<td align='left'><input type='text' name='displayname' tabindex='" .$tab++. "'
|
<td align='left'><input type='text' name='displayname' tabindex='" .$tab++. "'
|
||||||
value='$displayname' /></td></tr>\n";
|
value='$displayname' /></td></tr>\n";
|
||||||
|
|
||||||
print '
|
print '
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">Shell :</td>
|
<td align="right">Shell :</td>
|
||||||
<td align="left">
|
<td align="left">
|
||||||
<input type="text" name="loginshell" value="'
|
<input type="text" name="loginshell" value="'
|
||||||
. $info[0]['loginshell'][0] . '" />
|
. $info[0]['loginshell'][0] . '" />
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
|
||||||
print "<tr><td align='right'>Groupe Samba :</td>
|
print "<tr><td align='right'>Groupe Samba :</td>
|
||||||
<td align='left'>$sambagroup</td></tr>\n";
|
<td align='left'>$sambagroup</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
@ -344,7 +344,7 @@ if (isset($_SESSION['login']))
|
||||||
|
|
||||||
|
|
||||||
for ($i=0;$i<$info[0]["mailacceptinggeneralid"]['count'];$i++) {
|
for ($i=0;$i<$info[0]["mailacceptinggeneralid"]['count'];$i++) {
|
||||||
|
|
||||||
if (!$conf['domaines']['onlyone']) {
|
if (!$conf['domaines']['onlyone']) {
|
||||||
$info[0]['mailacceptinggeneralid'][$i] =
|
$info[0]['mailacceptinggeneralid'][$i] =
|
||||||
ereg_replace('@'.$_SESSION['domain'],'',$info[0]['mailacceptinggeneralid'][$i]);
|
ereg_replace('@'.$_SESSION['domain'],'',$info[0]['mailacceptinggeneralid'][$i]);
|
||||||
|
@ -432,7 +432,7 @@ if (isset($_SESSION['login']))
|
||||||
print "<p><input type='submit' class='button' onclick='return submit_add();'
|
print "<p><input type='submit' class='button' onclick='return submit_add();'
|
||||||
value='Valider' name='valider' tabindex='" .$tab++. "' /></p>\n";
|
value='Valider' name='valider' tabindex='" .$tab++. "' /></p>\n";
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
@ -443,7 +443,7 @@ if (isset($_SESSION['login']))
|
||||||
} elseif ( isset($_GET['del']) ) {
|
} elseif ( isset($_GET['del']) ) {
|
||||||
|
|
||||||
$uid = Html::clean($_GET['del']);
|
$uid = Html::clean($_GET['del']);
|
||||||
|
|
||||||
if ( (isset($_GET['modif'])) && ($_GET['modif'] == 'yes')) {
|
if ( (isset($_GET['modif'])) && ($_GET['modif'] == 'yes')) {
|
||||||
|
|
||||||
$ldapconn = Ldap::lda_connect(LDAP_ADMIN_DN,LDAP_ADMIN_PASS);
|
$ldapconn = Ldap::lda_connect(LDAP_ADMIN_DN,LDAP_ADMIN_PASS);
|
||||||
|
@ -463,7 +463,7 @@ if (isset($_SESSION['login']))
|
||||||
EvoLog::log("Delete $uid failed (user always in aliases).");
|
EvoLog::log("Delete $uid failed (user always in aliases).");
|
||||||
// LDAP deletion
|
// LDAP deletion
|
||||||
} elseif (Ldap::lda_del($ldapconn,"uid=" .$uid. "," .$rdn)) {
|
} elseif (Ldap::lda_del($ldapconn,"uid=" .$uid. "," .$rdn)) {
|
||||||
|
|
||||||
if (!$conf['domaines']['ldap']['virtual']) {
|
if (!$conf['domaines']['ldap']['virtual']) {
|
||||||
// script suppression systeme
|
// script suppression systeme
|
||||||
unix_del($uid);
|
unix_del($uid);
|
||||||
|
@ -473,7 +473,7 @@ if (isset($_SESSION['login']))
|
||||||
// $query = 'delete from horde_prefs where pref_uid="' .$uid. '"';
|
// $query = 'delete from horde_prefs where pref_uid="' .$uid. '"';
|
||||||
|
|
||||||
print "<p class='strong'>Suppression $uid effectuée.</p>";
|
print "<p class='strong'>Suppression $uid effectuée.</p>";
|
||||||
|
|
||||||
EvoLog::log("Del user ".$uid);
|
EvoLog::log("Del user ".$uid);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -482,13 +482,13 @@ if (isset($_SESSION['login']))
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</center>";
|
print "</center>";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
print "<center>";
|
print "<center>";
|
||||||
print "<p>Vous allez effacer complètement l'utilisateur <b>$uid</b><br />";
|
print "<p>Vous allez effacer complètement l'utilisateur <b>$uid</b><br />";
|
||||||
print "Tous ses messages et paramètres seront définitivement perdus.</p>";
|
print "Tous ses messages et paramètres seront définitivement perdus.</p>";
|
||||||
print "<a href='compte.php?del=$uid&modif=yes'>Confirmer la suppression</a>";
|
print "<a href='compte.php?del=$uid&modif=yes'>Confirmer la suppression</a>";
|
||||||
print "</center>";
|
print "</center>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ajouter un compte
|
// Ajouter un compte
|
||||||
|
@ -503,7 +503,7 @@ if (isset($_SESSION['login']))
|
||||||
*/
|
*/
|
||||||
if ( (isset($_GET['modif'])) && ($_GET['modif'] == 'yes')) {
|
if ( (isset($_GET['modif'])) && ($_GET['modif'] == 'yes')) {
|
||||||
|
|
||||||
// Verification coherence des mots de passe
|
// Verification coherence des mots de passe
|
||||||
if ( $_POST['pass1'] != $_POST['pass2'] ) {
|
if ( $_POST['pass1'] != $_POST['pass2'] ) {
|
||||||
print "<p class='error>Erreur, vous avez tape deux mots de passe differents</p>";
|
print "<p class='error>Erreur, vous avez tape deux mots de passe differents</p>";
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -518,7 +518,7 @@ if (isset($_SESSION['login']))
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cn = Html::justclean(Html::purgeaccents(utf8_decode($_POST['cn'])));
|
$cn = Html::justclean(Html::purgeaccents(utf8_decode($_POST['cn'])));
|
||||||
|
|
||||||
if (badname($postuid)) {
|
if (badname($postuid)) {
|
||||||
print "<p class='error>Erreur, <u>$postuid</u> est invalide.";
|
print "<p class='error>Erreur, <u>$postuid</u> est invalide.";
|
||||||
|
@ -527,7 +527,7 @@ if (isset($_SESSION['login']))
|
||||||
EvoLog::log("Add $postuid failed (bad name).");
|
EvoLog::log("Add $postuid failed (bad name).");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compatibilite anciens schemas LDAP
|
// Compatibilite anciens schemas LDAP
|
||||||
//if (!$conf['evoadmin']['version'] == 1) {
|
//if (!$conf['evoadmin']['version'] == 1) {
|
||||||
// mail and cn are auto-generated...
|
// mail and cn are auto-generated...
|
||||||
|
@ -563,7 +563,7 @@ if (isset($_SESSION['login']))
|
||||||
|
|
||||||
// Cas d'un compte Samba
|
// Cas d'un compte Samba
|
||||||
if (($conf['admin']['what'] == 2) || ($conf['admin']['what'] == 3)) {
|
if (($conf['admin']['what'] == 2) || ($conf['admin']['what'] == 3)) {
|
||||||
|
|
||||||
$smbgroup = Html::clean($_POST['smbgroup']);
|
$smbgroup = Html::clean($_POST['smbgroup']);
|
||||||
$tmp = getsambagroups('unix');
|
$tmp = getsambagroups('unix');
|
||||||
$gid = $tmp[$smbgroup];
|
$gid = $tmp[$smbgroup];
|
||||||
|
@ -579,7 +579,7 @@ if (isset($_SESSION['login']))
|
||||||
|
|
||||||
print "<center>";
|
print "<center>";
|
||||||
print "Ajout en cours...";
|
print "Ajout en cours...";
|
||||||
|
|
||||||
// TODO : generer un UID different en LDAP non-virtual !!!
|
// TODO : generer un UID different en LDAP non-virtual !!!
|
||||||
$info["uid"]=$uid;
|
$info["uid"]=$uid;
|
||||||
// recuperer un uid number valide
|
// recuperer un uid number valide
|
||||||
|
@ -592,7 +592,7 @@ if (isset($_SESSION['login']))
|
||||||
}
|
}
|
||||||
$info["gidNumber"]= $gid;
|
$info["gidNumber"]= $gid;
|
||||||
$info["objectclass"][0] = "posixAccount";
|
$info["objectclass"][0] = "posixAccount";
|
||||||
|
|
||||||
if (!$conf['domaines']['ldap']['virtual']) {
|
if (!$conf['domaines']['ldap']['virtual']) {
|
||||||
$info["objectclass"][1] = "shadowAccount";
|
$info["objectclass"][1] = "shadowAccount";
|
||||||
$info["objectclass"][2] = "inetorgperson";
|
$info["objectclass"][2] = "inetorgperson";
|
||||||
|
@ -628,7 +628,7 @@ if (isset($_SESSION['login']))
|
||||||
$info["loginShell"] = Html::clean($_POST['loginshell']);
|
$info["loginShell"] = Html::clean($_POST['loginshell']);
|
||||||
$info["sn"] = $sn;
|
$info["sn"] = $sn;
|
||||||
$info["homeDirectory"] = "/home/" .$uid;
|
$info["homeDirectory"] = "/home/" .$uid;
|
||||||
|
|
||||||
// TODO: rajouter un isset pour verifier la presence de ce champ optionnel
|
// TODO: rajouter un isset pour verifier la presence de ce champ optionnel
|
||||||
if ( $mail != '') {
|
if ( $mail != '') {
|
||||||
$info["mail"] = $mail;
|
$info["mail"] = $mail;
|
||||||
|
@ -640,7 +640,7 @@ if (isset($_SESSION['login']))
|
||||||
// Cas d'un compte mail
|
// Cas d'un compte mail
|
||||||
if (($conf['admin']['what'] == 1) || ($conf['admin']['what'] == 3)) {
|
if (($conf['admin']['what'] == 1) || ($conf['admin']['what'] == 3)) {
|
||||||
|
|
||||||
// Aliases
|
// Aliases
|
||||||
$aliases = $_POST['alias'];
|
$aliases = $_POST['alias'];
|
||||||
|
|
||||||
// Compatibilite anciens schemas LDAP et mode "virtuel"
|
// Compatibilite anciens schemas LDAP et mode "virtuel"
|
||||||
|
@ -732,7 +732,7 @@ if (isset($_SESSION['login']))
|
||||||
EvoLog::log("Add user ".$uid);
|
EvoLog::log("Add user ".$uid);
|
||||||
|
|
||||||
// notification par mail
|
// notification par mail
|
||||||
mailnotify($info,$_SESSION['domain'],$_POST['pass1']);
|
mailnotify($info,$_SESSION['domain'],$_POST['pass1']);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
print "<p class='error'>Erreur, envoyez le message d'erreur
|
print "<p class='error'>Erreur, envoyez le message d'erreur
|
||||||
|
@ -746,13 +746,13 @@ if (isset($_SESSION['login']))
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<center>
|
<center>
|
||||||
|
|
||||||
<h4>Ajout d'un compte</h4>
|
<h4>Ajout d'un compte</h4>
|
||||||
|
|
||||||
<form name="add"
|
<form name="add"
|
||||||
action="compte.php?modif=yes"
|
action="compte.php?modif=yes"
|
||||||
method="post">
|
method="post">
|
||||||
|
|
||||||
<p class="italic">Remplissez lez champs, ceux contenant [*] sont obligatoires.</p>
|
<p class="italic">Remplissez lez champs, ceux contenant [*] sont obligatoires.</p>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
@ -787,7 +787,7 @@ if (isset($_SESSION['login']))
|
||||||
|
|
||||||
<tr><td align="right">Confirmation du mot de passe [*] :</td>
|
<tr><td align="right">Confirmation du mot de passe [*] :</td>
|
||||||
<td align="left"><input type="password" name="pass2" tabindex='5' /></td></tr>
|
<td align="left"><input type="password" name="pass2" tabindex='5' /></td></tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// Compatibilite anciens schemas LDAP
|
// Compatibilite anciens schemas LDAP
|
||||||
if (!$conf['evoadmin']['version'] == 1) {
|
if (!$conf['evoadmin']['version'] == 1) {
|
||||||
|
@ -812,7 +812,7 @@ if (isset($_SESSION['login']))
|
||||||
<tr><td align="right">Groupe Samba :</td>
|
<tr><td align="right">Groupe Samba :</td>
|
||||||
<td align="left"><select name="smbgroup">
|
<td align="left"><select name="smbgroup">
|
||||||
<option value="" disabled selected>Choisir un groupe</option>
|
<option value="" disabled selected>Choisir un groupe</option>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
foreach (getsambagroups('smb') as $key=>$value) {
|
foreach (getsambagroups('smb') as $key=>$value) {
|
||||||
print "<option value='" . $key . "'> $key </option>\n";
|
print "<option value='" . $key . "'> $key </option>\n";
|
||||||
|
@ -820,14 +820,14 @@ if (isset($_SESSION['login']))
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">Shell :</td>
|
<td align="right">Shell :</td>
|
||||||
<td align="left">
|
<td align="left">
|
||||||
<input type="text" name="loginshell" value="/bin/bash" />
|
<input type="text" name="loginshell" value="/bin/bash" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -856,7 +856,7 @@ if (isset($_SESSION['login']))
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
<tr><td align="right">Alias :</td>
|
<tr><td align="right">Alias :</td>
|
||||||
<td align="left"><input type='text' name='alias[2]' tabindex='9' />
|
<td align="left"><input type='text' name='alias[2]' tabindex='9' />
|
||||||
<?php
|
<?php
|
||||||
|
@ -875,11 +875,11 @@ if (isset($_SESSION['login']))
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
<tr><td align="right">Activation globale :</td>
|
<tr><td align="right">Activation globale :</td>
|
||||||
<td align="left"><input type='checkbox' tabindex='11'
|
<td align="left"><input type='checkbox' tabindex='11'
|
||||||
name='isactive' checked /></td></tr>
|
name='isactive' checked /></td></tr>
|
||||||
|
|
||||||
<tr><td align="right">Compte admin :</td>
|
<tr><td align="right">Compte admin :</td>
|
||||||
<td align="left"><input type='checkbox' tabindex='14'
|
<td align="left"><input type='checkbox' tabindex='14'
|
||||||
name='isadmin' /></td></tr>
|
name='isadmin' /></td></tr>
|
||||||
|
|
||||||
<?php // only for samba mode
|
<?php // only for samba mode
|
||||||
|
@ -887,29 +887,29 @@ if (isset($_SESSION['login']))
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr><td align="right">Compte Samba actif :</td>
|
<tr><td align="right">Compte Samba actif :</td>
|
||||||
<td align="left"><input type='checkbox' tabindex='13'
|
<td align="left"><input type='checkbox' tabindex='13'
|
||||||
name='smbactive' checked /></td></tr>
|
name='smbactive' checked /></td></tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
// only for mail mode
|
// only for mail mode
|
||||||
if (($conf['admin']['what'] == 1) || ($conf['admin']['what'] == 3)) {
|
if (($conf['admin']['what'] == 1) || ($conf['admin']['what'] == 3)) {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr><td align="right">Compte mail actif :</td>
|
<tr><td align="right">Compte mail actif :</td>
|
||||||
<td align="left"><input type='checkbox' tabindex='12'
|
<td align="left"><input type='checkbox' tabindex='12'
|
||||||
name='accountactive' checked /></td></tr>
|
name='accountactive' checked /></td></tr>
|
||||||
|
|
||||||
<tr><td align="right">Utilisation POP/IMAP :</td>
|
<tr><td align="right">Utilisation POP/IMAP :</td>
|
||||||
<td align="left"><input type='checkbox' tabindex='15'
|
<td align="left"><input type='checkbox' tabindex='15'
|
||||||
name='courieractive' checked /></td></tr>
|
name='courieractive' checked /></td></tr>
|
||||||
|
|
||||||
<tr><td align="right">Webmail actif :</td>
|
<tr><td align="right">Webmail actif :</td>
|
||||||
<td align="left"><input type='checkbox' tabindex='16'
|
<td align="left"><input type='checkbox' tabindex='16'
|
||||||
name='webmailactive' checked /></td></tr>
|
name='webmailactive' checked /></td></tr>
|
||||||
|
|
||||||
<tr><td align="right">Authentification SMTP :</td>
|
<tr><td align="right">Authentification SMTP :</td>
|
||||||
<td align="left"><input type='checkbox' tabindex='17'
|
<td align="left"><input type='checkbox' tabindex='17'
|
||||||
name='authsmtpactive' <?php if ($conf['evoadmin']['useauthsmtp']) print "checked" ?> /></td></tr>
|
name='authsmtpactive' <?php if ($conf['evoadmin']['useauthsmtp']) print "checked" ?> /></td></tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
@ -917,7 +917,7 @@ if (isset($_SESSION['login']))
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr><td> </td><td align="left">
|
<tr><td> </td><td align="left">
|
||||||
<p><input type="submit" class="button" tabindex='18'
|
<p><input type="submit" class="button" tabindex='18'
|
||||||
value="Valider" name="valider" onclick='return submit_add();' /></p>
|
value="Valider" name="valider" onclick='return submit_add();' /></p>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
|
@ -930,7 +930,7 @@ if (isset($_SESSION['login']))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} //if (isset($_SESSION['login']))
|
} //if (isset($_SESSION['login']))
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
header("location: auth.php\n\n");
|
header("location: auth.php\n\n");
|
||||||
|
|
|
@ -9,7 +9,7 @@ function display($msg)
|
||||||
function superadmin($login) {
|
function superadmin($login) {
|
||||||
|
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
foreach ($conf['admin']['logins'] as $admin) {
|
foreach ($conf['admin']['logins'] as $admin) {
|
||||||
if ( Html::clean($login) == $admin ) {
|
if ( Html::clean($login) == $admin ) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -160,11 +160,11 @@ function getnumber($domain,$type) {
|
||||||
// compatibilite anciens schemas
|
// compatibilite anciens schemas
|
||||||
if ($conf['evoadmin']['version'] == 1) {
|
if ($conf['evoadmin']['version'] == 1) {
|
||||||
$filter="(&(objectClass=mailAlias)(onlyAlias=TRUE))";
|
$filter="(&(objectClass=mailAlias)(onlyAlias=TRUE))";
|
||||||
}
|
}
|
||||||
|
|
||||||
} elseif ( $type == 'smb' ) {
|
} elseif ( $type == 'smb' ) {
|
||||||
$filter="(objectClass=sambaSamAccount)";
|
$filter="(objectClass=sambaSamAccount)";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $conf['domaines']['onlyone']) {
|
if (! $conf['domaines']['onlyone']) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue