+ if ($this->rec !== FALSE) {
+ $doc_filepath = $G_base.$G_doc_path.sprintf($G_tos_fname, $G_tos_vers, $G_lang);
+ $doc_filename = basename($doc_filepath);
+ 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
+ $buttons = array($mlang_user['btn_agree'][$G_lang], $mlang_user['btn_refuse'][$G_lang],
+ $mlang_user['btn_dload'][$G_lang]);
+ if ($curtime > $G_tos_dtsoft && $curtime < $G_tos_dthard) {
+ // call notify soft (same as soft + later button)
+ array_push($buttons, $mlang_user['btn_later'][$G_lang]);
+ $type = "soft";
+ $preface = sprintf("<div class='doc_alert'>%s</div>",
+ sprintf($mlang_user['toc_date_dscl'][$G_lang],
+ strftime("%e/%m/%Y", $G_tos_dthard)));
+ }
+ else {
+ // call notify hard
+ $type = "hard";
+ $preface = "";
+ }
+ $ret .= show_notify_document($preface.esclfhtml(file_get_contents($doc_filepath)), 0, $buttons,
+ "tos_confirm", sprintf("[ '%s/doc_download.php?doc=%s' ]", SITE_PREFIX,
+ basename($doc_filename, ".txt")), 600, 600, TRUE, 0);
+
+ $ret .= sprintf("act_tosmgr('%s', g_nd.ret_get(), '%s', '%s');", $type,
+ xcape($this->rec->tos_vers_get()), xcape($G_tos_vers));
+ }
+ }
+ }