#!/usr/bin/perl -T
# $Id: about.cgi,v 1.7 2023/02/21 15:13:11 sqko Exp $
############################################################
############################################################
###                                                      ###
###   Originally designed by Soeren Koch                 ###
###                                                      ###
###   Impelemented by Soeren Koch                        ###
###                                                      ###
###   Copyright by Soeren Koch January 2005              ###
###                                                      ###
############################################################
############################################################

use strict;
use warnings;
use RFC::Main;
use RFC::RFCCGI qw(:cgi :html);
use RFC::Header;
use CGI qw(:standard :netscape);

my $ref = &RFC::RFCCGI::get_user_data_ref();
my $uid = $$ref{'uid'};


if (!defined(param))
{
    print process('to_login.tt');
}
else
{
    if ($uid)
    {
        print process('main_nav.tt');
        $_ = param('action');
      CASE:
        {
            ### Insert case statements ###
            &main_page;
        }
        print process('end_html.tt');
    }
    else 
    {
        print process('not_auth.tt');
    }
}
exit;


sub main_page
{
    my %data = ();
    my $prog = '/usr/local/bin/celltest/celltest-passwd-server';
    my $cmd = $prog.' --version';
    my $passversion = '';
    if (-e $prog)
    {
	my $res = `$cmd`; 
	$res =~ /\:\s+([\.\d]+)/;
	$passversion = $1+0;
    }
    $data{'version'} = $RFC::Header::VERSION;
    $data{'gui_version'} = $passversion;
    $data{'implementers'} = $RFC::Header::IMPLEMENTERS;
    $data{'designers'} =  $RFC::Header::DESIGNERS;
    print process('about.tt',&get_template_data_ref(\%data));
}

