Tags:
create new tag
, view all tags

Bug: Session variables will override preferences listed in FINALPREFERENCES

If a preference is listed in FINALPREFERENCES, setting a session variable (with something like SmartSessionPlugin and SessionPlugin) will override that final preference.

Test case

Put SKIN in FINALPREFERENCES in TWikiPreferences. Now try to set SKIN in the user's TWiki page. This SKIN will not work. Now use SmartSessionPlugin or SessionPlugin to set a "sticky skin." The session variable WILL override the pre-set SKIN.

This will become more important if and when I upload a version of SmartSessionPlugin that provides a TWikiVariable that allows users to set and get session variables. Right now the problem only SEEMS to surround %SKIN% right now, until other plugins start using setSessionVariable. The changes I'm about to make will provide a plugin that gives users access to setSessionVariable.

This patch to Prefs.pm should fix it:

<pre>
===================================================================
RCS file: Prefs.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -r1.1 -r1.2
186c186,189
<         return $sessionValue;
---
>     # BUG: This allows session variable to override final preference
>     #    return $sessionValue; 
>     # This should fix it
>          prvAddToPrefsList( $theKey, $sessionValue );
</pre>

Environment

TWiki version: TWikiRelease01Feb2003
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin, SmartSessionPlugin
Server OS: Linux
Web server: Apache
Perl version: 5.6.0
Client OS: MS Windows 2000
Web Browser: MSIE 5.5

-- TedPavlic - 24 Aug 2003

Follow up

Fix record

Topic revision: r1 - 2003-08-24 - TedPavlic
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2015 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.