Permettre les mots de passe vide pour les comptes FTP
* closed #1284 * CRYPT de mysql ne gere pas la chaine vide, on passe par la fonction PHP * microtime car autrement il utilse le sel le plus fort et ne gere pas pas un pass DESS et donc un crypt de 34 caractères * strrev car seul les 2 premiers caractéres du sel sont pris en compte , donc pour choper les microseconde
This commit is contained in:
parent
33c89722da
commit
ca6311c3d3
|
@ -204,8 +204,8 @@ class m_ftp {
|
||||||
return false; // The error has been raised by checkPolicy()
|
return false; // The error has been raised by checkPolicy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$encrypted_password = crypt($pass,strrev(microtime(true)));
|
||||||
$db->query("UPDATE ftpusers SET name='".$prefixe.$login."', password='', encrypted_password=ENCRYPT('$pass'), homedir='/var/alternc/html/$l/$lo/$dir', uid='$cuid' WHERE id='$id';");
|
$db->query("UPDATE ftpusers SET name='".$prefixe.$login."', password='', encrypted_password='$encrypted_password', homedir='/var/alternc/html/$l/$lo/$dir', uid='$cuid' WHERE id='$id';");
|
||||||
} else {
|
} else {
|
||||||
$db->query("UPDATE ftpusers SET name='".$prefixe.$login."', homedir='/var/alternc/html/$l/$lo/$dir', uid='$cuid' WHERE id='$id';");
|
$db->query("UPDATE ftpusers SET name='".$prefixe.$login."', homedir='/var/alternc/html/$l/$lo/$dir', uid='$cuid' WHERE id='$id';");
|
||||||
}
|
}
|
||||||
|
@ -281,7 +281,8 @@ class m_ftp {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($quota->cancreate("ftp")) {
|
if ($quota->cancreate("ftp")) {
|
||||||
$db->query("INSERT INTO ftpusers (name,password, encrypted_password,homedir,uid) VALUES ('".$prefixe.$login."', '', ENCRYPT('$pass'), '/var/alternc/html/$l/$lo/$dir', '$cuid')");
|
$encrypted_password = crypt($pass,strrev(microtime(true)));
|
||||||
|
$db->query("INSERT INTO ftpusers (name,password, encrypted_password,homedir,uid) VALUES ('".$prefixe.$login."', '', '$encrypted_password', '/var/alternc/html/$l/$lo/$dir', '$cuid')");
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$err->raise("ftp",5);
|
$err->raise("ftp",5);
|
||||||
|
|
Loading…
Reference in New Issue