Changeset 1238
- Timestamp:
- 12/09/08 22:54:45 (4 years ago)
- Location:
- trunk/ExportCookiePlugin
- Files:
-
- 3 edited
- 4 moved
-
. (moved) (moved from trunk/DrupalConSidExportPlugin)
-
data/System/ExportCookiePlugin.txt (moved) (moved from trunk/DrupalConSidExportPlugin/data/System/DrupalConSidExportPlugin.txt) (1 diff)
-
lib/Foswiki/Plugins/ExportCookiePlugin (moved) (moved from trunk/DrupalConSidExportPlugin/lib/Foswiki/Plugins/DrupalConSidExportPlugin)
-
lib/Foswiki/Plugins/ExportCookiePlugin/Config.spec (modified) (1 diff)
-
lib/Foswiki/Plugins/ExportCookiePlugin/MANIFEST (modified) (1 diff)
-
lib/Foswiki/Plugins/ExportCookiePlugin/build.pl (modified) (1 diff)
-
lib/Foswiki/Plugins/ExportCookiePluginPlugin.pm (moved) (moved from trunk/DrupalConSidExportPlugin/lib/Foswiki/Plugins/DrupalConSidExportPlugin.pm) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ExportCookiePlugin/data/System/ExportCookiePlugin.txt
r1210 r1238 1 1 ---+!! <nop>%TOPIC% 2 2 3 _This Drupal-Connector exports the SID of drupal and makes it available in Foswiki_ 3 Exports the value of a Cookie into the Foswiki variable <verbatim>%EXPORTCOOKIE%</verbatim> 4 4 5 5 %TOC% 6 6 7 7 ---++ USAGE 8 Use the macro <verbatim>% DRUPALSID%</verbatim> to display the sid. You can use this in links or further pugins.8 Use the macro <verbatim>%EXPORTCOOKIE%</verbatim> to display the value. You can use this in links or further pugins. 9 9 10 10 ---++ Plugin Settings 11 12 Plugin settings are stored as preferences variables. To reference a plugin setting write ==%<nop><plugin>_<setting>%==, i.e. ==%<nop>NEWPLUGIN_SHORTDESCRIPTION%== 13 14 * You need to set the Drupal->SessionHash string in the configure script of Foswiki. You find this hash in your Drupal installation. Please consider the Drupal documentation 15 * Hint: You can find the hash by easy checking your cookies when logged in in drupal. 11 * you need to set the CookieName in the Foswiki configure-system 16 12 17 13 ---++ Plugin Installation Instructions 18 19 __Note:__ You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server. 20 21 * Download the ZIP file from the Plugin Home (see below) 22 * Unzip ==%TOPIC%.zip== in your twiki installation directory. Content: 23 | *File:* | *Description:* | 24 | ==data/System/%TOPIC%.txt== | Plugin topic | 25 | ==data/System/%TOPIC%.txt,v== | Plugin topic repository | 26 | ==lib/Foswiki/Plugins/%TOPIC%.pm== | Plugin Perl module | 27 14 * just use the installer attached to the topic or even easier, use the configure-system/Extension to easy install it trough an user-interface 28 15 ---++ Plugin Info 29 16 30 | Plugin Author: | Foswiki:Main. EugenMayer|31 | Copyright: | © 200 7, Impressive.media |17 | Plugin Author: | Foswiki:Main.MayerEugen | 18 | Copyright: | © 2006, Impressive.media | 32 19 | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | 33 | Plugin Version: | 0 1 Dez 2008 (V0.1) |20 | Plugin Version: | 09 Dez 2008 (V0.2) | 34 21 | Change History: | <!-- versions below in reverse order --> | 35 | 01 dEZ 2008: | Initial version | 36 | TWiki Dependency: | $TWiki::Plugins::VERSION 1.1 | 22 | 09 Dez 2008: | Renamed plugin to ExportCookiePlugin to generelize the use | 23 | 01 Dez 2008: | Initial version | 24 | Foswiki Dependency: | | 37 25 | CPAN Dependencies: | HTTP::Cookies::Find | 38 | Other Dependencies: | none|26 | Other Dependencies: | | 39 27 | Perl Version: | 5.005 | 40 | [[Foswiki:Extensions/Benchmark][Benchmarks]]: | | 41 | Plugin Home: | http://foswiki.org/Extensions/%TOPIC% | 28 | Add-on Home: | http://foswiki.org/Extensions/%TOPIC% | 42 29 | Feedback: | http://foswiki.org/Extensions/%TOPIC%Dev | 43 30 | Appraisal: | http://foswiki.org/Extensions/%TOPIC%Appraisal | 44 31 45 __Related Topics:__ [[%SYSTEMWEB%.Plugins][Plugins]], %SYSTEMWEB%.DeveloperDocumentationCategory, %SYSTEMWEB%.AdminDocumentationCategory, %SYSTEMWEB%.DefaultPreferences, %USERSWEB%.SitePreferences32 __Related Topics:__ -
trunk/ExportCookiePlugin/lib/Foswiki/Plugins/ExportCookiePlugin/Config.spec
r1117 r1238 1 # ---+ Drupal1 # ---+ ExportCookie 2 2 # <h2>General Settings</h2> 3 3 4 4 # **STRING** 5 # Path to the themes folder 6 7 $Foswiki::cfg{Plugins}{Drupal}{SessionHash}=""; 5 # Name of the cookie to export 6 $Foswiki::cfg{Plugins}{ExportCookie}{CookieName}=""; -
trunk/ExportCookiePlugin/lib/Foswiki/Plugins/ExportCookiePlugin/MANIFEST
r1117 r1238 1 data/System/DrupalConSidExportPlugin.txt Plugin topic 2 lib/Foswiki/Plugins/DrupalConSidExportPlugin.pm Plugin Perl module 1 data/System/ExportCookiePlugin.txt Plugin topic 2 lib/Foswiki/Plugins/ExportCookiePlugin.pm Plugin Perl module 3 lib/Foswiki/Plugins/ExportCookiePlugin/Config.spec 0644 3 4 -
trunk/ExportCookiePlugin/lib/Foswiki/Plugins/ExportCookiePlugin/build.pl
r1117 r1238 9 9 use Foswiki::Contrib::Build; 10 10 11 $build = new Foswiki::Contrib::Build( " DrupalConSidExportPlugin" );11 $build = new Foswiki::Contrib::Build( "ExportCookiePlugin" ); 12 12 $build->build($build->{target}); 13 13 -
trunk/ExportCookiePlugin/lib/Foswiki/Plugins/ExportCookiePluginPlugin.pm
r1210 r1238 14 14 # http://www.gnu.org/copyleft/gpl.html 15 15 16 package Foswiki::Plugins:: DrupalConSidExportPlugin;16 package Foswiki::Plugins::ExportCookiePlugin; 17 17 18 18 use strict; … … 26 26 $RELEASE = 'Dakar'; 27 27 28 $SHORTDESCRIPTION = ' Saves the current PHPsid generated by drupal and makes it available';28 $SHORTDESCRIPTION = 'Exports the value of a cookie into the Foswiki variable %EXPORTCOOKIE%'; 29 29 $NO_PREFS_IN_TOPIC = 1; 30 30 31 $pluginName = ' DrupalConSidExportPlugin';31 $pluginName = 'ExportCookiePlugin'; 32 32 33 33 sub initPlugin { … … 42 42 $debug = $Foswiki::cfg{Plugins}{PHPsidPlugin}{Debug} || 0; 43 43 44 Foswiki::Func::registerTagHandler( ' DRUPALSID', \&_DRUPALSID);44 Foswiki::Func::registerTagHandler( 'EXPORTCOOKIE', \&_GETCOOKIE ); 45 45 return 1; 46 46 } 47 47 48 sub _ DRUPALSID{48 sub _GETCOOKIEVALUE { 49 49 my($this, $params, $theTopic, $theWeb) = @_; 50 my $twiki = $this->{twiki};51 50 my $query = Foswiki::Func::getCgiQuery(); 52 my $ sid= "";53 my $ drupalSessionHash = $Foswiki::cfg{Plugins}{Drupal}{SessionHash};51 my $value = ""; 52 my $CookieName = $Foswiki::cfg{Plugins}{ExportCookie}{CookieName}; 54 53 55 54 foreach my $name ($query->cookie()) { 56 if($name eq $ drupalSessionHash)55 if($name eq $CookieName) 57 56 { 58 $ sid= $query->cookie('-name'=>$name);57 $value = $query->cookie('-name'=>$name); 59 58 } 60 59 } 61 60 62 return $ sid;61 return $value; 63 62 } 64 63 1;
Note: See TracChangeset
for help on using the changeset viewer.
