X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Findex_wr.php;h=fe7a798f23d61a0da5c55352a91f5dbac100873f;hb=refs%2Fheads%2Fmoder;hp=5b05c6883d5752fca768b7d5e36eddc70435ef12;hpb=f8ae81cef2871be97c5466319efbafb23599baac;p=brisk.git diff --git a/web/index_wr.php b/web/index_wr.php index 5b05c68..fe7a798 100644 --- a/web/index_wr.php +++ b/web/index_wr.php @@ -280,13 +280,13 @@ function index_wr_main(&$room, $remote_addr_full, $get, $post, $cookie) } else { /* MLANG: "E\' occorso un errore durante il salvataggio, riprova o contatta l\'amministratore." */ - $mesg_to_user = sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['commerr'][$G_lang]); + $mesg_to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['commerr'][$G_lang]); } } else { /* MLANG: "Per autenticare qualcuno devi a tua volta essere autenticato." */ - $mesg_to_user = sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['warrmust'][$G_lang]); + $mesg_to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['warrmust'][$G_lang]); } if ($mesg_to_user != "") { @@ -333,19 +333,19 @@ function index_wr_main(&$room, $remote_addr_full, $get, $post, $cookie) } else { /* MLANG: "Il database è temporaneamente irraggiungibile, riprova più tardi o contatta l\'amministratore." */ - $mesg_to_user = sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['coerrdb'][$G_lang]); + $mesg_to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['coerrdb'][$G_lang]); $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; "; } } else { /* MLANG: "E\' occorso un errore durante il salvataggio, riprova o contatta l\'amministratore." */ - $mesg_to_user = sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['commerr'][$G_lang]); + $mesg_to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['commerr'][$G_lang]); } } else { /* MLANG: "Per autenticare qualcuno devi a tua volta essere autenticato." */ - $mesg_to_user = sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['mesgmust'][$G_lang]); + $mesg_to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['mesgmust'][$G_lang]); } if ($mesg_to_user != "") { @@ -355,9 +355,6 @@ function index_wr_main(&$room, $remote_addr_full, $get, $post, $cookie) $user->step_inc(); } } - - - else if ($argz[0] == 'poll') { GLOBAL $G_with_poll, $G_poll_name; if (($cli_choose = gpcs_var('cli_choose', $get, $post, $cookie)) === FALSE) @@ -389,7 +386,7 @@ function index_wr_main(&$room, $remote_addr_full, $get, $post, $cookie) log_wr("INFO:SKIP:argz == poll name: [".$cli_poll_name."] AUTH: ".($user->flags & USER_FLAG_AUTH)); if (($user->flags & USER_FLAG_AUTH) != USER_FLAG_AUTH) { // MLANG: Per partecipare al sondaggio devi essere autenticato. - $mesg_to_user = sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['pollmust'][$G_lang]); + $mesg_to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['pollmust'][$G_lang]); log_wr("break1"); break; } @@ -408,7 +405,7 @@ function index_wr_main(&$room, $remote_addr_full, $get, $post, $cookie) if (($poll_lock = Poll::lock_data(TRUE)) == FALSE) { /* MLANG: "E\' occorso un errore durante il salvataggio, riprova o contatta l\'amministratore." */ - $mesg_to_user = sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['commerr'][$G_lang]); + $mesg_to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['commerr'][$G_lang]); log_wr("break3"); break; } @@ -417,7 +414,7 @@ function index_wr_main(&$room, $remote_addr_full, $get, $post, $cookie) $fp = @fopen(LEGAL_PATH."/".$G_poll_name.".txt", 'w+'); if ($fp == FALSE) { - $mesg_to_user = sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['commerr'][$G_lang]); + $mesg_to_user = sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['commerr'][$G_lang]); log_wr("break4"); break; } @@ -470,7 +467,24 @@ function index_wr_main(&$room, $remote_addr_full, $get, $post, $cookie) echo "$echont"; } - + else if ($argz[0] == 'moderate') { + // TODO: add certification check + if (1 == 1) { + if ($user->flags_vlt_get(USER_FLAG_MODER) == 0 && $argz[1] == 'true') { + /* enable moderation */ + $moder_enable = 'true'; + $user->flags_vlt_set(USER_FLAG_MODER, USER_FLAG_MODER); + } + else { + /* disable moderation */ + $moder_enable = 'false'; + $user->flags_vlt_set(0, USER_FLAG_MODER); + } + $user->comm[$user->step % COMM_N] = sprintf("gst.st = %d; moderate(%s);", + $user->step+1, $moder_enable); + $user->step_inc(); + } + } /****************** * * * STAT: room * @@ -573,13 +587,13 @@ function index_wr_main(&$room, $remote_addr_full, $get, $post, $cookie) /* MLANG: "Il server sta per essere riavviato, non possono avere inizio nuove partite.", "Il tavolo a cui volevi sederti richiede autentifica.", "Il tavolo si è appena liberato, ci si potrà sedere tra %d secondi." */ if ($G_shutdown) { - $user->comm[$user->step % COMM_N] .= sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['shutmsg'][$G_lang]); + $user->comm[$user->step % COMM_N] .= sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['shutmsg'][$G_lang]); } else if ($table->auth_only && (($user->flags & USER_FLAG_AUTH) == 0)) { - $user->comm[$user->step % COMM_N] .= sprintf('chatt_sub("%s", [2, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['mustauth'][$G_lang]); + $user->comm[$user->step % COMM_N] .= sprintf('chatt_sub("%s", [2, 0, "%s"],"%s");', $dt, NICKSERV, $mlang_indwr['mustauth'][$G_lang]); } else { - $user->comm[$user->step % COMM_N] .= sprintf('chatt_sub("%s", [2, "%s"],"%s%d%s");', $dt, NICKSERV, $mlang_indwr['tabwait_a'][$G_lang], $table->wakeup_time - $curtime, $mlang_indwr['tabwait_b'][$G_lang]); + $user->comm[$user->step % COMM_N] .= sprintf('chatt_sub("%s", [2, 0, "%s"],"%s%d%s");', $dt, NICKSERV, $mlang_indwr['tabwait_a'][$G_lang], $table->wakeup_time - $curtime, $mlang_indwr['tabwait_b'][$G_lang]); } $user->step_inc(); return TRUE;