X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Findex_wr.php;h=ea88b0f690a97e589e0ce8c276a11426b6fda5f7;hb=e2d1e08df1bfffaeda9487b60a0d13aafbedde57;hp=b7d633986b9770b052629f5c4d2934d0896bbd62;hpb=00e036a391ee5514ceb66828a83ec2b2def5e0dc;p=brisk.git
diff --git a/web/index_wr.php b/web/index_wr.php
index b7d6339..ea88b0f 100644
--- a/web/index_wr.php
+++ b/web/index_wr.php
@@ -42,6 +42,8 @@ $mlang_indwr = array( 'unknownerr' => array( 'it' => 'errore sconosciuto',
'en' => 'To send a message to the administrator you have to be authenticated'),
'shutmsg' => array( 'it' => 'Il server sta per essere riavviato, non possono avere inizio nuove partite.',
'en' => 'The server is going to be rebooted, new games are not allowed.'),
+ 'mustappr' => array( 'it' => 'Il tavolo a cui volevi sederti richiede autentifica o apprendistato.',
+ 'en' => 'The table where you want to sit require authentication or apprentice'),
'mustauth' => array( 'it' => 'Il tavolo a cui volevi sederti richiede autentifica.',
'en' => 'The table where you want to sit require authentication'),
'mustcert' => array( 'it' => 'Il tavolo a cui volevi sederti richiede autentifica e certificazione.',
@@ -117,6 +119,8 @@ Ti sei registrato col nickname \'%s\',
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.')
);
define('LICMGR_CHO_ACCEPT', 0);
@@ -351,6 +355,20 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
if ($argz[0] == 'ping') {
log_wr("PING RECEIVED");
}
+ else if ($argz[0] == 'info') {
+ 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;
+ }
+ }
else if ($argz[0] == 'prefs') {
if ($argz[1] == 'save') {
if (!isset($post['prefs'])) {
@@ -412,7 +430,7 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
if (($wa_lock = Warrant::lock_data(TRUE)) != FALSE) {
if (($fp = @fopen(LEGAL_PATH."/warrant.txt", 'a')) != FALSE) {
/* Unix time | session | nickname | IP | where was | mesg */
- fwrite($fp, sprintf("%ld|%s|%s|%s|\n", $curtime, xcapelt($user->name), xcapelt(urldecode($cli_name)), xcapelt(urldecode($cli_email))));
+ fwrite($fp, sprintf("%ld|%s|%s|%s|\n", $curtime, xcapelt($user->name), xcapelt(trim(urldecode($cli_name))), xcapelt(trim(urldecode($cli_email)))));
fclose($fp);
}
Warrant::unlock_data($wa_lock);
@@ -434,8 +452,8 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
if (($bdb = BriskDB::create()) == FALSE)
break;
- $cli_name = urldecode($cli_name);
- $cli_email = urldecode($cli_email);
+ $cli_name = trim(urldecode($cli_name));
+ $cli_email = trim(urldecode($cli_email));
// check for already used fields
if (($idret = $bdb->check_record_by_login_or_email($cli_name, $cli_email)) != 0) {
@@ -593,7 +611,7 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
$dobreak = FALSE;
do {
log_wr("INFO:SKIP:argz == poll name: [".$cli_poll_name."] AUTH: ".$user->is_auth());
- if ( ! $user->is_auth() ) {
+ if ( ! $user->is_auth() || $user->is_appr() ) {
// MLANG: Per partecipare al sondaggio devi essere autenticato.
$mesg_to_user = nickserv_msg($dt, $mlang_indwr['pollmust'][$G_lang]);
log_wr("break1");
@@ -811,6 +829,10 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
(!$user->is_auth() || $user->is_appr()) ) {
$not_allowed_msg = nickserv_msg($dt, $mlang_indwr['mustauth'][$G_lang]);
}
+ else if ( $table->auth_type == TABLE_AUTH_TY_APPR &&
+ (!$user->is_auth()) ) {
+ $not_allowed_msg = nickserv_msg($dt, $mlang_indwr['mustappr'][$G_lang]);
+ }
else if ($user->flags & USER_FLAG_TY_FIRONLY && $table->player_n > 0) {
$not_allowed_msg = nickserv_msg($dt, $mlang_indwr['mustfirst'][$G_lang]);
}