summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmenu.pl51
1 files 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;
}
}
}