New updateSpecialPages.php script, to update the QueryPage cache. Disabled recache...
[lhc/web/wiklou.git] / includes / SpecialSitesettings.php
1 <?php
2 /**
3 * @package MediaWiki
4 * @subpackage SpecialPage
5 */
6 require_once('HTMLForm.php');
7
8 function wfSpecialSiteSettings() {
9 global $wgRequest;
10
11 $form = new SiteSettingsForm( $wgRequest );
12 $form->execute();
13 }
14
15 class SiteSettingsForm extends HTMLForm {
16 var $mPosted, $mRequest, $mReset, $mSaveprefs;
17
18 function SiteSettingsForm ( &$request ) {
19 $this->mPosted = $request->wasPosted();
20 $this->mRequest = $request;
21 $this->mName = 'sitesettings';
22 }
23
24 function execute() {
25 if ( wfReadOnly() ) {
26 $wgOut->readOnlyPage();
27 return;
28 }
29 if ( $this->mReset ) {
30 $this->resetPrefs();
31 $this->mainPrefsForm( wfMsg( "prefsreset" ) );
32 } else if ( $this->mSaveprefs ) {
33 $this->savePreferences();
34 } else {
35 $this->resetPrefs();
36 $this->mainPrefsForm( "" );
37 }
38 }
39
40 /* private */ function resetPrefs() {
41 return;
42 }
43
44 /* private */ function mainPrefsForm( $err ) {
45 global $wgOut;
46
47 $wgOut->setPageTitle( wfMsg( "sitesettings" ) );
48 $wgOut->setArticleRelated( false );
49 $wgOut->setRobotpolicy( "noindex,nofollow" );
50
51 if ( "" != $err ) {
52 $wgOut->addHTML( "<p class='error'>" . htmlspecialchars( $err ) . "</p>\n" );
53 }
54
55 $titleObj = Title::makeTitle( NS_SPECIAL, "SiteSettings" );
56 $action = $titleObj->escapeLocalURL();
57
58 $wgOut->addHTML( "<form id=\"preferences\" name=\"preferences\" action=\"$action\"
59 method=\"post\">" );
60 $wgOut->addHTML( $this->fieldset( "sitesettings-features",
61 $this->checkbox( 'wgShowIPinHeader' ) .
62 $this->checkbox( 'wgUseDatabaseMessages' ) .
63 $this->checkbox( 'wgUseCategoryMagic' ) .
64 $this->checkbox( 'wgUseCategoryBrowser' ) .
65 $this->checkbox( 'wgDisableLangConversion' ).
66 $this->textbox( 'wgHitcounterUpdateFreq' ) .
67 $this->textbox( 'wgExtraSubtitle' ).
68 $this->textbox( 'wgSiteSupportPage' ) .
69 $this->textbox( 'wgSiteNotice' ) .
70 $this->checkbox( 'wgDisableAnonTalk' ).
71 $this->checkbox( 'wgRCSeconds' ) .
72 $this->checkbox( 'wgCapitalLinks' ).
73 $this->checkbox( 'wgShowCreditsIfMax' ) .
74 $this->textbox( 'wgMaxCredits' ).
75 $this->checkbox( 'wgGoToEdit' ).
76 $this->checkbox( 'wgAllowRealName' ) .
77 $this->checkbox( 'wgAllowUserJs' ) .
78 $this->checkbox( 'wgAllowUserCss' ).
79 $this->checkbox( 'wgAllowPageInfo' ).
80 $this->textbox( 'wgMaxTocLevel' ) .
81 $this->checkbox( 'wgUseGeoMode' ) .
82 $this->checkbox( 'wgUseValidation' ) .
83 $this->checkbox( 'wgUseExternalDiffEngine' ) .
84 $this->checkbox( 'wgUseRCPatrol' )
85 ) );
86 $wgOut->addHTML( $this->fieldset( "sitesettings-permissions",
87 $this->fieldset( 'sitesettings-permissions-readonly' ,
88 $this->checkbox( 'wgReadOnly' ) .
89 $this->textbox( 'wgReadOnlyFile','',50 )
90 ) .
91 $this->fieldset( 'sitesettings-permissions-whitelist' ,
92 $this->checkbox( 'wgWhitelistEdit' ) .
93 $this->arraybox( 'wgWhitelistRead' ) .
94 $this->checkbox( 'wgWhitelistAccount-user' ) .
95 $this->checkbox( 'wgWhitelistAccount-sysop' ) .
96 $this->checkbox( 'wgWhitelistAccount-developer' )
97 ) .
98 $this->fieldset( 'sitesettings-permissions-banning' ,
99 $this->checkbox( 'wgSysopUserBans' ) .
100 $this->checkbox( 'wgSysopRangeBans' ) .
101 $this->textbox( 'wgDefaultBlockExpiry', "24 hours" )
102 ) .
103 $this->checkbox( 'wgAllowAnonymousMinor' ).
104 $this->checkbox( 'wgPutIPinRC' ) .
105 $this->textbox( 'wgSpamRegex' ).
106 $this->checkbox( 'wgUserHtml' ).
107 $this->checkbox( 'wgRawHtml' )
108 ) );
109 $wgOut->addHTML( $this->fieldset( "sitesettings-images" ,
110 $this->checkbox( 'wgAllowExternalImages' ) .
111 $this->fieldset( 'sitesettings-images-upload' ,
112 $this->checkbox( 'wgEnableUploads' ) .
113 $this->checkbox( 'wgRemoteUploads' ) .
114 $this->arraybox( 'wgFileExtensions' ) .
115 $this->arraybox( 'wgFileBlacklist' ) .
116 $this->checkbox( 'wgCheckFileExtensions' ) .
117 $this->checkbox( 'wgStrictFileExtensions' ) .
118 $this->textbox( 'wgUploadSizeWarning' ) .
119 $this->checkbox( 'wgUseCopyrightUpload' ) .
120 $this->checkbox( 'wgCheckCopyrightUpload' )
121 ) .
122 $this->fieldset( 'sitesettings-images-resize' ,
123 $this->checkbox( 'wgUseImageResize' ) .
124 $this->checkbox( 'wgUseImageMagick' ) .
125 $this->textbox( 'wgImageMagickConvertCommand' )
126 )
127 ) );
128 $wgOut->addHTML( $this->fieldset( "sitesettings-performance",
129 $this->fieldset( 'sitesettings-permissions-miser' ,
130 $this->checkbox( 'wgMiserMode' ) .
131 $this->checkbox( 'wgDisableQueryPages' ) .
132 $this->checkbox( 'wgUseWatchlistCache' ) .
133 $this->textbox( 'wgWLCacheTimeout', '3600' )
134 ) .
135 $this->checkbox( 'wgDisableCounters' ) .
136 $this->checkbox( 'wgDisableTextSearch' ) .
137 $this->checkbox( 'wgDisableFuzzySearch' ) .
138 $this->checkbox( 'wgDisableSearchUpdate' )
139 ) );
140 $wgOut->addHTML( $this->fieldset( "sitesettings-memcached",
141 $this->checkbox( 'wgMemCachedDebug' ) .
142 $this->checkbox( 'wgUseMemCached' ) .
143 $this->textbox( 'wgMemCachedServers' ) .
144 $this->checkbox( 'wgSessionsInMemcached' ).
145 $this->checkbox( 'wgLinkCacheMemcached' ) .
146 $this->textbox( 'wgAccountCreationThrottle' )
147 ) );
148 $wgOut->addHTML( $this->fieldset( "sitesettings-caching",
149 $this->checkbox( 'wgCachePages' ).
150 $this->checkbox( 'wgUseFileCache' ).
151 $this->textbox( 'wgFileCacheDirectory' ) .
152 $this->textbox( 'wgCookieExpiration' ) .
153 $this->fieldset( 'sitesettings-caching-squid' ,
154 $this->checkbox( 'wgUseSquid' ) .
155 $this->checkbox( 'wgUseESI' ) .
156 $this->textbox( 'wgInternalServer' ) .
157 $this->textbox( 'wgSquidMaxage' ) .
158 $this->textbox( 'wgMaxSquidPurgeTitles' )
159 )
160 ) );
161 $wgOut->addHTML( $this->fieldset( "sitesettings-cookies",
162 $this->textbox( 'wgCookieDomain' ) .
163 $this->textbox( 'wgCookiePath' ) .
164 $this->checkbox( 'wgDisableCookieCheck' )
165 ) );
166 $wgOut->addHTML( $this->fieldset( "sitesettings-debugging",
167 $this->textbox( 'wgDebugLogFile','',50 ) .
168 $this->checkbox( 'wgDebugRedirects' ) .
169 $this->checkbox( 'wgDebugRawPage' ) .
170 $this->checkbox( 'wgDebugComments' ) .
171 $this->checkbox( 'wgLogQueries' ) .
172 $this->checkbox( 'wgDebugDumpSql' ) .
173 $this->fieldset( 'sitesettings-debugging-profiling',
174 $this->checkbox( 'wgProfiling' ) .
175 $this->textbox( 'wgProfileLimit' ) .
176 $this->checkbox( 'wgProfileOnly' ) .
177 $this->checkbox( 'wgProfileToDatabase' ) .
178 $this->textbox( 'wgProfileSampleRate' ) .
179 $this->checkbox( 'wgDebugProfiling' ) .
180 $this->checkbox( 'wgDebugFunctionEntry')
181 ) .
182 $this->checkbox( 'wgDebugSquid' )
183 ) );
184 $wgOut->addHTML( "</form>" );
185 }
186
187 }
188
189 ?>