@@ -31,9 +31,9 @@ |
||
31 | 31 | */ |
32 | 32 | public function forgotPassword($data) |
33 | 33 | { |
34 | - if($data['Email']) { |
|
34 | + if ($data['Email']) { |
|
35 | 35 | /* @var $member Member */ |
36 | - if ($member = Member::get()->where("Email = '".Convert::raw2sql($data['Email'])."'")->first()) { |
|
36 | + if ($member = Member::get()->where("Email = '" . Convert::raw2sql($data['Email']) . "'")->first()) { |
|
37 | 37 | $token = $member->generateAutologinTokenAndStoreHash(); |
38 | 38 | $this->sendPasswordResetLinkEmail($member, $token); |
39 | 39 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | Deprecation::notice('1.1', 'Use the "IpAccess.allowed_ips" config setting instead'); |
61 | 61 | self::config()->allowed_ips = $this->allowedIps; |
62 | 62 | } |
63 | - return (array)self::config()->allowed_ips; |
|
63 | + return (array) self::config()->allowed_ips; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function isEnabled() |
70 | 70 | { |
71 | - return (bool)Config::inst()->get('IpAccess', 'enabled'); |
|
71 | + return (bool) Config::inst()->get('IpAccess', 'enabled'); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function hasAccess() |
78 | 78 | { |
79 | - if(!$this->isEnabled() || empty($this->getAllowedIps())) { |
|
79 | + if (!$this->isEnabled() || empty($this->getAllowedIps())) { |
|
80 | 80 | return true; |
81 | 81 | } |
82 | 82 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function matchRange() |
115 | 115 | { |
116 | - $ranges = array_filter($this->getAllowedIps(), function ($ip) { |
|
116 | + $ranges = array_filter($this->getAllowedIps(), function($ip) { |
|
117 | 117 | return strstr($ip, '-'); |
118 | 118 | }); |
119 | 119 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | foreach ($ranges as $range) { |
128 | 128 | $rangeFirstPart = substr($range, 0, strrpos($range, '.') + 1); |
129 | 129 | list ($start, $end) = explode('-', substr(strrchr($range, '.'), 1)); |
130 | - if($ipFirstPart === $rangeFirstPart && $ipLastpart >= $start && $ipLastpart <= $end) { |
|
130 | + if ($ipFirstPart === $rangeFirstPart && $ipLastpart >= $start && $ipLastpart <= $end) { |
|
131 | 131 | return $range; |
132 | 132 | } |
133 | 133 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | */ |
143 | 143 | public function matchCIDR() |
144 | 144 | { |
145 | - if ($ranges = array_filter($this->getAllowedIps(), function ($ip) { |
|
145 | + if ($ranges = array_filter($this->getAllowedIps(), function($ip) { |
|
146 | 146 | return strstr($ip, '/'); |
147 | 147 | }) |
148 | 148 | ) { |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | */ |
167 | 167 | public function matchWildCard() |
168 | 168 | { |
169 | - if ($ranges = array_filter($this->getAllowedIps(), function ($ip) { |
|
169 | + if ($ranges = array_filter($this->getAllowedIps(), function($ip) { |
|
170 | 170 | return substr($ip, -1) === '*'; |
171 | 171 | }) |
172 | 172 | ) { |