default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / elements / header-full.html
index 5586a0a..a56e0b1 100644 (file)
@@ -96,6 +96,14 @@ Example:
           <BR></FONT>
         </td>
       </tr>
+%     foreach my $top_warning ( @top_warnings ) {
+        <TR>
+          <TD COLSPAN=4>
+            <IMG SRC="<% $fsurl %>images/error.png">
+            <FONT COLOR="#FF0000" SIZE="+1"><% $top_warning %></FONT>
+          </TD>
+        </TR>
+%     }
     </table>
 
     <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=0>
@@ -204,8 +212,10 @@ Example:
 % if ( $cookies{freeside_status} ) {
     <BR>
 %   foreach my $status_msg ( $cookies{freeside_status}->value ) {
-      <TABLE CLASS="fsinnerbox" STYLE="background-color:#eeffee"><TR>
-        <TD><IMG SRC="<% $fsurl %>images/tick.png"> <% $status_msg |h %></TD>
+%     my ($message, $type) = split /=/, $status_msg;
+%     $type ||= 'status';
+      <TABLE CLASS="fsinnerbox" STYLE="background-color:<% $status_color{$type} %>"><TR>
+        <TD><IMG SRC="<% $fsurl %><% $status_image{$type} %>"> <% $message |h %></TD>
       </TR></TABLE>
 %   }
     <script src="<% $fsurl %>elements/js.cookie.js"></script>
@@ -270,4 +280,27 @@ if ( scalar(@agentnums) == 1 ) {
   $company_url  = $conf->config('company_url');
 }
 
+## status->green(#eeffee), warning->yellow(#fdfd96), error->red(#f97c7c)
+my %status_color = ( 'status' => '#eeffee', 'warning' => '#fefbd0', 'error' => '#f97c7c', );
+my %status_image = ( 'status' => 'images/tick.png', 'warning' => 'images/tick.png', 'error' => 'images/error.png', );
+
+my @top_warnings = ();
+my $deb_version = int(slurp('/etc/debian_version'));
+#per wiki.debian.org/LTS
+push @top_warnings, deb_warning($deb_version)
+  if ( $deb_version <= 8 )
+  or ( $deb_version == 9  && time > 1656658800 ) #7/1/2022
+  or ( $deb_version == 10 && time > 1719817200 ) #7/1/2024
+  or ( $deb_version == 11 && time > 1782889200 ) #7/1/2026
+;
+
+sub deb_warning {
+  my $ver = shift;
+  <<"END";
+WARNING: Your operating system (Debian v$ver) is EOL and no longer supported.
+This is insecure and a violation of PCI data security standard.
+Contact <a href="mailto:sales\@freeside.biz?subject=Debian OS upgrade">sales\@freeside.biz</a> to schedule an upgrade ASAP.
+END
+}
+
 </%init>