From 9b4aaeb974e7f92e6e124bde29c78a1f5f8fb2b0 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Thu, 10 Feb 2011 19:17:43 +0100 Subject: [PATCH] G_base var added to fix relative path problem in include of includes --- web/Obj/auth.phh | 2 +- web/Obj/brisk.phh | 12 ++++++------ web/Obj/dbase_file.phh | 2 +- web/Obj/dbase_pgsql.phh | 2 +- web/briskin5/Obj/briskin5.phh | 5 +++-- web/briskin5/index.php | 2 ++ web/briskin5/index_rd.php | 2 ++ web/briskin5/index_wr.php | 3 +++ web/briskin5/statadm.php | 2 ++ web/donometer.php | 2 ++ web/index.php | 2 ++ web/index_rd.php | 2 ++ web/index_wr.php | 2 ++ 13 files changed, 29 insertions(+), 11 deletions(-) diff --git a/web/Obj/auth.phh b/web/Obj/auth.phh index f25e01a..eff784f 100644 --- a/web/Obj/auth.phh +++ b/web/Obj/auth.phh @@ -22,7 +22,7 @@ * */ -require_once("Obj/dbase_".$G_dbasetype.".phh"); +require_once("${G_base}Obj/dbase_${G_dbasetype}.phh"); define(CHAL_SHM_DIMS_MIN, 16384); define(CHAL_SHM_DIMS_MAX, 65536); diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 5be9eac..ed630ce 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -925,7 +925,7 @@ class Room { function garbage_manager($force) { - GLOBAL $G_lang, $mlang_brisk; + GLOBAL $G_lang, $mlang_brisk, $G_base; $ismod = FALSE; @@ -936,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++) { @@ -1425,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 @@ -1770,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]; @@ -1867,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; @@ -1951,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) { diff --git a/web/Obj/dbase_file.phh b/web/Obj/dbase_file.phh index 2cf1a33..d09f5df 100644 --- a/web/Obj/dbase_file.phh +++ b/web/Obj/dbase_file.phh @@ -22,7 +22,7 @@ * */ -require_once("Obj/dbase_base.phh"); +require_once("${G_base}Obj/dbase_base.phh"); define(BRISK_AUTH_CONF, "brisk_auth.conf.pho"); diff --git a/web/Obj/dbase_pgsql.phh b/web/Obj/dbase_pgsql.phh index ff314b1..2c274dd 100644 --- a/web/Obj/dbase_pgsql.phh +++ b/web/Obj/dbase_pgsql.phh @@ -22,7 +22,7 @@ * */ -require_once("Obj/dbase_base.phh"); +require_once("${G_base}Obj/dbase_base.phh"); $escsql_from = array( "\\", "'" ); $escsql_to = array( "\\\\", "\\'" ); diff --git a/web/briskin5/Obj/briskin5.phh b/web/briskin5/Obj/briskin5.phh index e05e7b9..2990da4 100644 --- a/web/briskin5/Obj/briskin5.phh +++ b/web/briskin5/Obj/briskin5.phh @@ -575,7 +575,8 @@ class Briskin5 { function garbage_manager($force) { - + GLOBAL $G_base; + /* Garbage collector degli utenti in timeout */ $ismod = FALSE; $curtime = time(); @@ -606,7 +607,7 @@ class Briskin5 { /* se gli altri utenti non erano d'accordo questo utente viene bannato */ $remcalc = $this->table[0]->exitlock_calc(&$this->user, $user_cur->table_pos); if ($remcalc < 3) { - require_once("/var/www/webspace/trusty/Obj/hardban.phh"); + require_once("${G_base}Obj/hardban.phh"); Hardbans::add(($user_cur->flags & USER_FLAG_AUTH ? $user_cur->name : FALSE), $user_cur->ip, $user_cur->sess, $user_cur->laccwr + BAN_TIME); } diff --git a/web/briskin5/index.php b/web/briskin5/index.php index a3fb80a..3d7f2ec 100644 --- a/web/briskin5/index.php +++ b/web/briskin5/index.php @@ -24,6 +24,8 @@ /* MLANG: le img dell'asta */ +$G_base = "../"; + require_once("../Obj/brisk.phh"); require_once("../Obj/proxyscan.phh"); require_once("Obj/briskin5.phh"); diff --git a/web/briskin5/index_rd.php b/web/briskin5/index_rd.php index 995486b..2a35220 100644 --- a/web/briskin5/index_rd.php +++ b/web/briskin5/index_rd.php @@ -22,6 +22,8 @@ * */ +$G_base = "../"; + require_once("../Obj/brisk.phh"); // require_once("../Obj/proxyscan.phh"); require_once("Obj/briskin5.phh"); diff --git a/web/briskin5/index_wr.php b/web/briskin5/index_wr.php index bc349a3..9b269f7 100644 --- a/web/briskin5/index_wr.php +++ b/web/briskin5/index_wr.php @@ -22,6 +22,9 @@ * */ + +$G_base = "../"; + require_once("../Obj/brisk.phh"); // require_once("../Obj/proxyscan.phh"); require_once("Obj/briskin5.phh"); diff --git a/web/briskin5/statadm.php b/web/briskin5/statadm.php index 2c488f0..257bf3f 100644 --- a/web/briskin5/statadm.php +++ b/web/briskin5/statadm.php @@ -33,6 +33,8 @@ TODO: */ +$G_base = "../"; + ini_set("max_execution_time", "240"); require_once("../Obj/brisk.phh"); diff --git a/web/donometer.php b/web/donometer.php index 620a39d..e6a21d3 100644 --- a/web/donometer.php +++ b/web/donometer.php @@ -22,6 +22,8 @@ * */ +$G_base = ""; + require_once("Obj/brisk.phh"); diff --git a/web/index.php b/web/index.php index f0b05c7..5fd269d 100644 --- a/web/index.php +++ b/web/index.php @@ -22,6 +22,8 @@ * */ +$G_base = ""; + require_once("Obj/brisk.phh"); require_once("Obj/auth.phh"); require_once("Obj/proxyscan.phh"); diff --git a/web/index_rd.php b/web/index_rd.php index 80c41d1..7112182 100644 --- a/web/index_rd.php +++ b/web/index_rd.php @@ -22,6 +22,8 @@ * */ +$G_base = ""; + require_once("Obj/brisk.phh"); // require_once("Obj/proxyscan.phh"); require_once("briskin5/Obj/briskin5.phh"); diff --git a/web/index_wr.php b/web/index_wr.php index 8dda399..0db96eb 100644 --- a/web/index_wr.php +++ b/web/index_wr.php @@ -22,6 +22,8 @@ * */ +$G_base = ""; + require_once("Obj/brisk.phh"); require_once("Obj/auth.phh"); // require_once("Obj/proxyscan.phh"); -- 2.17.1