diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-04-26 18:00:56 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-04-26 18:00:56 +0000 |
commit | 666fd833584fe2e3618a397fe9d9a9bdf4c5b94b (patch) | |
tree | 19c4444705fd7f7803e0d7b597659c11d7e85b73 /common.pl | |
parent | 2edd2e4de0f08a0a5f23647ea715f279671a0b89 (diff) |
Doing a simple Perltidy commit so that I can evaluate differences between the branches and make sure patches are up to date
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1103 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'common.pl')
-rw-r--r-- | common.pl | 69 |
1 files changed, 36 insertions, 33 deletions
@@ -9,9 +9,9 @@ # with permission. # # This file contains source code included with or based on SQL-Ledger which -# is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 and licensed -# under the GNU General Public License version 2 or, at your option, any later -# version. For a full list including contact information of contributors, +# is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 and licensed +# under the GNU General Public License version 2 or, at your option, any later +# version. For a full list including contact information of contributors, # maintainers, and copyright holders, see the CONTRIBUTORS file. # ##################################################################### @@ -23,44 +23,47 @@ use LedgerSMB::Sysconfig; sub redirect { - use List::Util qw(first); - my ($script, $argv) = split(/\?/, $form->{callback}); + use List::Util qw(first); + my ( $script, $argv ) = split( /\?/, $form->{callback} ); - my @common_attrs = qw( - dbh login favicon stylesheet titlebar password custom_db_fields - ); + my @common_attrs = qw( + dbh login favicon stylesheet titlebar password custom_db_fields + ); - if (!$script){ # http redirect to login.pl if called w/no args - print "Location: login.pl\n"; - print "Content-type: text/html\n\n"; - exit; - } + if ( !$script ) { # http redirect to login.pl if called w/no args + print "Location: login.pl\n"; + print "Content-type: text/html\n\n"; + exit; + } - $form->error($locale->text(__FILE__.':'.__LINE__.':'.$script.':'."Invalid Redirect")) - unless first {$_ eq $script} @{LedgerSMB::Sysconfig::scripts}; + $form->error( + $locale->text( + __FILE__ . ':' . __LINE__ . ':' . $script . ':' . "Invalid Redirect" + ) + ) unless first { $_ eq $script } @{LedgerSMB::Sysconfig::scripts}; - my %temphash; - for (@common_attrs){ - $temphash{$_} = $form->{$_}; - } + my %temphash; + for (@common_attrs) { + $temphash{$_} = $form->{$_}; + } - undef $form; - $form = new Form($argv); - require "bin/$script"; + undef $form; + $form = new Form($argv); + require "bin/$script"; - for (@common_attrs){ - $form->{$_} = $temphash{$_}; - } - $form->{script} = $script; + for (@common_attrs) { + $form->{$_} = $temphash{$_}; + } + $form->{script} = $script; - if (!$myconfig){ # needed for login - %myconfig = %{LedgerSMB::User->fetch_config($form->{login})}; - } - if (!$form->{dbh} and ($script ne 'admin.pl')){ - $form->db_init(\%myconfig); - } + if ( !$myconfig ) { # needed for login + %myconfig = %{ LedgerSMB::User->fetch_config( $form->{login} ) }; + } + if ( !$form->{dbh} and ( $script ne 'admin.pl' ) ) { + $form->db_init( \%myconfig ); + } - &{$form->{action}}; + &{ $form->{action} }; } 1; |