X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fbrisk.phh;h=959fd1a9068a4fbc819c81f4381b0a82109cfc6f;hb=9603235381668b55449b18a108e85ee27726d596;hp=64ed2b3c5b4efd9267a5aaced46255c54cb13c88;hpb=8bb224a0ce40e72e2c3f1ae82957cd10e449c22b;p=brisk.git diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 64ed2b3..959fd1a 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -277,7 +277,6 @@ Copyright 2006-2009 Matteo Nasta
version '.$G_brisk_version.'

Copyright 2006-2009
Matteo Nastasi (aka mop)

'); - $escinp_from = array( "\"" ); $escinp_to = array( """ ); @@ -293,6 +292,11 @@ function eschtml($s) return htmlentities($s); } +function esclfhtml($s) +{ + return str_replace("\n", "
\n", htmlentities($s)); +} + function langtolng($lang) { @@ -589,9 +593,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 +930,7 @@ class Room { function garbage_manager($force) { - GLOBAL $G_lang, $mlang_brisk; + GLOBAL $G_lang, $mlang_brisk, $G_base; $ismod = FALSE; @@ -934,7 +941,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 +1430,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 @@ -1612,9 +1619,10 @@ class Room { $user->name = $name_new; // OK - nick changed /* se nome gia' in uso, segnala cosa potrebbe capitare */ if (($user->flags & USER_FLAG_AUTH) == 0) { - $userdb = new LoginDB(); + $bdb = new BriskDB(); + $bdb->users_load(); /* MLANG: "Il nickname \'%s\' è già registrato, se il suo proprietario si autentificherà verrai rinominato d\'ufficio come ghostN." */ - if ($userdb->login_exists($name_new)) { + if ($bdb->login_exists($name_new)) { $prestr = sprintf($mlang_brisk['nickjust'][$G_lang], xcape($name_new)); $to_user .= sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $prestr); } @@ -1768,7 +1776,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 +1873,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; @@ -1888,10 +1896,11 @@ class Room { /* if pass != FALSE verify the login with pass */ log_auth("XXX", "auth1"); - $userdb = new LoginDB(); + $bdb = new BriskDB(); + $bdb->users_load(); if ($pass != FALSE) { log_auth("XXX", "auth2"); - $authenticate = $userdb->login_verify($name_new, $pass); + $authenticate = $bdb->login_verify($name_new, $pass, $code); log_auth("XXX", "authenticate: ".($authenticate != FALSE ? "TRUE" : "FALSE")); if ($authenticate != FALSE) { @@ -1903,7 +1912,7 @@ class Room { } } else { - $login_exists = $userdb->login_exists($name_new); + $login_exists = $bdb->login_exists($name_new); } for ($i = 0 ; $i < MAX_PLAYERS ; $i++) { /* free user ? */ @@ -1949,7 +1958,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) {