X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fbrisk.phh;h=6ff2b8e116f4ca10c159c9c1c59aeee35a067f94;hb=8b9c2b3ec59baef7c9f64f9663347bc5b9cf69fe;hp=b1e7e46e2dfda036b411f2bfdf1a43c7c3e6e11f;hpb=b8cdf67fa95fe158b8588e98d637fe0ffe654bb5;p=brisk.git
diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh
index b1e7e46..6ff2b8e 100644
--- a/web/Obj/brisk.phh
+++ b/web/Obj/brisk.phh
@@ -803,13 +803,13 @@ class Table {
if ($sitted < PLAYERS_N) {
switch ($this->auth_type) {
case TABLE_AUTH_TY_CERT:
- if ($user->flags & USER_FLAG_AUTH && $user->flags & USER_FLAG_TY_CERT)
+ if ($user->is_cert())
$act = "sitcert";
else
$act = 'resercert';
break;
case TABLE_AUTH_TY_AUTH:
- if ($user->flags & USER_FLAG_AUTH)
+ if ($user->is_auth())
$act = "sitreser";
else
$act = 'reserved';
@@ -1115,7 +1115,7 @@ class Brisk
}
// if authorized not check if banlisted
- if ($user_cur->flags & USER_FLAG_AUTH) {
+ if ($user_cur->is_auth()) {
continue;
}
@@ -1840,16 +1840,16 @@ class Brisk
}
}
else if (strcmp($msg, "/authreq") == 0) {
- if ($user->flags & USER_FLAG_AUTH) {
- $to_user = sprintf('authbox(300,200);');
- }
- else {
- /* MLANG: "Per autenticare qualcuno devi a tua volta essere autenticato.", "Il nickname deve contenere almeno una lettera dell\'alfabeto o una cifra.", "Nickname %s già in uso." */
- $to_user = sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_brisk['authmust'][$G_lang]);
- }
+ if ($user->is_cert()) {
+ $to_user = sprintf('authbox(300,200);');
+ }
+ else {
+ /* MLANG: "Per autenticare qualcuno devi a tua volta essere autenticato.", "Il nickname deve contenere almeno una lettera dell\'alfabeto o una cifra.", "Nickname %s già in uso." */
+ $to_user = sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_brisk['authmust'][$G_lang]);
+ }
}
else if (strncmp($msg, "/mesgtoadm", 8) == 0) {
- if ($user->flags & USER_FLAG_AUTH) {
+ if ($user->is_auth()) {
$to_user = sprintf('mesgtoadmbox(500,300);');
}
else {
@@ -1882,7 +1882,7 @@ class Brisk
}
/* MLANG: "Non puoi cambiare nick a un tavolo per soli autenticati.", "Il nickname \'%s\' è già registrato, se il suo proprietario si autentificherà verrai rinominato d\'ufficio come ghostN." */
- if ($user->flags & USER_FLAG_AUTH) {
+ if ($user->is_auth()) {
if (strcasecmp($user->name,$name_new) != 0) {
if (( ($user->flags & USER_FLAG_MAP_AUTH) != USER_FLAG_ISOLAUTH) &&
($user->subst == 'standup' ||
@@ -1902,7 +1902,7 @@ class Brisk
}
$user->name = $name_new; // OK - nick changed
/* se nome gia' in uso, segnala cosa potrebbe capitare */
- if (($user->flags & USER_FLAG_AUTH) == 0) {
+ if ( ! $user->is_auth() ) {
if (($bdb = BriskDB::create()) != FALSE) {
$bdb->users_load();
/* MLANG: "Il nickname \'%s\' è già registrato, se il suo proprietario si autentificherà verrai rinominato d\'ufficio come ghostN." */
@@ -2055,9 +2055,9 @@ class Brisk
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;
- }
+ if ( ! $user->is_auth() ) {
+ continue;
+ }
}
}
/*
@@ -2211,7 +2211,7 @@ class Brisk
if (strcasecmp($this->user[$i]->name, $name_new) == 0) {
if ($authenticate != FALSE) {
$ghost = $i;
- $ghost_auth = ($this->user[$i]->flags & USER_FLAG_AUTH);
+ $ghost_auth = $this->user[$i]->is_auth();
}
else {
$idx = $i;
@@ -3025,7 +3025,7 @@ function log_legal($curtime, $addr, $user, $where, $mesg)
if (($fp = @fopen(LEGAL_PATH."/legal.log", 'a')) != FALSE) {
/* Unix time | session | nickname | IP | where was | mesg */
fwrite($fp, sprintf("%ld|%s|%s|%s|%s|%s|%s|\n", $curtime, $user->sess,
- ($user->flags & USER_FLAG_AUTH ? 'A' : 'N'),
+ ($user->is_auth() ? 'A' : 'N'),
$user->name, $addr, $where , $mesg));
fclose($fp);
}