Skip to content

fix getUserPermissionsErrors hook #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: REL1_39
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ It will also block the viewing of the readonly form.

1.1.3 MediaWiki 1.39x compatible

1.1.4 Fix Permission error page (getUserPermissionsErrors hook)

### Compatibility

* PHP 8+
Expand Down
11 changes: 6 additions & 5 deletions SourceProtection.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,14 @@ public static function disableActions( Title $title, User $user, $action, &$resu
);
// Also disable the version difference options
if ( isset( $_GET['diff'] ) ) {
return [ "no access" ];
$result = wfMessage( 'sourceprotection-no-access');
return false;
}
if ( isset( $_GET['action'] ) ) {
$actie = $_GET['action'];
if ( in_array( $actie,
$actionNotAllowed ) ) {
return [ "no access" ];
$getAction = $_GET['action'];
if ( in_array( $getAction, $actionNotAllowed ) ) {
$result = wfMessage( 'sourceprotection-no-access');
return false;
}
}

Expand Down
2 changes: 1 addition & 1 deletion extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SourceProtection",
"version": "1.1.3",
"version": "1.1.4",
"author": [
"[https://www.wikibase-solutions.com/author/charlot Sen-Sai]"
],
Expand Down
3 changes: 2 additions & 1 deletion i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"Sen-Sai"
]
},
"sourceprotection-desc": "Removes View Source tab and (if Pageforms is installed the edit-Form tab) & History tab from menu and disable as many action functions for users with no edit permissions. It will also block the viewing of the readonly form."
"sourceprotection-desc": "Removes View Source tab and (if Pageforms is installed the edit-Form tab) & History tab from menu and disable as many action functions for users with no edit permissions. It will also block the viewing of the readonly form.",
"sourceprotection-no-access": "You are not allowed to do this action. <span class=\"plainlinks\">[{{fullurl:Special:ListUsers|group=sysop}} Contact an administrator]</span> when you think this is an error."
}