# All rights reserved (c) 2002;  Author: Daniel Dinev;  http://chatologica.com

package MTS4::ADMIN::Environment;                           # SHOW SERVER ENVIRONMENT

use strict;
use MTS4::STD::Common;
use MTS4::STD::CGI_Response;



sub run                                                     # THE LOGIC OF THIS NAVIGATION DESTINATION
{
    my ($class) = @_;
    my $me = {}; bless $me, $class;                         # setting standard object variables:
    my $P = $$me{'P'} = ${$UNIVERSAL::MTS4}{'Parameters'};
    my $E = $$me{'E'} = ${$UNIVERSAL::MTS4}{'ENV'};
    my $in = $$me{'in'} = $$E{'CGI_INPUT_HASH'};
    my $R = $$me{'R'} = new MTS4::STD::CGI_Response;
    my $out = $$me{'out'} = $$R{'out'};                     # init input fields:
    for (sort keys %ENV) {                                  # prepare Environmental data
        $$out{'environment'} .= "<B>$_</B>=$ENV{$_}<BR>\n";
    };
    use Config;                                             # prepare Perl Config data
    for (sort keys %Config) {
        $$out{'config'} .= "<B>$_</B>=" . ($Config{$_} || '') . "<BR>\n";
    };
    $$out{'osvers'} = $Config{'osvers'} || '';
    $$out{'os'} = $^O;
    $$out{'server_software'} = $ENV{'SERVER_SOFTWARE'};
    $$out{'perl_version'} = $];
    $$out{'script_path'} = $0;
    $R->send_page('Environment.htm');
};



1; # must return TRUE


