[Bps-public-commit] RT-Extension-rt_cpan_org branch, rt4, created. 2fceb4c147869e456af4db531205f6e719d4e458

Thomas Sibley trs at bestpractical.com
Tue Feb 26 00:47:27 EST 2013


The branch, rt4 has been created
        at  2fceb4c147869e456af4db531205f6e719d4e458 (commit)

- Log -----------------------------------------------------------------
commit d95799e5b4f6f6366e33d8f0c8292b026c5ccc4f
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Feb 25 17:00:08 2013 -0800

    This will be version 4.0 to match the RT version it is compatible with.
    
    Going forward, we can keep the major version in lockstep.

diff --git a/lib/RT/Extension/rt_cpan_org.pm b/lib/RT/Extension/rt_cpan_org.pm
index 75ab941..327fb87 100644
--- a/lib/RT/Extension/rt_cpan_org.pm
+++ b/lib/RT/Extension/rt_cpan_org.pm
@@ -52,7 +52,7 @@ use warnings;
 
 package RT::Extension::rt_cpan_org;
 
-our $VERSION = '0.03';
+our $VERSION = '4.0';
 
 =head1 NAME
 

commit c8bd5b494d1fa56cc6693b00b2c54e3ae4d9d7af
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Feb 25 16:57:39 2013 -0800

    Update override of RT::Interface::Web::ShowRequestedPage()
    
    This function is overridden to gut the core Self Service handling
    because it interferes with our own public-user handling.  Luckily, the
    function doesn't change much as evidence by the single-line change
    needed to bring it up to parity with RT 4.0.10.

diff --git a/lib/RT/Extension/rt_cpan_org.pm b/lib/RT/Extension/rt_cpan_org.pm
index 327fb87..bb642f9 100644
--- a/lib/RT/Extension/rt_cpan_org.pm
+++ b/lib/RT/Extension/rt_cpan_org.pm
@@ -100,6 +100,9 @@ sub ShowRequestedPage {
 
     SendSessionCookie();
 
+    # precache all system level rights for the current user
+    $HTML::Mason::Commands::session{CurrentUser}->PrincipalObj->HasRights( Object => RT->System );
+
     return $m->comp(
         { base_comp => $m->request_comp },
         $m->fetch_next,

commit 09aca537de0f5d384fcba1352f0c5822e4e3f10d
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Feb 25 17:01:40 2013 -0800

    Expand on the comments about RT::Config::META overrides

diff --git a/lib/RT/Extension/rt_cpan_org.pm b/lib/RT/Extension/rt_cpan_org.pm
index bb642f9..eb6ba85 100644
--- a/lib/RT/Extension/rt_cpan_org.pm
+++ b/lib/RT/Extension/rt_cpan_org.pm
@@ -80,11 +80,15 @@ SelfService. Not sure why. Should be checked.
 
 =cut
 
-# there is no sense in overriding default queue for rt.cpan.org
 require RT::Config;
+
+# There is no sense in overriding default queue for rt.cpan.org
 $RT::Config::META{'DefaultQueue'}{'Overridable'} = 0;
+
+# We provide a custom username format; others are not useful.
 $RT::Config::META{'UsernameFormat'}{'Overridable'} = 0;
 
+# Add rt.cpan.org variants of supplied styles.
 $RT::Config::META{'WebDefaultStylesheet'}{'WidgetArguments'}{'Values'} = [
     qw(rt.cpan.org-web2 rt.cpan.org-3.5 rt.cpan.org-3.4)
 ];

commit 2fceb4c147869e456af4db531205f6e719d4e458
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Feb 25 21:45:40 2013 -0800

    Remove horrible hack which set WebBaseURL and WebURL for each request
    
    This was to support much older versions of RT when visitors could toggle
    between HTTP and a self-signed SSL cert for HTTPS.
    
    Nowadays, we force SSL with a real cert.  This file should have been
    removed in dd1507e.

diff --git a/html/Callbacks/rt_cpan_org/autohandler/Init b/html/Callbacks/rt_cpan_org/autohandler/Init
deleted file mode 100644
index 5b4df3a..0000000
--- a/html/Callbacks/rt_cpan_org/autohandler/Init
+++ /dev/null
@@ -1,23 +0,0 @@
-<%INIT>
-# for testing purposes don't mess
-return if RT->Config->Get('WebDomain') eq 'localhost';
-
-# TODO: change this if there better way to check http vs. https
-if ( ($ENV{'SERVER_PORT'}||0) == 443 || ($ENV{HTTPS}||'') eq 'on' ) {
-    return if RT->Config->Get('WebBaseURL') =~ /^https:/;
-
-    foreach my $opt (qw(WebBaseURL WebURL)) {
-        my $value = RT->Config->Get( $opt );
-        RT->Config->Set( $opt => $value )
-            if $value =~ s{^http:}{https:};
-    }
-} else {
-    return if RT->Config->Get('WebBaseURL') =~ /^http:/;
-
-    foreach my $opt (qw(WebBaseURL WebURL)) {
-        my $value = RT->Config->Get( $opt );
-        RT->Config->Set( $opt => $value )
-            if $value =~ s{^https:}{http:};
-    }
-}
-</%INIT>

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



More information about the Bps-public-commit mailing list