X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Findex_wr.php;h=002a76e73c5f2a1b621341ec153b8ec11eab8a17;hb=ef2da0157f1a97800360df93b89d3c234d3e04c5;hp=eb014101fe83cb34c6fb127b8e80074797131eeb;hpb=a0b24745843fc7bad6f8291ef6f660e255af7825;p=brisk.git
diff --git a/web/index_wr.php b/web/index_wr.php
index eb01410..002a76e 100644
--- a/web/index_wr.php
+++ b/web/index_wr.php
@@ -120,6 +120,8 @@ Ciò è necessario per ottenere la password.
Saluti e buone partite, mop.
',
'en' => 'EN mhtml [%s] [%s]'),
'info_err' => array( 'it' => 'E\' occorso un errore (%d), riprova più tardi.',
+ 'en' => 'Some error occurs (%d), retry later.'),
+ 'info_auth' => array('it' => 'Non essendo autenticato non puoi costruire una rete di preferenze.',
'en' => 'Some error occurs (%d), retry later.')
);
@@ -164,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') {
@@ -194,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);
}
}
@@ -359,16 +361,22 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
log_wr("PING RECEIVED");
}
else if ($argz[0] == 'info') {
- if ($argz[1] == 'save') {
- if (!isset($post['info'])) {
+ if ($user->is_auth()) {
+ if ($argz[1] == 'save') {
+ if (!isset($post['info'])) {
+ return FALSE;
+ }
+ if (($ret = $brisk->info_save($user, $post['info'])) == 0) {
+ echo "1";
+ return TRUE;
+ }
+
+ printf($mlang_indwr['info_err'][$G_lang], $ret);
return FALSE;
}
- if (($ret = $brisk->info_save($user, $post['info'])) == 0) {
- echo "1";
- return TRUE;
- }
-
- printf($mlang_indwr['info_err'][$G_lang], $ret);
+ }
+ else {
+ printf($mlang_indwr['info_auth'][$G_lang]);
return FALSE;
}
}
@@ -413,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 ???");
}
@@ -759,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));
+ $brisk->chatt_send($user, xcapemesg($mesg), $mlang_indwr);
}
else if ($argz[0] == 'tosmgr') {
// check IF is authnticated user, both terms of service versions matches
@@ -915,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);
@@ -946,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();
}
}
/**********************
@@ -974,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();
}
}
}