dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Replace Pakaran with Punjabi"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiWatch.php
diff --git
a/includes/api/ApiWatch.php
b/includes/api/ApiWatch.php
index
3e51299
..
c7d636a
100644
(file)
--- a/
includes/api/ApiWatch.php
+++ b/
includes/api/ApiWatch.php
@@
-36,6
+36,9
@@
class ApiWatch extends ApiBase {
if ( !$user->isLoggedIn() ) {
$this->dieUsage( 'You must be logged-in to have a watchlist', 'notloggedin' );
}
if ( !$user->isLoggedIn() ) {
$this->dieUsage( 'You must be logged-in to have a watchlist', 'notloggedin' );
}
+ if ( !$user->isAllowed( 'editmywatchlist' ) ) {
+ $this->dieUsage( 'You don\'t have permission to edit your watchlist', 'permissiondenied' );
+ }
$params = $this->extractRequestParams();
$title = Title::newFromText( $params['title'] );
$params = $this->extractRequestParams();
$title = Title::newFromText( $params['title'] );
@@
-57,19
+60,19
@@
class ApiWatch extends ApiBase {
if ( $params['unwatch'] ) {
$res['unwatched'] = '';
$res['message'] = $this->msg( 'removedwatchtext', $title->getPrefixedText() )->title( $title )->parseAsBlock();
if ( $params['unwatch'] ) {
$res['unwatched'] = '';
$res['message'] = $this->msg( 'removedwatchtext', $title->getPrefixedText() )->title( $title )->parseAsBlock();
- $s
ucces
s = UnwatchAction::doUnwatch( $title, $user );
+ $s
tatu
s = UnwatchAction::doUnwatch( $title, $user );
} else {
$res['watched'] = '';
$res['message'] = $this->msg( 'addedwatchtext', $title->getPrefixedText() )->title( $title )->parseAsBlock();
} else {
$res['watched'] = '';
$res['message'] = $this->msg( 'addedwatchtext', $title->getPrefixedText() )->title( $title )->parseAsBlock();
- $s
ucces
s = WatchAction::doWatch( $title, $user );
+ $s
tatu
s = WatchAction::doWatch( $title, $user );
}
if ( !is_null( $oldLang ) ) {
$this->getContext()->setLanguage( $oldLang ); // Reset language to $oldLang
}
}
if ( !is_null( $oldLang ) ) {
$this->getContext()->setLanguage( $oldLang ); // Reset language to $oldLang
}
- if ( !$s
uccess
) {
- $this->die
UsageMsg( 'hookaborted'
);
+ if ( !$s
tatus->isOK()
) {
+ $this->die
Status( $status
);
}
$this->getResult()->addValue( null, $this->getModuleName(), $res );
}
}
$this->getResult()->addValue( null, $this->getModuleName(), $res );
}