# Author: Ulli Horlacher <framstag@rus.uni-stuttgart.de>
#
-use CGI qw(:standard);
-use CGI::Carp qw(fatalsToBrowser);
-use Fcntl qw(:flock :seek :mode);
+BEGIN { ($ENV{PERLINIT}||'') =~ /(.+)/s and eval $1 }
-$CGI::LIST_CONTEXT_WARN = 0;
-$CGI::LIST_CONTEXT_WARN = 0;
+use Fcntl qw(:flock :seek :mode);
# import from fex.ph
our (@local_hosts,@local_domains,@local_rhosts,@local_rdomains);
our ($usage_conditions);
# import from fex.pp
-our ($mdomain,$logdir,$spooldir,$fra,$hostname,$sendmail,$admin,$bcc);
+our ($mdomain,@logdir,$spooldir,$fra,$hostname,$sendmail,$admin,$bcc);
our $error = "F*EX user registration ERROR";
# load common code, local config: $HOME/lib/fex.ph
require "$FEXLIB/fex.pp" or die "$0: cannot load $FEXLIB/fex.pp - $!\n";
-my $log = "$logdir/fur.log";
+my $log = 'fur.log';
my $head = "$ENV{SERVER_NAME} F*EX user registration";
chdir $spooldir or die "$spooldir - $!\n";
}
# look for CGI parameters
-foreach my $v (param) {
- my $vv = despace(param($v));
- debuglog("Param: $v=\"$vv\"");
+our %PARAM;
+&parse_parameters;
+foreach my $v (keys %PARAM) {
+ my $vv = despace($PARAM{$v});
+ # debuglog("Param: $v=\"$vv\"");
$CASE =
$v =~ /^user$/i ? $user = normalize_address($vv):
$v =~ /^exuser$/i ? $exuser = normalize_address($vv):
http_header("200 OK",'Content-Type: text/plain');
print "$ENV{PROTO}://$ENV{HTTP_HOST}/fup?from=$user&ID=$id\n";
furlog("direct: account $user created");
- if ($bcc and open my $mail,"|$sendmail '$bcc' 2>>$log") {
+ if ($bcc and open my $mail,"|$sendmail '$bcc' 2>>$logdir[0]/$log") {
pq($mail,qq(
'From: fex'
'To: $bcc'
$msg =~ s/\n/ /g;
$msg =~ s/\s+$//;
+ $msg = sprintf "%s [%s_%s] %s %s\n",
+ isodate(time),$$,$ENV{REQUESTCOUNT},$fra,$msg;
- if (open $log,'>>',$log) {
- flock $log,LOCK_EX;
- seek $log,0,SEEK_END;
- printf {$log} "%s [%s_%s] %s %s\n",
- isodate(time),$$,$ENV{REQUESTCOUNT},$fra,$msg;
- close $log;
- }
+ writelog($log,$msg);
}
sub normalize_address {