@@ -24,30 +24,30 @@ discard block |
||
24 | 24 | public function signInAction() { |
25 | 25 | $bootstrap = $this->jquery->bootstrap(); |
26 | 26 | |
27 | - if(!empty($_POST['identite']) && !empty($_POST['password'])) { |
|
27 | + if (!empty($_POST['identite']) && !empty($_POST['password'])) { |
|
28 | 28 | |
29 | 29 | $userPseudo = User::findFirst("identite = '".$_POST['identite']."'"); |
30 | 30 | |
31 | 31 | $userMail = User::findFirst("mail = '".$_POST['identite']."'"); |
32 | 32 | |
33 | - if($userPseudo != NULL && password_verify($_POST['password'], $userPseudo->getPassword())) { |
|
33 | + if ($userPseudo != NULL && password_verify($_POST['password'], $userPseudo->getPassword())) { |
|
34 | 34 | $this->session->set("user", $userPseudo); |
35 | 35 | $this->response->redirect("Index/index"); |
36 | 36 | $this->loadAclAction($userPseudo->getIdTypeUser()); |
37 | - } else if($userMail != NULL && password_verify($_POST['password'], $userMail->getPassword())) { |
|
37 | + } else if ($userMail != NULL && password_verify($_POST['password'], $userMail->getPassword())) { |
|
38 | 38 | $this->session->set("user", $userMail); |
39 | 39 | $this->response->redirect("Index/index"); |
40 | 40 | $this->loadAclAction($userMail->getIdTypeUser()); |
41 | 41 | } else { |
42 | - echo $bootstrap->htmlAlert("alert1","L'identifiant ou le mot de passe est incorrecte."); |
|
42 | + echo $bootstrap->htmlAlert("alert1", "L'identifiant ou le mot de passe est incorrecte."); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | } |
46 | 46 | |
47 | 47 | public function rulesAction() { |
48 | - $accordion=$this->jquery->bootstrap()->htmlAccordion("accordion1"); |
|
49 | - $accordion->addPanel("Panel 1","Contenu du panel 1"); |
|
50 | - $accordion->addPanel("Panel 2","Contenu du panel 2"); |
|
48 | + $accordion = $this->jquery->bootstrap()->htmlAccordion("accordion1"); |
|
49 | + $accordion->addPanel("Panel 1", "Contenu du panel 1"); |
|
50 | + $accordion->addPanel("Panel 2", "Contenu du panel 2"); |
|
51 | 51 | echo $accordion; |
52 | 52 | } |
53 | 53 | |
@@ -74,12 +74,12 @@ discard block |
||
74 | 74 | |
75 | 75 | $this->jquery->compile($this->view); |
76 | 76 | |
77 | - }else { |
|
77 | + } else { |
|
78 | 78 | $this->view->pick("main/error"); |
79 | 79 | } |
80 | 80 | } |
81 | 81 | |
82 | - public function passwordAction(){ |
|
82 | + public function passwordAction() { |
|
83 | 83 | $password = password_hash("password", PASSWORD_DEFAULT); |
84 | 84 | echo $password; |
85 | 85 | } |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | if ($this->verifyAccessAction($this->controller, "write")) { |
90 | 90 | $typeUser = TypeUser::find(); |
91 | 91 | $this->view->setVar("typeUser", $typeUser); |
92 | - }else { |
|
92 | + } else { |
|
93 | 93 | $this->view->pick("main/error"); |
94 | 94 | } |
95 | 95 | |
96 | 96 | } |
97 | 97 | |
98 | - public function updateAction(){ |
|
98 | + public function updateAction() { |
|
99 | 99 | if ($this->verifyAccessAction($this->controller, "write")) { |
100 | 100 | if ($this->request->isPost()) { |
101 | 101 | $user = new User(); |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | $user->setPassword(password_hash($this->request->getPost("password", "string"), PASSWORD_DEFAULT)); |
104 | 104 | try { |
105 | 105 | $user->save(); |
106 | - echo "Instance de " . $this->model . " ajoutée"; |
|
106 | + echo "Instance de ".$this->model." ajoutée"; |
|
107 | 107 | } catch (\Exception $e) { |
108 | - echo "Impossible d'ajouter l'instance de " . $this->model, "danger : $e"; |
|
108 | + echo "Impossible d'ajouter l'instance de ".$this->model, "danger : $e"; |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $this->jquery->compile($this->view); |
76 | 76 | |
77 | - }else { |
|
77 | + } else { |
|
78 | 78 | $this->view->pick("main/error"); |
79 | 79 | } |
80 | 80 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | if ($this->verifyAccessAction($this->controller, "write")) { |
90 | 90 | $typeUser = TypeUser::find(); |
91 | 91 | $this->view->setVar("typeUser", $typeUser); |
92 | - }else { |
|
92 | + } else { |
|
93 | 93 | $this->view->pick("main/error"); |
94 | 94 | } |
95 | 95 |