diff options
author | christopherm <christopherm@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-09-06 16:56:09 +0000 |
---|---|---|
committer | christopherm <christopherm@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-09-06 16:56:09 +0000 |
commit | 271341ef0145176512f1bf739943c2088a92a8ef (patch) | |
tree | e649c0858c3e7ad157d7ed5de18364d08e6c1b31 | |
parent | 721fe9e90008ba98899fad3fe2f79b5f9cf5a0ba (diff) |
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
-rwxr-xr-x | bin/lynx/admin.pl | 8 | ||||
-rwxr-xr-x | bin/mozilla/admin.pl | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/bin/lynx/admin.pl b/bin/lynx/admin.pl index 114c0f69..3bf69501 100755 --- a/bin/lynx/admin.pl +++ b/bin/lynx/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} = <HASHFILE>); 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} = <HASHFILE>); |