From 9db190c7e736ec8d063187d4241b59feaf7dc2d1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 22 Jun 2011 11:28:20 +0200 Subject: update to MediaWiki 1.17.0 --- includes/specials/SpecialRemoveRestrictions.php | 60 ------------------------- 1 file changed, 60 deletions(-) delete mode 100644 includes/specials/SpecialRemoveRestrictions.php (limited to 'includes/specials/SpecialRemoveRestrictions.php') diff --git a/includes/specials/SpecialRemoveRestrictions.php b/includes/specials/SpecialRemoveRestrictions.php deleted file mode 100644 index a3428a5a..00000000 --- a/includes/specials/SpecialRemoveRestrictions.php +++ /dev/null @@ -1,60 +0,0 @@ -getSkin(); - $title = SpecialPage::getTitleFor( 'RemoveRestrictions' ); - $id = $wgRequest->getVal( 'id' ); - if( !is_numeric( $id ) ) { - $wgOut->addWikiMsg( 'removerestrictions-noid' ); - return; - } - - UserRestriction::purgeExpired(); - $r = UserRestriction::newFromId( $id, true ); - if( !$r ) { - $wgOut->addWikiMsg( 'removerestrictions-wrongid' ); - return; - } - - $form = array(); - $form['removerestrictions-user'] = $sk->userLink( $r->getSubjectId(), $r->getSubjectText() ) . - $sk->userToolLinks( $r->getSubjectId(), $r->getSubjectText() ); - $form['removerestrictions-type'] = UserRestriction::formatType( $r->getType() ); - if( $r->isPage() ) - $form['removerestrictions-page'] = $sk->link( $r->getPage() ); - if( $r->isNamespace() ) - $form['removerestrictions-namespace'] = $wgLang->getDisplayNsText( $r->getNamespace() ); - $form['removerestrictions-reason'] = Xml::input( 'reason' ); - - $result = null; - if( $wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal( 'edittoken' ) ) ) - $result = wfSpecialRemoveRestrictionsProcess( $r ); - - $wgOut->addWikiMsg( 'removerestrictions-intro' ); - $wgOut->addHTML( Xml::fieldset( wfMsgHtml( 'removerestrictions-legend' ) ) ); - if( $result ) - $wgOut->addHTML( '' . wfMsgExt( 'removerestrictions-success', - 'parseinline', $r->getSubjectText() ) . '' ); - $wgOut->addHTML( Xml::openElement( 'form', array( 'action' => $title->getLocalUrl( array( 'id' => $id ) ), - 'method' => 'post' ) ) ); - $wgOut->addHTML( Xml::buildForm( $form, 'removerestrictions-submit' ) ); - $wgOut->addHTML( Xml::hidden( 'id', $r->getId() ) ); - $wgOut->addHTML( Xml::hidden( 'title', $title->getPrefixedDbKey() ) ); - $wgOut->addHTML( Xml::hidden( 'edittoken', $wgUser->editToken() ) ); - $wgOut->addHTML( "" ); -} - -function wfSpecialRemoveRestrictionsProcess( $r ) { - global $wgRequest; - $reason = $wgRequest->getVal( 'reason' ); - $result = $r->delete(); - $log = new LogPage( 'restrict' ); - $params = array( $r->getType() ); - if( $r->isPage() ) - $params[] = $r->getPage()->getPrefixedDbKey(); - if( $r->isNamespace() ) - $params[] = $r->getNamespace(); - $log->addEntry( 'remove', Title::makeTitle( NS_USER, $r->getSubjectText() ), $reason, $params ); - return $result; -} -- cgit v1.2.3-54-g00ecf