|
1
|
|
|
<?php |
|
2
|
|
|
namespace core\admin\inscription; |
|
3
|
|
|
use core\App; |
|
4
|
|
|
use core\auth\Encrypt; |
|
5
|
|
|
use core\auth\Inscription; |
|
6
|
|
|
|
|
7
|
|
|
class AdminInscription extends Inscription { |
|
8
|
|
|
protected $acces_administration; |
|
9
|
|
|
protected $id_liste_droit_acces; |
|
10
|
|
|
|
|
11
|
|
|
|
|
12
|
|
|
//-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
13
|
|
|
//-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
14
|
|
|
|
|
15
|
|
|
|
|
16
|
|
|
//-------------------------- GETTER ----------------------------------------------------------------------------// |
|
17
|
|
|
public function getAccesAdministration() { |
|
18
|
|
|
return $this->acces_administration; |
|
19
|
|
|
} |
|
20
|
|
|
public function getidListeDroitAcces() { |
|
21
|
|
|
return $this->id_liste_droit_acces; |
|
22
|
|
|
} |
|
23
|
|
|
//-------------------------- FIN GETTER ----------------------------------------------------------------------------// |
|
24
|
|
|
|
|
25
|
|
|
|
|
26
|
|
|
//-------------------------- SETTER ----------------------------------------------------------------------------// |
|
27
|
|
|
/** |
|
28
|
|
|
* vient de la partie admin n du site pages gestion-comptes/creer-utilisateur |
|
29
|
|
|
* @param $value |
|
30
|
|
|
* @param null $required |
|
|
|
|
|
|
31
|
|
|
* @return bool |
|
32
|
|
|
*/ |
|
33
|
|
View Code Duplication |
protected function setVerifAccesAdministration($value) { |
|
|
|
|
|
|
34
|
|
|
//on verifie que la valeur est bien un int |
|
35
|
|
|
//test avec le required, si le champe est vide et que le required est != null on return fa lse sinon on va tester |
|
36
|
|
|
if ($this->getTestInt($value) === true) { |
|
37
|
|
|
$this->acces_administration = $value; |
|
38
|
|
|
return true; |
|
39
|
|
|
} |
|
40
|
|
|
else if ($this->getTestInt($value) === false) { |
|
41
|
|
|
$this->erreur .= "<li>Le champs accès administration n'est pas au bon format</li>"; |
|
42
|
|
|
return false; |
|
43
|
|
|
} |
|
44
|
|
|
else { |
|
45
|
|
|
return true; |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* vient de la partie admin du site pages gestion-comptes/creer-utilisateur |
|
52
|
|
|
* @param $value |
|
53
|
|
|
* @param null $required |
|
|
|
|
|
|
54
|
|
|
* @return bool |
|
55
|
|
|
*/ |
|
56
|
|
View Code Duplication |
protected function setVerifListeDroitAcces($value) { |
|
|
|
|
|
|
57
|
|
|
//on verifie que la valeur est bien un int |
|
58
|
|
|
//test avec le required, si le champe est vide et que le required est != null on return fa lse sinon on va tester |
|
59
|
|
|
if ($this->getTestInt($value) === true) { |
|
60
|
|
|
$this->id_liste_droit_acces = $value; |
|
61
|
|
|
return true; |
|
62
|
|
|
} |
|
63
|
|
|
else if ($this->getTestInt($value) === false) { |
|
64
|
|
|
$this->erreur .= "<li>Le champs accès administration n'est pas au bon format</li>"; |
|
65
|
|
|
return false; |
|
66
|
|
|
} |
|
67
|
|
|
else { |
|
68
|
|
|
return true; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* si tous les test concernant le formulaire sont passés on inscrit le user |
|
75
|
|
|
*/ |
|
76
|
|
|
public function setInscrireUtilisateur() { |
|
77
|
|
|
$dbc = App::getDb(); |
|
78
|
|
|
|
|
79
|
|
|
$value = array( |
|
80
|
|
|
"pseudo" => $this->pseudo, |
|
81
|
|
|
"nom" => $this->nom, |
|
82
|
|
|
"prenom" => $this->prenom, |
|
83
|
|
|
"mail" => $this->mail, |
|
84
|
|
|
"mdp" => Encrypt::setEncryptMdp($this->mdp), |
|
85
|
|
|
"mdp_params" => Encrypt::getParams(), |
|
86
|
|
|
"last_change_mdp" => date("Y-m-d"), |
|
87
|
|
|
"img_profil" => "profil/defaut.png", |
|
88
|
|
|
"img_profil_blog" => "profil/defaut_blog.png", |
|
89
|
|
|
"valide" => 1, |
|
90
|
|
|
"acces_admin" => $this->acces_administration, |
|
91
|
|
|
"liste_droit" => $this->id_liste_droit_acces |
|
92
|
|
|
); |
|
93
|
|
|
|
|
94
|
|
|
|
|
95
|
|
|
$dbc->prepare("INSERT INTO identite (pseudo, nom, prenom, mail, mdp, mdp_params, last_change_mdp, img_profil, img_profil_blog, valide, acces_admin, liste_droit) VALUES (:pseudo, :nom, :prenom, :mail, :mdp, :mdp_params, :last_change_mdp, :img_profil, :img_profil_blog, :valide, :acces_admin, :liste_droit)", $value); |
|
96
|
|
|
} |
|
97
|
|
|
//-------------------------- FIN SETTER ----------------------------------------------------------------------------// |
|
98
|
|
|
} |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.