+ # Calculate the remaining time
+ my $remainingTime = $expiryDate - time();
+
+ # Create some simple booleans to check the status
+ my $hasExpired = ($remainingTime <= 0);
+ my $expiresSoon = ($remainingTime <= 30 * 24 * 3600);
+
+ print "<tr>";
+
+ if ($hasExpired || $expiresSoon) {
+ $col="bgcolor='$color{'color14'}'";
+ } elsif ($id % 2) {
+ $col="bgcolor='$color{'color20'}'";
+ } else {
+ $col="bgcolor='$color{'color22'}'";
+ }
+ print "<td align='center' nowrap='nowrap' $col>$confighash{$key}[1]";
+ if ($hasExpired) {
+ print " ($Lang::tr{'openvpn cert has expired'})";
+ } elsif ($expiresSoon) {
+ print " ($Lang::tr{'openvpn cert expires soon'})";
+ }
+ print "</td>";
+ print "<td align='center' nowrap='nowrap' $col>" . $Lang::tr{"$confighash{$key}[3]"} . " (" . $Lang::tr{"$confighash{$key}[4]"} . ")</td>";