From 271341ef0145176512f1bf739943c2088a92a8ef Mon Sep 17 00:00:00 2001 From: christopherm Date: Wed, 6 Sep 2006 16:56:09 +0000 Subject: fixing first login annoyance where adminhash isn't there, this bug will be gone with a proper authentication module git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@37 4979c152-3d1c-0410-bac9-87ea11338e46 --- bin/mozilla/admin.pl | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bin/mozilla/admin.pl') diff --git a/bin/mozilla/admin.pl b/bin/mozilla/admin.pl index 114c0f69..3bf69501 100755 --- a/bin/mozilla/admin.pl +++ b/bin/mozilla/admin.pl @@ -1063,6 +1063,14 @@ sub check_password { %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} = ); -- cgit v1.2.3