|
|
@ -23,48 +23,48 @@
|
|
|
|
return $dataVueEreur;
|
|
|
|
return $dataVueEreur;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static function val_inscription($username,$pwd1,$pwd2,$dataVueEreur){
|
|
|
|
static function val_inscription($dataVueEreur){
|
|
|
|
if (!isset($username)||$username==="") {
|
|
|
|
if (!isset($_POST['username'])||$_POST['username']==="") {
|
|
|
|
$dataVueEreur[] ="Nom d'utilisateur manquant";
|
|
|
|
$dataVueEreur[] ="Nom d'utilisateur manquant";
|
|
|
|
throw new Exception('pas de username');
|
|
|
|
throw new Exception('pas de username');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$username = Validation::clear_string($username);
|
|
|
|
$_POST['username'] = Validation::clear_string($_POST['username']);
|
|
|
|
if($username == false){
|
|
|
|
if($_POST['username'] == false){
|
|
|
|
$dataVueEreur[] = "Sanitizing error";
|
|
|
|
$dataVueEreur[] = "Sanitizing error";
|
|
|
|
throw new Exception('sanitizing fail');
|
|
|
|
throw new Exception('sanitizing fail');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!isset($pwd1)||$pwd1==="") {
|
|
|
|
if (!isset($_POST['username'])||$_POST['username']==="") {
|
|
|
|
$dataVueEreur[] ="Mot de passe manquant";
|
|
|
|
$dataVueEreur[] ="Mot de passe manquant";
|
|
|
|
throw new Exception('pas de password');
|
|
|
|
throw new Exception('pas de password');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$pwd1 = Validation::clear_string($pwd1);
|
|
|
|
$_POST['password'] = Validation::clear_string($_POST['password']);
|
|
|
|
if($pwd1 == false){
|
|
|
|
if($_POST['password'] == false){
|
|
|
|
$dataVueEreur[] = "Sanitizing error";
|
|
|
|
$dataVueEreur[] = "Sanitizing error";
|
|
|
|
throw new Exception('sanitizing fail');
|
|
|
|
throw new Exception('sanitizing fail');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!isset($pwd2)||$pwd2==="") {
|
|
|
|
if (!isset($_POST['confirmpassword'])||$_POST['confirmpassword']==="") {
|
|
|
|
$dataVueEreur[] ="Confirmation mot de passe manquant";
|
|
|
|
$dataVueEreur[] ="Confirmation mot de passe manquant";
|
|
|
|
throw new Exception('pas de confirmation password');
|
|
|
|
throw new Exception('pas de confirmation password');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$pwd2 = Validation::clear_string($pwd2);
|
|
|
|
$_POST['confirmpassword'] = Validation::clear_string($_POST['confirmpassword']);
|
|
|
|
if($pwd2 == false){
|
|
|
|
if($_POST['confirmpassword'] == false){
|
|
|
|
$dataVueEreur[] = "Sanitizing error";
|
|
|
|
$dataVueEreur[] = "Sanitizing error";
|
|
|
|
throw new Exception('sanitizing fail');
|
|
|
|
throw new Exception('sanitizing fail');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($pwd1 !== $pwd2){
|
|
|
|
if($_POST['password'] !== $_POST['confirmpassword']){
|
|
|
|
$dataVueEreur[]="Mot de passe et confirmation différents";
|
|
|
|
$dataVueEreur[]="Mot de passe et confirmation différents";
|
|
|
|
throw new Exception("Mot de passe et confirmation différents");
|
|
|
|
throw new Exception("Mot de passe et confirmation différents");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $dataVueEreur;
|
|
|
|
return $dataVueEreur;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static function val_intitule($intitule, $dataVueEreur){
|
|
|
|
static function val_intitule($dataVueEreur){
|
|
|
|
if (!isset($intitule)||$intitule==="") {
|
|
|
|
if (!isset($_POST['name'])||$_POST['name']==="") {
|
|
|
|
$dataVueEreur[] ="Intitulé manquant";
|
|
|
|
$dataVueEreur[] ="Intitulé manquant";
|
|
|
|
throw new Exception('pas d\'intitule');
|
|
|
|
throw new Exception('pas d\'intitule');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$intitule = Validation::clear_string($intitule);
|
|
|
|
$_POST['name'] = Validation::clear_string($_POST['name']);
|
|
|
|
if($intitule == false){
|
|
|
|
if($_POST['name'] == false){
|
|
|
|
$dataVueEreur[] = "Sanitizing error";
|
|
|
|
$dataVueEreur[] = "Sanitizing error";
|
|
|
|
throw new Exception('sanitizing fail');
|
|
|
|
throw new Exception('sanitizing fail');
|
|
|
|
}
|
|
|
|
}
|
|
|
|