Index: trunk/extensions/ProofreadPage/ProofreadPage.php |
— | — | @@ -34,8 +34,8 @@ |
35 | 35 | # Bump the version number every time you change proofread.js |
36 | 36 | $wgProofreadPageVersion = 26; |
37 | 37 | |
38 | | -# set to true in order to allow anons to modify pagequality |
39 | | -$wgProofreadPageAllowAnons = false; |
| 38 | +# Group allowed to modify pagequality |
| 39 | +$wgGroupPermissions['user']['pagequality'] = true; |
40 | 40 | |
41 | 41 | # Max width of zoomable image |
42 | 42 | $wgProofreadPageMaxWidth = 2048; |
— | — | @@ -377,7 +377,7 @@ |
378 | 378 | |
379 | 379 | function pr_preparePage( $out, $m, $isEdit ) { |
380 | 380 | global $wgJsMimeType, $wgScriptPath, $wgRequest, $wgProofreadPageVersion, $wgProofreadPageMaxWidth; |
381 | | - global $wgTitle; |
| 381 | + global $wgTitle, $wgUser; |
382 | 382 | |
383 | 383 | if ( !isset( $wgTitle->pr_index_title ) ) { |
384 | 384 | pr_load_index( $wgTitle ); |
— | — | @@ -430,6 +430,8 @@ |
431 | 431 | 'proofreadPageNextURL' => $next_url, |
432 | 432 | 'proofreadPageHeader' => $header, |
433 | 433 | 'proofreadPageFooter' => $footer, |
| 434 | + 'proofreadPageAddButtons' => $wgUser->isAllowed('pagequality'), |
| 435 | + 'proofreadPageUserName' => $wgUser->getName(), |
434 | 436 | ); |
435 | 437 | $varScript = Skin::makeVariablesScript( $jsVars ); |
436 | 438 | |
— | — | @@ -955,7 +957,7 @@ |
956 | 958 | * Check the format of pages in "Page" namespace. |
957 | 959 | */ |
958 | 960 | function pr_attemptSave( $editpage ) { |
959 | | - global $wgOut, $wgUser, $wgProofreadPageAllowAnons; |
| 961 | + global $wgOut, $wgUser; |
960 | 962 | |
961 | 963 | $page_namespace = pr_page_ns(); |
962 | 964 | $index_namespace = pr_index_ns(); |
— | — | @@ -992,7 +994,7 @@ |
993 | 995 | list( $old_q , $old_username, $old_ptext ) = pr_parse_page( $old_text ); |
994 | 996 | if( $old_q != -1 ) { |
995 | 997 | //check usernames |
996 | | - if( ($old_q != $q) && $wgUser->isAnon() && !$wgProofreadPageAllowAnons ) { |
| 998 | + if( ($old_q != $q) && !$wgUser->isAllowed('pagequality') ) { |
997 | 999 | $wgOut->showErrorPage( 'proofreadpage_nologin', 'proofreadpage_nologintext' ); |
998 | 1000 | return false; |
999 | 1001 | } |
Index: trunk/extensions/ProofreadPage/proofread.js |
— | — | @@ -886,7 +886,7 @@ |
887 | 887 | function pr_add_quality(form,value){ |
888 | 888 | |
889 | 889 | self.proofreadpage_quality = value; |
890 | | - self.proofreadpage_username = wgUserName; |
| 890 | + self.proofreadpage_username = proofreadPageUserName; |
891 | 891 | var text=""; |
892 | 892 | switch( value ) { |
893 | 893 | case 0: text = proofreadPageMessageQuality0; break; |
— | — | @@ -903,8 +903,9 @@ |
904 | 904 | |
905 | 905 | function pr_add_quality_buttons(){ |
906 | 906 | |
| 907 | + if( !proofreadPageAddButtons ) return; |
907 | 908 | var ig = document.getElementById("wpWatchthis"); |
908 | | - if(!wgUserName) ig = document.getElementById("wpSummary"); |
| 909 | + if( !ig ) ig = document.getElementById("wpSummary"); |
909 | 910 | if( !ig ) return; |
910 | 911 | var f = document.createElement("span"); |
911 | 912 | f.innerHTML = |
— | — | @@ -916,10 +917,9 @@ |
917 | 918 | +'<span class="quality4"> <input type="radio" name="quality" value=4 onclick="pr_add_quality(this.form,4)" tabindex=4> </span>'; |
918 | 919 | f.innerHTML = f.innerHTML + ' ' + escapeQuotesHTML(proofreadPageMessageStatus); |
919 | 920 | |
920 | | - if(!wgUserName) f.style.cssText = 'display:none'; |
921 | 921 | ig.parentNode.insertBefore(f,ig.nextSibling.nextSibling.nextSibling); |
922 | 922 | |
923 | | - if( ! ( ( self.proofreadpage_quality == 4 ) || ( ( self.proofreadpage_quality == 3 ) && ( self.proofreadpage_username != wgUserName ) ) ) ) { |
| 923 | + if( ! ( ( self.proofreadpage_quality == 4 ) || ( ( self.proofreadpage_quality == 3 ) && ( self.proofreadpage_username != proofreadPageUserName ) ) ) ) { |
924 | 924 | document.editform.quality[4].parentNode.style.cssText = 'display:none'; |
925 | 925 | document.editform.quality[4].disabled = true; |
926 | 926 | } |