#!/usr/bin/perl ############################################## ## ## ## PROFILE MANAGER PREMIUM 2.2 ## ## Build 2004-11-20 ## ## ## ## Aytekin Tank ## ## email: aytekin@interlogy.com ## ## http://www.interlogy.com/products/pmpre ## ## ## ## Copyright 1999-2004 Aytekin Tank. ## ## ## ############################################## #- use this file, if you would like to have cookie support #- otherwise just copy the code in "login.html" to some page ############################### # find the root if this is IIS: ############################### if($ENV{'SERVER_SOFTWARE'} =~ m/IIS/) { if($root eq "" && $ENV{'PATH_TRANSLATED'} ne "") { my $pt = $ENV{'PATH_TRANSLATED'}; my @pts = split(/\\/, $pt); $pts[-1] = ""; $root = join "/", @pts; $OS = "NT"; } } ############################### # functions library: ############################### require "${root}lib/pm.lib"; ############################### # Read the data coming from the form.. ############################### if(!$dontparse){ &readit; } #- retrieve existing $lp = $req->cookie("pmpre_login"); ($input{'login'}, $input{'password'}) = split(/\|/, pm_decode($lp)); #- print header print $req->header(); #- get templates list require "${root}data/config/pmpre.cfg"; #- get user info &pm_check; #- simple tempwiz my @template; $input{'action'} = "login"; $action = "login"; foreach my $rulepointer(@template_rules){ if($rulepointer->{'action'} eq $action){ my $field = $rulepointer->{'field'}; my $temp = $rulepointer->{'temp'}; if($input{$field} eq $rulepointer->{'text'} || $values{$field} eq $rulepointer->{'text'}){ $tempz{$action} = $tempz{$temp}; } } } open (TEMP, "<${root}$tempz{$input{'action'}}"); my $login_found = 0; while(($thisrow = )) { push(@template, $thisrow); } close TEMP; my $templateflat = join(" ", @template); foreach $part(split(/%%/, $templateflat)) { if ($part eq "login") { print $input{'login'}; } elsif ($part eq "password") { print $input{'password'}; } elsif ($part =~ m/^INCLUDE:(.*)$/) { open (INC,"<$1"); while() { print $_; } close INC; } elsif ($part =~ m/^TEMPLATE:(.*)$/) { if($tempz{$1} eq ""){ print "
*Error: $1 template does not exist.*
"; }else{ tempwiz($1); } } elsif ($part =~ m/^EXEC:(.*)$/) { print `perl $1`;} elsif ($part =~ m/^ONLINE:(.*)$/) { if(!defined(%online)){ &get_online; } print join "$1 ", map {"$_"} keys %online; } elsif ($part eq "imageswww") { print $imageswww; } elsif ($part eq "no of members") { print &no_of_members; } else{ print $part; } }