reduced log
[brisk.git] / web / index_wr.php
index c427c3d..dd2d9db 100644 (file)
@@ -131,7 +131,7 @@ define('LICMGR_CHO_AFTER',  2);
 
 function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
 {
-    GLOBAL $G_domain, $G_webbase, $G_mail_seed, $G_notguar_code;
+    GLOBAL $G_proto, $G_domain, $G_webbase, $G_mail_seed, $G_notguar_code;
     GLOBAL $G_shutdown, $G_alarm_passwd, $G_ban_list, $G_black_list, $G_lang, $G_room_help, $G_room_about;
     GLOBAL $G_room_passwdhowto, $mlang_indwr;
     GLOBAL $G_tos_vers;
@@ -166,7 +166,7 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
     $curtime = time();
     $dt = date("H:i ", $curtime);
 
-    if (($user = $brisk->get_user($sess, &$idx)) == FALSE) {
+    if (($user = $brisk->get_user($sess, $idx)) == FALSE) {
         $argz = explode('|', xcapemesg($mesg));
 
         if ($argz[0] == 'getchallenge') {
@@ -196,7 +196,7 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
                         echo '1|';
                     }
                     if ($chals->ismod()) {
-                        Challenges::save_data(&$chals);
+                        Challenges::save_data($chals);
                     }
                 }
 
@@ -289,8 +289,8 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
                 }
                 $hash = md5($curtime . $G_alarm_passwd . $cli_name . $cli_email);
 
-                $confirm_page = sprintf("http://%s/%s/mailmgr.php?f_act=checkmail&f_code=%d&f_hash=%s",
-                                        $G_domain, $G_webbase, $mail_code, $hash);
+                $confirm_page = sprintf("%s://%s/%s/mailmgr.php?f_act=checkmail&f_code=%d&f_hash=%s",
+                                        $G_proto, $G_domain, $G_webbase, $mail_code, $hash);
                 $subj = $mlang_indwr['nu_msubj'][$G_lang];
                 $body_txt = sprintf($mlang_indwr['ap_mtext'][$G_lang],
                                     $cli_name, $confirm_page);
@@ -322,7 +322,7 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
                 }
 
                 $bdb->transaction('COMMIT');
-                fprintf(STDERR, "REMOTE: %d\n", $remote_ip);
+                // fprintf(STDERR, "REMOTE: %d\n", $remote_ip);
                 echo "1";
                 return TRUE;
             } while(FALSE);
@@ -421,7 +421,7 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
         if ($user->subst == 'sitdown' || $user->stat == 'table')
             $brisk->room_wakeup($user);
         else if ($user->subst == 'standup')
-            $brisk->room_outstandup(&$user);
+            $brisk->room_outstandup($user);
         else {
             log_rd2("SHUTDOWN FROM WHAT ???");
         }
@@ -488,8 +488,8 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
                     }
                     $hash = md5($curtime . $G_alarm_passwd . $cli_name . $cli_email);
 
-                    $confirm_page = sprintf("http://%s/%s/mailmgr.php?f_act=checkmail&f_code=%d&f_hash=%s",
-                                            $G_domain, $G_webbase, $mail_code, $hash);
+                    $confirm_page = sprintf("%s://%s/%s/mailmgr.php?f_act=checkmail&f_code=%d&f_hash=%s",
+                                            $G_proto, $G_domain, $G_webbase, $mail_code, $hash);
                     $subj = $mlang_indwr['nu_msubj'][$G_lang];
                     $body_txt = sprintf($mlang_indwr['nu_mtext'][$G_lang],
                                         $user->name, $cli_name, $confirm_page);
@@ -767,7 +767,7 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
 
         }
         else if ($argz[0] == 'chatt') {
-            $brisk->chatt_send(&$user, xcapemesg($mesg), $mlang_indwr);
+            $brisk->chatt_send($user, xcapemesg($mesg), $mlang_indwr);
         }
         else if ($argz[0] == 'tosmgr') {
             // check IF is authnticated user, both terms of service versions matches
@@ -923,7 +923,9 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
                         $bin5_user_cur->trans_step = $user_cur->step + 1;
                         $bin5_user_cur->comm[$bin5_user_cur->step % COMM_N] = "";
                         $bin5_user_cur->step_inc();
-                        $bin5_user_cur->comm[$bin5_user_cur->step % COMM_N] = show_table(&$bin5,&$bin5_user_cur,$bin5_user_cur->step+1,TRUE,FALSE);
+                        $bin5_user_cur->comm[$bin5_user_cur->step % COMM_N] = show_table($bin5, $bin5_user_cur,
+                                                                                         $bin5_user_cur->step+1,
+                                                                                         TRUE, FALSE);
                         $bin5_user_cur->step_inc();
 
                         log_wr("TRY PRESAVE: ".$bin5_user_cur->step." TRANS STEP: ".$bin5_user_cur->trans_step);
@@ -954,16 +956,13 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
             }
             else if ($argz[0] == 'logout') {
                 $brisk->ghost_sess->push($curtime, $user->sess, GHOST_SESS_REAS_LOUT);
+
                 $user->the_end = TRUE;
+                $brisk->room_outstandup($user);
 
-                if ($user->subst == 'sitdown') {
-                    log_load("ROOM WAKEUP");
-                    $brisk->room_wakeup($user);
-                }
-                else if ($user->subst == 'standup')
-                    $brisk->room_outstandup($user);
-                else
-                    log_rd2("LOGOUT FROM WHAT ???");
+                $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
+                $user->comm[$user->step % COMM_N] .=  sprintf('gst.st_loc++; xstm.stop(); window.onbeforeunload = null; window.onunload = null; document.location.assign("index.php");');
+                $user->step_inc();
             }
         }
         /**********************
@@ -982,9 +981,13 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
             }
             else if ($argz[0] == 'logout') {
                 $brisk->ghost_sess->push($curtime, $user->sess, GHOST_SESS_REAS_LOUT);
-                $user->the_end = TRUE;
 
+                $user->the_end = TRUE;
                 $brisk->room_wakeup($user);
+
+                $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
+                $user->comm[$user->step % COMM_N] .=  sprintf('gst.st_loc++; xstm.stop(); window.onbeforeunload = null; window.onunload = null; document.location.assign("index.php");');
+                $user->step_inc();
             }
         }
     }