on autorise un mail invalide pour la creation d'un membre avec force=1, permet de mettre le panel sur un domaine non qualifie. Closes #591
This commit is contained in:
parent
22935e9b68
commit
2da495aa25
|
@ -305,20 +305,26 @@ class m_admin {
|
|||
* @return boolean Retourne FALSE si une erreur s'est produite, TRUE sinon.
|
||||
*
|
||||
*/
|
||||
function add_mem($login, $pass, $nom, $prenom, $mail, $canpass=1, $type='default', $duration=0, $notes = "") {
|
||||
function add_mem($login, $pass, $nom, $prenom, $mail, $canpass=1, $type='default', $duration=0, $notes = "", $force=0) {
|
||||
global $err,$quota,$classes,$cuid,$mem,$L_MYSQL_DATABASE,$L_MYSQL_LOGIN;
|
||||
$err->log("admin","add_mem",$login."/".$mail);
|
||||
if (!$this->enabled) {
|
||||
$err->raise("admin",1);
|
||||
return false;
|
||||
}
|
||||
if (($login=="")||($pass=="")||($mail=="")){
|
||||
if (($login=="")||($pass=="")) {
|
||||
$err->raise("admin",6);
|
||||
return false;
|
||||
}
|
||||
if (checkmail($mail)!=0){
|
||||
$err->raise("admin",5);
|
||||
return false;
|
||||
if (!$force) {
|
||||
if ($mail=="") {
|
||||
$err->raise("admin",6);
|
||||
return false;
|
||||
}
|
||||
if (checkmail($mail)!=0){
|
||||
$err->raise("admin",5);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Vérification de la conformité du login
|
||||
$login=strtolower($login);
|
||||
|
|
|
@ -44,7 +44,7 @@ require("/var/alternc/bureau/class/config_nochk.php");
|
|||
$admin->enabled=1;
|
||||
|
||||
// On crée le compte admin :
|
||||
if (!$admin->add_mem("admin","admin","Administrateur", "Admin", "postmaster@".$L_FQDN)) {
|
||||
if (!$admin->add_mem("admin","admin","Administrateur", "Admin", "postmaster@".$L_FQDN,1,'default',0,'',1)) {
|
||||
echo $err->errstr()."\n";
|
||||
exit(1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue