[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [743] branches/1.2/menu.pl



Revision: 743
          http://svn.sourceforge.net/ledger-smb/?rev=743&view=rev
Author:   christopherm
Date:     2006-12-07 12:25:26 -0800 (Thu, 07 Dec 2006)

Log Message:
-----------
removing if ($myconfig{password}) clause, as I cannot see why one would want this

Modified Paths:
--------------
    branches/1.2/menu.pl

Modified: branches/1.2/menu.pl
===================================================================
--- branches/1.2/menu.pl	2006-12-07 19:30:21 UTC (rev 742)
+++ branches/1.2/menu.pl	2006-12-07 20:25:26 UTC (rev 743)
@@ -152,39 +152,36 @@
 
 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;
-				}
+			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 {
+			#check for valid session
+			if(!Session::session_check($cookie{"LedgerSMB"}, $form)){
+				&getpassword(1);
 				exit;
 			}
+		} else {
+			exit;
 		}
 	}
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.