manage refuse answer to licence manager
[brisk.git] / web / Obj / user.phh
index 8ae6b32..69842e8 100644 (file)
@@ -63,6 +63,7 @@ define('USER_FLAG_TY_FIRONLY', 0x200000); // done
 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);
@@ -314,9 +315,11 @@ class User {
   {
       $flags_old = $this->flags & (~$mask);
       $this->flags = ($flags_old | ($flags & $mask));
+
+      return ($flags_old);
   }
 
-  function store_set()
+  function prefs_store()
   {
       if (($bdb = BriskDB::create()) == FALSE) {
           return FALSE;
@@ -325,6 +328,23 @@ class User {
                                       $this->rec->supp_comp_get()));
   }
 
+  function licence_store()
+  {
+      if (($bdb = BriskDB::create()) == FALSE) {
+          return FALSE;
+      }
+      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;
@@ -597,7 +617,7 @@ class User {
                               // call notify soft
                               $ret .=  show_notify_document("Versione corrente: [".$this->rec->lice_vers_get()."] Versione sito: ".$G_lice_vers,
                                        0, array("Accetto.", "Rifiuto.", "Leggo poi.",  /* , "Scarico." */),
-                                       400, 600, TRUE, 0);
+                                       "lice_confirm", 600, 600, TRUE, 0);
                               $ret .= sprintf("act_licencemgr('soft', g_nd.ret_get(), '%s', '%s');", 
                                               xcape($this->rec->lice_vers_get()), xcape($G_lice_vers));
                           }
@@ -605,7 +625,7 @@ class User {
                               // call notify hard
                               $ret .=  show_notify_document("Versione corrente: [".$this->rec->lice_vers_get()."] Versione sito: ".$G_lice_vers,
                                        0, array("Accetto.", "Rifiuto." /* , "Scarico." */),
-                                       400, 600, TRUE, 0);
+                                       "lice_confirm", 600, 600, TRUE, 0);
                               $ret .= sprintf("act_licencemgr('hard', g_nd.ret_get(), '%s', '%s');", 
                                               xcape($this->rec->lice_vers_get()), xcape($G_lice_vers));
                           }