version updated to 5.4.2
[brisk.git] / web / Obj / brisk.phh
index 0ed2eae..42e4bd1 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.2.0";
+$G_brisk_version = "5.4.2";
 
 /* MLANG: ALL THE INFO STRINGS IN brisk.phh */
-$root_wellarr = array( 'it' => array ( '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 ci sono i nuovi tavoli riservati per registrati e apprendisti.',
+$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NOVITA\'</b>: uscita piĆ¹ veloce dal sito.',
                                        '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.',
@@ -1226,10 +1226,15 @@ class Brisk
 
     function users_cleanup()
     {
+        $curtime = time();
         for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
             $user_cur = $this->user[$i];
 
-            if ($user_cur->the_end) {
+            if ($user_cur->the_end
+                && (($user_cur->rd_toflush == FALSE
+                     && $user_cur->rd_step == $user_cur->step)
+                    || $user_cur->rd_endtime_is_expired($curtime))
+                ) {
                 $user_cur->reset(); // users_cleanup, OK
             }
         }
@@ -1923,7 +1928,7 @@ class Brisk
       return ($this->kickuser($user_out, $out_reas));
   }
 
-  function chatt_send($user, $mesg)
+  function chatt_send($user, $mesg, $mlang_indwr = NULL)
   {
     GLOBAL $G_base, $G_alarm_passwd, $mlang_brisk, $G_lang;
     $only_you = FALSE;
@@ -2137,9 +2142,20 @@ class Brisk
       } while (0);
     } // nick chat command
     else if (strncmp($msg, "/info ", 6) == 0) {
-        $info_user = substr($msg, 6);
+        do {
+            if (! $user->is_auth()) {
+                if ($mlang_indwr) {
+                    $to_user = nickserv_msg($dt, $mlang_indwr['info_auth'][$G_lang]);
+                }
+                else {
+                    $to_user = nickserv_msg($dt, "error");
+                }
+                break;
+            }
+            $info_user = substr($msg, 6);
 
-        echo $this->info_show($user, urldecode($info_user), $dt);
+            echo $this->info_show($user, urldecode($info_user), $dt);
+        } while(0);
     }
     else if (strncmp($msg, "/st ", 4) == 0) {
       log_main("chatt_send BEGIN");
@@ -2422,7 +2438,7 @@ class Brisk
         $bdb->users_load();
         if ($pass != FALSE) { // TODO: here add a method to $bdb to check if the db is available.
             log_auth("XXX", "auth2");
-            $authenticate = $bdb->login_verify(strtolower($name_new), $pass, $code);
+            $authenticate = $bdb->login_verify($name_new, $pass, $code);
             log_auth("XXX", "authenticate: ".($authenticate != FALSE ? "TRUE" : "FALSE"));
 
             if ($authenticate != FALSE) {