X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Findex_wr.php;h=b0c9ac025aff849d0dabf97195f88fcc58971ee4;hb=7f9618888f9963c4a7daebeb9e3d14ef0a56b968;hp=1d0b61ef9a3ef11ef9e3243a4be65354490cfc1c;hpb=e941e33787f5686885b88070a68005aa1eab5273;p=brisk.git diff --git a/web/index_wr.php b/web/index_wr.php index 1d0b61e..b0c9ac0 100644 --- a/web/index_wr.php +++ b/web/index_wr.php @@ -125,7 +125,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; + GLOBAL $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; @@ -239,8 +239,10 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) // check existence of username or email $is_trans = FALSE; do { - if (($bdb = BriskDB::create()) == FALSE) + if (($bdb = BriskDB::create()) == FALSE) { + $mesg_to_user = "Connessione al database fallita"; break; + } // check IP address as previous requirer if ($bdb->selfreg_check($remote_ip) == FALSE) { @@ -265,13 +267,15 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) // FIXME: move 'no-guaran' user into configuration file if (($usr_obj = $bdb->user_add($cli_name, 'THE_PASS', $cli_email, USER_FLAG_TY_DISABLE | USER_FLAG_TY_APPR, - USER_DIS_REA_NU_MAILED, 10103)) == FALSE) { + USER_DIS_REA_NU_MAILED, $G_notguar_code)) == FALSE) { fprintf(STDERR, "ERROR: user_add FAILED\n"); + $mesg_to_user = "Fallito inserimento nel database."; break; } if (($mail_code = $bdb->mail_reserve_code()) == FALSE) { fprintf(STDERR, "ERROR: mail reserve code FAILED\n"); + $mesg_to_user = "Fallita creazione codice email."; break; } $hash = md5($curtime . $G_alarm_passwd . $cli_name . $cli_email); @@ -291,6 +295,7 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) if ($mail_item->store($bdb) == FALSE) { // store mail error fprintf(STDERR, "ERROR: store mail FAILED\n"); + $mesg_to_user = "Fallita procedura di store."; break; } @@ -303,6 +308,7 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) if (brisk_mail($cli_email, $subj, $body_txt, $body_htm) == FALSE) { // mail error fprintf(STDERR, "ERROR: mail send FAILED\n"); + $mesg_to_user = "Fallito invio email."; break; } @@ -311,7 +317,8 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) echo "1"; return TRUE; } while(FALSE); - $bdb->transaction('ROLLBACK'); + if ($is_trans) + $bdb->transaction('ROLLBACK'); echo "$mesg_to_user"; return FALSE; } @@ -586,7 +593,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"); @@ -796,10 +803,12 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) $not_allowed_msg = nickserv_msg($dt, sprintf($mlang_indwr['tabwait'][$G_lang], $table->wakeup_time - $curtime)); } - else if ($table->auth_type == TABLE_AUTH_TY_CERT && ( ! $user->is_cert() ) ) { + else if ( $table->auth_type == TABLE_AUTH_TY_CERT && + (!$user->is_cert() || $user->is_appr()) ) { $not_allowed_msg = nickserv_msg($dt, $mlang_indwr['mustcert'][$G_lang]); } - else if ($table->auth_type == TABLE_AUTH_TY_AUTH && ( ! $user->is_auth() ) ) { + else if ( $table->auth_type == TABLE_AUTH_TY_AUTH && + (!$user->is_auth() || $user->is_appr()) ) { $not_allowed_msg = nickserv_msg($dt, $mlang_indwr['mustauth'][$G_lang]); } else if ($user->flags & USER_FLAG_TY_FIRONLY && $table->player_n > 0) {