players_n=3
tables_n=44
tables_auth_n=12
-brisk_auth_conf="brisk_spu_auth.conf.pho"
+brisk_auth_conf="brisk_auth.conf.pho"
brisk_debug="0x0400"
# brisk_debug="0xffff"
web_path="/home/nastasi/web/brisk"
-- define(USER_FLAG_TY_SUSPEND, 0x00400000); // done
-- define(USER_FLAG_TY_DISABLE, 0x00800000); // done
-INSERT INTO #PFX#users (code, login, pass, email, type, flags) VALUES (1, 'uno', md5('one'), 'uno@pluto.com', CAST (X'00020000' as integer), 0);
-INSERT INTO #PFX#users (code, login, pass, email, type, flags) VALUES (2, 'due', md5('two'), 'due@pluto.com', CAST (X'00010000' as integer), 0);
-INSERT INTO #PFX#users (code, login, pass, email, type, flags) VALUES (3, 'tre', md5('thr'), 'tre@pluto.com', CAST (X'00010000' as integer), 0);
-INSERT INTO #PFX#users (code, login, pass, email, type, flags) VALUES (4, 'qua', md5('for'), 'qua@pluto.com', CAST (X'00010000' as integer), 0);
-INSERT INTO #PFX#users (code, login, pass, email, type, flags) VALUES (5, 'cin', md5('fiv'), 'cin@pluto.com', CAST (X'00010000' as integer), 0);
+INSERT INTO #PFX#users (code, login, pass, email, type) VALUES (1, 'uno', md5('one'), 'uno@pluto.com', CAST (X'00020000' as integer));
+INSERT INTO #PFX#users (code, login, pass, email, type) VALUES (2, 'due', md5('two'), 'due@pluto.com', CAST (X'00010000' as integer));
+INSERT INTO #PFX#users (code, login, pass, email, type) VALUES (3, 'tre', md5('thr'), 'tre@pluto.com', CAST (X'00010000' as integer));
+INSERT INTO #PFX#users (code, login, pass, email, type) VALUES (4, 'qua', md5('for'), 'qua@pluto.com', CAST (X'00010000' as integer));
+INSERT INTO #PFX#users (code, login, pass, email, type) VALUES (5, 'cin', md5('fiv'), 'cin@pluto.com', CAST (X'00010000' as integer));
}
}
+class ModerationItem
+{
+ var $table;
+ var $date;
+ var $content;
+
+ function ModerationItem($where, $date, $content)
+ {
+ $this->where = $where;
+ $this->time = $time;
+ $this->content = $content;
+ }
+}
+
+class Moderation
+{
+ var $row;
+
+ function Moderation()
+ {
+ $this->item = Array();
+ }
+
+ function get_all()
+ {
+ return json_encode($this->item);
+ }
+}
class Room
{
}
if ($to_room != FALSE) {
- for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
- $user_cur = $this->user[$i];
- if ($target != "" && $user_cur->name != $target)
- continue;
- if ($user_cur->sess == '' || $user_cur->stat == 'table' || $user->idx_get() == $i)
- continue;
-
- if ($is_normchat == TRUE) {
- // use MAP_AUTH to check if auth or isolation
- if ($user_cur->flags & USER_FLAG_MAP_AUTH) {
- if (($user->flags & USER_FLAG_AUTH) == 0) {
- continue;
+ for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
+ $user_cur = $this->user[$i];
+ if ($target != "" && $user_cur->name != $target)
+ continue;
+ if ($user_cur->sess == '' || $user_cur->stat == 'table' || $user->idx_get() == $i)
+ continue;
+
+ if ($is_normchat == TRUE) {
+ // use MAP_AUTH to check if auth or isolation
+ if ($user_cur->flags & USER_FLAG_MAP_AUTH) {
+ if (($user->flags & USER_FLAG_AUTH) == 0) {
+ continue;
+ }
+ }
}
- }
- }
- /*
- else if ($is_ticker) {
- if (($user_cur->flags & USER_FLAG_MAP_AUTH) == USER_FLAG_ISOLAUTH) {
- if ($user->table >= TABLES_AUTH_N)
+ /*
+ else if ($is_ticker) {
+ if (($user_cur->flags & USER_FLAG_MAP_AUTH) == USER_FLAG_ISOLAUTH) {
+ if ($user->table >= TABLES_AUTH_N)
continue;
- }
+ }
+ }
+ */
+ $user_cur->comm[$user_cur->step % COMM_N] = "gst.st = ".($user_cur->step+1)."; ";
+ $user_cur->comm[$user_cur->step % COMM_N] .= $to_room;
+
+ if ($user_cur->flags_vlt_get(USER_FLAG_MODER)) {
+ $user_cur->comm[$user_cur->step % COMM_N] .= sprintf('$$(moder_win, "mainbody").innerHTML += "%s<br>";' ,
+ xcape($to_room) );
+ }
+ $user_cur->step_inc();
}
- */
- $user_cur->comm[$user_cur->step % COMM_N] = "gst.st = ".($user_cur->step+1)."; ";
- $user_cur->comm[$user_cur->step % COMM_N] .= $to_room;
- $user_cur->step_inc();
- }
}
if ($to_tabl) {
define('USER_FLAG_S_ALL', 0xff); // done
+/* does is user moderationg brisk ? */
+define('USER_FLAG_MODER', 0x0100); // done
+
/* type of user normal, supporter etc ... */
define('USER_FLAG_TY_ALL', 0xff0000); // done
define('USER_FLAG_TY_NORM', 0x010000); // done
var $table_orig; // id of the current table when you aren't in game
var $table_pos; // idx on the table
var $table_token;// token that identify a game on a table
+
+ var $flags_volat;// Bitfield of volatile flags
var $flags; // Bitfield with: AUTHENTICATE: 0x02
var $flags_vlt; // Volatile flags valid for this session only
var $rec; // field with user db record or FALSE
return ($thiz);
}
+ function flags_get($mask)
+ {
+ return ($this->flags & $mask);
+ }
+
function flags_set($flags, $mask)
{
$flags_old = $this->flags;
return ($flags_old != $this->flags);
}
+ function flags_vlt_get($mask)
+ {
+ return ($this->flags_vlt & $mask);
+ }
+
function flags_vlt_set($flags_vlt, $mask)
{
$flags_vlt_old = $this->flags_vlt;
function $(id) { return document.getElementById(id); }
+function $$(win, id) { return win.document.getElementById(id); }
+
function dec2hex(d, padding)
{
var hex = Number(d).toString(16);
send_mesg("logout|"+exitlock);
}
+var moder_win = null;
+var moder_cur = -1;
+function act_moderate()
+{
+ send_mesg("moderate");
+}
+
+function moderate(enable)
+{
+ if (enable) {
+ moder_win = window.open("moderation.php", "moderation", "width=800,height=600,toolbar=no,location=no,menubar=no,status=no");
+ }
+ else {
+ if (moder_win != null) {
+ moder_win.close();
+ moder_win = null;
+ moder_cur = -1;
+ }
+ }
+}
+
function act_reloadroom()
{
window.onunload = null;
document.location.assign("index.php");
}
+
function act_shutdown()
{
var c = 0;
'en' => '<br>The nickname you are using it\'s already registered, <br><br>if its proprietary authenticates<br><br>you will named ghost<i>N</i>.'),
'btn_rettabs' => array('it' => 'torna ai tavoli',
'en' => 'back to tables'),
+ 'btn_moder' => array('it' => 'Modera.',
+ 'en' => 'Moderate.'),
+ 'btn_reload' => array('it' => 'Reload.',
+ 'en' => 'Reload.'),
'btn_exit' => array('it' => 'Esco.',
'en' => 'Exit.'),
'btn_prefs_save' => array('it' => 'Salva.',
$standup .= '<div id="room_tit"><span class="room_titin"><b>'.$mlang_room['standing'][$G_lang].'</b></span></div>';
$standup .= sprintf('<div id="standup" class="room_standup"></div>');
- // MLANG Esco.
- $standup .= '<div id="esco" class="esco"><input type="button" class="button" name="xreload" value="Reload." onclick="act_reloadroom();"><input class="button" name="logout" value="'.$mlang_room['btn_exit'][$G_lang].'" onclick="esco_cb();" type="button"></div>';
+ // MLANG (Modera) Reload Esco.
+ // TODO: moderation button if moderator only
+ if (1 == 1) {
+ $moder_button = '<input type="button" class="button" name="xmoder" value="'.$mlang_room['btn_moder'][$G_lang].'" onclick="act_moderate();">';
+ }
+ else {
+ $moder_button = '';
+ }
+ $standup .= '<div id="esco" class="esco">'.$moder_button.'<input type="button" class="button" name="xreload" value="'.$mlang_room['btn_reload'][$G_lang].'" onclick="act_reloadroom();"><input class="button" name="logout" value="'.$mlang_room['btn_exit'][$G_lang].'" onclick="esco_cb();" type="button"></div>';
$standup .= '</div></td></tr></table>';
}
var g_listen;
var g_withflash = false;
var g_is_spawn = 0;
+ var g_moder = -1;
var gst = new globst();
var topbanner_sfx, topbanner_dx;
var g_brow = null;
$user->step_inc();
}
}
-
-
-
else if ($argz[0] == 'poll') {
GLOBAL $G_with_poll, $G_poll_name;
if (($cli_choose = gpcs_var('cli_choose', $get, $post, $cookie)) === FALSE)
echo "$echont";
}
-
+ else if ($argz[0] == 'moderate') {
+ // TODO: add certification check
+ if (1 == 1) {
+ if ($user->flags_vlt_get(USER_FLAG_MODER) == 0) {
+ /* enable moderation */
+ $moder_enable = 'true';
+ $user->flags_vlt_set(USER_FLAG_MODER, USER_FLAG_MODER);
+ }
+ else {
+ /* disable moderation */
+ $moder_enable = 'false';
+ $user->flags_vlt_set(0, USER_FLAG_MODER);
+ }
+ $user->comm[$user->step % COMM_N] = sprintf("gst.st = %d; moderate(%s);",
+ $user->step+1, $moder_enable);
+ $user->step_inc();
+ }
+ }
/******************
* *
* STAT: room *