]> mop.ddnsfree.com - git repositories - brisk.git/commitdiff
lexical adjustment, all licence occurrencies are replaced wit tos word
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Wed, 4 Dec 2013 06:41:33 +0000 (07:41 +0100)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Wed, 4 Dec 2013 06:41:33 +0000 (07:41 +0100)
TODO.txt
sql/sql.d/062-guar-policy-expire.sql
web/Obj/brisk.conf-templ.pho
web/Obj/dbase_base.phh
web/Obj/dbase_pgsql.phh
web/Obj/doc/terms-of-service_V1.1_it.txt [moved from web/Obj/doc/terms-of-use_V1.1_it.txt with 100% similarity]
web/Obj/sac-a-push.phh
web/Obj/user.phh
web/commons.js
web/index_wr.php

index 2bfef1f82cc7b8b5ae650a3dce2c367272a1239a..128598c1252cfc51fc27931769699d2548aa1be9 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -4,19 +4,19 @@
   FEATURES |
  ----------+
    - AUTO-MAINTENANCE
-     . policy acceptance
-       DONE . policy version
-       DONE . user policy acceptance (db field)
-       DONE . show licence ([show me later, yes, no]/[yes, no])
+     . Terms Of Service acceptance
+       DONE . TOS version
+       DONE . user TOS acceptance (db field)
+       DONE . show TOS ([show me later, yes, no]/[yes, no])
        DONE . switch-off date
        DONE . manage accept
        DONE . manage refuse
-       DONE . show current licence
+       DONE . show current TOS
        . WIP disable user reason integer field and remove SUSPEND state (db, php)
        . checkbox for anonimous users with message when not checked
-       . opt - button on when arrived to the bottom of the licence
-       . opt - download licence
-       . min - check licence version between config file and licence file
+       . opt - button on when arrived to the bottom of the TOS
+       . opt - download TOS
+       . min - check TOS version between config file and TOS file
      . show guaranteer
 
      . email validation
index 72a2449bc5c162093d790c4c5af361c8c3ce3318..d7e22b50be34f0efd5503c9bb9e251b151ae4f68 100644 (file)
@@ -1,6 +1,6 @@
--- 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 current terms of service version accepted by users
+ALTER TABLE #PFX#users DROP COLUMN tos_vers;
+ALTER TABLE #PFX#users ADD COLUMN tos_vers text DEFAULT '';  -- current accepted terms of service version
 
 -- add reason field for disabled users
 ALTER TABLE #PFX#users DROP COLUMN disa_reas;
index 19d99c84919bcfe729e9af833ba603dc4dd8b9a1..78e4fbb71b9942778b2877ad4327f05be239adf0 100644 (file)
@@ -85,10 +85,10 @@ $G_black_list = array();
 $G_btrace_pref_sub = "/home/nastasi/web/";
 
 // licence related stuff
-$G_lice_vers  = "2.0";
-$G_lice_fname = "Obj/doc/terms-of-use_%s_%s.txt";
+$G_tos_vers  = "2.0";
+$G_tos_fname = "Obj/doc/terms-of-service_%s_%s.txt";
 // USE date +%s -d 'Wed Nov 20 18:35:41 CET 2013' to calculate
-$G_lice_dthard = 1384968941;
-$G_lice_dtsoft = 1384968941;
-$G_lice_idx    = 1;
+$G_tos_dthard = 1384968941;
+$G_tos_dtsoft = 1384968941;
+$G_tos_idx    = 1;
 ?>
index 938a277841d570fee7e4e08a488688b77e0ffaf5..d0ca39aaeba3b5942b53139c52f47f0766d9422c 100644 (file)
@@ -31,10 +31,10 @@ class LoginDBItem {
     var $type;
     var $last_dona;
     var $supp_comp;
-    var $lice_vers;
+    var $tos_vers;
     var $disa_reas;
 
-    function LoginDBItem($code, $login, $pass, $email, $type, $last_dona, $supp_comp, $lice_vers, $disa_reas)
+    function LoginDBItem($code, $login, $pass, $email, $type, $last_dona, $supp_comp, $tos_vers, $disa_reas)
     {
         $this->code      = $code;
         $this->login     = $login;
@@ -43,7 +43,7 @@ class LoginDBItem {
         $this->type      = $type;
         $this->last_dona = $last_dona;
         $this->supp_comp = $supp_comp;
-        $this->lice_vers = $lice_vers;
+        $this->tos_vers  = $tos_vers;
         $this->disa_reas = $disa_reas;
     }
 
@@ -51,7 +51,7 @@ class LoginDBItem {
     {
         $ret = new LoginDBItem($rec->code, $rec->login, $rec->pass, 
                                $rec->email, $rec->type, $rec->last_dona,
-                               $rec->supp_comp, $rec->lice_vers, $rec->disa_reas);
+                               $rec->supp_comp, $rec->tos_vers, $rec->disa_reas);
 
         return ($ret);
     }
@@ -95,13 +95,13 @@ class LoginDBItem {
         $this->supp_comp = $supp_comp;
     }
 
-    function lice_vers_get()
+    function tos_vers_get()
     {
-        return $this->lice_vers;
+        return $this->tos_vers;
     }
-    function lice_vers_set($lice_vers)
+    function tos_vers_set($tos_vers)
     {
-        $this->lice_vers = $lice_vers;
+        $this->tos_vers = $tos_vers;
     }
 
     function disa_reas_get()
index d923fb9190695bedce8efaa0c95b3148b9eff2d6..e7444255819cb1267ec354400ff35e39ca774fcf 100644 (file)
@@ -200,12 +200,12 @@ class BriskDB
         return TRUE;
     }
 
-    function user_licence_update($code, $lice_vers)
+    function user_tos_update($code, $tos_vers)
     {
         GLOBAL $G_dbpfx;
 
-        $user_sql = sprintf("UPDATE %susers SET (lice_vers) = ('%s') WHERE code = %d;",
-                            $G_dbpfx, escsql($lice_vers), $code);
+        $user_sql = sprintf("UPDATE %susers SET (tos_vers) = ('%s') WHERE code = %d;",
+                            $G_dbpfx, escsql($toss_vers), $code);
         fprintf(STDERR, "REQUEST [%s]\n", $user_sql);
         if ( ! (($user_pg  = $this->query($user_sql)) != FALSE && pg_affected_rows($user_pg) == 1) ) {
              return FALSE;
index b2efb6107e6b2aea58264bd7e45788eddbe3074b..08ced763c554d777661203e5c820e01a09cb7473 100644 (file)
@@ -611,7 +611,7 @@ class Sac_a_push {
         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;
+        GLOBAL $G_tos_vers, $G_tos_fname, $G_tos_dtsoft, $G_tos_dthard, $G_tos_idx;
 
         if ($this->main_loop) {
             return (FALSE);
index 9554cc0a0d04101ab350dae3e73a18a67943b153..1d4b5947ac593185094126e8ea4b668d1780c494 100644 (file)
@@ -328,12 +328,12 @@ class User {
                                       $this->rec->supp_comp_get()));
   }
 
-  function licence_store()
+  function tos_store()
   {
       if (($bdb = BriskDB::create()) == FALSE) {
           return FALSE;
       }
-      return ($bdb->user_licence_update($this->code, $this->rec->lice_vers_get()));
+      return ($bdb->user_tos_update($this->code, $this->rec->tos_vers_get()));
   }
 
   function state_store()
@@ -561,7 +561,7 @@ class User {
       // GLOBAL $first_loop;
       GLOBAL $G_with_splash, $G_splash_content, $G_splash_interval, $G_splash_idx;
       GLOBAL $G_splash_w, $G_splash_h, $G_splash_timeout;
-      GLOBAL $G_lice_vers, $G_lice_fname, $G_lice_dthard, $G_lice_dtsoft, $G_lice_idx;
+      GLOBAL $G_tos_vers, $G_tos_fname, $G_tos_dthard, $G_tos_dtsoft, $G_tos_idx;
 
       GLOBAL $S_load_stat;
       
@@ -611,36 +611,25 @@ class User {
               log_rd("roomma ".$this->step);
               $curtime = time();
               if ($this->rec !== FALSE) {
-                  if ($curtime > $G_lice_dtsoft || $curtime > $G_lice_dthard) {
-                      if (versions_cmp($this->rec->lice_vers_get(), $G_lice_vers) < 0) { // comparison between user version and current version
-                          if ($curtime > $G_lice_dtsoft) {
+                  if ($curtime > $G_tos_dtsoft || $curtime > $G_tos_dthard) {
+                      if (versions_cmp($this->rec->tos_vers_get(), $G_tos_vers) < 0) { // comparison between user version and current version
+                          if ($curtime > $G_tos_dtsoft) {
                               // call notify soft
                               // FIXME: manage translations
-                              $ret .=  show_notify_document(esclfhtml(file_get_contents($G_base.sprintf($G_lice_fname, $G_lice_vers, $G_lang))),
+                              $ret .=  show_notify_document(esclfhtml(file_get_contents($G_base.sprintf($G_tos_fname, $G_tos_vers, $G_lang))),
                                        0, array("Accetto.", "Rifiuto.", "Leggo poi.",  /* , "Scarico." */),
-                                       "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));
+                                       "tos_confirm", 600, 600, TRUE, 0);
+                              $ret .= sprintf("act_tosmgr('soft', g_nd.ret_get(), '%s', '%s');",
+                                              xcape($this->rec->tos_vers_get()), xcape($G_tos_vers));
                           }
-                          else if ($curtime > $G_lice_dthard) {
+                          else if ($curtime > $G_tos_dthard) {
                               // call notify hard
-                              $ret .=  show_notify_document(esclfhtml(file_get_contents($G_base.sprintf($G_lice_fname, $G_lice_vers, $G_lang))),
+                              $ret .=  show_notify_document(esclfhtml(file_get_contents($G_base.sprintf($G_tos_fname, $G_tos_vers, $G_lang))),
                                        0, array("Accetto.", "Rifiuto." /* , "Scarico." */),
-                                       "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));
+                                       "tos_confirm", 600, 600, TRUE, 0);
+                              $ret .= sprintf("act_tosmgr('hard', g_nd.ret_get(), '%s', '%s');",
+                                              xcape($this->rec->tos_vers_get()), xcape($G_tos_vers));
                           }
-
-
-                          /* $ret .=  show_notify_ex(str_replace("\n", " ", "Versione corrente: [".$this->rec->lice_vers_get()."] Versione sito: ".$G_lice_vers), */
-                          /*     ($is_super ? 0 : $G_splash_timeout), */
-                          /*     // $mlang_indrd[($is_super ? 'btn_btotabsup' : 'btn_backtotab')][$G_lang], */
-                          /*     $mlang_indrd['btn_backtotab'][$G_lang], */
-                          /*     $G_splash_w, $G_splash_h, true, */
-                          /*     ($is_super ? 0 : $G_splash_timeout)); */
-                          /* $ret .= sprintf('|createCookie("CO_lice_date%d", %d, 24*365, cookiepath);', $G_lice_idx, $curtime); */
-
-
                       }
                   }
               }
index a38a36c48fbe6400cb1613d2fadb79350ede0cb8..c5cee044869b7f4d5931cf15acfd56a89558eacb 100644 (file)
@@ -45,8 +45,8 @@ var mlang_commons = { 'imgload_a' : { 'it' : 'Immagini caricate ',
                                                'en' : '(only aut.)' },
                                       '2'  : { 'it' : '(isolam.to)',
                                                'en' : '(isolation)' } },
-                      'lic_refu'  : { 'it' : 'Rifiutando di sottoscrivere la nuova licenza d\' uso non ti sarà più possibile accedere col tuo utente registrato al sito, sei proprio sicuro di non voler accettare le nuove condizioni d\'uso ?',
-                                      'en' : 'EN Rifiutando di sottoscrivere la nuova licenza d\' uso non ti sarà più possibile accedere col tuo utente registrato al sito, sei proprio sicuro di non voler accettare le nuove condizioni d\'uso ?'
+                      'tos_refu'  : { 'it' : 'Rifiutando di sottoscrivere i nuovi termini del servizio non ti sarà più possibile accedere col tuo utente registrato al sito, sei proprio sicuro di non voler accettare le nuove condizioni d\'uso ?',
+                                      'en' : 'EN Rifiutando di sottoscrivere i nuovi termini del servizio non ti sarà più possibile accedere col tuo utente registrato al sito, sei proprio sicuro di non voler accettare le nuove condizioni d\'uso ?',
                                     }
                     };
 
@@ -481,7 +481,7 @@ function postact_logout()
   code - if soft: accept (0), refuse (1), after (2)
          if hard: accept (0), refuse (1)
  */
-function act_licencemgr(type, code, lice_curr, lice_vers)
+function act_tosmgr(type, code, tos_curr, tos_vers)
 {
     if (type != "soft" && type != "hard") {
         return false;
@@ -489,7 +489,7 @@ function act_licencemgr(type, code, lice_curr, lice_vers)
     switch (code) {
     case 0:
     case 1:
-        send_mesg("licencemgr|"+type+"|"+code+"|"+lice_curr+"|"+lice_vers);
+        send_mesg("tosmgr|"+type+"|"+code+"|"+tos_curr+"|"+tos_vers);
         break;
     case 2:
         break;
@@ -499,10 +499,10 @@ function act_licencemgr(type, code, lice_curr, lice_vers)
     return true;
 }
 
-function lice_confirm(val)
+function tos_confirm(val)
 {
     if (val == 1) {
-        return (window.confirm(mlang_commons['lic_refu'][g_lang]));
+        return (window.confirm(mlang_commons['tos_refu'][g_lang]));
     }
 
     return true;
index 75fed15da916bb6794a50721114f8437f0af6625..014b12571e35debea1daa2cba2ce2be5e891bbcc 100644 (file)
@@ -88,7 +88,7 @@ define('LICMGR_CHO_AFTER',  2);
 function index_wr_main(&$room, $remote_addr_full, $get, $post, $cookie)
 {
     GLOBAL $G_shutdown, $G_black_list, $G_lang, $G_room_help, $G_room_about, $G_room_passwdhowto, $mlang_indwr;
-    GLOBAL $G_lice_vers;
+    GLOBAL $G_tos_vers;
     $remote_addr = addrtoipv4($remote_addr_full);
 
     log_load("index_wr.php");
@@ -548,20 +548,20 @@ function index_wr_main(&$room, $remote_addr_full, $get, $post, $cookie)
         else if ($argz[0] == 'chatt') {
             $room->chatt_send(&$user, xcapemesg($mesg));
         }
-        else if ($argz[0] == 'licencemgr') {
-            // check IF is authnticated user, both licences version matches
+        else if ($argz[0] == 'tosmgr') {
+            // check IF is authnticated user, both terms of service versions matches
             if ($user->flags & USER_FLAG_AUTH && count($argz) == 5) {
                 $f_type = $argz[1];      $f_code = $argz[2];
-                $f_lice_curr = $argz[3]; $f_lice_vers = $argz[4];
+                $f_tos_curr = $argz[3]; $f_tos_vers = $argz[4];
 
-                if ("$f_lice_curr" == $user->rec->lice_vers_get()  &&
-                    "$f_lice_vers" == "$G_lice_vers") {
+                if ("$f_tos_curr" == $user->rec->tos_vers_get()  &&
+                    "$f_tos_vers" == "$G_tos_vers") {
                     if ("$f_type" == "soft" || "$f_type" == "hard") {
                         $res = 100;
                         switch ($f_code) {
                         case LICMGR_CHO_ACCEPT:
-                            $user->rec->lice_vers_set($G_lice_vers);
-                            $res = $user->licence_store();
+                            $user->rec->tos_vers_set($G_tos_vers);
+                            $res = $user->tos_store();
                             break;
                         case LICMGR_CHO_REFUSE:
                             $user->flags_set(USER_FLAG_TY_DISABLE, USER_FLAG_TY_ALL);