$rollbackErrors = $this->mTitle->getUserPermissionsErrors( 'rollback', $wgUser );
$errors = array_merge( $editErrors, wfArrayDiff2( $rollbackErrors, $editErrors ) );
- $t = new Token( Token::PERSISTENT, array( $this->mTitle->getPrefixedText(), $fromP ) );
+ $t = new Token( array( $this->mTitle->getPrefixedText(), $fromP ) );
if ( !$t->match( $token ) ) {
$errors[] = array( 'sessionfailure' );
}
$query = array(
'action' => 'rollback',
'from' => $rev->getUserText(),
- 'token' => Token::prepare(
- Token::PERSISTENT,
- array( $title->getPrefixedText(), $rev->getUserText() )
- ),
+ 'token' => Token::prepare( array( $title->getPrefixedText(), $rev->getUserText() ) ),
);
if ( $wgRequest->getBool( 'bot' ) ) {
$query['bot'] = '1';
<?php
/**
- * Copyright © 2003 Brion Vibber <brion@pobox.com>
+ * Copyright © 2010
* http://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
* @param $request WebRequest most of the time you'll want to get/store
* the tokens in $wgRequest, which is the default.
*/
- public function __construct( $salt, $type = self::ANONYMOUS, WebRequest $request = null ){
+ public function __construct( $salt, $type = self::PERSISTENT, WebRequest $request = null ){
global $wgRequest;
$this->type = $type;
* @param $type Token class constant identifier
* @return String token string to store in HTML
*/
- public static function prepare( $salt, $type = self::ANONYMOUS ){
+ public static function prepare( $salt, $type = self::PERSISTENT ){
$t = new Token( $salt, $type );
return $t->set( false );
}
if ( !$wgUser->isAllowed( 'rollback' ) ) {
return false;
}
- return Token::prepare(
- Token::PERSISTENT,
- array( $title->getPrefixedText(), $rev->getUserText() )
- );
+ return Token::prepare( array( $title->getPrefixedText(), $rev->getUserText() ) );
}
public function execute() {