{
return $this->disa_reas;
}
+ function disa_reas_set($disa_reas)
+ {
+ $this->disa_reas = $disa_reas;
+ }
}
return TRUE;
}
+ function user_state_update($code, $flags, $disa_reas)
+ {
+ GLOBAL $G_dbpfx;
+
+ $user_sql = sprintf("UPDATE %susers SET (type, disa_reas) = (%d, %d) WHERE code = %d;",
+ $G_dbpfx, $flags, $disa_reas, $code);
+ fprintf(STDERR, "REQUEST [%s]\n", $user_sql);
+ if ( ! (($user_pg = $this->query($user_sql)) != FALSE && pg_affected_rows($user_pg) == 1) ) {
+ return FALSE;
+ }
+ fprintf(STDERR, "REQUEST GOOD [%s]\n", $user_sql);
+
+ return TRUE;
+ }
+
function user_licence_update($code, $lice_vers)
{
GLOBAL $G_dbpfx;
GLOBAL $G_splash_w, $G_topbanner, $G_with_donors, $G_with_poll;
GLOBAL $G_with_sidebanner, $G_with_sidebanner2, $G_with_splash;
GLOBAL $G_with_topbanner;
+ GLOBAL $G_lice_vers, $G_lice_fname, $G_lice_dtsoft, $G_lice_dthard, $G_lice_idx;
if ($this->main_loop) {
return (FALSE);
define('USER_FLAG_TY_SUSPEND', 0x400000); // done
define('USER_FLAG_TY_DISABLE', 0x800000); // done
+// ... reasons for disabling account ...
define('USER_DIS_REA_INVMAIL', 1);
define('USER_DIS_REA_LICENCE', 2);
define('USER_DIS_REA_BANNED', 3);
{
$flags_old = $this->flags & (~$mask);
$this->flags = ($flags_old | ($flags & $mask));
+
+ return ($flags_old);
}
function prefs_store()
return ($bdb->user_licence_update($this->code, $this->rec->lice_vers_get()));
}
+ function state_store()
+ {
+ if (($bdb = BriskDB::create()) == FALSE) {
+ return FALSE;
+ }
+ return ($bdb->user_state_update($this->code, ($this->flags & (USER_FLAG_TY_ALL | USER_FLAG_MAP_AUTH)),
+ $this->rec->disa_reas_get()));
+ }
+
function rd_data_set($curtime, $transp, $enc, $stat, $subst, $step, $from)
{
$this->rd_endtime = $curtime + RD_ENDTIME_DELTA;
$f_type = $argz[1]; $f_code = $argz[2];
$f_lice_curr = $argz[3]; $f_lice_vers = $argz[4];
- $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
- $user->comm[$user->step % COMM_N] .= show_notify(xcape("FIN QUIZ |"."${argz[1]}"."|"."${argz[2]}"."|"."${argz[3]}"."|"."${argz[4]}"."|".$res), 0, $mlang_indwr['btn_backtotab'][$G_lang], 400, 200);
- log_wr($user->comm[$user->step % COMM_N]);
- $user->step_inc();
-
if ("$f_lice_curr" == $user->rec->lice_vers_get() &&
"$f_lice_vers" == "$G_lice_vers") {
if ("$f_type" == "soft" || "$f_type" == "hard") {
$res = $user->licence_store();
break;
case LICMGR_CHO_REFUSE:
+ $user->flags_set(USER_FLAG_TY_DISABLE, USER_FLAG_TY_ALL);
+ $user->rec->disa_reas_set(USER_DIS_REA_LICENCE);
+ $res = $user->state_store();
+
+ $user->comm[$user->step % COMM_N] = $user->blocking_error(TRUE);
+ $user->the_end = TRUE;
+ $user->step_inc();
break;
}
}