@@ -6,52 +6,52 @@ |
||
6 | 6 | |
7 | 7 | class LoginModel extends Model |
8 | 8 | { |
9 | - protected $table = 'users'; |
|
9 | + protected $table = 'users'; |
|
10 | 10 | |
11 | - private $user; |
|
11 | + private $user; |
|
12 | 12 | |
13 | - public function isValidLogin($email, $password) |
|
14 | - { |
|
15 | - $user = $this->where('email=?' , $email)->fetch($this->table); |
|
13 | + public function isValidLogin($email, $password) |
|
14 | + { |
|
15 | + $user = $this->where('email=?' , $email)->fetch($this->table); |
|
16 | 16 | |
17 | - if (! $user) { |
|
17 | + if (! $user) { |
|
18 | 18 | |
19 | - return false; |
|
20 | - } |
|
19 | + return false; |
|
20 | + } |
|
21 | 21 | |
22 | - $this->user = $user; |
|
22 | + $this->user = $user; |
|
23 | 23 | |
24 | - return password_verify($password, $user->password); |
|
25 | - } |
|
24 | + return password_verify($password, $user->password); |
|
25 | + } |
|
26 | 26 | |
27 | - public function user() |
|
28 | - { |
|
29 | - return $this->user; |
|
30 | - } |
|
27 | + public function user() |
|
28 | + { |
|
29 | + return $this->user; |
|
30 | + } |
|
31 | 31 | |
32 | - public function isLogged() |
|
33 | - { |
|
34 | - if ($this->cookie->has('login')) { |
|
32 | + public function isLogged() |
|
33 | + { |
|
34 | + if ($this->cookie->has('login')) { |
|
35 | 35 | |
36 | - $code = $this->cookie->get('login'); |
|
36 | + $code = $this->cookie->get('login'); |
|
37 | 37 | |
38 | - } elseif ($this->session->has('login')) { |
|
38 | + } elseif ($this->session->has('login')) { |
|
39 | 39 | |
40 | - $code = $this->session->get('login'); |
|
40 | + $code = $this->session->get('login'); |
|
41 | 41 | |
42 | - } else { |
|
42 | + } else { |
|
43 | 43 | |
44 | - return false; |
|
45 | - } |
|
44 | + return false; |
|
45 | + } |
|
46 | 46 | |
47 | - $user = $this->where('code=?' , $code)->fetch($this->table); |
|
47 | + $user = $this->where('code=?' , $code)->fetch($this->table); |
|
48 | 48 | |
49 | - if (! $user) { |
|
50 | - return false; |
|
51 | - } |
|
49 | + if (! $user) { |
|
50 | + return false; |
|
51 | + } |
|
52 | 52 | |
53 | - $this->user = $user; |
|
53 | + $this->user = $user; |
|
54 | 54 | |
55 | - return true; |
|
56 | - } |
|
55 | + return true; |
|
56 | + } |
|
57 | 57 | } |
58 | 58 | \ No newline at end of file |
@@ -12,9 +12,9 @@ discard block |
||
12 | 12 | |
13 | 13 | public function isValidLogin($email, $password) |
14 | 14 | { |
15 | - $user = $this->where('email=?' , $email)->fetch($this->table); |
|
15 | + $user = $this->where('email=?', $email)->fetch($this->table); |
|
16 | 16 | |
17 | - if (! $user) { |
|
17 | + if (!$user) { |
|
18 | 18 | |
19 | 19 | return false; |
20 | 20 | } |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | return false; |
45 | 45 | } |
46 | 46 | |
47 | - $user = $this->where('code=?' , $code)->fetch($this->table); |
|
47 | + $user = $this->where('code=?', $code)->fetch($this->table); |
|
48 | 48 | |
49 | - if (! $user) { |
|
49 | + if (!$user) { |
|
50 | 50 | return false; |
51 | 51 | } |
52 | 52 |