[Evolvis-commits] r196: global permission set support for mediawiki plugin, untested↵

mirabilos at evolvis.org mirabilos at evolvis.org
Thu Nov 5 14:46:17 CET 2009


Author: mirabilos
Date: 2009-11-05 13:46:17 +0000 (Thu, 05 Nov 2009)
New Revision: 196

Added:
   trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/etc/local.d/
   trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/etc/local.d/70plugin_mediawiki
Modified:
   trunk/gforge_base/gforge-4.8.1+evolvis/debian/changelog
   trunk/gforge_base/gforge-4.8.1+evolvis/install/plugin-mediawiki
   trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/cronjobs/create-wikis.sh
   trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/www/LocalSettings.php
Log:
global permission set support for mediawiki plugin, untested


Modified: trunk/gforge_base/gforge-4.8.1+evolvis/debian/changelog
===================================================================
--- trunk/gforge_base/gforge-4.8.1+evolvis/debian/changelog	2009-11-05 13:05:49 UTC (rev 195)
+++ trunk/gforge_base/gforge-4.8.1+evolvis/debian/changelog	2009-11-05 13:46:17 UTC (rev 196)
@@ -1,8 +1,10 @@
 gforge (4.8.1+evolvis-6) xunstable; urgency=low
 
   * re-enable project list
+  * mediawiki plugin: allow permissions to be set globally via local.inc,
+    comment out per-group overrides by default
 
- -- Thorsten Glaser <t.glaser at tarent.de>  Thu, 05 Nov 2009 12:07:17 +0100
+ -- Thorsten Glaser <tg at mirbsd.de>  Thu, 05 Nov 2009 14:44:59 +0100
 
 gforge (4.8.1+evolvis-5) unstable; urgency=low
 

Modified: trunk/gforge_base/gforge-4.8.1+evolvis/install/plugin-mediawiki
===================================================================
--- trunk/gforge_base/gforge-4.8.1+evolvis/install/plugin-mediawiki	2009-11-05 13:05:49 UTC (rev 195)
+++ trunk/gforge_base/gforge-4.8.1+evolvis/install/plugin-mediawiki	2009-11-05 13:46:17 UTC (rev 196)
@@ -1,3 +1,5 @@
+# $Id$
+#
 plugins/mediawiki/bin/*            usr/share/gforge/plugins/mediawiki/bin/
 plugins/mediawiki/common/*         usr/share/gforge/plugins/mediawiki/common/
 plugins/mediawiki/cronjobs/*       usr/share/gforge/plugins/mediawiki/cronjobs/
@@ -4,3 +6,4 @@
 plugins/mediawiki/www/*            usr/share/gforge/www/plugins/mediawiki/
 plugins/mediawiki/mediawiki-skin/* usr/share/mediawiki/skins/
 plugins/mediawiki/etc/httpd.d/*    usr/share/gforge/etc/httpd.d/
+plugins/mediawiki/etc/local.d/[0-9][0-9]*  usr/share/gforge/etc/local.d/


Property changes on: trunk/gforge_base/gforge-4.8.1+evolvis/install/plugin-mediawiki
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/cronjobs/create-wikis.sh
===================================================================
--- trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/cronjobs/create-wikis.sh	2009-11-05 13:05:49 UTC (rev 195)
+++ trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/cronjobs/create-wikis.sh	2009-11-05 13:46:17 UTC (rev 196)
@@ -21,20 +21,23 @@
 \$wgEnableUploads = false;
 // Don't forget to "chown www-data $wdprefix/$project/images"
 
+// These are per-project settings. The global settings can be
+// changed in /etc/gforge/local.d/70plugin_mediawiki instead.
+
 // Edit permissions for group members
-\$wgGroupPermissions['Members']['edit']          = true;
-\$wgGroupPermissions['Members']['createpage']    = true;
-\$wgGroupPermissions['Members']['createtalk']    = true;
+//\$wgGroupPermissions['Members']['edit']          = true;
+//\$wgGroupPermissions['Members']['createpage']    = true;
+//\$wgGroupPermissions['Members']['createtalk']    = true;
 
 // Edit permissions for non-members
-\$wgGroupPermissions['Users']['edit']          = false;
-\$wgGroupPermissions['Users']['createpage']    = false;
-\$wgGroupPermissions['Users']['createtalk']    = false;
+//\$wgGroupPermissions['Users']['edit']          = false;
+//\$wgGroupPermissions['Users']['createpage']    = false;
+//\$wgGroupPermissions['Users']['createtalk']    = false;
 
 // Edit permissions for anonymous users
-\$wgGroupPermissions['*']['edit']          = false;
-\$wgGroupPermissions['*']['createpage']    = false;
-\$wgGroupPermissions['*']['createtalk']    = false;
+//\$wgGroupPermissions['*']['edit']          = false;
+//\$wgGroupPermissions['*']['createpage']    = false;
+//\$wgGroupPermissions['*']['createtalk']    = false;
 
 EOF
 

Added: trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/etc/local.d/70plugin_mediawiki
===================================================================
--- trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/etc/local.d/70plugin_mediawiki	                        (rev 0)
+++ trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/etc/local.d/70plugin_mediawiki	2009-11-05 13:46:17 UTC (rev 196)
@@ -0,0 +1,20 @@
+// $Id$
+
+// Edit and Read permissions for project members
+$sys_plugin_mediawiki_access_member_edit = true;
+$sys_plugin_mediawiki_access_member_createpage = true;
+$sys_plugin_mediawiki_access_member_createtalk = true;
+$sys_plugin_mediawiki_access_member_read = true;
+
+// Edit and Read permissions for non-project members
+$sys_plugin_mediawiki_access_user_edit = false;
+$sys_plugin_mediawiki_access_user_createpage = false;
+$sys_plugin_mediawiki_access_user_createtalk = false;
+$sys_plugin_mediawiki_access_user_read = true;
+
+// Edit and Read permissions for anonymous (not logged in)
+$sys_plugin_mediawiki_access_anon_edit = false;
+$sys_plugin_mediawiki_access_anon_createpage = false;
+$sys_plugin_mediawiki_access_anon_createtalk = false;
+$sys_plugin_mediawiki_access_anon_read = true;
+


Property changes on: trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/etc/local.d/70plugin_mediawiki
___________________________________________________________________
Name: svn:keywords
   + Author CVSHeader Date Id LastChangedBy LastChangedDate LastChangedRevision Log Revision Source State

Modified: trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/www/LocalSettings.php
===================================================================
--- trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/www/LocalSettings.php	2009-11-05 13:05:49 UTC (rev 195)
+++ trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/www/LocalSettings.php	2009-11-05 13:46:17 UTC (rev 196)
@@ -1,5 +1,7 @@
 <?php
 
+// $Id$
+
 $fusionforgeproject = 'siteadmin' ;
 $exppath = explode ('/', $_SERVER['PHP_SELF']) ;
 while (count ($exppath) >= 4) {
@@ -90,6 +92,10 @@
 $GLOBALS['REMOTE_ADDR'] = getStringFromServer('REMOTE_ADDR') ;
 $GLOBALS['HTTP_USER_AGENT'] = getStringFromServer('HTTP_USER_AGENT') ;
 
+function ifsetor(&$val, $default = false) {
+	return (isset($val) ? $val : $default);
+}
+
 function FusionForgeMWAuth( &$user, &$result ) {
 	global $fusionforgeproject ;
 
@@ -167,19 +173,22 @@
 $GLOBALS['wgHooks']['UserLoadFromSession'][]='FusionForgeMWAuth';
 
 $wgGroupPermissions['Members']['createaccount'] = true;
-$wgGroupPermissions['Members']['edit']          = true;
-$wgGroupPermissions['Members']['createpage']    = true;
-$wgGroupPermissions['Members']['createtalk']    = true;
+$wgGroupPermissions['Members']['edit']          = ifsetor($sys_plugin_mediawiki_access_member_edit);
+$wgGroupPermissions['Members']['createpage']    = ifsetor($sys_plugin_mediawiki_access_member_createpage);
+$wgGroupPermissions['Members']['createtalk']    = ifsetor($sys_plugin_mediawiki_access_member_createtalk);
+$wgGroupPermissions['Members']['read']          = ifsetor($sys_plugin_mediawiki_access_member_read, true);
 
-$wgGroupPermissions['Users']['createaccount'] = false;
-$wgGroupPermissions['Users']['edit']          = false;
-$wgGroupPermissions['Users']['createpage']    = false;
-$wgGroupPermissions['Users']['createtalk']    = false;
+$wgGroupPermissions['Users']['createaccount']   = false;
+$wgGroupPermissions['Users']['edit']            = ifsetor($sys_plugin_mediawiki_access_user_edit);
+$wgGroupPermissions['Users']['createpage']      = ifsetor($sys_plugin_mediawiki_access_user_createpage);
+$wgGroupPermissions['Users']['createtalk']      = ifsetor($sys_plugin_mediawiki_access_user_createtalk);
+$wgGroupPermissions['Users']['read']            = ifsetor($sys_plugin_mediawiki_access_user_read);
 
-$wgGroupPermissions['*']['createaccount'] = false;
-$wgGroupPermissions['*']['edit']          = false;
-$wgGroupPermissions['*']['createpage']    = false;
-$wgGroupPermissions['*']['createtalk']    = false;
+$wgGroupPermissions['*']['createaccount']       = false;
+$wgGroupPermissions['*']['edit']                = ifsetor($sys_plugin_mediawiki_access_anon_edit);
+$wgGroupPermissions['*']['createpage']          = ifsetor($sys_plugin_mediawiki_access_anon_createpage);
+$wgGroupPermissions['*']['createtalk']          = ifsetor($sys_plugin_mediawiki_access_anon_createtalk);
+$wgGroupPermissions['*']['read']                = ifsetor($sys_plugin_mediawiki_access_anon_read);
 
 if (file_exists ("$wikidata/LocalSettings.php")) {
         require ("$wikidata/LocalSettings.php") ;


Property changes on: trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/www/LocalSettings.php
___________________________________________________________________
Name: svn:keywords
   + Author CVSHeader Date Id LastChangedBy LastChangedDate LastChangedRevision Log Revision Source State




More information about the evolvis-commits mailing list