[Rt-commit] rt branch, find_disabled_rows, created. rt-3.8.7-160-g4658be3

Ruslan Zakirov ruz at bestpractical.com
Wed Feb 17 18:39:56 EST 2010


The branch, find_disabled_rows has been created
        at  4658be309b346f9f9af2123cf70a92fc3865d71d (commit)

- Log -----------------------------------------------------------------
commit dc7d83edb9fc81a4383ef78f1e5531c51ee567a9
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Feb 5 01:05:57 2010 -0500

    Revert "yell at people and autogen RTAddressRegexp"
    
    This reverts commit bbc4db537e908f20083b76e15eaf47f2344d1e4d.
    
    See branch rt-address-regexp

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 3468af8..5500356 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -286,7 +286,7 @@ avoid sending mail to itself.  It will also hide RT addresses from the list of
 
 =cut
 
-Set($RTAddressRegexp , undef);
+Set($RTAddressRegexp , '^rt\@example.com$');
 
 =item C<$CanonicalizeEmailAddressMatch>, C<$CanonicalizeEmailAddressReplace>
 
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index b652d3e..6fc1b89 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -333,40 +333,6 @@ our %META = (
         },
     },
 
-    RTAddressRegexp => {
-        Type    => 'SCALAR',
-        PostLoadCheck => sub {
-            my $self = shift;
-            my $value = $self->Get('RTAddressRegexp');
-            return if $value;
-
-            $RT::Logger->error(
-                'RTAddressRegexp option is not set in the config.'
-                .' Not setting this option may result in big mail loops.'
-                .' Going to generate value for you, but generating value takes'
-                .' time and only a few queues are accounted. So this slow downs'
-                .' server restarts and command line utilities, as well dont'
-                .' protect you from loops if you have many queues'
-            );
-
-            my @emails = (
-                $self->Get('CorrespondAddress'),
-                $self->Get('CommentAddress'),
-            );
-            my $queues = RT::Queues->new( $RT::SystemUser );
-            $queues->UnLimit;
-            $queues->RowsPerPage(100);
-            while ( my $queue = $queues->Next ) {
-                push @emails, $queue->CorrespondAddress, $queue->CommentAddress;
-            }
-
-            my %seen;
-            my $re = join '|', map "\Q$_\E",
-                grep defined && length && !$seen{ lc $_ }++,
-                @emails;
-            $self->Set( qr/$re/ );
-        },
-    },
     # User overridable mail options
     EmailFrequency => {
         Section         => 'Mail',                                     #loc

commit a0789f618c2fb66e0403707bfc7ff905ff74ae52
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Feb 5 12:10:15 2010 -0500

    Revert "Don't squish CSS outside of comproots"
    
    Unlike fba9e628d1810d3a04328850ab6ce34ec9a934e8 which passes a full
    path, this just passes /NoAuth/css/web2/main-squished.css which
    realpath() helpfully turns into undef and you don't get any css.
    
    This reverts commit 37e90168d8cf8276e6fdf09c2e77b379cfa0d1cb.

diff --git a/share/html/NoAuth/css/dhandler b/share/html/NoAuth/css/dhandler
index 5d43dcc..8c51c95 100644
--- a/share/html/NoAuth/css/dhandler
+++ b/share/html/NoAuth/css/dhandler
@@ -58,10 +58,6 @@ else {
     return $m->decline;
 }
 
-if (!RT::Interface::Web->FileExistsInCompRoots(File => $path)) {
-    return $m->decline;
-}
-
 $squisher = new RT::CSS::Squish unless $squisher;
 $squisher->{'mason'} = $m;
 

commit 79746a8046b1c04bbe2fd9adf73356fd3aec3de1
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Feb 5 11:17:32 2010 -0500

    Dashboards changed from 20 to 50 to match the system default in
    b89e52f2964a1ca2dbceb236b107afcbb4806ef7
    
    Update the tests to match

diff --git a/t/web/dashboards.t b/t/web/dashboards.t
index 9d98ce6..a816eb3 100644
--- a/t/web/dashboards.t
+++ b/t/web/dashboards.t
@@ -133,14 +133,14 @@ $ticket->Create(
 );
 
 $m->follow_link_ok({text => 'different dashboard'});
-$m->content_contains("20 highest priority tickets I own");
-$m->content_contains("20 newest unowned tickets");
+$m->content_contains("50 highest priority tickets I own");
+$m->content_contains("50 newest unowned tickets");
 $m->content_lacks("Bookmarked Tickets");
 $m->content_contains("dashboard test", "ticket subject");
 
 $m->get_ok("/Dashboards/$id/This fragment left intentionally blank");
-$m->content_contains("20 highest priority tickets I own");
-$m->content_contains("20 newest unowned tickets");
+$m->content_contains("50 highest priority tickets I own");
+$m->content_contains("50 newest unowned tickets");
 $m->content_lacks("Bookmarked Tickets");
 $m->content_contains("dashboard test", "ticket subject");
 

commit 377a769dd6e71b1dd274413d276733a5ff54b189
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Feb 5 11:23:42 2010 -0500

    Use a define() check rather than != 0
    
    We need to detect if the user had a subscription preference,
    but the other check threw lots of warnings

diff --git a/share/html/Dashboards/Render.html b/share/html/Dashboards/Render.html
index 1ae9507..ba01a9d 100644
--- a/share/html/Dashboards/Render.html
+++ b/share/html/Dashboards/Render.html
@@ -112,7 +112,7 @@ for my $sub ($session{'CurrentUser'}->UserObj->Attributes->Named('Subscription')
 
 # otherwise honor their search preferences.. otherwise 50 rows
 # $rows == 0 means unlimited, which we don't want to ignore from above
-if (!$rows and ($rows != 0)) {
+unless (defined($rows)) {
     my $prefs = $session{'CurrentUser'}->UserObj->Preferences("SearchDisplay") || {};
     $rows = defined($prefs->{'RowsPerPage'}) ? $prefs->{'RowsPerPage'} : 50;
 }

commit 8b04ea78fbd34803a820a9edd4743e3592872b7e
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Feb 5 11:37:49 2010 -0500

    fix warning when authority is undef

diff --git a/share/html/Elements/Login b/share/html/Elements/Login
index f449e62..e768b0e 100755
--- a/share/html/Elements/Login
+++ b/share/html/Elements/Login
@@ -74,8 +74,9 @@ unless (!defined($uri->scheme) || $uri->scheme eq 'http' || $uri->scheme eq 'htt
 }
 
 # Make sure we're logging in to the same domain
+# You can get an undef authority with a relative uri like "index.html"
 my $uri_base_url = URI->new(RT->Config->Get('WebBaseURL'));
-unless ($uri->authority eq $uri_base_url->authority) {
+unless (!defined($uri->authority) || $uri->authority eq $uri_base_url->authority) {
     $form_action = RT->Config->Get('WebPath');
 }
 </%INIT>

commit d0765fa0d59080e98bcb0eb2e33588ab137e7edd
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Feb 5 08:56:51 2010 -0500

    Show the dynamically calculated mason local component root
    
    Now that the mason component roots are modified at runtime by Plugins,
    show the order to admins in case they're having trouble tracking down
    the load order.

diff --git a/share/html/Admin/Tools/Configuration.html b/share/html/Admin/Tools/Configuration.html
index eb48af1..93b60a9 100644
--- a/share/html/Admin/Tools/Configuration.html
+++ b/share/html/Admin/Tools/Configuration.html
@@ -128,6 +128,13 @@ foreach my $key ( RT->Config->Options( Overridable => undef, Sorted => 0 ) ) {
 % }
 </table>
 
+<h3><&|/l&>Plugin Mason Component Path Order</&></h3>
+<table>
+% foreach my $path ( map { $_->[1] } $m->interp->comp_root_array ) {
+<tr><td><% $path %></td></tr>
+% }
+</table>
+
 <h2><&|/l&>RT Size</&></h2>
 <table>
 <%PERL>

commit 650e1c8622c053975612b827f18faa643f0c694a
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Feb 5 08:55:07 2010 -0500

    Stop sorting Callbacks directories
    
    Originally this was added because all callbacks lived in
    local/html/Callbacks and we needed to impose some order other than "how
    readdir returned a list of directories".
    
    Now with plugins, each Callbacks directory lives in
    local/plugins/RT-Extension-Foo/html/Callbacks and we have a user defined
    sort order (the order of the @Plugins config option) which we should use
    instead.

diff --git a/lib/RT/Interface/Web/Request.pm b/lib/RT/Interface/Web/Request.pm
index e179464..573c69a 100644
--- a/lib/RT/Interface/Web/Request.pm
+++ b/lib/RT/Interface/Web/Request.pm
@@ -160,7 +160,7 @@ sub callback {
 
         my %seen;
         @$callbacks = (
-            sort grep defined && length,
+            grep defined && length,
             # Skip backup files, files without a leading package name,
             # and files we've already seen
             grep !$seen{$_}++ && !m{/\.} && !m{~$} && m{^/Callbacks/[^/]+\Q$page/$name\E$},

commit 4ec85e646f688744bd42fc9d83e6e43fef91870e
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Feb 5 23:53:27 2010 -0500

    Revert introduction of Class::Trigger
    
    This reverts commits
        5e70707066a176b7d7916d561a77e8cf9135f892
        f4be0b3e23ac675eae591d6a8f032880dcd82aa9
    
    There are better alternatives.

diff --git a/lib/RT/Action/SendEmail.pm b/lib/RT/Action/SendEmail.pm
index 8e1d24a..56d00b4 100755
--- a/lib/RT/Action/SendEmail.pm
+++ b/lib/RT/Action/SendEmail.pm
@@ -58,8 +58,6 @@ use base qw(RT::Action);
 use RT::EmailParser;
 use RT::Interface::Email;
 use Email::Address;
-use Class::Trigger;
-
 our @EMAIL_RECIPIENT_HEADERS = qw(To Cc Bcc);
 
 
@@ -170,8 +168,6 @@ sub Prepare {
 
     $self->RemoveInappropriateRecipients();
 
-    $self->call_trigger('RecipientProcessing');
-
     my %seen;
     foreach my $type (@EMAIL_RECIPIENT_HEADERS) {
         @{ $self->{$type} }
diff --git a/sbin/rt-test-dependencies.in b/sbin/rt-test-dependencies.in
index 89805ac..a0c99a4 100755
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@ -209,7 +209,6 @@ Digest::base
 Digest::MD5 2.27
 DBI 1.37
 Class::ReturnValue 0.40
-Class::Trigger
 DBIx::SearchBuilder 1.54
 Text::Template 1.44
 File::ShareDir

commit df7a20d87c92774126ae7251c563214fc6eb82c0
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Feb 9 07:26:41 2010 -0800

    RT::Config fix for proper loading when Fcntl is loaded.
    
    Date: Mon, 8 Feb 2010 19:47:04 -0800
    From: Ivan Kohler <ivan-rt-devel at 420.am>
    To: rt-devel at lists.bestpractical.com
    Cc: rt at northpb.com
    Subject: [Rt-devel] [patch] RT 3.8 bug when using Fcntl perl module
    
    Hi,
    
    I find myself having recently encountered the bug indicated here:
    
    http://lists.fsck.com/pipermail/rt-users/2009-September/061167.html
    
    (including "use Fcntl;" in a script which uses the RT libraries
    and attempts to LoadConfig() and Init() causes io error out with an
    error: "Couldn't load RT config file RT_SiteConfig.pm: Not a SCALAR
    reference")
    
    The following patch to lib/RT/Config.pm should fix the problem and allow
    use of RT libraries while Fcntl (and probably other similar modules
    which export symbols) are loaded concurrently:

diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 6fc1b89..2604a24 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -829,9 +829,9 @@ sub SetFromConfig {
 
             # get entry for type we are looking for
             # XXX skip references to scalars or other references.
-            # Otherwie 5.10 goes boom. may be we should skip any
+            # Otherwise 5.10 goes boom. maybe we should skip any
             # reference
-            return if ref($entry) eq 'SCALAR' || ref($entry) eq 'REF';
+            next if ref($entry) eq 'SCALAR' || ref($entry) eq 'REF';
             my $entry_ref = *{$entry}{ ref($ref) };
             next unless $entry_ref;
 

commit 14b2119fe023c4174c4ad6a6dfe13300a9184607
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Feb 9 09:34:15 2010 -0800

    Updated doc/Security with more modern security tips from Aaron Sigel

diff --git a/docs/Security b/docs/Security
index c9787ac..51ddfab 100755
--- a/docs/Security
+++ b/docs/Security
@@ -1,25 +1,12 @@
-RT2 runs setgid to some group (it defaults to 'rt').
+Security tips for running RT3
 
-rt's configuration file, 'config.pm', is not world readable because it 
-contains rt's database password. If  a user gets access to this file, he
-can arbitrarily manipulate the RT database. This is bad. You don't want
-this to happen.  config.pm is mode 550. No users should be members of 
-the 'rt' group unless you want them to be able to obtain your rt password.
+0   Protect your RT installation by making it only accessible via SSL
 
-If you're running the web interface, you'll need to make sure your webserver
-has access to config.pm.  You could do this by letting your webserver's user
-be a member of the 'rt' group. This has the disadvantage of letting 
-any mod_perl code on your web server have access to your RT password.
+1   Be sure to change the password for the root user of RT.  The default password is "password".  This can be changed via the RT web interface at: Preferences > About me
 
-Alternatively, you can run RT2 on its own apache instance bound to a high
-port on 127.0.0.1
-which runs as a non-priviledged user which is a member of the group 'rt'.  
+2   Be sure to protect your RT_SiteConfig.pm file if it contains database credentials or other sensitive information.  This file only needs to be readable by RT and your web server.  One way to accomplish this is to make the file readable only by root and the group that RT runs as, and then make sure your web server is a member of that group.  Advanced configuration may be required if other users have the ability to run CGIs or access the server where RT is running.  Otherwise, those users may have access to become RT superusers.
 
-Configure your webserver to proxy requests to RT's 
-virtual directory to the apache instance you just set up.
-
-TODO: doc the apache configs needed to do this.
-
-The same technique can be used to run multiple RT2 instances on the same host.
+3   Be sure to protect your database.  If it does not need to talk to the world, then don't allow it to listen for remote connections.  With MySQL this can be accomplished via "skip-networking".  If you use your database for other things and must allow remote connections, be sure to use a strong, hard to guess  password for RT.
 
+4   Apache, lighttpd, and most other web servers support name based virtual hosts.  When possible, configure RT as a name based virtual host to raise the bar against DNS rebinding attacks.  Note:  If when you visit http://your.servers.ipaddress.here you see RT, it means you are not likely getting this additional protection.
 

commit d5488e7f2d7de7e27eb5be9f5b78323adbdcc07d
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Feb 9 16:46:11 2010 -0500

    Analyze the path logically without consulting the filesystem

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index b38faa1..2fb9701 100755
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -554,27 +554,51 @@ sub StaticFileHeaders {
     # $HTML::Mason::Commands::r->headers_out->{'Last-Modified'} = $date->RFC2616;
 }
 
-=head2 FileExistsInCompRoots
+=head2 PathIsSafe
 
-Takes a C<< File => path >> and returns the path of first Mason comp root
-that the file lives under, or C<undef> if none exist.
+Takes a C<< Path => path >> and returns a boolean indicating that
+the path is safely within RT's control or not. The path I<must> be
+relative.
+
+This function does not consult the filesystem at all; it is merely
+a logical sanity checking of the path. This explicitly does not handle
+symlinks; if you have symlinks in RT's webroot pointing outside of it,
+then we assume you know what you are doing.
 
 =cut
 
-sub FileExistsInCompRoots {
+sub PathIsSafe {
     my $self = shift;
     my %args = @_;
-    my $file = $args{File};
-
-    require Cwd;
-    my $realpath = Cwd::realpath($file);
-
-    for my $comp_root ($HTML::Mason::Commands::m->interp->comp_root_array) {
-        my ($name, $rootdir) = @$comp_root;
-        return $rootdir if $realpath =~ /^\Q$rootdir\E(?=\/|$)/;
+    my $path = $args{Path};
+
+    # Get File::Spec to clean up extra /s, ./, etc
+    my $cleaned_up = File::Spec->canonpath($path);
+
+    # Forbid too many ..s. We can't just sum then check because
+    # "../foo/bar/baz" should be illegal even though it has more
+    # downdirs than updirs. So as soon as we get a negative score
+    # (which means "breaking out" of the top level) we reject the path.
+
+    my @components = split '/', $cleaned_up;
+    my $score = 0;
+    for my $component (@components) {
+        if ($component eq '..') {
+            $score--;
+            if ($score < 0) {
+                $RT::Logger->info("Rejecting unsafe path: $file");
+                return 0;
+            }
+        }
+        elsif ($component eq '.' || $component eq '') {
+            # these two have no effect on $score
+        }
+        else {
+            $score++;
+        }
     }
 
-    return undef;
+    return 1;
 }
 
 =head2 SendStaticFile 
@@ -594,8 +618,9 @@ sub SendStaticFile {
     my %args = @_;
     my $file = $args{File};
     my $type = $args{Type};
+    my $relfile = $args{RelativeFile};
 
-    if (!$self->FileExistsInCompRoots(File => $file)) {
+    if (defined($relfile) && !$self->PathIsSafe(Path => $relfile)) {
         $HTML::Mason::Commands::r->status(400);
         $HTML::Mason::Commands::m->abort;
     }
diff --git a/share/html/NoAuth/images/autohandler b/share/html/NoAuth/images/autohandler
index 431a44f..7abf8b8 100644
--- a/share/html/NoAuth/images/autohandler
+++ b/share/html/NoAuth/images/autohandler
@@ -3,5 +3,6 @@
 # properly configured their webserver to stop RT from passing 
 # images through the mason handler.
 my $file = $m->base_comp->source_file;
-RT::Interface::Web->SendStaticFile( File => $file );
+my $relfile = $m->base_comp->path;
+RT::Interface::Web->SendStaticFile( File => $file, RelativeFile => $relfile );
 </%INIT>

commit 306df9019b263bee09d5c5e564179849f7c59536
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Feb 9 16:53:49 2010 -0500

    Use the right variable name

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 2fb9701..fccfdb2 100755
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -586,7 +586,7 @@ sub PathIsSafe {
         if ($component eq '..') {
             $score--;
             if ($score < 0) {
-                $RT::Logger->info("Rejecting unsafe path: $file");
+                $RT::Logger->info("Rejecting unsafe path: $path");
                 return 0;
             }
         }

commit e7431dbebb6989563b770cceeafdbf1d02627492
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Feb 9 22:50:10 2010 -0500

    Reject paths for which canonpath returns undef

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index fccfdb2..d6b854f 100755
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -575,6 +575,11 @@ sub PathIsSafe {
     # Get File::Spec to clean up extra /s, ./, etc
     my $cleaned_up = File::Spec->canonpath($path);
 
+    if (!defined($cleaned_up)) {
+        $RT::Logger->info("Rejecting path that canonpath doesn't understand: $path");
+        return 0;
+    }
+
     # Forbid too many ..s. We can't just sum then check because
     # "../foo/bar/baz" should be illegal even though it has more
     # downdirs than updirs. So as soon as we get a negative score

commit fd60fd33287448352ba615856501615d54305030
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Feb 10 00:14:43 2010 -0500

    Pass RelativeFile to SendStaticFile in css and js autohandlers

diff --git a/share/html/NoAuth/css/autohandler b/share/html/NoAuth/css/autohandler
index a92cfd1..f11f78a 100644
--- a/share/html/NoAuth/css/autohandler
+++ b/share/html/NoAuth/css/autohandler
@@ -49,7 +49,8 @@
 my $file = $m->base_comp->source_file;
 
 if ($file =~ /\.(gif|png|jpe?g)$/i) {
-    RT::Interface::Web->SendStaticFile( File => $file );
+    my $relfile = $m->base_comp->path;
+    RT::Interface::Web->SendStaticFile( File => $file, RelativeFile => $relfile );
 } else {
     RT::Interface::Web::StaticFileHeaders();
     $r->content_type('text/css') ;
diff --git a/share/html/NoAuth/js/autohandler b/share/html/NoAuth/js/autohandler
index 74028f8..e814154 100644
--- a/share/html/NoAuth/js/autohandler
+++ b/share/html/NoAuth/js/autohandler
@@ -51,7 +51,8 @@ my $type;
 my $file = $m->base_comp->source_file;
 
 if ($file =~ /\.(gif|png|jpe?g)$/i) {
-    RT::Interface::Web->SendStaticFile( File => $file );
+    my $relfile = $m->base_comp->path;
+    RT::Interface::Web->SendStaticFile( File => $file, RelativeFile => $relfile );
 } else {
     &RT::Interface::Web::StaticFileHeaders();
     $r->content_type('application/x-javascript');

commit e25358cd1f5f85ce52638537383055c7dfe0eeb6
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Feb 16 07:14:02 2010 -0800

    Added "hourly" variant for our ticket search result charts

diff --git a/lib/RT/Report/Tickets.pm b/lib/RT/Report/Tickets.pm
index c539ab1..05f0100 100644
--- a/lib/RT/Report/Tickets.pm
+++ b/lib/RT/Report/Tickets.pm
@@ -68,14 +68,13 @@ sub Groupings {
         );
     }
 
-    push @fields, map {$_, $_} qw(
-        DueDaily DueMonthly DueAnnually
-        ResolvedDaily ResolvedMonthly ResolvedAnnually
-        CreatedDaily CreatedMonthly CreatedAnnually
-        LastUpdatedDaily LastUpdatedMonthly LastUpdatedAnnually
-        StartedDaily StartedMonthly StartedAnnually
-        StartsDaily StartsMonthly StartsAnnually
-    );
+
+    for my $field (qw(Due Resolved Created LastUpdated Started Starts)) {
+        for my $frequency (qw(Hourly Daily Monthly Annually)) {
+            my $item = $field.$frequency;
+            push @fields,  $item,  $item;
+        }
+    }
 
     my $queues = $args{'Queues'};
     if ( !$queues && $args{'Query'} ) {
@@ -183,11 +182,14 @@ sub _FieldToFunction {
 
     my $field = $args{'FIELD'};
 
-    if ($field =~ /^(.*)(Daily|Monthly|Annually)$/) {
+    if ($field =~ /^(.*)(Hourly|Daily|Monthly|Annually)$/) {
         my ($field, $grouping) = ($1, $2);
         my $alias = $args{'ALIAS'} || 'main';
         # Pg 8.3 requires explicit casting
         $field .= '::text' if RT->Config->Get('DatabaseType') eq 'Pg';
+        if ( $grouping =~ /Hourly/ ) {
+            $args{'FUNCTION'} = "SUBSTR($alias.$field,1,13)";
+        }
         if ( $grouping =~ /Daily/ ) {
             $args{'FUNCTION'} = "SUBSTR($alias.$field,1,10)";
         }

commit cda5a5f30bda3eb1715ed1b5b5d790a7b741a301
Author: Emmanuel Lacour <elacour at easter-eggs.com>
Date:   Tue Feb 16 17:56:35 2010 +0100

    Fix typo in code comments

diff --git a/lib/RT/Groups_Overlay.pm b/lib/RT/Groups_Overlay.pm
index 8d09755..f20c6ae 100755
--- a/lib/RT/Groups_Overlay.pm
+++ b/lib/RT/Groups_Overlay.pm
@@ -129,7 +129,7 @@ sub PrincipalsAlias {
 }
 
 
-# {{{ LimiToSystemInternalGroups
+# {{{ LimitToSystemInternalGroups
 
 =head2 LimitToSystemInternalGroups
 
@@ -148,7 +148,7 @@ sub LimitToSystemInternalGroups {
 
 # }}}
 
-# {{{ LimiToUserDefinedGroups
+# {{{ LimitToUserDefinedGroups
 
 =head2 LimitToUserDefinedGroups
 
@@ -167,7 +167,7 @@ sub LimitToUserDefinedGroups {
 
 # }}}
 
-# {{{ LimiToPersonalGroupsFor
+# {{{ LimitToPersonalGroupsFor
 
 =head2 LimitToPersonalGroupsFor PRINCIPAL_ID
 

commit 8079c05cc2f513c7d511d324f7e9e74513c19890
Author: Emmanuel Lacour <elacour at easter-eggs.com>
Date:   Tue Feb 16 18:21:10 2010 +0100

    Add missing loc()

diff --git a/share/html/SelfService/Error.html b/share/html/SelfService/Error.html
index 9c81ebb..8956c3e 100755
--- a/share/html/SelfService/Error.html
+++ b/share/html/SelfService/Error.html
@@ -66,6 +66,6 @@ $Why => loc("the calling component did not specify why")
 </%args>
 
 <%INIT>
-$Details ||= "No details";
+$Details ||= loc("No details");
 $RT::Logger->error("WebRT: $Why ($Details)");
 </%INIT>

commit 82b813d4771ca303c098382e00790cde21b1155a
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Feb 16 14:44:15 2010 -0500

    New configuration for AttachmentUnits

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 5500356..5d9607e 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1078,6 +1078,18 @@ this overrides C<TrustHTMLAttachments>.
 
 Set($AlwaysDownloadAttachments, undef);
 
+=item C<$AttachmentUnits>
+
+Controls the units (kilobytes or bytes) that attachment sizes use
+for display. The default is to display kilobytes if the attachment
+is larger than 1024 bytes, bytes otherwise. If you set
+C<$AttachmentUnits> to C<'k'> then attachment sizes will always be
+displayed in kilobytes. If set to C<'b'>, then sizes will be bytes.
+
+=cut
+
+Set($AttachmentUnits, undef);
+
 =item C<$RedistributeAutoGeneratedMessages>
 
 Should RT redistribute correspondence that it identifies as
diff --git a/share/html/Ticket/Elements/ShowAttachments b/share/html/Ticket/Elements/ShowAttachments
index 72298d7..ab0d921 100755
--- a/share/html/Ticket/Elements/ShowAttachments
+++ b/share/html/Ticket/Elements/ShowAttachments
@@ -61,11 +61,22 @@
 my $size = $rev->ContentLength;
 
 if ($size) {
-    if ($size > 1024) {
-        $size = int($size/102.4)/10 . "k";
+    my $kb = int($size/102.4) / 10;
+    my $units = RT->Config->Get('AttachmentUnits');
+
+    if (!defined($units)) {
+        if ($size > 1024) {
+            $size = $kb . "k";
+        }
+        else {
+            $size = $size . "b";
+        }
+    }
+    elsif ($units eq 'k') {
+        $size = $kb . "k";
     }
     else {
-        $size = $size ."b";
+        $size = $size . "b";
     }
 
 </%PERL>

commit e7b508e6e8a8a38b0bb664ba46bd8cbbab661c3d
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Feb 16 15:37:08 2010 -0500

    Pass more information to the FormStart callback

diff --git a/share/html/Ticket/Update.html b/share/html/Ticket/Update.html
index 58e1812..79e0f99 100755
--- a/share/html/Ticket/Update.html
+++ b/share/html/Ticket/Update.html
@@ -55,7 +55,7 @@
 
 <form action="Update.html" name="TicketUpdate"
     method="post" enctype="multipart/form-data">
-% $m->callback( CallbackName => 'FormStart', ARGSRef => \%ARGS, Ticket => $TicketObj );
+% $m->callback( CallbackName => 'FormStart', ARGSRef => \%ARGS, Ticket => $TicketObj, CanRespond => $CanRespond, CanComment => $CanComment, ResponseDefault => $ResponseDefault, CommentDefault => $CommentDefault );
 <input type="hidden" class="hidden" name="QuoteTransaction" value="<% $ARGS{QuoteTransaction}||'' %>" />
 <input type="hidden" class="hidden" name="DefaultStatus" value="<% $DefaultStatus ||''%>" />
 <input type="hidden" class="hidden" name="Action" value="<% $ARGS{Action}||'' %>" />

commit 4c69a83253157680018b6d0b81791a6a51bbaf9f
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Feb 16 16:34:15 2010 -0500

    Callback for the bottom of the logout box

diff --git a/share/html/NoAuth/Logout.html b/share/html/NoAuth/Logout.html
index f795658..5a70277 100755
--- a/share/html/NoAuth/Logout.html
+++ b/share/html/NoAuth/Logout.html
@@ -58,6 +58,9 @@
 <br />
 <a href="<%$URL%>"><&|/l&>You're welcome to login again</&></a>.
 </&>
+
+% $m->callback( %ARGS );
+
 </div></div>
 <& /Elements/Footer, Menu => 0 &>
 

commit 4658be309b346f9f9af2123cf70a92fc3865d71d
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Feb 16 16:45:35 2010 -0500

    LogoutRefresh config for controlling how long to wait before going back to login

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 5d9607e..a04ba95 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1195,6 +1195,16 @@ to RT for the defined time.
 
 Set($AutoLogoff, 0);
 
+=item C<$LogoutRefresh>
+
+The number of seconds to wait after logout before sending the user to the
+login page. By default, 1 second, though you may want to increase this if
+you display additional information on the logout page.
+
+=cut
+
+Set($LogoutRefresh, 1);
+
 =item C<$WebSecureCookies>
 
 By default, RT's session cookie isn't marked as "secure" Some web browsers 
diff --git a/share/html/NoAuth/Logout.html b/share/html/NoAuth/Logout.html
index 5a70277..9f01aa2 100755
--- a/share/html/NoAuth/Logout.html
+++ b/share/html/NoAuth/Logout.html
@@ -45,7 +45,7 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-<& /Elements/Header, Title => loc('Logout'), Refresh => "1;URL=$URL" &>
+<& /Elements/Header, Title => loc('Logout'), Refresh => RT->Config->Get('LogoutRefresh').";URL=$URL" &>
 </div>
 
 <div id="body" class="login-body">

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


More information about the Rt-commit mailing list