log_legal function usable without a valid user instance as parameter
[brisk.git] / web / Obj / brisk.phh
index 68e0418..4be9c87 100644 (file)
@@ -153,10 +153,10 @@ $mlang_brisk = array( 'btn_backstand'=> array( 'it' => 'torna in piedi',
 $G_lng = langtolng($G_lang);
 
 $G_all_points = array( 11,10,4,3,2, 0,0,0,0,0 );
-$G_brisk_version = "5.5.0";
+$G_brisk_version = "5.7.0";
 
 /* MLANG: ALL THE INFO STRINGS IN brisk.phh */
-$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NOVITA\'</b>: uscita piĆ¹ veloce dal sito.',
+$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NOVITA\'</b>: dati dai client via web-socket.',
                                        'Se vuoi iscriverti alla <a target="_blank" href="mailto:ml-briscola+subscribe@milug.org">Mailing List</a>, cliccala!' ),
                        'en' => array ( 'EN Brisk (Ver. '.$G_brisk_version.'), <b>NOVITA\'</b>: puoi creare la tua rete di amicizie con /info,',
                                        'vedere cosa pensano i tuoi amici degli altri utenti e tavoli riservati per registrati e apprendisti.',
@@ -1373,7 +1373,7 @@ class Brisk
         if ($user_cur->is_active() == FALSE)
             continue;
 
-        if ($user_cur->lacc + EXPIRE_TIME_RD < ($curtime - $delta)) {
+        if ($user_cur->lacc + (($user_cur->ping_req ? 1.5 : 1.0) * EXPIRE_TIME_RD) < ($curtime - $delta)) {
             // Auto logout dell'utente
             log_rd2("AUTO LOGOUT.".($user_cur->lacc + EXPIRE_TIME_RD)." curtime - delta ".($curtime - $delta));
 
@@ -2451,6 +2451,14 @@ class Brisk
         }
         else {
             $login_exists =  $bdb->login_exists(strtolower($name_new));
+/*
+TO ENABLE USER-LOGIN ONLY
+-            $login_exists =  $bdb->login_exists(strtolower($name_new));
++            // $login_exists =  $bdb->login_exists(strtolower($name_new));
++            // Force access with login and password
++            $idx = -3;
++            return (FALSE);
+*/
         }
     }
     else {
@@ -3346,9 +3354,9 @@ 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->is_auth() ? 'A' : 'N'),
-                        $user->name, $addr, $where , $mesg));
+    fwrite($fp, sprintf("%ld|%s|%s|%s|%s|%s|%s|\n", $curtime, ($user ? $user->sess : "NOSESS"),
+                        ($user ? ($user->is_auth() ? 'A' : 'N') : "U"),
+                        ($user ? $user->name : "NO-USER"), $addr, $where , $mesg));
     fclose($fp);
   }
 }