From 1aaa9fe478fc2e9ea0fa744edb704ccacf46d07b Mon Sep 17 00:00:00 2001 From: einhverfr Date: Thu, 13 Nov 2008 01:15:47 +0000 Subject: Correcting issues with draft editing. Moving AA::post_transaction to use strict. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2392 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Form.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'LedgerSMB/Form.pm') diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index f9ae6ad5..dec0813d 100644 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -536,7 +536,7 @@ sub redirect { my ( $self, $msg ) = @_; if ( $self->{callback} || !$msg ) { - + print STDERR "Full redirect\n"; main::redirect(); exit; } @@ -1189,6 +1189,16 @@ sub db_init { push @{ $self->{custom_db_fields}{ $ref->{extends} } }, $ref->{field_def}; } + # Roles tracking + $self->{_roles} = []; + $query = "select rolname from pg_roles + where pg_has_role(SESSION_USER, 'USAGE')"; + $sth = $dbh->prepare($query); + $sth->execute(); + while (my @roles = $sth->fetchrow_array){ + push @{$self->{_roles}}, $roles[0]; + } + $sth->finish(); } =item $form->run_custom_queries($tablename, $query_type[, $linenum]); -- cgit v1.2.3