Webservice whitelister.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 1 Jun 2008 15:10:26 +0000 (17:10 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 1 Jun 2008 15:10:26 +0000 (17:10 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
page.webservice.php

index e4783cb..919d130 100644 (file)
@@ -3,7 +3,13 @@ require_once dirname(__FILE__) . '/widget.blog.owner.php';
 
 class XorgWebservice extends dcUrlHandlers {
   static private function canRunServices() {
-    return true;
+    $addrs = explode(',', XORG_SERV_ADDRS);
+    foreach ($addrs as $addr) {
+      if ($addr == $_SERVER['REMOTE_ADDR']) {
+        return true;
+      }
+    }
+    return false;
   }
 
   static public function handle($args) {