Commit 070b0cf8 authored by Dustri's avatar Dustri

Harmonisation de la longueur des mots de passe generés

parent 2fd8938f
......@@ -265,8 +265,8 @@ function inscription($message)
else
{
$password = genere_pass(16);
$password = crypt($password, uniqid('$2y$07$', true));
$user->create_user($nom, $prenom, $email, $password, false, $naissance, $sexe, $utbm);
$hashed_password = crypt($password, uniqid('$2y$07$', true));
$user->create_user($nom, $prenom, $email, $hashed_password, false, $naissance, $sexe, $utbm);
$user->load_by_email($email);
$return = $user->id;
}
......
......@@ -551,7 +551,7 @@ class utilisateur extends stdentity
array("id_utilisateur" => $this->id));
}
}
$this->hash = genere_pass(20);
$this->hash = crypt(genere_pass(20), uniqid('$2y$07$', true));
$this->tovalid = $reason;
$req = new update($this->dbrw,
"utilisateurs",
......
......@@ -151,7 +151,7 @@ function GenerateSelectList($values, $current, $name, $size=1)
*
* @return La chaîne aléatoire
*/
function genere_pass ($nameLength=12)
function genere_pass ($nameLength=16)
{
$NameChars = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKMNLOP';
$Vouel = 'aeiouAEIOU';
......
......@@ -37,12 +37,12 @@ if ( isset($_REQUEST["email"]) )
if ( $user->is_valid() )
{
$pass = genere_pass(10);
$pass = genere_pass(12);
$user->invalidate();
$user->change_password($pass);
$user->send_autopassword_email($_REQUEST["email"],$pass);
$user->send_autopassword_email($_REQUEST["email"], $pass);
/*
$body = "Bonjour,
Votre mot de passe sur le site de l'Association des Étudiants de
......
......@@ -231,8 +231,8 @@ if(isset($_POST["action"]) && $_POST["action"]=="merge")
}
}
$pass = genere_pass(10);
$user->send_autopassword_email($_REQUEST["email"],$pass);
$pass = genere_pass(16);
$user->send_autopassword_email($_REQUEST["email"], $pass);
$user->invalidate();
$user->change_password($pass);
}
......
......@@ -92,7 +92,7 @@ if ( $_REQUEST['action'] == "reinit" && $site->user->is_in_group("gestion_ae") )
$email = $user->email_utbm;
else
$email = $user->email;
$pass = genere_pass(10);
$pass = genere_pass(12);
$user->invalidate();
$user->change_password($pass);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment