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 hasAccess() |
||
83 | |||
84 | /** |
||
85 | * @param Controller $controller |
||
86 | * @throws SS_HTTPResponse_Exception |
||
87 | */ |
||
88 | public function respondNoAccess(Controller $controller) |
||
96 | |||
97 | /** |
||
98 | * @return string |
||
99 | */ |
||
100 | public function matchExact() |
||
104 | |||
105 | /** |
||
106 | * Try to match against a ip range |
||
107 | * |
||
108 | * Example : 192.168.1.50-100 |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | public function matchRange() |
||
131 | |||
132 | /** |
||
133 | * Try to match cidr range |
||
134 | * |
||
135 | * Example : 192.168.1.0/24 |
||
136 | * |
||
137 | * @return string |
||
138 | */ |
||
139 | public function matchCIDR() |
||
154 | |||
155 | /** |
||
156 | * Try to match against a range that ends with a wildcard * |
||
157 | * |
||
158 | * Example : 192.168.1.* |
||
159 | * Example : 192.168.* |
||
160 | * |
||
161 | * @return string |
||
162 | */ |
||
163 | public function matchWildCard() |
||
177 | |||
178 | } |
||
179 |
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.