pass $header and $ghost to underline function that require them
[brisk.git] / web / Obj / brisk.phh
index 2efb2ff..41653d1 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);
 
@@ -2138,7 +2143,7 @@ class Brisk
   }
 
   /*
-   * function add_user(&$brisk, &$sess, &$idx, $name, $pass, $ip)
+   * function add_user(&$brisk, &$sess, &$idx, $name, $pass, $ip, $header, $cookie)
    *
    * RETURN VALUE:
    *   if ($idx >  -1    && ret == FALSE)  =>  duplicated nick
@@ -2149,7 +2154,7 @@ class Brisk
    *   if ($idx == -$idx && ret == user)   =>  SUCCESS (but the login exists in the auth db)
    */
 
-  function add_user(&$sess, &$idx, $name, $pass, $ip, $cookie)
+  function add_user(&$sess, &$idx, $name, $pass, $ip, $header, $cookie)
   {
     GLOBAL $G_base;
 
@@ -2258,6 +2263,9 @@ class Brisk
       }
 
       $idx = $ghost;
+      if (defined('CURL_DE_SAC_VERS')) {
+          brisk_cds_execute($this, $ghost, $real_idx, $sess, $ip, $authenticate, $header);
+      }
       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, $ghost, $real_idx, $sess, $ip, $authenticate, $header);
       }
-
       return ($ret);
     }
 
@@ -2521,7 +2528,7 @@ class Brisk
       case "":
       case "index.php":
           ob_start();
-          index_main($this, $transp_type, $header_out, $addr, $get, $post, $cookie);
+          index_main($this, $transp_type, $header, $header_out, $addr, $get, $post, $cookie);
           $content = ob_get_contents();
           ob_end_clean();