summaryrefslogtreecommitdiff
path: root/bin/mozilla
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-13 16:20:39 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-13 16:20:39 +0000
commit503b56279444b93b303d57f785a74d44d75a07df (patch)
treebffbc89441cd4e7b1a98243b4da73a629a7ae4bc /bin/mozilla
parent26481b1cc57416dbe1b93dd4e27d7fb62021243c (diff)
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
Diffstat (limited to 'bin/mozilla')
-rwxr-xr-xbin/mozilla/admin.pl53
1 files changed, 49 insertions, 4 deletions
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|
+ <body class="admin" onload="sf()">
+ <div align="center">
+ <a href="http://sourceforge.net/projects/ledger-smb/"><img src="ledger-smb.png" width="200" height="100" border="0" alt="LedgerSMB Logo" /></a>
+ <h1 class="login">|.$locale->text('Version').qq| $form->{version} <br />|.$locale->text('Administration').qq|</h1>
+
+ <fieldset><legend>Change password</legend>
+ <p>This is your first time logging into LedgerSMB. Please set your administrative password</p>
+
+ <form method="post" action="$form->{script}" name="admin">
+ <table>
+ <tr>
+ <th align="right">|.$locale->text('Password').qq|</th>
+ <td><input type="password" name="new_password" /></td>
+ </tr>
+ <tr>
+ <th align="right">|.$locale->text('Confirm').qq|</th>
+ <td><input type="password" name="confirm_password" /></td>
+ </tr>
+ </table>
+ <input type="hidden" name="path" value="$form->{path}" />
+ <input type="hidden" name="sessionid" value="$form->{sessionid}" />
+ <p><input type="submit" class="submit" name="action" value="|.$locale->text('Change Password').qq|" /></p>
+ </form>
+
+ <a href="http://sourceforge.net/projects/ledger-smb/">LedgerSMB |.$locale->text('website').qq|</a>
+ </div>
+ </body>
+ </html>
+|;
+}
+
sub adminlogin {
$form->{title} = qq|LedgerSMB $form->{version} |.$locale->text('Administration');