From ca86bb11388b5d22ec2e63088d87ca27f17ea530 Mon Sep 17 00:00:00 2001 From: christopherm Date: Thu, 7 Dec 2006 20:25:26 +0000 Subject: removing if ($myconfig{password}) clause, as I cannot see why one would want this git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@743 4979c152-3d1c-0410-bac9-87ea11338e46 --- menu.pl | 51 ++++++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/menu.pl b/menu.pl index a1166a90..e54fdd2d 100755 --- a/menu.pl +++ b/menu.pl @@ -152,39 +152,36 @@ if ($form->{action}) { sub check_password { - if ($myconfig{password}) { + require "bin/pw.pl"; - require "bin/pw.pl"; - - if ($form->{password}) { - if (! Session::password_check($form, $form->{login}, $form->{password})) { - if ($ENV{HTTP_USER_AGENT}) { - &getpassword; - } else { - $form->error(__FILE__.':'.__LINE__.': '.$locale->text('Access Denied!')); - } - exit; + if ($form->{password}) { + if (! Session::password_check($form, $form->{login}, $form->{password})) { + if ($ENV{HTTP_USER_AGENT}) { + &getpassword; } else { - Session::session_create($form); + $form->error(__FILE__.':'.__LINE__.': '.$locale->text('Access Denied!')); } - + exit; } else { - if ($ENV{HTTP_USER_AGENT}) { - $ENV{HTTP_COOKIE} =~ s/;\s*/;/g; - @cookies = split /;/, $ENV{HTTP_COOKIE}; - foreach (@cookies) { - ($name,$value) = split /=/, $_, 2; - $cookie{$name} = $value; - } - - #check for valid session - if(!Session::session_check($cookie{"LedgerSMB"}, $form)){ - &getpassword(1); - exit; - } - } else { + Session::session_create($form); + } + + } else { + if ($ENV{HTTP_USER_AGENT}) { + $ENV{HTTP_COOKIE} =~ s/;\s*/;/g; + @cookies = split /;/, $ENV{HTTP_COOKIE}; + foreach (@cookies) { + ($name,$value) = split /=/, $_, 2; + $cookie{$name} = $value; + } + + #check for valid session + if(!Session::session_check($cookie{"LedgerSMB"}, $form)){ + &getpassword(1); exit; } + } else { + exit; } } } -- cgit v1.2.3