source: trunk/w/LocalSettings.php @ 1934

Revision 1934, 16.8 KB checked in by Xiping.Wang, 8 months ago (diff)

[trunk] #324 Add anti-spam support to wiki module

Line 
1<?php
2
3include_once( dirname(__file__) . '/../common/omconfig.php' );
4
5# This file was automatically generated by the MediaWiki installer.
6# If you make manual changes, please keep track in case you need to
7# recreate them later.
8#
9# See includes/DefaultSettings.php for all configurable settings
10# and their default values, but don't forget to make changes in _this_
11# file, not there.
12
13# If you customize your file layout, set $IP to the directory that contains
14# the other MediaWiki files. It will be used as a base to locate files.
15if( defined( 'MW_INSTALL_PATH' ) ) {
16        $IP = MW_INSTALL_PATH;
17} else {
18        $IP = dirname( __FILE__ );
19}
20
21$path = array( $IP, "$IP/includes", "$IP/languages" );
22set_include_path( implode( PATH_SEPARATOR, $path ) . PATH_SEPARATOR . get_include_path() );
23
24require_once( "$IP/includes/DefaultSettings.php" );
25
26# If PHP's memory limit is very low, some operations may fail.
27# ini_set( 'memory_limit', '20M' );
28
29if ( $wgCommandLineMode ) {
30        if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
31                die( "This script must be run from the command line\n" );
32        }
33}
34## Uncomment this to disable output compression
35# $wgDisableOutputCompression = true;
36
37$wgSitename = OMWIKI_APPLICATION_NAME;
38
39## The URL base path to the directory containing the wiki;
40## defaults for all runtime URL paths are based off of this.
41$wgScriptPath           = OMWIKI_SCRIPT_PATH;
42$wgArticlePath          = OMWIKI_ARTICLE_PATH;
43$wgDBprefix         = OMWIKI_DB_TABLE_PREFIX;
44
45// Use url to determind which instance is used
46$callingURL = strtolower($_SERVER['REQUEST_URI']); //the requesting url
47$language_choice = join("|",array_keys($omcollab_languages));
48
49if(preg_match("/\/wiki\/?($language_choice)\//",$callingURL,$matches)) {
50        $language_code = $matches[1];
51
52        $wgLanguageCode = $language_code;
53        $wgDBprefix = OMWIKI_DB_TABLE_PREFIX."{$language_code}_";
54        $wgArticlePath = "/wiki/{$language_code}/".'$1';
55        $wgScriptPath = "/wiki{$language_code}";
56
57        // site name
58        $wgSitename = OMWIKI_APPLICATION_NAME." ({$omcollab_languages[$language_code]})"  ;
59       
60        // Arabic settings
61        if ($language_code == 'ar') {
62                //Set this to true to clean up archaic Unicode
63                //     sequences in Arabic text.
64                //From MW 1.16.0
65                $wgFixArabicUnicode = true;
66        }
67
68} else {
69        // Let English language be processed at last
70        // default language - English
71        $wgLanguageCode = 'en';
72        $wgDBprefix = OMWIKI_DB_TABLE_PREFIX;
73        $wgArticlePath = OMWIKI_ARTICLE_PATH;
74        $wgScriptPath = OMWIKI_SCRIPT_PATH;
75        // default site name
76        $wgSitename = OMWIKI_APPLICATION_NAME;
77}
78
79
80
81
82$wgScript               = "{$wgScriptPath}/index.php";
83$wgScriptExtension      = '.php';
84$wgRedirectScript       = "{$wgScriptPath}/redirect.php";
85$wgShowExceptionDetails = true;
86$wgUsePathInfo          = true;
87
88
89# MySQL database settings
90$wgDBtype           = "mysql";
91$wgDBserver         = OMCOLLAB_DB_HOSTNAME;
92$wgDBname           = OMWIKI_DATABASE_NAME;
93$wgDBuser           = OMWIKI_DB_USERNAME;
94$wgDBpassword       = OMWIKI_DB_PASSWORD;
95
96
97# MySQL table options to use during installation or update
98$wgDBTableOptions   = "TYPE=InnoDB";
99
100# Experimental charset support for MySQL 4.1/5.0.
101$wgDBmysql5 = false;
102
103# Postgres specific settings
104$wgDBport           = "5432";
105$wgDBmwschema       = "mediawiki";
106$wgDBts2schema      = "public";
107
108## Shared memory settings
109$wgMainCacheType    = CACHE_NONE;
110$wgMemCachedServers = array();
111
112$wgLocalInterwiki   = $wgSitename;
113## $wgLanguageCode     = "en";
114$wgProxyKey         = "4b3e36213be7ba5c16302ecde7b577643c0a2752692cbf64887d5c3f6c9db2";
115
116## For attaching licensing metadata to pages, and displaying an
117## appropriate copyright notice / icon. GNU Free Documentation
118## License and Creative Commons licenses are supported so far.
119# $wgEnableCreativeCommonsRdf = true;
120$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
121$wgRightsUrl  = "";
122$wgRightsText = "";
123$wgRightsIcon = "";
124# $wgRightsCode = ""; # Not yet used
125
126$wgDiff3 = "";
127
128# When you make changes to this configuration file, this will make
129# sure that cached pages are cleared.
130$wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( __FILE__ ) ) );
131
132
133# ------------------------------------------------- #
134#                                                   #
135#         omCollab Settings and Extensions          #
136#                                                   #
137# --------------------------------------------------#
138
139# [ error reporting ]
140$wgShowExceptionDetails = false; // set to false to disable
141
142# [ permissions ]
143$wgGroupPermissions['*']['edit']                   = false;
144$wgGroupPermissions['*']['createaccount']          = true;
145$wgGroupPermissions['*']['read']                   = true;
146
147# xiping.wang at gmail.com - 2010-08-31 - Remove space from group name
148# http://stackoverflow.com/questions/1104299/adding-users-to-a-custom-group-in-mediawiki
149$wgGroupPermissions['CoreContributor']['protect'] = true;
150$wgGroupPermissions['sysop']['editwidgets']        = true;
151$wgSysopUserBans                                   = true;
152$wgWhitelistRead                                   = array( "Main Page"
153                                                          , "Special:Userlogin"
154                                                          , "-"
155                                                          , "MediaWiki:Monobook.css" );
156
157# [ skin ]
158require_once( FS_COMMON_SKIN_DIRECTORY . '/common.php' );
159$wgStylePath           = "$wgScriptPath/skins";
160$wgStyleDirectory      = "$IP/skins";
161$wgLogo                = RR_COMMON_SKIN_DIRECTORY . '/images/omcollab_logo_text.gif';
162$wgDefaultSkin         = OMCOLLAB_SKIN_DIRNAME;
163$wgEnableParserCache   = false;
164$wgUseAjax             = true;
165$wgFavicon             = RR_OMCOLLAB_DIRECTORY . 'favicon.ico';
166
167# [ messaging ]
168$wgEnotifUserTalk      = true; # User Preference Option
169$wgEnotifWatchlist     = true; # User Preference Option
170$wgEmailAuthentication = true;
171$wgEnableEmail         = true;
172$wgEnableUserEmail     = true;
173$wgEmergencyContact    = OMCOLLAB_ADMIN_EMAIL;
174$wgPasswordSender      = OMCOLLAB_ADMIN_EMAIL;
175
176# [ namespaces ]
177$wgExtraNamespaces = array( 100 => "OMCOLLAB" );
178
179$wgNamespacesWithSubpages = array( NS_TALK           => true
180                                 , NS_USER           => true
181                                 , NS_USER_TALK      => true
182                                 , NS_PROJECT_TALK   => true
183                                 , NS_IMAGE_TALK     => true
184                                 , NS_MEDIAWIKI_TALK => true
185                                 , NS_TEMPLATE_TALK  => true
186                                 , NS_HELP_TALK      => true
187                                 , NS_CATEGORY_TALK  => true
188                                 , 100               => true );
189
190$wgNamespacesToBeSearchedDefault = array( NS_MAIN => true
191                                        ,NS_FILE => true
192                                        ,NS_CATEGORY => true
193                                        , 100     => true );
194                               
195# [ uploads ]
196$wgUploadPath        = "$wgScriptPath/images";
197$wgUploadDirectory   = "$IP/images";
198$wgEnableUploads     = true;
199#$wgUploadBaseUrl     = $wgServer;
200$wgFileExtensions    = array( 'png', 'gif', 'jpg', 'jpeg', 'doc', 'pdf', 'xls', 'ppt', 'docx','xlsx','pptx','zip','svg','mpp','swf','flv');
201
202# Workaround for file upload corruption issue. 
203$wgVerifyMimeType = false;
204
205# [ extensions ]
206require_once( "$IP/extensions/omCollabSingleSignon.php" );
207require_once( "$IP/extensions/APIQueryExtension/APIQueryExtension.php" );
208require_once( "$IP/extensions/omCollabHelperFunctions.php" );
209require_once( "$IP/extensions/omCollabBookmarks/omCollabBookmarks.php" );
210require_once( "$IP/extensions/omBookmarksExternal/omBookmarksExternal.php" );
211require_once( "$IP/extensions/Contributors/Contributors.php" );
212require_once( "$IP/extensions/ContributionScores/ContributionScores.php" );
213require_once( "$IP/extensions/ContributorsAddon/ContributorsAddon.php" );
214require_once( "$IP/extensions/WikiCategoryTagCloud/WikiCategoryTagCloud.php" );
215require_once( "$IP/extensions/SelectCategoryTagCloud/SelectCategoryTagCloud.php" );
216$wgSCTC_min_size                = OMWIKI_EXT_SCTC_MIN_SIZE;
217$wgSCTC_increase_factor = OMWIKI_EXT_SCTC_INCREASE_FACTOR;
218$wgSCTC_min_count               = OMWIKI_EXT_SCTC_MIN_COUNT;
219
220require_once( "$IP/extensions/DynamicArticleList/DynamicArticleList.php" );
221require_once( "$IP/extensions/DynamicPageList/DynamicPageList2.php" );
222require_once( "$IP/extensions/CategoryTree/CategoryTree.php" );
223require_once( "$IP/extensions/TreeAndMenu/TreeAndMenu.php" );
224require_once( "$IP/extensions/RSSReader/RSSReader.php" );
225require_once( "$IP/extensions/referenceselector/referenceselector.php" );
226require_once( "$IP/extensions/ImageMap/ImageMap.php" );
227require_once( "$IP/extensions/Cite/Cite.php" );
228require_once( "$IP/extensions/CharInsert/CharInsert.php" );
229require_once( "$IP/extensions/SocialProfile/SocialProfile.php" );
230require_once( "$IP/extensions/skype.php" );
231require_once( "$IP/extensions/Flash.php" );
232require_once( "$IP/extensions/Anywebsite/Anywebsite.php" );
233require_once( "$IP/extensions/CreateArticle.php" );
234#require_once( "$IP/extensions/ShareThis.php" );
235require_once("$IP/extensions/add-to-any-share-save/add-to-any-share-save.php");
236require_once( "$IP/extensions/Widgets/Widgets.php" );
237#require_once( "$IP/extensions/omCollabWikiEditorHelp.php" );
238require_once( "$IP/extensions/FCKeditor/FCKeditor.php" );
239
240#require_once('extensions/WYSIWYG/WYSIWYG.php');
241#$wgCKEditorHideDisabledTbutton = true;
242#$wgGroupPermission['*']['wysiwyg']=true;
243
244#require_once( "$IP/extensions/LiquidThreads/LqtPages.php" );
245require_once( "$IP/extensions/DiscussionThreading/DiscussionThreading.php" );
246require_once( "$IP/extensions/ParserFunctions/ParserFunctions.php" );
247
248#MediaWiki Wikitracer Plugin
249require_once( "$IP/extensions/SpecialWikitracer/SpecialWikitracer.php" );
250
251#MediaWiki Extension DocConvert settings
252require_once( "$IP/extensions/DocConvert/SpecialDocConvertExt.php" );
253
254require_once( "$IP/extensions/WikiSubscription/WikiSubscription.php" );
255require_once( "$IP/extensions/SpecialSubscribeAjax.php" );
256
257#Ticket 124 - Title Score definition table admin management
258require_once( "$IP/extensions/UserTitle/SpecialUserTitle.php" );
259$wgGroupPermissions['sysop']['usertitle'] = true;
260
261#Ticket 124 - Overall Contribution
262require_once( "$IP/extensions/OverallContributionScores/OverallContributionScores.php" );
263
264$wgEnableAPI=true;
265#Uncomment this line and put in the Path to the soffice (Open Office) binary, or alternatively, make sure you have soffice binary on your SYSTEM %path% variable or a symbolic link to your bin folder
266$wgExtDocConvertOOPath = OMWIKI_DOCCONVERT_OO_PATH;
267#these are the allowable extensions that Open Office can export to mediawiki, change only if you have tested file extensions inside open office by going to File -> Export As -> MediaWiki
268$wgExtDocConvAllowed = array(".doc",".odt",".docx");
269#Use this to completely disable the Extension, for example, if your host doesn't allow for open office installations
270$wgExtDocConvEnabled = OMWIKI_ENABLE_DOCCONVERT;
271#increase or decrease this to your liking, this controls how long the extension waits for open office to convert before it gives up and reports timeout message to the user
272$wgExtDocConvTimeout = 120;
273
274
275#InviteFriends Extension
276require_once("$IP/extensions/invitefriends.php");
277$wgExtInviteFriendsLoginRequired = true;
278
279# [ extensions - additional configuration options for the above ]
280
281//for extensions/APIQueryExtension/APIQueryExtension.php
282$wgAQETarget = 'http://mike2.openmethodology.org/w';
283
284//for extensions/ContributionScores/ContributionScores.php
285$contribScoreIgnoreBots = true;                        // Optional
286$contribScoreReports    = array( array( 7  , 50 )      // Optional. Each array defines a report - 7,50 is "past 7 days" and "LIMIT 50"
287                               , array( 30 , 50 )
288                               , array( 0  , 50 ) );
289
290//for extensions/TreeAndMenu/TreeAndMenu.php
291$wgTreeViewShowLines = true; 
292
293//for extensions/ShareThis.php
294$wgShowShareThisSidebar = true;
295if(isset($wgShareThisSiteList)){
296        unset($wgShareThisSiteList['Fark']);
297        unset($wgShareThisSiteList['Newsvine']);
298        unset($wgShareThisSiteList['reddit']);
299        unset($wgShareThisSiteList['Segnalo']);
300        unset($wgShareThisSiteList['Slashdot']);
301        unset($wgShareThisSiteList['Spurl']);
302        unset($wgShareThisSiteList['Wists']);
303}
304
305# To remove various skins from the User Preferences choices
306$wgSkipSkins = array("chick", "monobook" ,"cologneblue", "modern","myskin", "nostalgia", "simple", "standard");
307
308# [ extensions requiring configuration AFTER omCollab has been installed ]
309
310/*
311// ReCaptcha - adds CAPTCHA security to the registration process.
312// Sign up for your keys at http://recaptcha.net/api/getkey
313// then just paste them below and uncomment this block.
314require_once( "$IP/extensions/recaptcha/ReCaptcha.php" );
315$recaptcha_public_key = 'Paste_your_PUBLIC_recaptcha_key_here';
316$recaptcha_private_key = 'Paste_your_PRIVATE_recaptcha_key_here';
317*/
318
319/* POST-INSTALL-PLACEHOLDER (DO NOT REMOVE OR EDIT THIS COMMENT) */
320
321# mediawiki 1.14.0
322
323/** enable Mediawiki article name suggestion */
324$wgEnableMWSuggest =true;
325
326
327SpecialPage::$mList['SubscriptionList']=array( 'SpecialPage', 'SubscriptionList','subscriptionList','','',$IP.'/extensions/WikiSubscription/SpecialSubscriptionList.php' );
328$wgGroupPermissions['sysop']['subscriptionList'] = true;
329require_once( "$IP/extensions/WikiSubscription/SpecialUnsubscribe.php" );
330require_once( "$IP/extensions/WikiSubscription/SpecialSubscribeUserPanel.php" );
331//require_once( "$IP/extensions/team/SpecialTeamList.php" );
332SpecialPage::$mList['TeamList']=array( 'SpecialPage', 'TeamList','','','',$IP.'/extensions/team/SpecialTeamList.php' );
333//SpecialPage::$mList['TeamInvitation']=array( 'SpecialPage', 'TeamInvitation','','','',$IP.'/extensions/team/SpecialTeamInvitation.php' );
334//require_once( "$IP/extensions/team/SpecialUserTeam.php" );
335require_once( "$IP/extensions/team/SpecialEditTeam.php" );
336//require_once( "$IP/extensions/team/SpecialTeamRequest.php" );
337require_once( "$IP/extensions/team/SpecialTeamArrangement.php" );
338//comments out BreadCrumbs function for 1.3 milestone
339require_once( "$IP/extensions/BreadCrumbs/BreadCrumbs.php" );
340//
341
342
343// xiping.wang@gmail.com 2009-11-22
344// Add Title, META and LINK tags support
345require_once( "$IP/extensions/Add_HTML_Meta_And_Title.php" );
346
347// xiping.wang@gmail.com 2010-01-30
348// Add for SEO
349$wgNoFollowLinks=false;
350
351// Zhongzhen 2010-02-12
352// Add top contributors per article
353require_once("$IP/extensions/awc/top_ten/top_ten.php");
354
355
356// xiping.wang@gmail.com 2010-02-24
357// Replace svg convert from ImageMagick to librsvg
358$wgSVGConverter = 'rsvg';
359
360// Zhongzhen 2010-03-04
361// Add help extention in edit page
362// FIXME:Remove it later
363require_once("$IP/extensions/Help/Help_Guide.php");
364$wgHelpExtentionTitle = "Contribution_Guide"; // this is used in Help Extention
365
366
367// xiping.wang@gmail.com 2010-03-09
368// Add Login Language Selector
369// $wgLoginLanguageSelector=true;
370
371// Make sure these settings right
372$wgInterwikiMagic = true;
373$wgHideInterlanguageLinks = false;
374
375// xiping.wang@gmail.com 2010-03-14
376// View and edit the interwiki table
377require_once("$IP/extensions/Interwiki/SpecialInterwiki.php");
378$wgGroupPermissions['*']['interwiki'] = false;
379$wgGroupPermissions['sysop']['interwiki'] = true;
380
381
382// Add shared database setting for SSO in all wiki sites
383$wgSharedDB = OMWIKI_DATABASE_NAME;
384$wgSharedPrefix = OMWIKI_DB_TABLE_PREFIX;
385
386
387
388// xiping.wang@gmail.com 2010-03-25
389// Setup shared directory
390$wgUseSharedUploads = true;
391$wgSharedUploadPath = "http://".OMCOLLAB_HTTP_HOST."/w/images";
392$wgSharedUploadDirectory = "$IP/images/";
393$wgHashedSharedUploadDirectory = true;
394
395// Zhongzhen 2010-3-27
396// Add data driven links extention in article page.
397require_once( "$IP/extensions/DataDrivenLinks/DataDrivenLinks.php" );
398
399// Zhongzhen 2010-4-14
400// My Links extention
401require_once( "$IP/extensions/MyLinks/MyLinks.php" );
402
403// if you want to disable variants as well
404$wgDisableTitleConversion =true;
405$wgDisableLangConversion=true;
406$wgShowExceptionDetails = true;
407
408// Add FLV support
409require_once( "$IP/extensions/FLVPlayerTwo/FLVPlayerTwo.php" );
410
411// Add Anti-Spam to every edits
412$wgGroupPermissions['*'            ]['skipcaptcha'] = false;
413$wgGroupPermissions['user'         ]['skipcaptcha'] = false;
414$wgGroupPermissions['autoconfirmed']['skipcaptcha'] = false;
415$wgGroupPermissions['bot'          ]['skipcaptcha'] = true; // registered bots
416$wgGroupPermissions['sysop'        ]['skipcaptcha'] = true;
417
418$wgCaptchaTriggers['edit']          = true;
419$wgCaptchaTriggers['create']        = true;
420$wgCaptchaTriggers['addurl']        = true;
421$wgCaptchaTriggers['createaccount'] = true;
422$wgCaptchaTriggers['badlogin']      = true;
Note: See TracBrowser for help on using the repository browser.