[Jifty-commit] jifty branch, master, updated. 2fe15ddcecd2194a3cbd9af5916e7f023de3eadd

Jifty commits jifty-commit at lists.jifty.org
Thu Dec 31 17:06:44 EST 2009


The branch, master has been updated
       via  2fe15ddcecd2194a3cbd9af5916e7f023de3eadd (commit)
      from  fff4d920ed1b13f2208a280767f37c6302850207 (commit)

Summary of changes:
 lib/Jifty/Plugin/RequestInspector.pm      |    8 +++++++-
 lib/Jifty/Plugin/RequestInspector/View.pm |    3 +++
 2 files changed, 10 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 2fe15ddcecd2194a3cbd9af5916e7f023de3eadd
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Dec 31 17:06:41 2009 -0500

    Use cookie value (if set) as an identifier, to appear in admin view

diff --git a/lib/Jifty/Plugin/RequestInspector.pm b/lib/Jifty/Plugin/RequestInspector.pm
index 26d675a..6d5bc11 100644
--- a/lib/Jifty/Plugin/RequestInspector.pm
+++ b/lib/Jifty/Plugin/RequestInspector.pm
@@ -52,11 +52,17 @@ sub get_plugin_data {
 sub new_request_inspection {
     my ($self, $cgi) = @_;
 
-    return {
+    my $ret = {
         id    => 1 + @requests,
         start => time,
         url   => $cgi->url(-absolute => 1, -path_info => 1),
     };
+
+    if (my $cookie_name = $self->on_cookie) {
+        my %cookies     = CGI::Cookie->fetch();
+        $ret->{cookie} = $cookies{$cookie_name}->value;
+    }
+    return $ret;
 }
 
 do {
diff --git a/lib/Jifty/Plugin/RequestInspector/View.pm b/lib/Jifty/Plugin/RequestInspector/View.pm
index a326b7b..b3efcc0 100644
--- a/lib/Jifty/Plugin/RequestInspector/View.pm
+++ b/lib/Jifty/Plugin/RequestInspector/View.pm
@@ -152,6 +152,9 @@ sub _render_request {
         );
 
         outs sprintf ' (%.2gs)',  $request->{end} - $request->{start};
+        if ($request->{cookie}) {
+            outs " [" . $request->{cookie} . "]";
+        }
 
         render_region("request_$id");
     };

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


More information about the Jifty-commit mailing list