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
--- 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;
$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;
?>
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;
$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;
}
{
$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);
}
$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()
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;
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);
$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()
// 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;
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); */
-
-
}
}
}
'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 ?',
}
};
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;
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;
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;
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");
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);