X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=inline;f=web%2FObj%2Fbrisk.phh;h=959fd1a9068a4fbc819c81f4381b0a82109cfc6f;hb=9603235381668b55449b18a108e85ee27726d596;hp=f9f54f01adb6330df85355abacd6c56ca7e9a66f;hpb=1e77a6539b5df73e362c36c11df1b0e3696c1647;p=brisk.git
diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh
index f9f54f0..959fd1a 100644
--- a/web/Obj/brisk.phh
+++ b/web/Obj/brisk.phh
@@ -292,6 +292,11 @@ function eschtml($s)
return htmlentities($s);
}
+function esclfhtml($s)
+{
+ return str_replace("\n", "
\n", htmlentities($s));
+}
+
function langtolng($lang)
{
@@ -588,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
@@ -922,7 +930,7 @@ class Room {
function garbage_manager($force)
{
- GLOBAL $G_lang, $mlang_brisk;
+ GLOBAL $G_lang, $mlang_brisk, $G_base;
$ismod = FALSE;
@@ -933,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++) {
@@ -1422,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
@@ -1611,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);
}
@@ -1767,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];
@@ -1864,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;
@@ -1887,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) {
@@ -1902,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 ? */
@@ -1948,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) {