}
}
+define('TABLE_AUTH_TY_PUBL', 0);
+define('TABLE_AUTH_TY_AUTH', 1);
+define('TABLE_AUTH_TY_CERT', 2);
+
+
class Table {
var $idx;
var $player;
var $player_n;
- var $auth_only; // se tavolo riservato o libero
+ var $auth_type; // required authorization to sit down
var $wag_own;
var $wag_com;
$thiz->idx = $idx;
$thiz->player = array();
$thiz->player_n = 0;
- $thiz->auth_only = FALSE;
+
+ if ($idx < TABLES_CERT_N)
+ $thiz->auth_type = TABLE_AUTH_TY_CERT;
+ else if ($idx < TABLES_AUTH_N)
+ $thiz->auth_type = TABLE_AUTH_TY_AUTH;
+ else
+ $thiz->auth_type = TABLE_AUTH_TY_PUBL;
$thiz->wag_own = -1;
$thiz->wag_com = "";
log_main("PLAYER_N - parent::copy.".$this->player_n);
- $this->auth_only = $from->auth_only;
+ $this->auth_type = $from->auth_type;
$this->wag_own = $from->wag_own;
$this->wag_com = $from->wag_com;
$thiz->player[$i] = $i;
$thiz->player_n = $from->player_n;
- $thiz->auth_only = $from->auth_only;
+ $thiz->auth_type = $from->auth_type;
$thiz->wag_own = $from->wag_own;
$thiz->wag_com = $from->wag_com;
}
}
- // function act_content($isstanding, $sitted, $table, $cur_table, $allowed)
+ // Table->act_content - return 'id' of type of output required for table button
function act_content($user)
{
$ret = "";
if ($isstanding) {
if ($sitted < PLAYERS_N) {
- if ($this->auth_only) {
- if ($user->flags & USER_FLAG_AUTH)
- $act = "sitreser";
- else
- $act = 'reserved';
- }
- else {
- $act = 'sit';
- }
+ switch ($this->auth_type) {
+ case TABLE_AUTH_TY_CERT:
+ if ($user->flags & USER_FLAG_AUTH && $user->flags & USER_FLAG_TY_CERT)
+ $act = "sitcert";
+ else
+ $act = 'resercert';
+ break;
+ case TABLE_AUTH_TY_AUTH:
+ if ($user->flags & USER_FLAG_AUTH)
+ $act = "sitreser";
+ else
+ $act = 'reserved';
+ break;
+ default:
+ $act = 'sit';
+ break;
+ }
}
else {
$act = 'none';
for ($i = 0 ; $i < TABLES_N ; $i++) {
$thiz->table[$i] = Table::create($i);
- /* OLD METHOD
- if ($i < 12) {
- $row = ( (((int)($i / 4)) % 2) == 0 );
- $col = ($i % 2 == 0);
- $thiz->table[$i]->auth_only = (($row && $col) || (!$row && !$col));
- }
- else {
- $thiz->table[$i]->auth_only = FALSE;
- }
- */
- if ($i < TABLES_AUTH_N)
- $thiz->table[$i]->auth_only = TRUE;
- else
- $thiz->table[$i]->auth_only = FALSE;
}
$thiz->garbage_timeout = 0;
$thiz->shm_sz = SHM_DIMS_MIN;
if (strcasecmp($user->name,$name_new) != 0) {
if (( ($user->flags & USER_FLAG_MAP_AUTH) != USER_FLAG_ISOLAUTH) &&
($user->subst == 'standup' ||
- ($user->subst != 'standup' && $this->table[$user->table]->auth_only == FALSE)
+ ($user->subst != 'standup' && $this->table[$user->table]->auth_type == TABLE_AUTH_TY_PUBL)
)
) {
$user->flags &= ~(USER_FLAG_AUTH | USER_FLAG_TY_ALL); // Remove auth if name changed
span.au2 {
font-style: italic;
-/* text-decoration: underline; */
background-color: #bafcba;
}
span.au3 {
font-weight: bold;
font-style: italic;
-/* text-decoration: underline; */
background-color: #bafcba;
}
+
+span.au4 {
+ background-color: #ffd780;
+}
+
+span.au5 {
+ font-weight: bold;
+ background-color: #ffd780;
+}
+
+span.au6 {
+ font-style: italic;
+ background-color: #ffd780;
+}
+
+span.au7 {
+ font-weight: bold;
+ font-style: italic;
+ background-color: #ffd780;
+}
function user_decorator(user)
{
var name;
- var flags = user[0];
- if ((flags & 0x03) != 0)
- name = "<span class='au" + (flags & 0x03) + "'>"+user[1]+"</span>";
+ var flags = user[0] & 0x03 | ((user[0] & 0x040000) >> 16);
+
+ if (flags != 0)
+ name = "<span class='au" + flags + "'>"+user[1]+"</span>";
else
name = user[1];
'shutmsg' => array( 'it' => '<b>Il server sta per essere riavviato, non possono avere inizio nuove partite.</b>',
'en' => '<b>The server is going to be rebooted, new games are not allowed.</b>'),
'mustauth' => array( 'it' => '<b>Il tavolo a cui volevi sederti richiede autentifica.</b>',
- 'en' => '<b>the table where you want to sit require authentication</b>'),
+ 'en' => '<b>The table where you want to sit require authentication</b>'),
+ 'mustcert' => array( 'it' => '<b>Il tavolo a cui volevi sederti richiede autentifica e certificazione.</b>',
+ 'en' => '<b>The table where you want to sit require authentication and certification</b>'),
'tabwait_a'=> array( 'it' => '<b>Il tavolo si è appena liberato, ci si potrà sedere tra ',
'en' => '<b>The table is only just opened, you will sit down in '), // FIXME
'tabwait_b'=> array( 'it' => ' secondi.</b>',
$dt, NICKSERV, $mlang_indwr['tabwait_a'][$G_lang],
$table->wakeup_time - $curtime, $mlang_indwr['tabwait_b'][$G_lang]);
}
- else if ($table->auth_only && (($user->flags & USER_FLAG_AUTH) == 0)) {
+ else if ($table->auth_type == TABLE_AUTH_TY_CERT
+ && ( (($user->flags & USER_FLAG_AUTH) == 0) || (($user->flags & USER_FLAG_TY_CERT) == 0) ) ) {
+ $not_allowed_msg = sprintf('chatt_sub("%s", [2, "%s"],"%s");',
+ $dt, NICKSERV, $mlang_indwr['mustcert'][$G_lang]);
+ }
+ else if ($table->auth_type == TABLE_AUTH_TY_AUTH && (($user->flags & USER_FLAG_AUTH) == 0)) {
$not_allowed_msg = sprintf('chatt_sub("%s", [2, "%s"],"%s");',
$dt, NICKSERV, $mlang_indwr['mustauth'][$G_lang]);
}
/*
* brisk - room.js
*
- * Copyright (C) 2006-2012 Matteo Nastasi
+ * Copyright (C) 2006-2014 Matteo Nastasi
* mailto: nastasi@alternativeoutput.it
* matteo.nastasi@milug.org
* web: http://www.alternativeoutput.it
$("table_act"+idx).innerHTML = '<input type="button" class="button" name="xhenter'+idx+'" value="'+(g_lang == 'en' ? "Sit down." : "Mi siedo.")+'" onclick="act_sitdown('+idx+');">';
}
else if (act == 'sitreser') {
- // <img class="nobo" title="tavolo riservato agli utenti registrati" style="display: inline; margin-right: 80px;" src="img/okauth.png">
// MLANG 1
- $("table_act"+idx).innerHTML = '<input type="button" style="background-repeat: no-repeat; background-position: center; background-image: url(\'img/okauth.png\');" class="button" name="xhenter'+idx+'" value="'+(g_lang == 'en' ? "Sit down." : "Mi siedo.")+'" onclick="act_sitdown('+idx+');">';
+ $("table_act"+idx).innerHTML = '<input type="button" style="background-repeat: no-repeat; background-position: center; background-image: url(\'img/okauth.png\');" class="button" name="xhenter'+idx+'" value="'+(g_lang == 'en' ? "Sit down." : "Mi siedo.")+'" onclick="act_sitdown('+idx+');" title="'+(g_lang == 'en' ? "reserved table for authenticated users only" : "tavolo riservato agli utenti registrati")+'" alt="'+(g_lang == 'en' ? "reserved table for authenticated users only" : "tavolo riservato agli utenti registrati")+'">';
+ }
+ else if (act == 'sitcert') {
+ // MLANG 1
+ $("table_act"+idx).innerHTML = '<input type="button" style="background-repeat: no-repeat; background-position: center; background-image: url(\'img/okcert.png\');" class="button" name="xhenter'+idx+'" value="'+(g_lang == 'en' ? "Sit down." : "Mi siedo.")+'" onclick="act_sitdown('+idx+');" title="'+(g_lang == 'en' ? "reserved table for authenticated users only" : "tavolo riservato agli utenti registrati e certificati")+'" alt="'+(g_lang == 'en' ? "reserved table for authenticated and certificated users only" : "tavolo riservato agli utenti registrati e certificati")+'">';
}
else if (act == 'wake') {
// MLANG 1
$("table_act"+idx).innerHTML = '<input type="button" class="button" name="xwakeup" value="'+(g_lang == 'en' ? "Wake up." : "Mi alzo.")+'" onclick="act_wakeup();">';
}
+ else if (act == 'resercert') {
+ // MLANG 1
+ $("table_act"+idx).innerHTML = '<img class="nobo" title="'+(g_lang == 'en' ? "reserved table for authenticated and certified users only" : "tavolo riservato agli utenti registrati e certificati")+'" style="margin-right: 20px;" src="img/onlycert.png">';
+ }
else if (act == 'reserved') {
// MLANG 1
$("table_act"+idx).innerHTML = '<img class="nobo" title="'+(g_lang == 'en' ? "reserved table for authenticated users only" : "tavolo riservato agli utenti registrati")+'" style="margin-right: 20px;" src="img/onlyauth.png">';