diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
commit | 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch) | |
tree | af68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /includes/api/ApiOptions.php | |
parent | af4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff) |
Update to MediaWiki 1.22.0
Diffstat (limited to 'includes/api/ApiOptions.php')
-rw-r--r-- | includes/api/ApiOptions.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/api/ApiOptions.php b/includes/api/ApiOptions.php index 8c996a26..7256066d 100644 --- a/includes/api/ApiOptions.php +++ b/includes/api/ApiOptions.php @@ -42,6 +42,10 @@ class ApiOptions extends ApiBase { $this->dieUsage( 'Anonymous users cannot change preferences', 'notloggedin' ); } + if ( !$user->isAllowed( 'editmyoptions' ) ) { + $this->dieUsage( 'You don\'t have permission to edit your options', 'permissiondenied' ); + } + $params = $this->extractRequestParams(); $changed = false; @@ -50,7 +54,7 @@ class ApiOptions extends ApiBase { } if ( $params['reset'] ) { - $user->resetOptions( $params['resetkinds'] ); + $user->resetOptions( $params['resetkinds'], $this->getContext() ); $changed = true; } @@ -83,7 +87,7 @@ class ApiOptions extends ApiBase { case 'registered-checkmatrix': // A key for a multiselect or checkmatrix option. $validation = true; - $value = $value !== null ? (bool) $value : null; + $value = $value !== null ? (bool)$value : null; break; case 'userjs': // Allow non-default preferences prefixed with 'userjs-', to be set by user scripts |