Limiting account creation on osmf wiki
authorGrant Slater <git@firefishy.com>
Sat, 20 Dec 2014 21:22:40 +0000 (21:22 +0000)
committerGrant Slater <git@firefishy.com>
Sat, 20 Dec 2014 21:22:40 +0000 (21:22 +0000)
cookbooks/foundation/recipes/wiki.rb
cookbooks/mediawiki/definitions/mediawiki_site.rb
cookbooks/mediawiki/templates/default/LocalSettings.php.erb

index d732df80795c6fcddac0572f4b6b5ab3d32387e7..f5347ee42c9825563dfcbb3a619f27bdbfa31a0e 100644 (file)
@@ -32,6 +32,7 @@ mediawiki_site  "wiki.osmfoundation.org" do
   email_contact "webmaster@openstreetmap.org"
   email_sender "webmaster@openstreetmap.org"
   email_sender_name "OSMF Wiki"
+  private_accounts true
 end
 
 cookbook_file "/srv/wiki.osmfoundation.org/Wiki.png" do
index e74c3ca269059b60b646a2037b6dbb39f8e4c657..3e427b2498ea3ba571116d4e9fa856f2fd0b5745 100644 (file)
@@ -54,6 +54,7 @@ define :mediawiki_site, :action => [ :create, :enable ] do
     :site_admin_user  => "Admin",
     :site_admin_pw    => params[:admin_password],
     :enable_ssl       => params[:enable_ssl] || FALSE,
+    :private_accounts => params[:private_accounts] || FALSE,
     :private          => params[:private] || FALSE
   }
 
index d03b78cf9f07a2bb04ffb72a396f392d8c1e9099..9f6ecb217a583ba28102a7a26e0a50d5e6fac277 100644 (file)
@@ -167,6 +167,12 @@ $wgGroupPermissions['bureaucrat']['deletelogentry'] = true;
 $wgGroupPermissions['bureaucrat']['deleterevision'] = true;
 $wgGroupPermissions['bureaucrat']['suppressrevision'] = true;
 $wgGroupPermissions['bureaucrat']['suppressionlog'] = true;
+
+<% if @mediawiki[:private_accounts] -%>
+#Prevent new user registrations except by existing users
+$wgGroupPermissions['*']['createaccount'] = false;
+$wgGroupPermissions['user']['createaccount'] = true;
+<% end -%>
 <% if @mediawiki[:private] -%>
 
 #Disable reading by anonymous users