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

SF.net SVN: ledger-smb: [37] trunk/bin



Revision: 37
          http://svn.sourceforge.net/ledger-smb/?rev=37&view=rev
Author:   christopherm
Date:     2006-09-06 09:56:09 -0700 (Wed, 06 Sep 2006)

Log Message:
-----------
fixing first login annoyance where adminhash isn't there, this bug will be gone with a proper authentication module

Modified Paths:
--------------
    trunk/bin/lynx/admin.pl
    trunk/bin/mozilla/admin.pl

Modified: trunk/bin/lynx/admin.pl
===================================================================
--- trunk/bin/lynx/admin.pl	2006-09-06 05:04:20 UTC (rev 36)
+++ trunk/bin/lynx/admin.pl	2006-09-06 16:56:09 UTC (rev 37)
@@ -1063,6 +1063,14 @@
 	%cookie = split /[=;]/, $ENV{HTTP_COOKIE}; # Changeme to %cookies
 	$cookie = ($form->{path} eq 'bin/lynx') ? $cookie{login} : $cookie{"LedgerSMB-root login"};
 
+	#fixes problem with first login and such
+	if (!(-f "$userspath/adminhash")) {
+      &get_hash;
+      open(HASHFILE, "> $userspath/adminhash") || $form->error("Can't Open Hashfile: $!");
+      print HASHFILE $form->{hash}; 
+	  close(HASHFILE);
+	}	
+
 	open (HASHFILE, "< $userspath/adminhash") || $form->error("Can't Open Hashfile: $!");
 
 	chomp($form->{hash} = <HASHFILE>);

Modified: trunk/bin/mozilla/admin.pl
===================================================================
--- trunk/bin/mozilla/admin.pl	2006-09-06 05:04:20 UTC (rev 36)
+++ trunk/bin/mozilla/admin.pl	2006-09-06 16:56:09 UTC (rev 37)
@@ -1063,6 +1063,14 @@
 	%cookie = split /[=;]/, $ENV{HTTP_COOKIE}; # Changeme to %cookies
 	$cookie = ($form->{path} eq 'bin/lynx') ? $cookie{login} : $cookie{"LedgerSMB-root login"};
 
+	#fixes problem with first login and such
+	if (!(-f "$userspath/adminhash")) {
+      &get_hash;
+      open(HASHFILE, "> $userspath/adminhash") || $form->error("Can't Open Hashfile: $!");
+      print HASHFILE $form->{hash}; 
+	  close(HASHFILE);
+	}	
+
 	open (HASHFILE, "< $userspath/adminhash") || $form->error("Can't Open Hashfile: $!");
 
 	chomp($form->{hash} = <HASHFILE>);


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