summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/lynx/admin.pl8
-rwxr-xr-xbin/mozilla/admin.pl8
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>);