X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2FStatus.html;h=dbe08b5bc08f9519c72a6a84bdc2f2f9884a7161;hb=1a320aa8f679a355bd3678ccceb5d7ecf7b0aeba;hp=7fb9d0be573be9f8329638206d69116df37dea21;hpb=53a8c81b4f3a414803a52fc8114b26a71055d012;p=freeside.git
diff --git a/httemplate/view/Status.html b/httemplate/view/Status.html
index 7fb9d0be5..dbe08b5bc 100644
--- a/httemplate/view/Status.html
+++ b/httemplate/view/Status.html
@@ -1,4 +1,7 @@
-<& /elements/header.html &>
+<& /elements/header.html, 'System Status' &>
+
+<& /elements/init_overlib.html &>
+
% foreach my $section ( keys %status ) {
<% mt($section) |h %>
% }
+
<& /elements/footer.html &>
<%init>
+###
+# Basics and Daemons
+###
+
my $os;
-e '/usr/bin/lsb_release' and run( ['lsb_release', '-d'], '>',\$os );
if ( ! $@ && $os =~ /^\s*Description:\s*(.+)$/ ) {
@@ -22,6 +30,14 @@ if ( ! $@ && $os =~ /^\s*Description:\s*(.+)$/ ) {
$os = "Debian $deb_version";
}
+my $pkg_version = '';
+-e '/usr/bin/dpkg-query'
+ and run( ['/usr/bin/dpkg-query',
+ '--showformat=${Version}', '--show', 'freeside'
+ ],
+ '>', \$pkg_version
+ );
+
( my $perl_ver = $^V ) =~ s/^v//;
my $db = driver_name;
@@ -36,8 +52,13 @@ if ( $db eq 'PostgreSQL' && $db_ver =~ /^\s*PostgreSQL\s+([\w\.]+)\s+on\s+/ ) {
my $db_size = 'Unknown';
if ( $db eq 'PostgreSQL' ) {
$db_size = FS::Record->scalar_sql(qq(
- SELECT pg_size_pretty(pg_database_size('freeside'))
- ));
+ SELECT pg_size_pretty(pg_database_size('freeside'))
+ )). ' '.
+ include('/elements/popup_link.html',
+ 'action' => 'Status-db_size_detail.html',
+ 'label' => '(details)',
+ 'actionlabel' => 'Database size details',
+ );
}
tie my %status, 'Tie::IxHash',
@@ -45,6 +66,13 @@ tie my %status, 'Tie::IxHash',
{ 'title' => 'Freeside version',
'value' => $FS::VERSION,
},
+ ( length($pkg_version)
+ ? ( { 'title' => 'Package version',
+ 'value' => $pkg_version,
+ },
+ )
+ : ()
+ ),
{ 'title' => 'Operating System',
'value' => $os,
},
@@ -97,13 +125,18 @@ tie my %status, 'Tie::IxHash',
],
;
+
+###
+# Replication
+###
+
if ( $db eq 'PostgreSQL' ) {
my $enabled = FS::Record->scalar_sql('SHOW wal_level') eq 'hot_standby'
&& FS::Record->scalar_sql('SHOW archive_mode') eq 'on';
my $slave =
- FS::Record->scalar_sql('SHOW archive_command') =~ / postgres\@([\w\.\-]+): /
+ FS::Record->scalar_sql('SHOW archive_command') =~ / postgres\@([\w\.\-]+):/
? $1 : '';
$status{'Replication'} = [
@@ -123,11 +156,11 @@ if ( $db eq 'PostgreSQL' ) {
# http://www.keithf4.com/monitoring_streaming_slave_lag/
# except pg_stat_replication still doesn't fill in the columns we need as
# non-Pg user :/
- push @{ $status{'Replication'} },
- { 'title' => 'Slave',
- 'value' => $slave || '(Missing, or unparseable archive_command)',
- },
- ;
+ #push @{ $status{'Replication'} },
+ # { 'title' => 'Slave',
+ # 'value' => $slave || '(Missing, or unparseable archive_command)',
+ # },
+ #;
}
}
@@ -141,6 +174,11 @@ if ( $db eq 'PostgreSQL' ) {
}
+
+###
+# CDR Processing
+###
+
if ( _is_running('cdrd') ) {
my $delay = FS::Record->scalar_sql('
@@ -200,6 +238,74 @@ if ( _is_running('cdrd') ) {
}
+
+###
+# PCI Compliance
+###
+
+my($store, $tokenize) = (0,0);
+foreach my $agent (
+ qsearch({
+ 'table' => 'agent',
+ 'hashref' => { 'disabled' => '', },
+ 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+ })
+) {
+ my $gateway = $agent->payment_gateway('method'=>'VISA card', 'nofatal'=>1, );
+ next unless $gateway
+ && $gateway->gateway_namespace eq 'Business::OnlinePayment';
+ eval "use Business::OnlinePayment";
+ die $@ if $@; #die?
+ my $bop = new Business::OnlinePayment( $gateway->gateway_module,
+ $gateway->gatewaynum
+ ? $gateway->options
+ : @{ $gateway->get('options') }
+ );
+ my %actions = $bop->info('supported_actions');
+ if ( $actions{'CC'} && grep /^Tokenize$/, @{$actions{'CC'}} ) {
+ $tokenize++;
+ } else {
+ $store++;
+ }
+
+}
+
+if ( $tokenize && ! $store ) {
+
+ $status{'PCI Compliance'} = [
+ { 'title' => 'Tokenization',
+ 'value' => 'Enabled',
+ },
+ { 'title' => 'SAQ type',
+ 'value' => 'A / A-EP',
+ },
+ ];
+
+} elsif ( $store ) {
+
+ my $conf = new FS::Conf; #wow, didn't need this before?
+
+ $status{'PCI Compliance'} = [
+ { 'title' => 'Tokenization',
+ 'value' => $tokenize ? 'Partialy enabled (some agents)' : 'Disabled'
+ },
+ { 'title' => 'Encryption',
+ 'value' =>
+ ( $conf->exists('encryption') && $conf->config('encryptionpublickey')
+ ? 'Enabled' : 'Disabled'
+ ),
+ },
+ { 'title' => 'SAQ type',
+ 'value' => 'D (enable tokenization for A / A-EP)',
+ },
+ ];
+
+}
+
+###
+# Subroutines
+###
+
sub _is_running {
my $thing = shift;