From 8507128d38073666f0e778b16fb691a3bc9ef0e7 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Wed, 16 Jul 2014 19:23:44 +0200 Subject: [PATCH] new span.auX class management, new guaranty policy --- web/Obj/brisk.phh | 6 +++--- web/Obj/user.phh | 14 +++++++++++--- web/brisk.css | 36 +++++++++--------------------------- web/commons.js | 11 +++++++++-- web/index_wr.php | 8 ++++---- 5 files changed, 36 insertions(+), 39 deletions(-) diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 6ff2b8e..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.', diff --git a/web/Obj/user.phh b/web/Obj/user.phh index 5ef9d9c..96706b8 100644 --- a/web/Obj/user.phh +++ b/web/Obj/user.phh @@ -562,9 +562,17 @@ class User { // 4 -> is certified // 2 -> is authorized // 1 -> is myself - $class_id = (($this->flags & USER_FLAG_TY_CERT) >> 16) | ($this->flags & USER_FLAG_AUTH) | 1; - - return (sprintf('$("myname").innerHTML = "%s";', $class_id, + $class_ids = (($this->flags & USER_FLAG_TY_CERT) >> 16) | ($this->flags & USER_FLAG_AUTH) | 1; + $sp = ""; + $cl = ""; + + for ($i = 0 ; $i < 3 ; $i++) { + if ($class_ids & (1 << $i)) { + $cl .= sprintf("%sau%d", $sp, $i); + $sp = " "; + } + } + return (sprintf('$("myname").innerHTML = "%s";', $cl, xcape($this->name,ENT_COMPAT,"UTF-8"))); } diff --git a/web/brisk.css b/web/brisk.css index 1e247cf..f984cb0 100644 --- a/web/brisk.css +++ b/web/brisk.css @@ -1,7 +1,7 @@ /* * brisk - brisk.css * - * 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 @@ -247,37 +247,19 @@ img.button:hover { cursor: pointer; } -span.au1 { +span.au0 { font-weight: bold; } -span.au2 { - font-style: italic; - background-color: #bafcba; -} - -span.au3 { - font-weight: bold; +span.au1 { + padding-left: 2px; + padding-right: 4px; font-style: italic; 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; +span.au2 { + /* orange: background-color: #ffd780; */ + /* background-color: #e0ff00; */ + background-color: #8c7dfb; } diff --git a/web/commons.js b/web/commons.js index b95519b..09129c3 100644 --- a/web/commons.js +++ b/web/commons.js @@ -1026,11 +1026,18 @@ var CHATT_MAXLINES = 40; function user_decorator(user) { - var name; + var name, i, sp = "", cl = ""; var flags = user[0] & 0x03 | ((user[0] & 0x040000) >> 16); + for (i = 0 ; i < 3 ; i++) { + if (flags & (1 << i)) { + cl += sp + "au" + i; + sp = " "; + } + } + if (flags != 0) - name = ""+user[1]+""; + name = ""+user[1]+""; else name = user[1]; diff --git a/web/index_wr.php b/web/index_wr.php index d8cd409..4ababaa 100644 --- a/web/index_wr.php +++ b/web/index_wr.php @@ -32,8 +32,8 @@ $mlang_indwr = array( 'btn_backtotab' => array( 'it' => 'Torna ai tavoli.', 'en' => 'An error was occurred during the saving, try again or contact the administrator.'), 'coerrdb' => array( 'it' => 'Il database è temporaneamente irraggiungibile, riprova più tardi o contatta l\'amministratore.', 'en' => 'The database is temporarly unavailable, retry to later or conctact the administrator.'), - 'warrmust' => array( 'it' => 'Per autenticare qualcuno devi a tua volta essere autenticato.', - 'en' => 'To authenticate somebody you have to be authenticated in your turn'), + 'warrmust' => array( 'it' => 'Per autenticare qualcuno devi a tua volta essere autenticato e certificato.', + 'en' => 'To authenticate somebody you have to be authenticated and certified yourown'), 'mesgrepl' => array( 'it' => '

Il messaggio è stato inoltrato all\'amministratore.', 'en' => '

The message was forwarded to the administrator'), 'mesgmust' => array( 'it' => 'Per mandare messaggi all\'amministratore devi essere autenticato.', @@ -300,8 +300,8 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) $mesg_to_user = ""; - log_wr("INFO:SKIP:argz == warranty name: [".$cli_name."] AUTH: ".$user->is_auth()); - if ($user->is_auth()) { + log_wr("INFO:SKIP:argz == warranty name: [".$cli_name."] CERT: ".$user->is_cert()); + if ($user->is_cert()) { if (0 == 1) { if (($wa_lock = Warrant::lock_data(TRUE)) != FALSE) { if (($fp = @fopen(LEGAL_PATH."/warrant.txt", 'a')) != FALSE) { -- 2.17.1