[Bps-public-commit] r15321 - in RT-Extension-Captcha/html/Callbacks/RT-Extension-Captcha: Ticket/Display.html

ruz at bestpractical.com ruz at bestpractical.com
Thu Aug 21 01:41:27 EDT 2008


Author: ruz
Date: Thu Aug 21 01:41:27 2008
New Revision: 15321

Added:
   RT-Extension-Captcha/html/Callbacks/RT-Extension-Captcha/index.html/
   RT-Extension-Captcha/html/Callbacks/RT-Extension-Captcha/index.html/Initial
Modified:
   RT-Extension-Captcha/html/Callbacks/RT-Extension-Captcha/Ticket/Display.html/Initial

Log:
* protect quick create

Modified: RT-Extension-Captcha/html/Callbacks/RT-Extension-Captcha/Ticket/Display.html/Initial
==============================================================================
--- RT-Extension-Captcha/html/Callbacks/RT-Extension-Captcha/Ticket/Display.html/Initial	(original)
+++ RT-Extension-Captcha/html/Callbacks/RT-Extension-Captcha/Ticket/Display.html/Initial	Thu Aug 21 01:41:27 2008
@@ -2,7 +2,6 @@
 $ARGSRef => {}
 </%ARGS>
 <%INIT>
-$RT::Logger->crit("woot");
 return unless ($ARGSRef->{'id'}||'') eq 'new';
 
 my $queue = RT::Queue->new( $session{'CurrentUser'} );
@@ -24,7 +23,7 @@
         ."?Queue=". $m->interp->apply_escapes( $ARGSRef->{'Queue'}, 'u' )
         ."&results=". $key
     );
-    $m->abort;
+    return $m->abort;
 }
 
 delete $session{'Captcha'};

Added: RT-Extension-Captcha/html/Callbacks/RT-Extension-Captcha/index.html/Initial
==============================================================================
--- (empty file)
+++ RT-Extension-Captcha/html/Callbacks/RT-Extension-Captcha/index.html/Initial	Thu Aug 21 01:41:27 2008
@@ -0,0 +1,32 @@
+<%ARGS>
+$ARGSRef => {}
+$results => []
+</%ARGS>
+<%INIT>
+return unless $ARGSRef->{'QuickCreate'};
+
+my $queue = RT::Queue->new( $session{'CurrentUser'} );
+$queue->Load( $ARGSRef->{'Queue'} );
+return unless $queue->id;
+
+return if $queue->CurrentUserHasRight('NoCaptchaOnCreate');
+
+delete $session{'Captcha'};
+my $key = Digest::MD5::md5_hex( rand(1024) );
+push @{ $session{"Actions"}->{ $key } ||= [] }, @$results;
+$session{'i'}++;
+RT::Interface::Web::Redirect(
+    RT->Config->Get('WebURL')
+    ."Ticket/Create.html?". $m->comp('/Elements/QueryString',
+        id         => 'new',
+        Status     => 'new',
+        Requestors => $session{'CurrentUser'}->EmailAddress,
+        Queue      => $ARGSRef->{'Queue'},
+        Owner      => $ARGSRef->{'Owner'},
+        Subject    => $ARGSRef->{'Subject'},
+        Content    => $ARGSRef->{'Content'},
+        results    => $key,
+    )
+);
+return $m->abort;
+</%INIT>



More information about the Bps-public-commit mailing list