[Rt-commit] rt branch, 3.8-rss-authstring, created. rt-3.8.7-61-g3787f56

Kevin Falcone falcone at bestpractical.com
Wed Dec 23 16:45:03 EST 2009


The branch, 3.8-rss-authstring has been created
        at  3787f562417de7c39c55e4f9336d8524f8844d98 (commit)

- Log -----------------------------------------------------------------
commit 03917d5b2127d7d529c93436c1e90dbcb4eb4a13
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Dec 21 15:45:39 2009 -0500

    fix Jumbo reloading and losing content

diff --git a/share/html/Ticket/ModifyAll.html b/share/html/Ticket/ModifyAll.html
index 7628700..4fcea50 100755
--- a/share/html/Ticket/ModifyAll.html
+++ b/share/html/Ticket/ModifyAll.html
@@ -133,8 +133,13 @@
   </tr>
   <tr>
     <td class="labeltop"><&|/l&>Content</&>:</td>
-    <td class="entry"><& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &></td>
-  </tr>
+    <td class="entry">
+% if (exists $ARGS{UpdateContent}) {
+    <& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, IncludeSignature => 0 &>
+% } else {
+    <& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &>
+% }
+  </td></tr>
 </table>
 </&>
   

commit 3787f562417de7c39c55e4f9336d8524f8844d98
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Dec 23 16:43:44 2009 -0500

    Switch over rdf generation to an authstring protected dhandler
    
    This logic apes the iCal handler in generating an authstring, but keeps
    Results.tsv untouched so folks with existing subscriptions won't need to
    change.  This works around IE and Safari restrictions where cookies
    aren't passed to RT.

diff --git a/share/html/NoAuth/rdf/dhandler b/share/html/NoAuth/rdf/dhandler
new file mode 100644
index 0000000..6b82f06
--- /dev/null
+++ b/share/html/NoAuth/rdf/dhandler
@@ -0,0 +1,78 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%# 
+%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
+%#                                          <jesse at bestpractical.com>
+%# 
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
+%# 
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%# 
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%# 
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+%# 
+%# 
+%# CONTRIBUTION SUBMISSION POLICY:
+%# 
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%# 
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%# 
+%# END BPS TAGGED BLOCK }}}
+<& /Search/Results.rdf, %ARGS &>
+<%init>
+use Encode ();
+
+my $path = $m->dhandler_arg;
+
+my $notfound = sub {
+    my $mesg = shift;
+    $r->headers_out->{'Status'} = '404 Not Found';
+    $RT::Logger->info("Error encountered in rss generation: $mesg");
+    $m->clear_and_abort;
+};
+
+$notfound->("Invalid path: $path") unless $path =~ m!^([^/]+)/([^/]+)/?!;
+
+my ($name, $auth) = ($1, $2);
+# Unescape parts
+$name =~ s/\%([0-9a-z]{2})/chr(hex($1))/gei;
+# convert to perl strings
+$name = Encode::decode_utf8( $name );
+
+my $user = RT::User->new( $RT::SystemUser );
+$user->Load( $name );
+$notfound->("Invalid user: $user") unless $user->id;
+
+$notfound->("Invalid authstring") unless $user->ValidateAuthString( $auth, $ARGS{Query}.$ARGS{Order}.$ARGS{OrderBy});
+
+my $cu = RT::CurrentUser->new;
+$cu->Load($user);
+$session{'CurrentUser'} = $cu;
+</%init>
diff --git a/share/html/Search/Results.html b/share/html/Search/Results.html
index 89101d9..703e3b5 100755
--- a/share/html/Search/Results.html
+++ b/share/html/Search/Results.html
@@ -165,7 +165,10 @@ my $QueryString = "?".$m->comp('/Elements/QueryString',
                                Page => $Page);
 my $ShortQueryString = "?".$m->comp('/Elements/QueryString', Query => $Query);
 my $RSSQueryString = "?".$m->comp('/Elements/QueryString', Query => $Query, Order => $Order, OrderBy => $OrderBy);
-my $RSSFeedURL = RT->Config->Get('WebPath')."/Search/Results.rdf$RSSQueryString";
+my $RSSPath  = join '/', map $m->interp->apply_escapes($_, 'u'),
+    $session{'CurrentUser'}->UserObj->Name,
+    $session{'CurrentUser'}->UserObj->GenerateAuthString( $Query.$Order.$OrderBy );
+my $RSSFeedURL = RT->Config->Get('WebPath')."/NoAuth/rdf/$RSSPath/$RSSQueryString";
 
 if ($ARGS{'TicketsRefreshInterval'}) {
 	$session{'tickets_refresh_interval'} = $ARGS{'TicketsRefreshInterval'};

-----------------------------------------------------------------------


More information about the Rt-commit mailing list