-
-
+
+ # $Lang::tr{'use a pre-shared key'} |
+ # |
+ #
+END
+ # ;
+ # &Header::closebox();
} elsif (! $cgiparams{'KEY'}) {
my $disabled='';
my $cakeydisabled='';
@@ -2459,6 +2507,7 @@ END
$Lang::tr{'country'}: |
|
+ |
END
;
-} else {
+ } else {
# display rootcert generation buttons
print <
+
$Lang::tr{'root certificate'}: |
$Lang::tr{'not present'} |
|
END
;
-}
+ }
-if (-f "${General::swroot}/ovpn/certs/servercert.pem") {
+ if (-f "${General::swroot}/ovpn/certs/servercert.pem") {
my $hostsubject = `/usr/bin/openssl x509 -text -in ${General::swroot}/ovpn/certs/servercert.pem`;
$hostsubject =~ /Subject: (.*)[\n]/;
$hostsubject = $1;
$hostsubject =~ s+/Email+, E+;
$hostsubject =~ s/ ST=/ S=/;
+
print <
+
$Lang::tr{'host certificate'} |
$hostsubject |
|
END
;
-} else {
+ } else {
# Nothing
print <
+
$Lang::tr{'host certificate'}: |
$Lang::tr{'not present'} |
|
END
;
-}
+ }
-if (! -f "${General::swroot}/ovpn/ca/cacert.pem") {
- print " |
\n";
+ }
-if (keys %cahash > 0) {
+ if (keys %cahash > 0) {
foreach my $key (keys %cahash) {
- if (($key + 1) % 2) {
- print "\n";
- } else {
- print "
\n";
- }
- print "$cahash{$key}[0] | \n";
- print "$cahash{$key}[1] | \n";
- print <
+ if (($key + 1) % 2) {
+ print " | \n";
+ } else {
+ print "
\n";
+ }
+ print "$cahash{$key}[0] | \n";
+ print "$cahash{$key}[1] | \n";
+ print <
- |
-
-
+ |
+
+
- |
-
+ |
+
- |
+
END
;
}
-}
-print "";
-if ( -f "${General::swroot}/ovpn/ca/cacert.pem") {# If the file contains entries, print Key to action icons
- print <
-
+ }
+
+ print "";
+
+ # If the file contains entries, print Key to action icons
+ if ( -f "${General::swroot}/ovpn/ca/cacert.pem") {
+ print <
+
$Lang::tr{'legend'}: |
|
$Lang::tr{'show certificate'} |
- |
+ |
$Lang::tr{'download certificate'} |
-
-
+
+
END
;
-}
-print <
-
+ }
+ print <
+
END
;
-&Header::closebox();
-if ( $srunning eq "yes" ) {
+
+ &Header::closebox();
+ if ( $srunning eq "yes" ) {
print "\n";
-}else{
- print "\n";
-}
-#CERT
-#RWSERVER
-#&Header::openbox('100%', 'LEFT', $Lang::tr{'global settings'});
-&Header::openbox('100%', 'LEFT', 'Roadwarrior Server');
-print <
-
- |
- |
- |
-$Lang::tr{'ovpn server status'} |
-$sactive |
-
$Lang::tr{'ovpn on red'} |
- |
-END
-;
-if (&Ovpnfunc::haveBlueNet()) {
- print "
$Lang::tr{'ovpn on blue'} | ";
- print " | ";
-}
-if (&Ovpnfunc::haveOrangeNet()) {
- print "
$Lang::tr{'ovpn on orange'} | ";
- print " | ";
-}
-print <$Lang::tr{'local vpn hostname/ip'}: |
- |
- $Lang::tr{'ovpn subnet'} |
- |
-$Lang::tr{'ovpn device'} |
- |
-
$Lang::tr{'protocol'} |
- |
- $Lang::tr{'destination port'}: |
- |
-$Lang::tr{'MTU'} |
- |
-
$Lang::tr{'comp-lzo'} |
- |
- $Lang::tr{'cipher'} |
- |
+ }else{
+ print "\n";
+ }
+ if ( -f "${General::swroot}/ovpn/ca/cacert.pem" ) {
+ &Header::openbox('100%', 'LEFT', $Lang::tr{'Client status and controlc' });
+ print <
+
+ $Lang::tr{'name'} |
+ $Lang::tr{'type'} |
+ $Lang::tr{'common name'} |
+ $Lang::tr{'valid till'} |
+ $Lang::tr{'remark'}
|
+ $Lang::tr{'status'} |
+ $Lang::tr{'action'} |
+
END
-;
-
-if ( $srunning eq "yes" ) {
- print " | ";
- print " | ";
- print " | ";
- print " |
";
-} else{
- print " | ";
- print " | ";
- if (( -e "${General::swroot}/ovpn/ca/cacert.pem" &&
- -e "${General::swroot}/ovpn/ca/dh1024.pem" &&
- -e "${General::swroot}/ovpn/certs/servercert.pem" &&
- -e "${General::swroot}/ovpn/certs/serverkey.pem") &&
- (( $cgiparams{'ENABLED'} eq 'on') ||
- ( $cgiparams{'ENABLED_BLUE'} eq 'on') ||
- ( $cgiparams{'ENABLED_ORANGE'} eq 'on'))){
- print " | ";
- print " |
";
+ ;
+ my $id = 0;
+ my $gif;
+ foreach my $key (keys %confighash) {
+ if ($confighash{$key}[0] eq 'on') { $gif = 'on.gif'; } else { $gif = 'off.gif'; }
+
+ if ($id % 2) {
+ print "\n";
} else {
- print " | ";
- print " |
";
- }
+ print "\n";
+ }
+ print "$confighash{$key}[1] | ";
+ print "" . $Lang::tr{"$confighash{$key}[3]"} . " (" . $Lang::tr{"$confighash{$key}[4]"} . ") | ";
+ if ($confighash{$key}[4] eq 'cert') {
+ print "$confighash{$key}[2] | ";
+ } else {
+ print " | ";
+ }
+ my $cavalid = `/usr/bin/openssl x509 -text -in ${General::swroot}/ovpn/certs/$confighash{$key}[1]cert.pem`;
+ $cavalid =~ /Not After : (.*)[\n]/;
+ $cavalid = $1;
+ print "$cavalid | ";
+ print "$confighash{$key}[25] | ";
+ my $active = "";
+ if ($confighash{$key}[0] eq 'off') {
+ $active = "";
+ } else {
+ my $cn;
+ my @match = ();
+ foreach my $line (@status) {
+ chomp($line);
+ if ( $line =~ /^(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(\d+),(\d+),(.+)/) {
+ @match = split(m/^(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(\d+),(\d+),(.+)/, $line);
+ if ($match[1] ne "Common Name") {
+ $cn = $match[1];
+ }
+ $cn =~ s/[_]/ /g;
+ if ($cn eq "$confighash{$key}[2]") {
+ $active = "";
+ }
+ }
+ }
+ }
+ my $disable_clientdl = "disabled='disabled'";
+ if (( $cgiparams{'ENABLED'} eq 'on') ||
+ ( $cgiparams{'ENABLED_BLUE'} eq 'on') ||
+ ( $cgiparams{'ENABLED_ORANGE'} eq 'on')){
+ $disable_clientdl = "";
+ }
+ print <$active
+
+
+
+
+
+ |
+END
+ ;
+ if ($confighash{$key}[4] eq 'cert') {
+ print <
+
+
+
+ |
+END
+ ; } else {
+ print " | ";
+ }
+ if ($confighash{$key}[4] eq 'cert' && -f "${General::swroot}/ovpn/certs/$confighash{$key}[1].p12") {
+ print <
+
+
+
+ |
+END
+ ; } elsif ($confighash{$key}[4] eq 'cert') {
+ print <
+
+
+
+ |
+END
+ ; } else {
+ print " | ";
+ }
+ print <
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+END
+ ;
+ $id++;
+ }
+ ;
+
+ # If the config file contains entries, print Key to action icons
+ if ( $id ) {
+ print <
+
+ $Lang::tr{'legend'}: |
+ |
+ $Lang::tr{'click to disable'} |
+ |
+ $Lang::tr{'show certificate'} |
+ |
+ $Lang::tr{'edit'} |
+ |
+ $Lang::tr{'remove'} |
+
+
+ |
+ |
+ $Lang::tr{'click to enable'} |
+ |
+ $Lang::tr{'download certificate'} |
+ |
+ $Lang::tr{'dl client arch'} |
+
+
+END
+ ;
+ }
+
+ print <
+
+ |
+ |
+
+
+END
+ ;
+ &Header::closebox();
}
-print "";
-&Header::closebox();
-#RWSERVER
-&Ovpnfunc::rwclientstatus($activeonrun);
-&Ovpnfunc::net2netstatus($activeonrun);
-&Header::closepage();
\ No newline at end of file
+&Header::closepage();