Skip to content

Commit

Permalink
Item13312: Item13185: HomePagePlugin overrides params
Browse files Browse the repository at this point in the history
If the web/topic path is established by topic= and/or defaultweb=, then
HomePagePlugin overrides it.
  • Loading branch information
gac410 committed Mar 19, 2015
1 parent 25d8602 commit 28ebc00
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
9 changes: 6 additions & 3 deletions HomePagePlugin/data/System/HomePagePlugin.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1426439233" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1426726301" format="1.1" version="1"}%
---+!! !HomePagePlugin
<!--
One line description, required for extensions repository catalog.
Expand Down Expand Up @@ -54,8 +54,11 @@ Many thanks to the following sponsors for supporting this work:
* Created for Blackfin inc.

| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 1.23 (18 Mar 2015) | Foswikitask:Item13312: Don't override URL params topic and defaultweb |
| 1.22 (18 Dec 2014) | Foswikitask:Item12583: Use simple decimal version strings for better compatibility |
| 1.2.1 (16 Dec 2012) | Foswikitask:Item12297: Address perlcritic recommendation. |
| 1.2.1 (16 Dec 2012) | Foswikitask:Item12297: Address perlcritic recommendation.%BR%\
Foswikitask:Item11960: Don't redirect cli scripts %BR%\
Foswikitask:Item11866: Don't redirect to malformed targets |
| 1.2.0 (16 Apr 2012) | Foswikitask:Item11761: Include in core release |
| 1.1.1 (1 Aug 2009) | fix bug in login screen usage |
| 1.1.0 (July 2009) | add Expert hash allowing domain name based frontpage setting |
Expand All @@ -71,5 +74,5 @@ Many thanks to the following sponsors for supporting this work:
%META:FIELD{name="License" title="License" value="[[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License 3)]]"}%
%META:FIELD{name="Home" title="Home" value="http://foswiki.org/Extensions/HomePagePlugin"}%
%META:FIELD{name="Author" title="Author" value="Foswiki:Main.SvenDowideit"}%
%META:FIELD{name="Copyright" title="Copyright" value="&copy; 2009 SvenDowideit@fosiki.com - http://fosiki.com<br> &copy; 2012 Foswiki Contributors"}%
%META:FIELD{name="Copyright" title="Copyright" value="&copy; 2009 SvenDowideit@fosiki.com - http://fosiki.com<br> &copy; 2012-2015 Foswiki Contributors"}%
%META:FIELD{name="Repository" title="Repository" value="https://github.com/foswiki/distro"}%
11 changes: 8 additions & 3 deletions HomePagePlugin/lib/Foswiki/Plugins/HomePagePlugin.pm
Expand Up @@ -13,8 +13,8 @@ use warnings;
use Foswiki::Func ();
use Foswiki::Plugins ();

our $VERSION = '1.22';
our $RELEASE = '1.22';
our $VERSION = '1.23';
our $RELEASE = '1.23';
our $SHORTDESCRIPTION = 'Allow User specified home pages - on login';
our $NO_PREFS_IN_TOPIC = 1;

Expand All @@ -34,6 +34,11 @@ sub initializeUserHandler {
return
if ( $Foswiki::Plugins::SESSION->inContext('command_line') );

# Don't override web/topic if specified by url param.
return
if ( $Foswiki::Plugins::SESSION->{request}->param('defaultweb')
|| $Foswiki::Plugins::SESSION->{request}->param('topic') );

my $gotoOnLogin =
( $Foswiki::cfg{HomePagePlugin}{GotoHomePageOnLogin}
and $Foswiki::Plugins::SESSION->inContext('login') );
Expand Down Expand Up @@ -110,7 +115,7 @@ __END__
Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Copyright (c) 2009-2011 Sven Dowideit, SvenDowideit@fosiki.com
Copyright (c) 2012 Foswiki Contributors
Copyright (c) 2012-2015 Foswiki Contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
Expand Down
4 changes: 0 additions & 4 deletions core/lib/Foswiki.pm
Expand Up @@ -2239,10 +2239,6 @@ sub new {
# SMELL: what happens if we move this into the Foswiki::Users::new?
$this->{user} = $this->{users}->initialiseUser( $this->{remoteUser} );

# SMELL: Initializing the user overrides the web/topic for some reason
$this->{topicName} = $topic;
$this->{webName} = $web;

#Monitor::MARK("Initialised user");

# Static session variables that can be expanded in topics when they
Expand Down

0 comments on commit 28ebc00

Please sign in to comment.