[rt-devel] Duplicate response checking

Matt Lightner mlightner at site5.com
Wed Sep 18 04:36:34 EDT 2002

> Trouble is, there's nothing to stop somebody stealing the ticket and
> replying before you've finished :)
> Unless stealing should also not be allowed, but I think that it is
> needed.

The way we do it is a person doesn't take a ticket unless it's specifically
for them.  All other tickets are left with no owner, and the on-duty
admin/tech will just respond to them.  So this issue tends to come up a bit
for us.

I just finished a pretty basic modification to prevent this from happening.
I'm not sure how graceful it is, but it seems to get the job done.  A more
practical patch would redisplay the Update.html page with the
newly-submitted response and allow the user to re-submit their response if
they were sure they wanted to reply again.  Oh well... maybe something for
2.1  :)

A simple patch against the 2.0.13 source is below.  I included 5 lines of
context so that people with newer versions can apply the patch easily.

Best Regards,
    Matt Lightner
    Vice President, Technical Operations
    Site5 Internet Solutions, Inc.
    mlightner at site5.com

diff -bBdNrw -U5 rt-2-0-13/webrt/Ticket/Display.html
--- rt-2-0-13/webrt/Ticket/Display.html Tue Nov  6 18:07:07 2001
+++ rtmod/webrt/Ticket/Display.html     Wed Sep 18 04:26:22 2002
@@ -127,10 +127,17 @@
     my $action = $1;
     my ($res, $msg)=$Ticket->$action();
     push(@Actions, $msg);
+if (defined $ARGS{pageload}) {
+        if ($ARGS{pageload} <= $Ticket->ToldObj->Unix) {
+            Abort("This ticket has been updated since you loaded the
response page.");
+        }
     $ARGS{'UpdateContent'} =~ s/\r\n/\n/g;
     chomp ($ARGS{'UpdateContent'}) ;

     if ($ARGS{'UpdateContent'} &&
         $ARGS{'UpdateContent'} ne '' &&
diff -bBdNrw -U5 rt-2-0-13/webrt/Ticket/Update.html
--- rt-2-0-13/webrt/Ticket/Update.html  Wed Feb 20 20:45:38 2002
+++ rtmod/webrt/Ticket/Update.html      Wed Sep 18 04:22:42 2002
@@ -54,10 +54,11 @@
 of email addresses. Does <b>not</b> change who will receive future
 <tr><td align=right>Attach:</td><td><input name="UpdateAttachment"
 <& /Elements/MessageBox, Name=>"UpdateContent",
QuoteTransaction=>$ARGS{QuoteTransaction} &>
+               <INPUT TYPE=HIDDEN NAME=pageload VALUE="<%time()%>">
                <INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>"><br>

More information about the Rt-devel mailing list