Changeset 3602
- Timestamp:
- 04/21/09 13:15:32 (3 years ago)
- Location:
- trunk/WebPermissionsPlugin
- Files:
-
- 7 edited
-
data/System/WebPermissionsPlugin.txt (modified) (12 diffs)
-
lib/Foswiki/Plugins/WebPermissionsPlugin.pm (modified) (1 diff)
-
lib/Foswiki/Plugins/WebPermissionsPlugin/Core.pm (modified) (5 diffs)
-
lib/Foswiki/Plugins/WebPermissionsPlugin/DEPENDENCIES (modified) (1 diff)
-
pub/System/WebPermissionsPlugin/WebPermissionsPlugin.js (modified) (3 diffs)
-
templates/webpermissionsplugin.topichtml.tmpl (modified) (4 diffs)
-
templates/webpermissionsplugin.topicjavascript.tmpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebPermissionsPlugin/data/System/WebPermissionsPlugin.txt
r788 r3602 9 9 * Set N = <input type="checkbox" /> 10 10 --> 11 This plugin provides a centralised interface to TWiki permissions.11 This plugin provides a centralised interface to Foswiki permissions. 12 12 13 13 Web permissions are presented as a matrix that has columns of webs and rows of users. For each web, you can control which users can view or change that web. All user webs, every registered user (except admin users), and every group (except admin groups) are shown in the matrix. … … 17 17 ---++++ Web Permissions 18 18 This interface allows you to control 19 <table class=" twikiTable">19 <table class="foswikiTable"> 20 20 <tr><th width="50%"> Viewing </th><th width="50%"> Editing </th></tr> 21 21 <tr><td> 22 22 VIEW = %V% CHANGE = %C% 23 <table class=" twikiTable">23 <table class="foswikiTable"> 24 24 <tr><th></th><th>Albums</th><th>Singles</th><th>Reviews</th><th>Statistics</th></tr> 25 25 <tr><th>AnnieLennox<td>%V%%C%</td><td>%V%%C%</td><td>%V%%C%</td><td>%V%</td></tr> … … 32 32 </td><td> 33 33 VIEW = %V% CHANGE = %C% 34 <table class=" twikiTable" border="1">34 <table class="foswikiTable" border="1"> 35 35 <tr><th></th><th>Albums</th><th>Singles</th><th>Reviews</th><th>Statistics</th></tr> 36 36 <tr><th> AnnieLennox </th><td>%V%%Y% %C%%Y%</td><td>%V%%Y%%C%%Y%</td><td>%V%%Y%%C%%Y%</td><td>%V%%Y%%C%%N%</td></tr> … … 64 64 <optgroup label="Users"><option>ProjectContributor</option><option>WikiGuest</option></optgroup></select> 65 65 </td><td align="center" width="100"> 66 <button type="button" style="width: 100%;" class=" twikiSubmit" name="action_save" id="save">%LEFT% Remove</button>67 <button type="button" style="width: 100%;" class=" twikiSubmit" name="action_cancel" id="cancel">Add %RIGHT%</button></td>66 <button type="button" style="width: 100%;" class="foswikiSubmit" name="action_save" id="save">%LEFT% Remove</button> 67 <button type="button" style="width: 100%;" class="foswikiSubmit" name="action_cancel" id="cancel">Add %RIGHT%</button></td> 68 68 <td width="40%"> 69 69 <h4><a name="Editors"></a> Editors </h4> … … 78 78 <tr><td></td> 79 79 <td align="center" valign="center"> 80 <button type="button" style="height: 20px; width: 30%;" class=" twikiSubmit" name="action_save" id="save">%DOWN%</button>81 <button type="button" style="height: 20px; width: 30%;" class=" twikiSubmit" name="action_cancel" id="cancel">%UP%</button>80 <button type="button" style="height: 20px; width: 30%;" class="foswikiSubmit" name="action_save" id="save">%DOWN%</button> 81 <button type="button" style="height: 20px; width: 30%;" class="foswikiSubmit" name="action_cancel" id="cancel">%UP%</button> 82 82 </td> 83 83 </tr> 84 84 <tr><td align="center"> 85 <button type="button" style="width: 100%;"class=" twikiSubmit" name="action_save" id="save">%LEFT% Remove</button>86 <button type="button" style="width: 100%;" class=" twikiSubmit" name="action_cancel" id="cancel">Add %RIGHT%</button></td>85 <button type="button" style="width: 100%;"class="foswikiSubmit" name="action_save" id="save">%LEFT% Remove</button> 86 <button type="button" style="width: 100%;" class="foswikiSubmit" name="action_cancel" id="cancel">Add %RIGHT%</button></td> 87 87 <td><h4><a name="Viewers"></a> Viewers </h4> 88 88 <select size="5" name="topicviewers" multiple="multiple" style="width: 100%;"> … … 95 95 </tr><tr> 96 96 <td colspan="3" align="right"> 97 <input class=" twikiSubmit" name="topic_permissions_action" id="save" value="Save" >98 <input class=" twikiSubmit" name="topic_permissions_action" id="cancel" value="Cancel"> 97 <input class="foswikiSubmit" name="topic_permissions_action" id="save" value="Save" > 98 <input class="foswikiSubmit" name="topic_permissions_action" id="cancel" value="Cancel"> 99 99 </td> 100 100 </tr> … … 102 102 </form> 103 103 <hr /> 104 105 *THIS PLUGIN REQUIRES TWiki-4.0.0 or later*106 104 107 105 ---++ Syntax Rules … … 115 113 116 114 ---+++ =WEBPERMISSIONS= 117 The =WEBPERMISSIONS= T Wikivariable accepts the following parameters:115 The =WEBPERMISSIONS= TML variable accepts the following parameters: 118 116 * =repeatheads= - if set to a number, headings will be repeated every this number of rows. This is very useful when you have a lot of users and groups. 119 117 * =webs= - a comma-separated list of webs to show. Default is to show all webs. … … 153 151 By default, the plugin only supports VIEW and CHANGE permissions on webs. You can change the set of access modes handled by the plugin by defining a configuration variable (in !LocalSite.cfg) to be a comma-separated list of access modes. For example, 154 152 <verbatim> 155 $ TWiki::cfg{Plugins}{WebPermissionsPlugin}{modes} = 'VIEW,CHANGE,RENAME';153 $Foswiki::cfg{Plugins}{WebPermissionsPlugin}{modes} = 'VIEW,CHANGE,RENAME'; 156 154 </verbatim> 157 155 See %SYSTEMWEB%.AccessControl for more information on what access modes can be used to control. … … 167 165 ---++ Plugin Info 168 166 169 Another great TWiki extension from the <a style="text-decoration:none" href="http://wikiring.com"><img src="%ATTACHURLPATH%/wikiringlogo20x20.png" alt="" /> *WikiRing* </a> - working together to improve your wiki experience!167 Another great Foswiki extension from the <a style="text-decoration:none" href="http://wikiring.com"><img src="%ATTACHURLPATH%/wikiringlogo20x20.png" alt="" /> *WikiRing* </a> - working together to improve your wiki experience! 170 168 171 169 Many thanks to the following sponsors for supporting this work: … … 173 171 * Further work supported by [[http://www.spanlink.com/][Spanlink Communications]] 174 172 175 | Plugin Author: | TWiki:Main.CrawfordCurrie & TWiki:Main.SvenDowideit, http://wikiring.com |173 | Plugin Author: | Foswiki:Main.CrawfordCurrie & :Main.SvenDowideit, http://wikiring.com | 176 174 | Copyright: | © 2006, Evolved Media Network, Spanlink Communications and WikiRing | 177 175 | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | 178 176 | Plugin Version: | %$VERSION% | 179 177 | Change History: | | 178 | March 2009 | ported to Foswiki | 180 179 | 4 Dec 2007 | TWikibug:Item4901 fixed templates TWikibug:Item5072 added users parameter to select a subset of users/groups in the web permissions interface | 181 180 | 8 Sep 2007 | Updated for TWiki-4.2.0 | … … 185 184 | 8877 | TWikibug:Item1701 - first release | 186 185 | Dependencies: | %$DEPENDENCIES% | 187 | Demo Url: | http://demo.wikiring.com/twiki/bin/view/Demo/TopicPermissionsDemo |188 186 | Plugin Home: | http://foswiki.org/Extensions/%TOPIC% | 189 187 | Feedback: | http://foswiki.org/Extensions/%TOPIC%Dev | -
trunk/WebPermissionsPlugin/lib/Foswiki/Plugins/WebPermissionsPlugin.pm
r3601 r3602 17 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 18 # 19 # For licensing info read LICENSE file in the TWiki root.19 # For licensing info read LICENSE file in the Foswiki root. 20 20 # 21 21 # Author: Crawford Currie http://c-dot.co.uk -
trunk/WebPermissionsPlugin/lib/Foswiki/Plugins/WebPermissionsPlugin/Core.pm
r3601 r3602 17 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 18 # 19 # For licensing info read LICENSE file in the TWiki root.19 # For licensing info read LICENSE file in the Foswiki root. 20 20 # 21 21 # Author: Crawford Currie http://c-dot.co.uk 22 # Author: Sven Dowideit http://fosiki.com 22 23 # Author: Eugen Mayer http://impressimpressive-media.de 23 24 # … … 31 32 # BUGO: because WEBPERMISSIONS is using the same view to change and display, 32 33 # updated ACL's do not apply to this view. 33 # TWiki has already loaded the permissions that it is using, and some34 # Foswiki has already loaded the permissions that it is using, and some 34 35 # random plugins have already processed things based on the ACLs prior to 35 36 # the users change. THIS IS HORRIGIBILE … … 108 109 } 109 110 110 $tab .= CGI::start_table( { border => 1, class => ' twikiTable' } );111 $tab .= CGI::start_table( { border => 1, class => 'foswikiTable' } ); 111 112 112 113 my $repeat_heads = $params->{repeatheads} || 0; … … 143 144 144 145 if( $editing ) { 145 $tab .= CGI::submit( -name => 'web_permissions_action', -value => 'Save', -class => ' twikiSubmit');146 $tab .= CGI::submit( -name => 'web_permissions_action', -value => 'Cancel', -class => ' twikiSubmit' );146 $tab .= CGI::submit( -name => 'web_permissions_action', -value => 'Save', -class => 'foswikiSubmit'); 147 $tab .= CGI::submit( -name => 'web_permissions_action', -value => 'Cancel', -class => 'foswikiSubmit' ); 147 148 } else { 148 $tab .= CGI::submit( -name => 'web_permissions_action', -value => 'Edit', -class => ' twikiSubmit' );149 $tab .= CGI::submit( -name => 'web_permissions_action', -value => 'Edit', -class => 'foswikiSubmit' ); 149 150 } 150 151 my $page = CGI::start_form( … … 390 391 @{$session->{users}->getAllGroups()}; 391 392 } else { 392 # This code assumes we are using TWiki topic based Group mapping393 # This code assumes we are using Foswiki topic based Group mapping 393 394 $session->{search}->searchWeb( 394 395 _callback => sub { -
trunk/WebPermissionsPlugin/lib/Foswiki/Plugins/WebPermissionsPlugin/DEPENDENCIES
r388 r3602 1 TWiki::Plugins,>=1.10,perl,TWiki-42 1 3 2 -
trunk/WebPermissionsPlugin/pub/System/WebPermissionsPlugin/WebPermissionsPlugin.js
r1050 r3602 17 17 */ 18 18 19 //create the TWiki namespace if needed20 if ( typeof( TWiki) == "undefined" ) {21 TWiki= {};19 //create the Fowsiki namespace if needed 20 if ( typeof( ) == "undefined" ) { 21 = {}; 22 22 } 23 23 24 24 /**********************************************************************************/ 25 //create the TWiki.WebPermissionsPlugin namespace if needed26 if ( typeof( TWiki.WebPermissionsPlugin ) == "undefined" ) {27 TWiki.WebPermissionsPlugin = {};25 //create the Foswiki.WebPermissionsPlugin namespace if needed 26 if ( typeof( Foswiki.WebPermissionsPlugin ) == "undefined" ) { 27 Foswiki.WebPermissionsPlugin = {}; 28 28 } 29 29 30 30 31 31 //moveSelectionTo(event, 'topiceditors', 'allusersandgroups') 32 TWiki.WebPermissionsPlugin.moveSelectionTo = function(event, fromSelectName, toSelectName) {32 Foswiki.WebPermissionsPlugin.moveSelectionTo = function(event, fromSelectName, toSelectName) { 33 33 var buttonTarget = (event.target) ? event.target : event.srcElement; 34 34 … … 55 55 } 56 56 57 //the namespace makes TWiki decide its a web.topic to be rendered as a url57 //the namespace makes Foswiki decide its a web.topic to be rendered as a url 58 58 prepareForSave = function(event) { 59 return TWiki.WebPermissionsPlugin.prepareForSave(event);59 return Foswiki.WebPermissionsPlugin.prepareForSave(event); 60 60 } 61 61 62 62 //return false cancels the submit 63 TWiki.WebPermissionsPlugin.prepareForSave = function(event) {63 Foswiki.WebPermissionsPlugin.prepareForSave = function(event) { 64 64 //, 'topiceditors', 'topicviewers', 'disallowedusers' 65 65 var buttonTarget = (event.target) ? event.target : event.srcElement; … … 68 68 var selectObj = buttonTarget.form.elements.namedItem('topiceditors'); 69 69 for (i=0; i< selectObj.options.length; i++) { 70 if (selectObj.options[i].value == TWiki.UsersWikiName) {70 if (selectObj.options[i].value == Foswiki.UsersWikiName) { 71 71 userInEditorsList = true; 72 72 } -
trunk/WebPermissionsPlugin/templates/webpermissionsplugin.topichtml.tmpl
r1340 r3602 17 17 </td> 18 18 <td align="center" width="100px"> 19 <button type="button" style="width:100%;" onclick=" TWiki.WebPermissionsPlugin.moveSelectionTo(event, 'topiceditors', 'disallowedusers');" class="twikiSubmit" >19 <button type="button" style="width:100%;" onclick="Foswiki.WebPermissionsPlugin.moveSelectionTo(event, 'topiceditors', 'disallowedusers');" class="foswikiSubmit" > 20 20 <IMG src="%PUBURL%/%SYSTEMWEB%/%PLUGINNAME%/leftarrow.png" alt="<-"> Remove 21 21 </button> 22 <button type="button" style="width: 100%;" onclick=" TWiki.WebPermissionsPlugin.moveSelectionTo(event, 'disallowedusers', 'topiceditors');" class="twikiSubmit" >22 <button type="button" style="width: 100%;" onclick="Foswiki.WebPermissionsPlugin.moveSelectionTo(event, 'disallowedusers', 'topiceditors');" class="foswikiSubmit" > 23 23 Add <IMG src="%PUBURL%/%SYSTEMWEB%/%PLUGINNAME%/rightarrow.png" alt="->"> 24 24 </button> … … 40 40 </td> 41 41 <td align="center" valign="center"> 42 <button type="button" style="height: 20px;width:30%;" onclick=" TWiki.WebPermissionsPlugin.moveSelectionTo(event, 'topiceditors', 'topicviewers');" class="twikiSubmit" >42 <button type="button" style="height: 20px;width:30%;" onclick="Foswiki.WebPermissionsPlugin.moveSelectionTo(event, 'topiceditors', 'topicviewers');" class="foswikiSubmit" > 43 43 <IMG src="%PUBURL%/%SYSTEMWEB%/%PLUGINNAME%/downarrow.png" alt="V"> 44 44 </button> 45 <button type="button" style="height: 20px;width:30%;" onclick=" TWiki.WebPermissionsPlugin.moveSelectionTo(event, 'topicviewers', 'topiceditors');" class="twikiSubmit" >45 <button type="button" style="height: 20px;width:30%;" onclick="Foswiki.WebPermissionsPlugin.moveSelectionTo(event, 'topicviewers', 'topiceditors');" class="foswikiSubmit" > 46 46 <IMG src="%PUBURL%/%SYSTEMWEB%/%PLUGINNAME%/uparrow.png" alt="^"> 47 47 </button> … … 50 50 <tr> 51 51 <td align="center"> 52 <button type="button" style="width: 100%;" onclick=" TWiki.WebPermissionsPlugin.moveSelectionTo(event, 'topicviewers', 'disallowedusers');" class="twikiSubmit" >52 <button type="button" style="width: 100%;" onclick="Foswiki.WebPermissionsPlugin.moveSelectionTo(event, 'topicviewers', 'disallowedusers');" class="foswikiSubmit" > 53 53 <IMG src="%PUBURL%/%SYSTEMWEB%/%PLUGINNAME%/leftarrow.png" alt="<-"> Remove 54 54 </button> 55 <button type="button" style="width: 100%;" onclick=" TWiki.WebPermissionsPlugin.moveSelectionTo(event, 'disallowedusers', 'topicviewers');" class="twikiSubmit" >55 <button type="button" style="width: 100%;" onclick="Foswiki.WebPermissionsPlugin.moveSelectionTo(event, 'disallowedusers', 'topicviewers');" class="foswikiSubmit" > 56 56 Add <IMG src="%PUBURL%/%SYSTEMWEB%/%PLUGINNAME%/rightarrow.png" alt="->"> 57 57 </button> … … 73 73 <tr> 74 74 <td align="right" colspan="3"> 75 <input type="submit" %DISABLESAVE% class=" twikiSubmit%DISABLESAVE%" name="topic_permissions_action" id="save" value='Save' onclick="return prepareForSave(event);" />76 <input type="submit" class=" twikiSubmit" name="topic_permissions_action" id="cancel" value='Cancel' accesskey='c' /> 75 <input type="submit" %DISABLESAVE% class="foswikiSubmit%DISABLESAVE%" name="topic_permissions_action" id="save" value='Save' onclick="return prepareForSave(event);" /> 76 <input type="submit" class="foswikiSubmit" name="topic_permissions_action" id="cancel" value='Cancel' accesskey='c' /> 77 77 </td> 78 78 </tr> -
trunk/WebPermissionsPlugin/templates/webpermissionsplugin.topicjavascript.tmpl
r1340 r3602 2 2 <script language="JavaScript" type="text/javascript" src="%PLUGINPUBURL%/WebPermissionsPlugin.js"></script> 3 3 <script language="JavaScript" type="text/javascript"> 4 TWiki.UsersWikiName = '%USERINFO{format="$wikiname"}%';4 Foswiki.UsersWikiName = '%USERINFO{format="$wikiname"}%'; 5 5 </script>
Note: See TracChangeset
for help on using the changeset viewer.
