X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fbrisk.phh;h=4e765a1ecd784969b56e8176df4ae87ffeb2a29f;hb=8507128d38073666f0e778b16fb691a3bc9ef0e7;hp=b1e7e46e2dfda036b411f2bfdf1a43c7c3e6e11f;hpb=b8cdf67fa95fe158b8588e98d637fe0ffe654bb5;p=brisk.git
diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh
index b1e7e46..4e765a1 100644
--- a/web/Obj/brisk.phh
+++ b/web/Obj/brisk.phh
@@ -60,7 +60,7 @@ define('WAKEUP_TIME', 12);
// BAN_TIME da allineare anche in commons.js
define('BAN_TIME', 3600);
define('GARBAGE_TIMEOUT', 5);
-define('NICKSERV', "BriskServ");
+define('NICKSERV', "BriskServ");
define('LOCK_SHARE_MAX', 10000);
@@ -110,8 +110,8 @@ $mlang_brisk = array( 'btn_backstand'=> array( 'it' => 'torna in piedi',
'en' => '
The entered password is not correct.
'),
'alarret' => array( 'it' => '"Alarm \\"%s\\" inviato a %s."',
'en' => '"Alarm \\"%s\\" sent to %s."'),
- 'authmust' => array( 'it' => 'Per autenticare qualcuno devi a tua volta essere autenticato.',
- 'en' => 'To authenticate someone you have to be authenticated.'), // on your turn
+ 'authmust' => array( 'it' => 'Per autenticare qualcuno devi a tua volta essere autenticato e certificato.',
+ 'en' => 'To authenticate someone you have to be authenticated and certified.'), // on your turn
'mesgmust' => array( 'it' => 'Per inviare un messaggio devi essere autenticato.',
'en' => 'To send a message you have to be authenticated.'),
'nickmust' => array( 'it' => 'Il nickname deve contenere almeno una lettera dell\'alfabeto o una cifra.',
@@ -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);
}