X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fbrisk.phh;h=cbe89a62a66d84d4a8ec3068d6aa06c5d8066b8d;hb=a53bab3c7b384a95a807ddd64fe93a6564be5504;hp=711e16bf052cced177f21d7187cffc230da512b2;hpb=64f3311cce744f8bbac899511bbf58c7c5afdab3;p=brisk.git diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 711e16b..cbe89a6 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -622,12 +622,17 @@ class Vect { } } +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; @@ -650,7 +655,13 @@ class Table { $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 = ""; @@ -674,7 +685,7 @@ class Table { 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; @@ -707,7 +718,7 @@ class Table { $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; @@ -778,7 +789,7 @@ class Table { } } - // 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 = ""; @@ -790,15 +801,23 @@ class Table { 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'; @@ -1019,20 +1038,6 @@ class Brisk 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; @@ -1881,7 +1886,7 @@ class Brisk 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