move curl-de-sac stuff optionally included
[brisk.git] / web / Obj / brisk.phh
index 2efb2ff..3af8a15 100644 (file)
@@ -2,7 +2,7 @@
 /*
  *  brisk - brisk.phh
  *
- *  Copyright (C) 2006-2013 Matteo Nastasi
+ *  Copyright (C) 2006-2014 Matteo Nastasi
  *                          mailto: nastasi@alternativeoutput.it
  *                                  matteo.nastasi@milug.org
  *                          web: http://www.alternativeoutput.it
@@ -1078,6 +1078,11 @@ class Brisk
     {
         fprintf(STDERR, "RELOAD STUFF (%d)(%d)\n", count($ban_list), count($black_list));
 
+        if (defined('CURL_DE_SAC_VERS')) {
+            if (brisk_cds_reload($this) == FALSE) {
+                exit(12);
+            }
+        }
         $this->ipclass_update("ban_list", $ban_list);
         $this->ipclass_update("black_list", $black_list);
 
@@ -2258,6 +2263,9 @@ class Brisk
       }
 
       $idx = $ghost;
+      if (defined('CURL_DE_SAC_VERS')) {
+          brisk_cds_execute($this, $real_idx, $sess, $ip, $authenticate);
+      }
       return ($this->user[$ghost]);
     }
     else if ($idx != -1 && $i == MAX_PLAYERS) {
@@ -2357,10 +2365,9 @@ class Brisk
       log_main(sprintf("TROVATO LIBERO A [%d] sess [%s] name [%s] count [%d] name [%s] code [%s]", $idx, $sess, $name_new, count($this->user),$this->user[$real_idx]->name, $this->user[$real_idx]->code));
 
       $ret = $this->user[$real_idx];
-      if ($this->cds->execute("tor_chk", $this, $real_idx, $sess, $ip) == FALSE) {
-          log_main("cds_execute failed");
+      if (defined('CURL_DE_SAC_VERS')) {
+          brisk_cds_execute($this, $real_idx, $sess, $ip, $authenticate);
       }
-
       return ($ret);
     }