From f4178d38662a52ae2ccc8957e499621e735f4d16 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Wed, 27 Nov 2013 18:38:05 +0100 Subject: [PATCH] disa_reas field added to users table --- TODO.txt | 2 +- sql/sql.d/062-guar-policy-expire.sql | 5 +++++ web/Obj/dbase_base.phh | 11 +++++++++-- web/Obj/user.phh | 4 ++++ 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/TODO.txt b/TODO.txt index e67c498..89f5a7c 100644 --- a/TODO.txt +++ b/TODO.txt @@ -10,7 +10,7 @@ DONE . show licence ([show me later, yes, no]/[yes, no]) DONE . switch-off date . checkbox for anonimous users with message when not checked - . disable user reason field + . disable user reason integer field and remove SUSPEND state (db, php) . opt - button on when arrived to the bottom of the licence . opt - download licence . min - check licence version between config file and licence file diff --git a/sql/sql.d/062-guar-policy-expire.sql b/sql/sql.d/062-guar-policy-expire.sql index 76d568c..72a2449 100644 --- a/sql/sql.d/062-guar-policy-expire.sql +++ b/sql/sql.d/062-guar-policy-expire.sql @@ -1,3 +1,8 @@ -- add current licence version accepted by users ALTER TABLE #PFX#users DROP COLUMN lice_vers; ALTER TABLE #PFX#users ADD COLUMN lice_vers text DEFAULT ''; -- current accepted licence version + +-- add reason field for disabled users +ALTER TABLE #PFX#users DROP COLUMN disa_reas; +ALTER TABLE #PFX#users ADD COLUMN disa_reas integer DEFAULT 0; -- current disable reason + diff --git a/web/Obj/dbase_base.phh b/web/Obj/dbase_base.phh index d8bc1d7..2464f81 100644 --- a/web/Obj/dbase_base.phh +++ b/web/Obj/dbase_base.phh @@ -32,8 +32,9 @@ class LoginDBItem { var $last_dona; var $supp_comp; var $lice_vers; + var $disa_reas; - function LoginDBItem($code, $login, $pass, $email, $type, $last_dona, $supp_comp, $lice_vers) + function LoginDBItem($code, $login, $pass, $email, $type, $last_dona, $supp_comp, $lice_vers, $disa_reas) { $this->code = $code; $this->login = $login; @@ -43,13 +44,14 @@ class LoginDBItem { $this->last_dona = $last_dona; $this->supp_comp = $supp_comp; $this->lice_vers = $lice_vers; + $this->disa_reas = $disa_reas; } static function LoginDBItemFromRecord($rec) { $ret = new LoginDBItem($rec->code, $rec->login, $rec->pass, $rec->email, $rec->type, $rec->last_dona, - $rec->supp_comp, $ret->lice_vers); + $rec->supp_comp, $rec->lice_vers, $rec->disa_reas); return ($ret); } @@ -94,6 +96,11 @@ class LoginDBItem { return $this->lice_vers; } + function disa_reas_get() + { + return $this->disa_reas; + } + } ?> \ No newline at end of file diff --git a/web/Obj/user.phh b/web/Obj/user.phh index 8ffeee8..80d3ce9 100644 --- a/web/Obj/user.phh +++ b/web/Obj/user.phh @@ -63,6 +63,10 @@ define('USER_FLAG_TY_FIRONLY', 0x200000); // done define('USER_FLAG_TY_SUSPEND', 0x400000); // done define('USER_FLAG_TY_DISABLE', 0x800000); // done +define('USER_DIS_REA_INVMAIL', 1); +define('USER_DIS_REA_LICENCE', 2); +define('USER_DIS_REA_BANNED', 3); + // 240 is the right value, 600 is for fwrite error test define('RD_ENDTIME_DELTA', 240); define('RD_KEEPALIVE_TOUT', 4); -- 2.17.1