diff --git a/servers/demo/projects/minipedia/LocalSettings.php b/servers/demo/projects/minipedia/LocalSettings.php index 7243a65..a93226e 100644 --- a/servers/demo/projects/minipedia/LocalSettings.php +++ b/servers/demo/projects/minipedia/LocalSettings.php @@ -1,151 +1,168 @@ <?php # This file was automatically generated by the MediaWiki 1.31.7 # installer. If you make manual changes, please keep track in case you # need to recreate them later. # # See includes/DefaultSettings.php for all configurable settings # and their default values, but don't forget to make changes in _this_ # file, not there. # # Further documentation for configuration settings may be found at: # https://www.mediawiki.org/wiki/Manual:Configuration_settings # Protect against web entry if ( !defined( 'MEDIAWIKI' ) ) { exit; } ## Include platform/distribution defaults require_once "$IP/includes/PlatformSettings.php"; ## Uncomment this to disable output compression # $wgDisableOutputCompression = true; $wgSitename = "Minipedia"; $wgMetaNamespace = "Progetto"; ## The URL base path to the directory containing the wiki; ## defaults for all runtime URL paths are based off of this. ## For more information on customizing the URLs ## (like /w/index.php/Page_title to /wiki/Page_title) please see: ## https://www.mediawiki.org/wiki/Manual:Short_URL $wgScriptPath = ""; $wgArticlePath = "/wiki/$1"; ## The protocol and server name to use in fully-qualified URLs $wgServer = "https://demo.wikimedia.ch"; ## The URL path to static resources (images, scripts, etc.) $wgResourceBasePath = $wgScriptPath; ## The URL path to the logo. Make sure you change this from the default, ## or else you'll overwrite your logo when you upgrade! //$wgLogo = "$wgResourceBasePath/images/5/57/MinipediA_coconut_noun_simple_logo.png"; $wgLogo = 'https://upload.wikimedia.org/wikipedia/commons/d/dc/Wikipedia-logo-v2-en-beta.png'; ## UPO means: this is also a user preference option $wgEnableEmail = true; $wgEnableUserEmail = true; # UPO $wgEnotifUserTalk = false; # UPO $wgEnotifWatchlist = false; # UPO $wgEmailAuthentication = true; ## Database settings $wgDBtype = "mysql"; $wgDBserver = "localhost"; $wgDBname = "minipedia"; $wgDBuser = "minipedia"; // See LocalSettings-secret.php // $wgDBpassword = ''; # MySQL specific settings $wgDBprefix = "mini_"; # MySQL table options to use during installation or update $wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary"; ## Shared memory settings $wgMainCacheType = CACHE_ACCEL; $wgMemCachedServers = []; ## To enable image uploads, make sure the 'images' directory ## is writable, then set this to true: $wgEnableUploads = true; #$wgUseImageMagick = true; #$wgImageMagickConvertCommand = "/usr/bin/convert"; # InstantCommons allows wiki to use images from https://commons.wikimedia.org $wgUseInstantCommons = true; # Periodically send a pingback to https://www.mediawiki.org/ with basic data # about this MediaWiki instance. The Wikimedia Foundation shares this data # with MediaWiki developers to help guide future development efforts. $wgPingback = true; ## If you use ImageMagick (or any other shell command) on a ## Linux server, this will need to be set to the name of an ## available UTF-8 locale $wgShellLocale = "C.UTF-8"; ## Set $wgCacheDirectory to a writable directory on the web server ## to make your wiki go slightly faster. The directory should not ## be publically accessible from the web. $wgCacheDirectory = '/var/www/wikimedia.ch/demo/cache'; # Site language code, should be one of the list in ./languages/data/Names.php $wgLanguageCode = "it"; # Changing this will log out all existing sessions. $wgAuthenticationTokenVersion = "1"; ## For attaching licensing metadata to pages, and displaying an ## appropriate copyright notice / icon. GNU Free Documentation ## License and Creative Commons licenses are supported so far. $wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright $wgRightsUrl = "https://creativecommons.org/licenses/by-sa/4.0/"; $wgRightsText = "Creative Commons Attribuzione-Condividi allo stesso modo"; $wgRightsIcon = "$wgResourceBasePath/resources/assets/licenses/cc-by-sa.png"; # Path to the GNU diff3 utility. Used for conflict resolution. $wgDiff3 = "/usr/bin/diff3"; # The following permissions were set based on your choice in the installer $wgGroupPermissions['*']['createaccount'] = false; -$wgGroupPermissions['*']['edit'] = false; + +// this is just a demo, we do not have enough time to fight spam +// anyway, let's block editing via an hook, instead of via privileges, or the UI changes +// $wgGroupPermissions['*']['edit'] = true; + +// block editing via an hook if you are not registered-in +$wgHooks['EditFilter'][] = function ( $editor, $text, $section, &$error, $summary ) { + + // only logged-in users can write + global $wgUser; + if( ! ( StubObject::isRealObject( $wgUser ) && $wgUser->isLoggedIn() ) ) { + $error = sprintf( + '<div class="errorbox">%s</div>', + "Apologies, it's just a demo :) Please request an account." + ); + return true; + } +}; ## Default skin: you can change the default skin. Use the internal symbolic ## names, ie 'vector', 'monobook': $wgDefaultSkin = "vector"; // Define constants for my additional namespaces. define("NS_MINI", 3002); // This MUST be even. define("NS_MINI_TALK", 3003); // This MUST be the following odd integer. // Add namespaces. $wgExtraNamespaces[NS_MINI] = "Mini"; $wgExtraNamespaces[NS_MINI_TALK] = "Mini_talk"; // Note underscores in the namespace name. # Enabled skins. # The following skins were automatically enabled: wfLoadSkin( 'MonoBook' ); wfLoadSkin( 'Timeless' ); wfLoadSkin( 'Vector' ); wfLoadExtension( 'Cite' ); wfLoadExtension( 'WikiEditor' ); wfLoadExtension( 'Math' ); wfLoadExtension( 'Gadgets' ); # End of automatically generated settings. # Add more configuration options below. // $wgSecretKey // $wgUpgradeKey // $wgSMTP // $wgPasswordSender // $wgEmergencyContact require 'LocalSettings-secret.php';