From 503b56279444b93b303d57f785a74d44d75a07df Mon Sep 17 00:00:00 2001 From: einhverfr Date: Wed, 13 Sep 2006 16:20:39 +0000 Subject: Added Jason Rogriguez's admin.pl password patch. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@83 4979c152-3d1c-0410-bac9-87ea11338e46 --- bin/mozilla/admin.pl | 53 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/mozilla/admin.pl b/bin/mozilla/admin.pl index 4e80bf20..0bc40eb8 100755 --- a/bin/mozilla/admin.pl +++ b/bin/mozilla/admin.pl @@ -61,6 +61,9 @@ if (-f "$form->{path}/custom_$form->{script}") { } + + + if ($form->{action}) { &check_password unless $form->{action} eq 'logout'; @@ -76,13 +79,19 @@ if ($form->{action}) { open(FH, ">$memberfile") or $form->error("$memberfile : $!"); print FH qq|# LedgerSMB Accounting members - [root login] - password= - - |; +[root login] +password= +|; close FH; } + $root = new User "$memberfile", "root login"; + + unless($root && $root->{password}) { + &setup_initial_password(); + exit; + } + &adminlogin; } @@ -90,6 +99,42 @@ if ($form->{action}) { # end +sub setup_initial_password { + + + $form->header(); + print qq| + +
+ LedgerSMB Logo +

|.$locale->text('Version').qq| $form->{version}
|.$locale->text('Administration').qq|

+ +
Change password +

This is your first time logging into LedgerSMB. Please set your administrative password

+ +
+ + + + + + + + + +
|.$locale->text('Password').qq|
|.$locale->text('Confirm').qq|
+ + +

+
+ + LedgerSMB |.$locale->text('website').qq| +
+ + +|; +} + sub adminlogin { $form->{title} = qq|LedgerSMB $form->{version} |.$locale->text('Administration'); -- cgit v1.2.3