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