@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | { |
22 | 22 | // *** Class variables |
23 | 23 | private $image; |
24 | - private $width; |
|
25 | - private $height; |
|
24 | + private $width; |
|
25 | + private $height; |
|
26 | 26 | private $imageResized; |
27 | 27 | |
28 | 28 | function __construct($fileName) |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | // *** Open up the file |
31 | 31 | $this->image = $this->openImage($fileName); |
32 | 32 | |
33 | - // *** Get width and height |
|
34 | - $this->width = imagesx($this->image); |
|
35 | - $this->height = imagesy($this->image); |
|
33 | + // *** Get width and height |
|
34 | + $this->width = imagesx($this->image); |
|
35 | + $this->height = imagesy($this->image); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | ## -------------------------------------------------------- |
@@ -206,8 +206,8 @@ discard block |
||
206 | 206 | public function saveImage($savePath, $imageQuality="100") |
207 | 207 | { |
208 | 208 | // *** Get extension |
209 | - $extension = strrchr($savePath, '.'); |
|
210 | - $extension = strtolower($extension); |
|
209 | + $extension = strrchr($savePath, '.'); |
|
210 | + $extension = strtolower($extension); |
|
211 | 211 | |
212 | 212 | switch($extension) |
213 | 213 | { |
@@ -1,69 +1,69 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | - namespace core\mail; |
|
3 | + namespace core\mail; |
|
4 | 4 | |
5 | - class Mail { |
|
6 | - private $mail; |
|
5 | + class Mail { |
|
6 | + private $mail; |
|
7 | 7 | |
8 | 8 | |
9 | - //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
10 | - public function __construct($mail = null) { |
|
11 | - $this->mail = $mail; |
|
12 | - } |
|
13 | - //-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
9 | + //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
10 | + public function __construct($mail = null) { |
|
11 | + $this->mail = $mail; |
|
12 | + } |
|
13 | + //-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
14 | 14 | |
15 | 15 | |
16 | 16 | |
17 | - //-------------------------- GETTER ----------------------------------------------------------------------------// |
|
18 | - //-------------------------- FIN GETTER ----------------------------------------------------------------------------// |
|
17 | + //-------------------------- GETTER ----------------------------------------------------------------------------// |
|
18 | + //-------------------------- FIN GETTER ----------------------------------------------------------------------------// |
|
19 | 19 | |
20 | 20 | |
21 | 21 | |
22 | - //-------------------------- SETTER ----------------------------------------------------------------------------// |
|
23 | - /** |
|
24 | - * fonction qui permet de valider si un E-mail est valide |
|
25 | - * @return bool |
|
26 | - */ |
|
27 | - public function setVerifierMail() { |
|
28 | - if (filter_var($this->mail, FILTER_VALIDATE_EMAIL)) { |
|
29 | - return true; |
|
30 | - } |
|
31 | - else { |
|
32 | - return false; |
|
33 | - } |
|
34 | - } |
|
22 | + //-------------------------- SETTER ----------------------------------------------------------------------------// |
|
23 | + /** |
|
24 | + * fonction qui permet de valider si un E-mail est valide |
|
25 | + * @return bool |
|
26 | + */ |
|
27 | + public function setVerifierMail() { |
|
28 | + if (filter_var($this->mail, FILTER_VALIDATE_EMAIL)) { |
|
29 | + return true; |
|
30 | + } |
|
31 | + else { |
|
32 | + return false; |
|
33 | + } |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * fonction qui permet d'envoyer un mail |
|
38 | - * @param $sujet |
|
39 | - * @param $message |
|
40 | - * @param null $destinataire -> si null on envoi un mail au gerant du site |
|
41 | - * @param null $destinataire -> si null on emet le gerant du site car mail vient depuis l'admin |
|
42 | - * @return bool |
|
43 | - */ |
|
44 | - public function setEnvoyerMail($sujet, $message, $destinataire = null, $from = null) { |
|
45 | - //on récupere le mail du site |
|
46 | - $config = new \core\Configuration(); |
|
36 | + /** |
|
37 | + * fonction qui permet d'envoyer un mail |
|
38 | + * @param $sujet |
|
39 | + * @param $message |
|
40 | + * @param null $destinataire -> si null on envoi un mail au gerant du site |
|
41 | + * @param null $destinataire -> si null on emet le gerant du site car mail vient depuis l'admin |
|
42 | + * @return bool |
|
43 | + */ |
|
44 | + public function setEnvoyerMail($sujet, $message, $destinataire = null, $from = null) { |
|
45 | + //on récupere le mail du site |
|
46 | + $config = new \core\Configuration(); |
|
47 | 47 | |
48 | - if ($from == null) $from = $config->getMailSite(); |
|
48 | + if ($from == null) $from = $config->getMailSite(); |
|
49 | 49 | |
50 | - $headers = 'Content-type: text/html; charset=utf-8'."\r\n"; |
|
51 | - $headers .= "From: ".$from; |
|
50 | + $headers = 'Content-type: text/html; charset=utf-8'."\r\n"; |
|
51 | + $headers .= "From: ".$from; |
|
52 | 52 | |
53 | - //si pas de destinataire on envoi le mail au gérant du site car c'est un mail envoyé par le site lui même |
|
54 | - if (($destinataire == null) && ($this->mail == null)) { |
|
55 | - $destinataire = $config->getMailSite(); |
|
56 | - } |
|
57 | - else if ($destinataire == null) { |
|
58 | - $destinataire = $this->mail; |
|
59 | - } |
|
53 | + //si pas de destinataire on envoi le mail au gérant du site car c'est un mail envoyé par le site lui même |
|
54 | + if (($destinataire == null) && ($this->mail == null)) { |
|
55 | + $destinataire = $config->getMailSite(); |
|
56 | + } |
|
57 | + else if ($destinataire == null) { |
|
58 | + $destinataire = $this->mail; |
|
59 | + } |
|
60 | 60 | |
61 | - if (mail($destinataire, $sujet, $message, $headers)) { |
|
62 | - return true; |
|
63 | - } |
|
64 | - else { |
|
65 | - return false; |
|
66 | - } |
|
67 | - } |
|
68 | - //-------------------------- FIN SETTER ----------------------------------------------------------------------------// |
|
69 | - } |
|
70 | 61 | \ No newline at end of file |
62 | + if (mail($destinataire, $sujet, $message, $headers)) { |
|
63 | + return true; |
|
64 | + } |
|
65 | + else { |
|
66 | + return false; |
|
67 | + } |
|
68 | + } |
|
69 | + //-------------------------- FIN SETTER ----------------------------------------------------------------------------// |
|
70 | + } |
|
71 | 71 | \ No newline at end of file |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | |
26 | 26 | |
27 | - //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
27 | + //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
28 | 28 | public function __construct($id_liste_droit_acces = null) { |
29 | 29 | $dbc = App::getDb(); |
30 | 30 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | return $this->pseudo; |
109 | 109 | } |
110 | 110 | public function getNbUser() { |
111 | - return $this->nb_user; |
|
111 | + return $this->nb_user; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @param $id_liste_droit_acces |
117 | 117 | */ |
118 | 118 | public function getListeDroitAccesDetailDroit($id_liste_droit_acces = null) { |
119 | - $dbc = \core\App::getDb(); |
|
119 | + $dbc = \core\App::getDb(); |
|
120 | 120 | |
121 | 121 | if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces; |
122 | 122 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * @param $id_liste_droit_acces |
161 | 161 | */ |
162 | 162 | public function getListeDroitAccesDetailPage($id_liste_droit_acces = null) { |
163 | - $dbc = \core\App::getDb(); |
|
163 | + $dbc = \core\App::getDb(); |
|
164 | 164 | |
165 | 165 | if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces; |
166 | 166 | |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | $this->setListeDroitAccesDetailPage($id_page, $titre_page); |
180 | 180 | } |
181 | 181 | } |
182 | - //-------------------------- FIN GETTER ----------------------------------------------------------------------------// |
|
182 | + //-------------------------- FIN GETTER ----------------------------------------------------------------------------// |
|
183 | 183 | |
184 | 184 | |
185 | 185 | |
186 | - //-------------------------- SETTER ----------------------------------------------------------------------------// |
|
186 | + //-------------------------- SETTER ----------------------------------------------------------------------------// |
|
187 | 187 | private function setListeDroitAcces($id_liste_droit_acces, $nom_liste, $nb_droit_acces, $nb_droit_acces_page, $nb_user) { |
188 | 188 | $this->id_liste_droit_acces = $id_liste_droit_acces; |
189 | 189 | $this->nom_liste = $nom_liste; |
@@ -1,22 +1,22 @@ |
||
1 | 1 | <?php |
2 | - namespace core; |
|
2 | + namespace core; |
|
3 | 3 | |
4 | - class App { |
|
5 | - private static $database; |
|
4 | + class App { |
|
5 | + private static $database; |
|
6 | 6 | private static $erreur; |
7 | 7 | |
8 | 8 | |
9 | - //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
10 | - public function __construct() { |
|
9 | + //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
10 | + public function __construct() { |
|
11 | 11 | |
12 | - } |
|
13 | - //-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
12 | + } |
|
13 | + //-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
14 | 14 | |
15 | 15 | |
16 | 16 | |
17 | - //-------------------------- GETTER ----------------------------------------------------------------------------// |
|
17 | + //-------------------------- GETTER ----------------------------------------------------------------------------// |
|
18 | 18 | public static function getErreur() { |
19 | - return self::$erreur; |
|
19 | + return self::$erreur; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |