From: Matteo Nastasi (mop) Date: Tue, 26 Nov 2013 06:40:00 +0000 (+0100) Subject: client-side notify document return value managed X-Git-Tag: v4.11.0~21 X-Git-Url: http://mop.ddnsfree.com/gitweb/?p=brisk.git;a=commitdiff_plain;h=eb65f5518b0cacc60e1dd265ab966290e7cc0c54 client-side notify document return value managed --- diff --git a/web/Obj/brisk.conf-templ.pho b/web/Obj/brisk.conf-templ.pho index a258855..eeb5b54 100644 --- a/web/Obj/brisk.conf-templ.pho +++ b/web/Obj/brisk.conf-templ.pho @@ -84,6 +84,11 @@ $G_black_list = array(); // this is the prefix path to remove from backtrace $G_btrace_pref_sub = "/home/nastasi/web/"; - - +// licence related stuff +$G_lice_vers = "2.0"; +$G_lice_fname = "licence_complete_filename"; +// 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; ?> diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 3593f52..7fa2f36 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -2881,6 +2881,19 @@ function show_notify_ex($text, $tout, $butt, $w, $h, $is_opaque, $block_time) return sprintf('var noti = new notify_ex(gst,"%s",%d,"%s",%d,%d, %s, %d);', $text, $tout, $butt, $w, $h, ($is_opaque ? "true" : "false"), $block_time); } +function show_notify_document($text, $tout, $butt_arr, $w, $h, $is_opaque, $block_time) +{ + log_main("SHOW_NOTIFY OPAQUE: ".$text); + + $butts = ""; + for ($i = 0 ; $i < count($butt_arr) ; $i++) { + $butts .= sprintf("%s'%s'", ($i == 0 ? "" : ","), $butt_arr[$i]); + } + + return sprintf('g_nd = new notify_document(gst, "%s", %d, [ %s ], %d, %d, %s, %d);|', + escpush($text), $tout, $butts, $w, $h, ($is_opaque ? "true" : "false"), $block_time); +} + function root_welcome($user) { diff --git a/web/Obj/user.phh b/web/Obj/user.phh index 0661c38..c77f653 100644 --- a/web/Obj/user.phh +++ b/web/Obj/user.phh @@ -586,7 +586,34 @@ class User { if ($this->stat == 'room') { 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) { + // call notify soft + $ret .= show_notify_document("Versione corrente: [".$this->rec->lice_vers_get()."] Versione sito: ".$G_lice_vers, + 0, array($mlang_indrd['btn_backtotab'][$G_lang],"pippo", "pluto"), + 400, 600, TRUE, 0); + $ret .= "alert('RESULT: ' + g_nd.ret_get());"; + } + else if ($curtime > $G_lice_dthard) { + // call notify hard + ; + } + + + /* $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); */ + + + } + } + } if ($G_with_splash && ($splashdate < $curtime - $G_splash_interval || $splashdate > $curtime)) { diff --git a/web/index.php b/web/index.php index 8e64e8a..ac6ab9d 100644 --- a/web/index.php +++ b/web/index.php @@ -897,9 +897,10 @@ supported by:
var g_listen; var g_withflash = false; var g_is_spawn = 0; + var g_nd = null; + var g_brow = null; var gst = new globst(); var topbanner_sfx, topbanner_dx; - var g_brow = null; var xstm = null; var sess = "not_connected"; var spo_slide, sup_slide; @@ -1036,17 +1037,18 @@ echo "$body"; ?> var g_tables_auth_n = ; var g_prefs, g_prefs_new = null; var g_listen; + var g_is_spawn = 0; + var g_withflash = false; + var g_imgct = 0; + var g_imgtot = g_preload_img_arr.length; + var g_brow = null; + var g_nd = null; var tra = null; var stat = ""; var subst = ""; var gst = new globst(); - var g_is_spawn = 0; var topbanner_sfx, topbanner_dx; // var nonunload = false; - var g_withflash = false; - var g_imgct = 0; - var g_imgtot = g_preload_img_arr.length; - var g_brow = null; var spo_slide, sup_slide; window.onload = function() {