You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

80 lines
1.8 KiB

#!/usr/bin/perl
#
# $Id: licadmin.pl,v 1.3 2006/01/23 21:39:30 ddoughty Exp $
#
# Source File: licadmin.pl
# Get config
require 'sitecfg.pl';
require 'testlib.pl';
&app_initialize;
print "Content-Type: text/html\n\n";
if (&get_session($FORM{'tid'})) {
&LanguageSupportInit();
&log_entry($SESSION{'clid'}, $SESSION{'uid'}, "3", "AD/LI $FORM{'dbop'} $FORM{'uid'}");
&get_client_profile($SESSION{'clid'});
if ($FORM{'idx'} eq '0') {
# Blank page
&show_template("selectpg");
} elsif ($FORM{'idx'} eq '1') {
&get_licenses;
$liclist = "";
$pididx = $LICFIELDS{'regno'};
$nmeidx = $LICFIELDS{'nme'};
for (1 .. $#licrecs) {
$licrec = $licrecs[$_];
@flddata = split(/&/, $licrec);
$liclist = join('', $liclist, "<OPTION VALUE=$flddata[$pididx]>$flddata[$pididx] $flddata[$nmeidx]\n");
}
$SYSTEM{'liclist'} = $liclist;
&show_template("licensing");
} elsif ($FORM{'dtl'} eq '1') {
&get_licenses;
&get_license_record($FORM{'regno'});
&show_template("licenses");
} else {
if ($FORM{'dbop'} eq 'gnew') {
} elsif ($FORM{'dbop'} eq 'gupd') {
} elsif ($FORM{'dbop'} eq 'gdel') {
}
}
}
sub get_licenses {
@licrecs = &get_data("licenses.dat");
$licrec = $licrecs[0];
chop ($licrec);
@flds = split(/&/, $licrec);
for (0 .. $#flds) {
$LICFIELDS{$flds[$_]} = $_;
$LICFIELDINDECES{$_} = $flds[$_];
}
@flds = ();
}
sub get_license_record {
$bFound = 0;
$keymsk = "\&$_[0]\&";
for (1 .. $#licrecs) {
$licrec = $licrecs[$_];
if ( $licrec =~ /$keymsk/ ) {
$bFound = 1;
chop ($licrec);
@flddata = split(/&/, $licrec);
for (keys %LICFIELDS) {
$fldidx = $LICFIELDS{$_};
$fldnme = "lic$_";
$flddata = $flddata[$fldidx];
$SYSTEM{$fldnme} = $flddata;
}
$prodid = $SYSTEM{'licregno'};
$prodid =~ s/-//g;
$SYSTEM{'licregkey'} = crypt($prodid, $SYSTEM{'licuid'});
}
last if($bFound)
}
}