Index: trunk/extensions/Configure/Configure.page.php |
— | — | @@ -209,7 +209,12 @@ |
210 | 210 | protected function getUneditableSettings() { |
211 | 211 | static $notEditable; |
212 | 212 | if ( !isset( $notEditable ) ) { |
213 | | - global $wgConfigureNotEditableSettings; |
| 213 | + global $wgConfigureNotEditableSettings, $wgConfigureEditableSettings; |
| 214 | + |
| 215 | + if ( !count($wgConfigureNotEditableSettings) && count($wgConfigureEditableSettings ) ) { |
| 216 | + $wgConfigureNotEditableSettings = array_diff( array_keys( $this->mConfSettings->getAllSettings() ), $wgConfigureEditableSettings ); |
| 217 | + } |
| 218 | + |
214 | 219 | $notEditable = array_merge( $this->mConfSettings->getUneditableSettings(), |
215 | 220 | $wgConfigureNotEditableSettings ); |
216 | 221 | } |
— | — | @@ -1153,11 +1158,9 @@ |
1154 | 1159 | if ( !count( $groups[$name] ) ) |
1155 | 1160 | unset( $groups[$name] ); |
1156 | 1161 | } |
1157 | | - $ret .= Xml::openElement( 'fieldset' ) . "\n" . |
1158 | | - Xml::element( 'legend', null, wfMsgExt( "configure-section-$title", array( 'parseinline' ) ) ) . "\n"; |
1159 | | - if ( $res ) { |
1160 | | - $ret .= wfMsgExt( 'configure-section-' . $title . '-notallowed', array( 'parseinline' ) ); |
1161 | | - } else { |
| 1162 | + |
| 1163 | + $thisSection = ''; |
| 1164 | + if ( !$res ) { |
1162 | 1165 | $first = true; |
1163 | 1166 | if ( !isset( $param['showlink'] ) ) { |
1164 | 1167 | $showlink = true; |
— | — | @@ -1172,20 +1175,33 @@ |
1173 | 1176 | $showlink = (bool)$param['showlink']; |
1174 | 1177 | } |
1175 | 1178 | foreach ( $groups as $group => $settings ) { |
1176 | | - $ret .= $this->buildTableHeading( $group, !$first ); |
1177 | | - $first = false; |
| 1179 | + $thisGroup = ''; |
1178 | 1180 | foreach ( $settings as $setting => $type ) { |
1179 | 1181 | $params = $perms[$setting] + array( |
1180 | 1182 | 'type' => $type, |
1181 | 1183 | 'value' => $this->getSettingValue( $setting ), |
1182 | 1184 | 'link' => $showlink, |
1183 | 1185 | ); |
1184 | | - $ret .= $this->buildTableRow( $setting, $params ); |
| 1186 | + $canEdit = isset( $params['edit'] ) ? $params['edit'] : $this->userCanEdit( $setting ); |
| 1187 | + if ($canEdit) { |
| 1188 | + $thisGroup .= $this->buildTableRow( $setting, $params ); |
| 1189 | + } else { |
| 1190 | + ## Don't even show it. |
| 1191 | + } |
1185 | 1192 | } |
| 1193 | + |
| 1194 | + if ($thisGroup) { |
| 1195 | + $thisSection .= $this->buildTableHeading( $group, !$first ) . $thisGroup . Xml::closeElement( 'table' ); |
| 1196 | + $first = false; |
| 1197 | + } |
1186 | 1198 | } |
1187 | | - $ret .= Xml::closeElement( 'table' ) . "\n"; |
| 1199 | + |
| 1200 | + if ($thisSection) { |
| 1201 | + $thisSection = Xml::tags( 'legend', null, wfMsgExt( "configure-section-$title", array( 'parseinline' ) ) ) . $thisSection; |
| 1202 | + $ret .= Xml::tags( 'fieldset', null, $thisSection ); |
| 1203 | + } |
1188 | 1204 | } |
1189 | | - $ret .= Xml::closeElement( 'fieldset' ); |
| 1205 | + |
1190 | 1206 | } |
1191 | 1207 | return $ret; |
1192 | 1208 | } |
Index: trunk/extensions/Configure/CHANGELOG |
— | — | @@ -1,6 +1,12 @@ |
2 | 2 | This file lists changes on this extension. |
3 | 3 | Localisation updates are done on betawiki and aren't listed here. |
4 | 4 | |
| 5 | +0.10.8 - 26 November 2008 |
| 6 | + * Stopped displaying settings which can't be edited in Special:Configure. |
| 7 | + These can be viewed at Special:Configure. |
| 8 | + * Introduced explicit whitelisting of settings, rather than blacklisting |
| 9 | + of other settings. |
| 10 | + |
5 | 11 | 0.10.7 - 25 November 2008 |
6 | 12 | * Added diff links for the versions at the top of Special:Configure and |
7 | 13 | Special:Extensions |
Index: trunk/extensions/Configure/Configure.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Configure', |
19 | 19 | 'description' => 'Allow authorised users to configure the wiki via a web-based interface', |
20 | 20 | 'descriptionmsg' => 'configure-desc', |
21 | | - 'version' => '0.10.7', |
| 21 | + 'version' => '0.10.8', |
22 | 22 | ); |
23 | 23 | |
24 | 24 | # Configuration part |
— | — | @@ -102,10 +102,24 @@ |
103 | 103 | /** |
104 | 104 | * Array of not editable settings, by anyone. |
105 | 105 | * They won't be saved in conf-now.ser. |
| 106 | + * Superseded, use the explicit whitelist. |
106 | 107 | */ |
107 | 108 | $wgConfigureNotEditableSettings = array(); |
108 | 109 | |
109 | 110 | /** |
| 111 | + * Editable settings |
| 112 | + */ |
| 113 | + # Suggested configuration: |
| 114 | +$wgConfigureEditableSettings = array( |
| 115 | + 'wgSitename', 'wgLogo', 'wgContentNamespaces', 'wgMetaNamespace', 'wgMetaNamespaceTalk', |
| 116 | + 'wgNamespaceAliases', 'wgNamespaceProtection', 'wgNamespaceRobotPolicies', 'wgNamespacesToBeSearchedDefault', |
| 117 | + 'wgNamespacesToBeSearchedProject', 'wgNamespacesWithSubpages', 'wgNoFollowNsExceptions', 'wgNonincludableNamespaces', |
| 118 | + 'wgSitemapNamespaces', 'wgAutopromote', 'wgGroupPermissions', 'wgAddGroups', 'wgRemoveGroups', 'wgGroupsAddToSelf', |
| 119 | + 'wgGroupsRemoveFromSelf', 'wgArticleRobotPolicies', 'wgCapitalLinks', 'wgDefaultLanguageVariant', 'wgExtraSubtitle', |
| 120 | + 'wgImportSources', 'wgRateLimits', 'wgAutoConfirmAge', 'wgAutoConfirmCount', 'wgMaxSigChars' |
| 121 | +); |
| 122 | + |
| 123 | +/** |
110 | 124 | * Whether to use the API module |
111 | 125 | */ |
112 | 126 | $wgConfigureAPI = false; |