[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[3020] trunk/LedgerSMB/Form.pm



Revision: 3020
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3020&view=rev
Author:   einhverfr
Date:     2010-06-28 22:50:15 +0000 (Mon, 28 Jun 2010)

Log Message:
-----------
Correcting corner cases in anti-XSRF features

Modified Paths:
--------------
    trunk/LedgerSMB/Form.pm

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2010-06-28 20:52:18 UTC (rev 3019)
+++ trunk/LedgerSMB/Form.pm	2010-06-28 22:50:15 UTC (rev 3020)
@@ -171,12 +171,16 @@
 
 sub open_form {
     my ($self) = @_;
+    if ($self->{form_id} =~ '^\s*$'){
+        delete $self->{form_id};
+    }
     if (!$ENV{GATEWAY_INTERFACE}){
         return 1;
     }
     my $sth = $self->{dbh}->prepare('select form_open(?)');
     $sth->execute($self->{session_id});
     my @results = $sth->fetchrow_array();
+    print STDERR "Form id $results[0]\n";
     $self->{form_id} = $results[0];
     return $results[0];
 }
@@ -194,12 +198,16 @@
 
 sub close_form {
     my ($self) = @_;
+    if ($self->{form_id} =~ '^\s*$'){
+        delete $self->{form_id};
+    }
     if (!$ENV{GATEWAY_INTERFACE}){
         return 1;
     }
     my $sth = $self->{dbh}->prepare('select form_close(?, ?)');
     $sth->execute($self->{session_id}, $self->{form_id});
     my @results = $sth->fetchrow_array();
+    delete $self->{close_form};
     return $results[0];
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.