Skip to content

Commit

Permalink
Item1484: continuing the porting process. Not working on Release01x00…
Browse files Browse the repository at this point in the history
… at this point.

git-svn-id: http://svn.foswiki.org/trunk/WebPermissionsPlugin@3680 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed Apr 24, 2009
1 parent 98b325d commit 0823c43
Show file tree
Hide file tree
Showing 5 changed files with 499 additions and 364 deletions.
4 changes: 2 additions & 2 deletions data/System/WebPermissionsPlugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Use the following form to select the subset of webs and users you want to displa
<!-- Copy from HERE -->
#PermissionsMatrix
<div style="background-color: #ffffdf; padding: 10px">
Select the webs, users and groups you want to change permissions for from the list below. Ctrl+click and Shift+click work as normal.<br />
Select the webs, users, and groups you want to change permissions for from the list below. Ctrl+click and Shift+click work as normal.<br />
<form action="%SCRIPTURL{view}%/%WEB%/%TOPIC%#PermissionsMatrix" method="POST">
<select size="7" name="webs" multiple="multiple">
%WEBLIST{format="<option $marker>$name</option>" selection="%URLPARAM{"webs" multiple="on" separator=", "}%"}%
Expand Down Expand Up @@ -175,7 +175,7 @@ Many thanks to the following sponsors for supporting this work:
| License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
| Plugin Version: | %$VERSION% |
| Change History: | |
| March 2009 | ported to Foswiki |
| 21 Apr 2009 | Foswikitask:Item1484: Sven Dowideit, Crawford Currie, ported to Foswiki |
| 4 Dec 2007 | TWikibug:Item4901 fixed templates TWikibug:Item5072 added users parameter to select a subset of users/groups in the web permissions interface |
| 8 Sep 2007 | Updated for TWiki-4.2.0 |
| July 2006 | add Topic ACLs user interface via More topic actions - SvenDowideit@WikiRing.com |
Expand Down
37 changes: 20 additions & 17 deletions lib/Foswiki/Plugins/WebPermissionsPlugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,48 +28,51 @@ package Foswiki::Plugins::WebPermissionsPlugin;

use strict;

use vars qw( $VERSION $RELEASE $pluginName $antiBeforeSaveRecursion);
use Foswiki::Func ();

use Foswiki::Func;
use CGI qw( :all );
use Error;

$pluginName = 'WebPermissionsPlugin';

$VERSION = '$Rev: 160$';

$RELEASE = '1.120';
our $pluginName = 'WebPermissionsPlugin';
our $VERSION = '$Rev: 160$';
our $RELEASE = '21 Apr 2009';

sub initPlugin {
my( $topic, $web, $user, $installWeb ) = @_;
my ( $topic, $web, $user, $installWeb ) = @_;

# check for Plugins.pm versions
if( $Foswiki::Plugins::VERSION < 1.10 ) {
if ( $Foswiki::Plugins::VERSION < 1.10 ) {
Foswiki::Func::writeWarning(
'Version mismatch between WebPermissionsPlugin and Foswiki::Plugins' );
'Version mismatch between WebPermissionsPlugin and Foswiki::Plugins'
);
return 0;
}

Foswiki::Func::registerTagHandler( 'WEBPERMISSIONS', \&_WEBPERMISSIONS );
Foswiki::Func::registerTagHandler( 'TOPICPERMISSIONS', \&_TOPICPERMISSIONS );
Foswiki::Func::registerTagHandler( 'TOPICPERMISSIONS',
\&_TOPICPERMISSIONS );

# SMELL: need to disable this if the USERSLIST code is ever moved into the
# core.
Foswiki::Func::registerTagHandler( 'USERSLIST', \&_USERSLIST );
$antiBeforeSaveRecursion = 0;

Foswiki::Func::registerRESTHandler( 'change', \&_changeHandler );

return 1;
}

sub _changeHandler {
my $session = shift;
require Foswiki::Plugins::WebPermissionsPlugin::Core;
Foswiki::Plugins::WebPermissionsPlugin::Core::changeHandler($session);
}

sub _WEBPERMISSIONS {
my( $session, $params, $topic, $web ) = @_;
my ( $session, $params, $topic, $web ) = @_;

#return undef unless Foswiki::Func::isAdmin();

require Foswiki::Plugins::WebPermissionsPlugin::Core;
Foswiki::Plugins::WebPermissionsPlugin::Core::WEBPERMISSIONS(@_);
}


#TODO: add param topic= and show= specify to list only groups / only users / both
sub _TOPICPERMISSIONS {
require Foswiki::Plugins::WebPermissionsPlugin::Core;
Expand Down
Loading

0 comments on commit 0823c43

Please sign in to comment.