@@ -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 self::$allowed_ips ? self::$allowed_ips : (array)self::config()->allowed_ips; |
|
| 63 | + return self::$allowed_ips ? self::$allowed_ips : (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() || !(bool)$this->getAllowedIps()) { |
|
| 79 | + if (!$this->isEnabled() || !(bool) $this->getAllowedIps()) { |
|
| 80 | 80 | return true; |
| 81 | 81 | } |
| 82 | 82 | |
@@ -120,13 +120,13 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function matchRange() |
| 122 | 122 | { |
| 123 | - $ranges = array_filter($this->getAllowedIps(), function ($ip) { |
|
| 123 | + $ranges = array_filter($this->getAllowedIps(), function($ip) { |
|
| 124 | 124 | return strstr($ip, '-'); |
| 125 | 125 | }); |
| 126 | 126 | |
| 127 | 127 | $ip = $this->ip; |
| 128 | 128 | |
| 129 | - $matches = array_filter($ranges, function ($range) use ($ip) { |
|
| 129 | + $matches = array_filter($ranges, function($range) use ($ip) { |
|
| 130 | 130 | $ipFirstPart = substr($ip, 0, strrpos($ip, '.') + 1); |
| 131 | 131 | $ipLastPart = substr(strrchr($ip, '.'), 1); |
| 132 | 132 | $rangeFirstPart = substr($range, 0, strrpos($range, '.') + 1); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | public function matchCIDR() |
| 149 | 149 | { |
| 150 | - $ranges = array_filter($this->getAllowedIps(), function ($ip) { |
|
| 150 | + $ranges = array_filter($this->getAllowedIps(), function($ip) { |
|
| 151 | 151 | return strstr($ip, '/'); |
| 152 | 152 | }); |
| 153 | 153 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | public function matchWildCard() |
| 171 | 171 | { |
| 172 | - $ranges = array_filter($this->getAllowedIps(), function ($ip) { |
|
| 172 | + $ranges = array_filter($this->getAllowedIps(), function($ip) { |
|
| 173 | 173 | return substr($ip, -1) === '*'; |
| 174 | 174 | }); |
| 175 | 175 | |