1 | <?php |
||
14 | class IpAccess extends Object |
||
|
|||
15 | { |
||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | public $allowedIps = array(); |
||
20 | |||
21 | /** |
||
22 | * @config |
||
23 | * @var array |
||
24 | */ |
||
25 | private static $allowed_ips = array(); |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $ip = ''; |
||
31 | |||
32 | /** |
||
33 | * IpAccess constructor. |
||
34 | * |
||
35 | * @param string $ip |
||
36 | * @param array $allowedIps |
||
37 | */ |
||
38 | public function __construct($ip = '', $allowedIps = array()) |
||
45 | |||
46 | /** |
||
47 | * @param $ip |
||
48 | */ |
||
49 | public function setIp($ip) |
||
53 | |||
54 | /** |
||
55 | * @return array |
||
56 | */ |
||
57 | public function getAllowedIps() |
||
65 | |||
66 | /** |
||
67 | * @return bool |
||
68 | */ |
||
69 | public function isEnabled() |
||
73 | |||
74 | /** |
||
75 | * @return bool |
||
76 | */ |
||
77 | public function hasAccess() |
||
85 | |||
86 | /** |
||
87 | * @param Controller $controller |
||
88 | * @throws SS_HTTPResponse_Exception |
||
89 | */ |
||
90 | public function respondNoAccess(Controller $controller) |
||
98 | |||
99 | /** |
||
100 | * @return string |
||
101 | */ |
||
102 | public function matchExact() |
||
106 | |||
107 | /** |
||
108 | * Try to match against a ip range |
||
109 | * |
||
110 | * Example : 192.168.1.50-100 |
||
111 | * |
||
112 | * @return string |
||
113 | */ |
||
114 | public function matchRange() |
||
135 | |||
136 | /** |
||
137 | * Try to match cidr range |
||
138 | * |
||
139 | * Example : 192.168.1.0/24 |
||
140 | * |
||
141 | * @return string |
||
142 | */ |
||
143 | public function matchCIDR() |
||
158 | |||
159 | /** |
||
160 | * Try to match against a range that ends with a wildcard * |
||
161 | * |
||
162 | * Example : 192.168.1.* |
||
163 | * Example : 192.168.* |
||
164 | * |
||
165 | * @return string |
||
166 | */ |
||
167 | public function matchWildCard() |
||
181 | |||
182 | } |
||
183 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.