From a663c75503f551857d72354d984970a61fd8cf0f Mon Sep 17 00:00:00 2001 From: einhverfr Date: Fri, 22 Jun 2007 18:24:28 +0000 Subject: Request handler now working to the point that it properly handles a password that needs to be re-entered. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1305 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB.pm | 8 +++++--- UI/get_password.html | 2 +- lsmb-request.pl | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/LedgerSMB.pm b/LedgerSMB.pm index 193e258d..9c082693 100755 --- a/LedgerSMB.pm +++ b/LedgerSMB.pm @@ -163,6 +163,7 @@ sub new { my $locale = LedgerSMB::Locale->get_handle($self->{_user}->{countrycode}) or $self->error(__FILE__.':'.__LINE__.": Locale not loaded: $!\n"); $self->{_locale} = $locale; + $self->{stylesheet} = $self->{_user}->{stylesheet}; if ( $self->{password} ) { if ( !Session::password_check( @@ -212,7 +213,7 @@ sub new { sub _get_password { my ($self) = shift @_; $self->{sessionexpired} = shift @_; - @{$self->{hidden}}; + @{$self->{hidden}} = []; for (keys %$self){ next if $_ =~ /(^script$|^endsession$|^password$)/; my $attr = {}; @@ -220,14 +221,15 @@ sub _get_password { $attr->{value} = $self->{$_}; push @{$self->{hidden}}, $attr; } - my $template = Template->new( + my $template = LedgerSMB::Template->new( user =>$self->{_user}, locale => $self->{_locale}, path => 'UI', - template => 'get_password.html', + template => 'get_password', format => 'HTML' ); $template->render($self); + $template->output('http'); exit; } diff --git a/UI/get_password.html b/UI/get_password.html index 4f3bfc9a..774caea3 100644 --- a/UI/get_password.html +++ b/UI/get_password.html @@ -7,7 +7,6 @@ - @@ -39,6 +38,7 @@ function focus_input(){ + diff --git a/lsmb-request.pl b/lsmb-request.pl index 66978712..afc3f2a8 100644 --- a/lsmb-request.pl +++ b/lsmb-request.pl @@ -52,11 +52,11 @@ if (!$script){ } eval { require "scripts/$script" } - || $request->error($locale->text('Unable to open script' . ": $!"; + || $request->error($locale->text('Unable to open script') . ": $!"); $script =~ s/\.pl$//; $script = "LedgerSMB::Scripts::$script"; $script->can($request->{action}) - || $request->error($locale->text("Action Not Defined: ") . $request->{action}; + || $request->error($locale->text("Action Not Defined: ") . $request->{action}); $script->can($request->{action})->($request); -- cgit v1.2.3