-----Ursprüngliche Nachricht----- 
From: Stevan Bajić
Sent: Tuesday, May 10, 2011 10:50 AM
To: dspam-devel@lists.sourceforge.net
Subject: Re: [Dspam-devel] WebGUI Username lowercase small improvment

On Tue, 10 May 2011 09:32:11 +0100, Sebastian Toepfer wrote:

> Hello,
>
Hello,

> In short:
>
> set $CURRENT_USER to $ENV('REMOTE_USER') at the begining
> and replace the rest of $ENV('REMOTE_USER') with $CURRENT_USER
>
feel free to submit a patch of your working implementation.

any rules for creating a patch? Should this be okay:
--- /var/www/dspam/dspam.cgi    2011-05-14 21:17:06.000000000 +0200
+++ ./dspam.cgi 2011-05-16 21:38:09.000000000 +0200
@@ -36,6 +36,7 @@
   exit;
}
require "/etc/dspam/webfrontend.conf";
+#CURRENT_USER = $ENV{'REMOTE_USER'};

if($CONFIG{"DATE_FORMAT"}) {
   use POSIX qw(strftime);
@@ -76,11 +77,11 @@
#

$CONFIG{'ADMIN'} = 0;
-if ($ENV{'REMOTE_USER'} ne "") {
+if ($CURRENT_USER ne "") {
   open(FILE, "</etc/dspam/admins");
   while(<FILE>) {
     chomp;
-    if ($_ eq $ENV{'REMOTE_USER'}) {
+    if ($_ eq $CURRENT_USER) {
       $CONFIG{'ADMIN'} = 1;
       last;
     }
@@ -89,15 +90,15 @@
}
$CONFIG{'SUBADMIN'} = 0;
$CONFIG{'SUBADMIN_USERS'} = {};
-if ($ENV{'REMOTE_USER'} ne "" && $CONFIG{'ADMIN'} == 0) {
+if ($CURRENT_USER ne "" && $CONFIG{'ADMIN'} == 0) {
   open(FILE, "</etc/dspam/subadmins");
   while(<FILE>) {
     chomp;
     if ($_ !~ /^\s*#/) {
       my ($subadmin, $users) = (split(/\s*:\s*/))[0,1];
-      if ($subadmin eq $ENV{'REMOTE_USER'}) {
+      if ($subadmin eq $CURRENT_USER) {
         $CONFIG{'SUBADMIN'} = 1;
-        $CONFIG{'SUBADMIN_USERS'}->{ $ENV{'REMOTE_USER'} } = 1;
+        $CONFIG{'SUBADMIN_USERS'}->{ $CURRENT_USER } = 1;
         for (split(/\s*,\s*/,$users)) {
           my $user_clean = $_;
           $user_clean =~ s/^\s+//;
@@ -145,8 +146,6 @@
# Configure Filesystem
#

-$CURRENT_USER = $ENV{'REMOTE_USER'};
-
if ($FORM{'user'} ne "") {
   if ($CONFIG{'ADMIN'} == 1) {
     $CURRENT_USER = $FORM{'user'};

> Regards,
> Sebastian
>
-- 
Kind Regards from Switzerland,

Stevan Bajić


Links:
------
[1] http://p.sf.net/sfu/intel-dev2devmay
[2] mailto:Dspam-devel@lists.sourceforge.net
[3] https://lists.sourceforge.net/lists/listinfo/dspam-devel

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Dspam-devel mailing list
Dspam-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspam-devel 


------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Dspam-devel mailing list
Dspam-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspam-devel

Reply via email to