File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 4040 }
4141}
4242
43+ if (!CheckAgentVersion ()) {
44+ header ("HTTP/1.1 403 Unauthorized " );
45+ exit ();
46+ }
47+
4348$ block_list = GetSetting ('block_pc ' );
4449if ($ block_list && strlen ($ block_list ) && strlen ($ pc )) {
4550 $ block = explode (', ' , $ block_list );
@@ -260,6 +265,23 @@ function TestToJSON($testInfo)
260265 return $ testJson ;
261266}
262267
268+ /**
269+ * Used to enforce version limitation for specific locaitons
270+ *
271+ */
272+ function CheckAgentVersion ()
273+ {
274+ global $ locations ;
275+ $ location = trim ($ locations [0 ]);
276+ $ locInfo = GetLocationInfo ($ location );
277+ $ agent_version = $ _GET ['version ' ];
278+ if (isset ($ locInfo ) && is_array ($ locInfo ) && array_key_exists ('version ' , $ locInfo )) {
279+ return $ locInfo ['version ' ] === $ agent_version ;
280+ }
281+
282+ return true ;
283+ }
284+
263285/**
264286* Get an actual task to complete
265287*
You can’t perform that action at this time.
0 commit comments