G_base var added to fix relative path problem in include of includes
[brisk.git] / web / Obj / brisk.phh
index 02b91d6..ed630ce 100644 (file)
@@ -277,7 +277,6 @@ Copyright 2006-2009 <a href=\\"mailto:brisk@alternativeoutput.it\\">Matteo Nasta
 <br><b>version '.$G_brisk_version.'</b><br><br>
 Copyright 2006-2009 <a href=\\"mailto:brisk@alternativeoutput.it\\">Matteo Nastasi</a> (aka mop)<br><br>');
 
-
 $escinp_from = array( "\""     );
 $escinp_to = array(   "&quot;" );
 
@@ -589,9 +588,12 @@ define(USER_FLAG_S_MOP,   0xb00); // done
 define(USER_FLAG_S_ALL,   0xf00); // done
 
 /* type of user normal, supporter etc ... */
-define(USER_FLAG_TY_ALL,   0xf0000); // done
-define(USER_FLAG_TY_NORM,  0x10000); // done
-define(USER_FLAG_TY_SUPER, 0x20000); // done
+define(USER_FLAG_TY_ALL,     0xff0000); // done
+define(USER_FLAG_TY_NORM,    0x010000); // done
+define(USER_FLAG_TY_SUPER,   0x020000); // done
+//  ... other usefull status ...
+define(USER_FLAG_TY_SUSPEND, 0x400000); // done
+define(USER_FLAG_TY_DISABLE, 0x800000); // done
 
 class User {
   var $name;       // name of the user
@@ -923,7 +925,7 @@ class Room {
 
   function garbage_manager($force)
   {
-    GLOBAL $G_lang, $mlang_brisk;
+    GLOBAL $G_lang, $mlang_brisk, $G_base;
 
     $ismod = FALSE;
 
@@ -934,7 +936,7 @@ class Room {
     if ($force || $this->garbage_timeout < $curtime) {
       
       // FIXME BRISK4: include for each kind of table
-      require_once("briskin5/Obj/briskin5.phh");
+      require_once("${G_base}briskin5/Obj/briskin5.phh");
 
       // Before all align times with table timeout
       for ($table_idx = 0 ; $table_idx < TABLES_N ; $table_idx++) {
@@ -1423,7 +1425,7 @@ class Room {
 
   function chatt_send(&$user, $mesg)
   {
-    GLOBAL $G_alarm_passwd, $mlang_brisk, $G_lang;
+    GLOBAL $G_base, $G_alarm_passwd, $mlang_brisk, $G_lang;
     $only_you = FALSE;
     
     // common settings
@@ -1768,7 +1770,7 @@ class Room {
     
     if ($to_tabl) {
       // FIXME BRISK4: include for each kind of table
-      require_once("briskin5/Obj/briskin5.phh");
+      require_once("${G_base}briskin5/Obj/briskin5.phh");
       // Before all align times with table timeout
       for ($table_idx = 0 ; $table_idx < TABLES_N ; $table_idx++) {
         $table_cur =& $this->table[$table_idx];
@@ -1865,7 +1867,7 @@ class Room {
 
   function &add_user(&$sess, &$idx, $name, $pass, $ip)
   {
-    GLOBAL $G_false, $CO_list;
+    GLOBAL $G_base, $G_false, $CO_list;
 
     $idx = 0;
 
@@ -1949,7 +1951,7 @@ class Room {
       $table_idx = $ghost_user->table;
       if ($ghost_user->stat == "table" && $this->table[$table_idx]->player_n == PLAYERS_N) {
         // FIXME BRISK4: include for each kind of table
-        require_once("briskin5/Obj/briskin5.phh");
+        require_once("${G_base}briskin5/Obj/briskin5.phh");
         if (($brisem = Briskin5::lock_data($table_idx)) != FALSE) { 
           if (($bri = &Briskin5::load_data($table_idx)) != FALSE) {
             if ($bri->the_end != TRUE) {
@@ -2051,7 +2053,9 @@ class Room {
       if ($login_exists)
         $idx = -($idx + 1);
       log_main(sprintf("TROVATO LIBERO A [%d] sess [%s] name [%s] count [%d] [%s]", $idx, $sess, $name_new, count($this->user),$this->user[$real_idx]->name));
-      return ($this->user[$real_idx]);
+
+      $ret = $this->user[$real_idx];
+      return ($ret);
     }
 
     return ($G_false);