Skip to content

Instantly share code, notes, and snippets.

@Remedan
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Remedan/425e631fb184144c4dd2 to your computer and use it in GitHub Desktop.
Save Remedan/425e631fb184144c4dd2 to your computer and use it in GitHub Desktop.
diff --git includes/Article.php includes/Article.php
index b07f309..6bf578b 100644
--- includes/Article.php
+++ includes/Article.php
@@ -414,6 +414,12 @@ class Article extends Page {
# Another whitelist check in case getOldID() is altering the title
$permErrors = $this->getTitle()->getUserPermissionsErrors( 'read', $wgUser );
if ( count( $permErrors ) ) {
+ if($this->mTitle->isRestricted()){
+ $wgOut->restrictGroupRequired();
+ $wgOut->output();
+ $wgOut->disable();
+ }
+
wfDebug( __METHOD__ . ": denied on secondary read check\n" );
wfProfileOut( __METHOD__ );
throw new PermissionsError( 'read', $permErrors );
@@ -1899,4 +1905,145 @@ class Article extends Page {
return WikiPage::getAutosummary( $oldtext, $newtext, $flags );
}
// ******
+
+# ----------------------------------------------------------------------------
+# Page access restriction
+# ----------------------------------------------------------------------------
+
+ /**
+ * Restrict a page
+ * (restrict-patch by Jerome Combaz)
+ */
+ function restrict( $limit = true ) {
+ global $wgUser, $wgOut, $wgRequest, $wgEnableRestrict;
+
+ if ( !$wgEnableRestrict ) {
+ return;
+ }
+
+ if ( !$wgUser->isAllowed('restrict') ) {
+ $wgOut->restrictGroupRequired();
+ return;
+ }
+ if ( wfReadOnly() ) {
+ $wgOut->readOnlyPage();
+ return;
+ }
+ $id = $this->mTitle->getArticleID();
+ if ( 0 == $id ) {
+ $wgOut->showErrorPage( 'error', 'badarticleerror' );
+ return;
+ }
+
+ $confirm = $wgRequest->wasPosted() &&
+ $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) );
+ $reason = $wgRequest->getText( 'wpReasonRestrict' );
+
+ if ( $confirm ) {
+ $dbw =& wfGetDB( DB_MASTER );
+ $dbw->update( 'page',
+ array( /* SET */
+ 'page_touched' => $dbw->timestamp(),
+ 'page_restrictions' => (string)$limit
+ ), array( /* WHERE */
+ 'page_id' => $id
+ ), 'Article::restrict'
+ );
+ $getredit = $this->mTitle->getRestrictions('edit');
+
+ $edit = "edit=".current($getredit);
+ $getrmove = $this->mTitle->getRestrictions('move');
+ $move = "move=".current($getrmove);
+ $view = ($limit ? 'view=1' : 'view=0');
+ $restrictions = implode(':', array($edit, $move, $view));
+
+ if (wfRunHooks('ArticleRestrict', array(&$this, &$wgUser, $limit == true, $reason))) {
+ $dbw =& wfGetDB( DB_MASTER );
+ $dbw->update( 'page',
+ array( /* SET */
+ 'page_touched' => $dbw->timestamp(),
+ 'page_restrictions' => $restrictions
+ ), array( /* WHERE */
+ 'page_id' => $id
+ ), 'Article::restrict'
+ );
+
+ wfRunHooks('ArticleRestrictComplete', array(&$this, &$wgUser, $limit == true, $reason, $moveonly));
+
+ $log = new LogPage( 'restrict' );
+ if ( $limit === '' ) {
+ $log->addEntry( 'unrestrict', $this->mTitle, $reason );
+ } else {
+ $log->addEntry( 'restrict', $this->mTitle, $reason );
+ }
+ $wgOut->redirect( $this->mTitle->getFullURL() );
+ }
+ return;
+ } else {
+ return $this->confirmRestrict( '', '', $limit );
+ }
+ }
+
+ /**
+ * Output restriction confirmation dialog
+ */
+ function confirmRestrict( $par, $reason, $limit ) {
+ global $wgOut, $wgUser;
+
+ wfDebug( "Article::confirmRestrict\n" );
+
+ $sub = htmlspecialchars( $this->mTitle->getPrefixedText() );
+ $wgOut->setRobotpolicy( 'noindex,nofollow' );
+
+ $check = '';
+ $protcom = '';
+ $moveonly = '';
+
+ if ( $limit === '' ) {
+ $wgOut->setPageTitle( wfMsg( 'confirmunrestrict' ) );
+ $wgOut->setSubtitle( wfMsg( 'unrestrictsub', $sub ) );
+ $wgOut->addWikiText( wfMsg( 'confirmunrestricttext' ) );
+ $protcom = htmlspecialchars( wfMsg( 'unrestrictcomment' ) );
+ $formaction = $this->mTitle->escapeLocalURL( 'action=unrestrict' . $par );
+ } else {
+ $wgOut->setPageTitle( wfMsg( 'confirmrestrict' ) );
+ $wgOut->setSubtitle( wfMsg( 'restrictsub', $sub ) );
+ $wgOut->addWikiText( wfMsg( 'confirmrestricttext' ) );
+ $protcom = htmlspecialchars( wfMsg( 'restrictcomment' ) );
+ $formaction = $this->mTitle->escapeLocalURL( 'action=restrict' . $par );
+ }
+
+ $confirm = htmlspecialchars( wfMsg( 'confirm' ) );
+ $token = htmlspecialchars( $wgUser->editToken() );
+
+ $wgOut->addHTML( "
+<form id='restrictconfirm' method='post' action=\"{$formaction}\">
+ <table border='0'>
+ <tr>
+ <td align='right'>
+ <label for='wpReasonRestrict'>{$protcom}:</label>
+ </td>
+ <td align='left'>
+ <input type='text' size='60' name='wpReasonRestrict' id='wpReasonRestrict' value=\"" . htmlspecialchars( $reason ) . "\" />
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <input type='submit' name='wpConfirmRestrictB' value=\"{$confirm}\" />
+ </td>
+ </tr>
+ </table>
+ <input type='hidden' name='wpEditToken' value=\"{$token}\" />
+</form>" );
+
+ $wgOut->returnToMain( false );
+ }
+
+ /**
+ * Unrestrict the pages
+ */
+ function unrestrict() {
+ return $this->restrict( '' );
+ }
}
diff --git includes/AutoLoader.php includes/AutoLoader.php
index 2bf134b..81fce08 100644
--- includes/AutoLoader.php
+++ includes/AutoLoader.php
@@ -269,12 +269,14 @@ $wgAutoloadLocalClasses = array(
'RawAction' => 'includes/actions/RawAction.php',
'RawPage' => 'includes/actions/RawAction.php',
'RenderAction' => 'includes/actions/RenderAction.php',
+ 'RestrictAction' => 'includes/actions/RestrictAction.php',
'RevertAction' => 'includes/actions/RevertAction.php',
'RevertFileAction' => 'includes/actions/RevertAction.php',
'RevisiondeleteAction' => 'includes/actions/RevisiondeleteAction.php',
'RollbackAction' => 'includes/actions/RollbackAction.php',
'SubmitAction' => 'includes/actions/EditAction.php',
'UnprotectAction' => 'includes/actions/ProtectAction.php',
+ 'UnrestrictAction' => 'includes/actions/UnrestrictAction.php',
'UnwatchAction' => 'includes/actions/WatchAction.php',
'ViewAction' => 'includes/actions/ViewAction.php',
'WatchAction' => 'includes/actions/WatchAction.php',
@@ -876,6 +878,7 @@ $wgAutoloadLocalClasses = array(
'WantedTemplatesPage' => 'includes/specials/SpecialWantedtemplates.php',
'WatchlistEditor' => 'includes/specials/SpecialEditWatchlist.php',
'WithoutInterwikiPage' => 'includes/specials/SpecialWithoutinterwiki.php',
+ 'RestrictedPagesPage' => 'includes/specials/SpecialRestrictedpages.php',
# includes/templates
'UserloginTemplate' => 'includes/templates/Userlogin.php',
diff --git includes/DefaultSettings.php includes/DefaultSettings.php
index 44b2c18..f91b93f 100644
--- includes/DefaultSettings.php
+++ includes/DefaultSettings.php
@@ -3621,7 +3621,7 @@ $wgGroupsRemoveFromSelf = array();
* Title::getRestrictionTypes() will remove restrictions that are not
* applicable to a specific title (create and upload)
*/
-$wgRestrictionTypes = array( 'create', 'edit', 'move', 'upload' );
+$wgRestrictionTypes = array( 'create', 'edit', 'move', 'upload', 'view' );
/**
* Rights which can be required for each protection level (via action=protect)
@@ -5045,6 +5045,7 @@ $wgLogTypes = array(
'upload',
'move',
'import',
+ 'restrict',
'patrol',
'merge',
'suppress',
@@ -5103,6 +5104,7 @@ $wgLogNames = array(
'upload' => 'uploadlogpage',
'move' => 'movelogpage',
'import' => 'importlogpage',
+ 'restrict' => 'restrictlogpage',
'patrol' => 'patrol-log-page',
'merge' => 'mergelog',
'suppress' => 'suppressionlog',
@@ -5126,6 +5128,7 @@ $wgLogHeaders = array(
'upload' => 'uploadlogpagetext',
'move' => 'movelogpagetext',
'import' => 'importlogpagetext',
+ 'restrict' => 'restrictlogtext',
'patrol' => 'patrol-log-header',
'merge' => 'mergelogpagetext',
'suppress' => 'suppressionlogtext',
@@ -5145,6 +5148,8 @@ $wgLogActions = array(
'protect/modify' => 'modifiedarticleprotection',
'protect/unprotect' => 'unprotectedarticle',
'protect/move_prot' => 'movedarticleprotection',
+ 'restrict/restrict' => 'restrictedarticle',
+ 'restrict/unrestrict' => 'unrestrictedarticle',
'rights/rights' => 'rightslogentry',
'rights/autopromote' => 'rightslogentry-autopromote',
'upload/upload' => 'uploadedimage',
@@ -5225,6 +5230,7 @@ $wgSpecialPageGroups = array(
'Wantedtemplates' => 'maintenance',
'Unwatchedpages' => 'maintenance',
'Fewestrevisions' => 'maintenance',
+ 'Restrictedpages' => 'maintenance',
'Userlogin' => 'login',
'Userlogout' => 'login',
@@ -5356,6 +5362,8 @@ $wgActions = array(
'unwatch' => true,
'view' => true,
'watch' => true,
+ 'restrict' => true,
+ 'unrestrict' => true,
);
/**
@@ -5759,6 +5767,62 @@ $wgSeleniumConfigFile = null;
$wgDBtestuser = ''; //db user that has permission to create and drop the test databases only
$wgDBtestpassword = '';
+# ----------------------------------------------------------------------------
+# Page access restriction
+# ----------------------------------------------------------------------------
+
+/**
+ * If true, a new menu action allows to restrict pages access to 'restrict' group users.
+ * If false, all previously restricted pages are accessible again.
+ */
+$wgEnableRestrict = true;
+
+/**
+ * If true, new pages are restricted by default for 'restrict' group users.
+ */
+$wgRestrictNewPages = false;
+
+/**
+ * If true restrict user pages to their owner (as well as viewrestrict/restrict members)
+ */
+$wgUserPageRestrict = false;
+
+/**
+ * when wgUserPageRestrict and this option are true, allows user pages to be read but not edited by others?
+ * added to restrict version beta-0.8.2
+ */
+$wgUserReadRestrict = false;
+
+/**
+ * Regular expression array to restrict matching pages
+ * eg. $wgRegexRestrict = array("^Secure:", "^Secret ");
+ * restrict all pages where title is like 'Secure:...' or 'Secret ...'
+ * with restrict version beta-0.8.1 you can also use Inverse regex matching
+ * eg. $wgRegexRestrict = array("!!Public.*", ".*");
+ * any pages starting with "Public" is un-restricted and all others are restricted.
+ */
+$wgRegexRestrict = array();
+
+/**
+ * If true do not add recent changes entry for restricted pages
+ */
+$wgNoRecentChangesRestrict = true;
+
+/**
+ * If true hide log entries related to restriction, except for 'restrict' or 'viewrestrict' users (Special:Log page)
+ */
+$wgHideRestrictLog = true;
+
+/**
+ * MediaWiki permissions setup
+ */
+$wgGroupPermissions['restrict']['restrict'] = true;
+$wgGroupPermissions['restrict']['viewrestrict'] = true;
+$wgGroupPermissions['viewrestrict']['viewrestrict'] = true;
+// when $wgUserPageRestrict and $wgUserReadRestrict is true 'authors' group members get 'edituser' rights
+// and can edit other users pages and sub pages.
+$wgGroupPermissions['authors']['edituser'] = true;
+
/**
* For really cool vim folding this needs to be at the end:
* vim: foldmarker=@{,@} foldmethod=marker
diff --git includes/Export.php includes/Export.php
index 7773d03..b3dc492 100644
--- includes/Export.php
+++ includes/Export.php
@@ -147,6 +147,9 @@ class WikiExporter {
public function pageByName( $name ) {
$title = Title::newFromText( $name );
+ if ( !$title->userCanViewRestricted() ) {
+ return new WikiError( wfMsgHtml( 'restricttext' ) );
+ }
if ( is_null( $title ) ) {
throw new MWException( "Can't export invalid title" );
} else {
diff --git includes/Linker.php includes/Linker.php
index 575f284..77eeb9f 100644
--- includes/Linker.php
+++ includes/Linker.php
@@ -2071,6 +2071,26 @@ class Linker {
'title' => $tooltip
) );
}
+
+# ----------------------------------------------------------------------------
+# Page access restriction
+# ----------------------------------------------------------------------------
+
+ public static function restrictedLink(
+ $target, $html = null, $customAttribs = array(), $query = array(), $options = array()
+ ) {
+ if ( !$target->userCanViewRestricted() ) {
+ return "<em>" . wfMsgHtml( 'restricttitle' ) . "</em>";
+ }
+ return self::link( $target, $html, $customAttribs, $query, $options );
+ }
+
+ public static function restrictedLinkKnown(
+ $target, $text = null, $customAttribs = array(),
+ $query = array(), $options = array( 'known', 'noclasses' ) )
+ {
+ return self::restrictedLink( $target, $text, $customAttribs, $query, $options );
+ }
}
/**
diff --git includes/OutputPage.php includes/OutputPage.php
index a91d546..e37b206 100644
--- includes/OutputPage.php
+++ includes/OutputPage.php
@@ -3503,4 +3503,17 @@ $templates
return array();
}
+# ----------------------------------------------------------------------------
+# Page access restriction
+# ----------------------------------------------------------------------------
+
+ public function restrictGroupRequired() {
+ $this->setPageTitle( wfMsg( 'restricttitle' ) );
+ $this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
+ $this->setRobotpolicy( 'noindex,nofollow' );
+ $this->setArticleRelated( false );
+ $this->mBodytext = '';
+ $this->addHTML( wfMsg( 'restricttext' ) );
+ $this->returnToMain( false );
+ }
}
diff --git includes/QueryPage.php includes/QueryPage.php
index 69912cb..ba76ed4 100644
--- includes/QueryPage.php
+++ includes/QueryPage.php
@@ -55,6 +55,10 @@ global $wgDisableCounters;
if ( !$wgDisableCounters )
$wgQueryPages[] = array( 'PopularPagesPage', 'Popularpages' );
+global $wgEnableRestrict;
+if ( $wgEnableRestrict)
+ $wgQueryPages[] = array( 'RestrictedPagesPage', 'Restrictedpages' );
+
/**
* This is a class for doing query pages; since they're almost all the same,
@@ -760,6 +764,9 @@ abstract class WantedQueryPage extends QueryPage {
public function formatResult( $skin, $result ) {
$title = Title::makeTitleSafe( $result->namespace, $result->title );
if ( $title instanceof Title ) {
+ if ( !$title->userCanViewRestricted() ) {
+ return NULL;
+ }
if ( $this->isCached() || $this->forceExistenceCheck() ) {
$pageLink = $title->isKnown()
? '<del>' . Linker::link( $title ) . '</del>'
diff --git includes/SkinLegacy.php includes/SkinLegacy.php
index 77c85a8..3704580 100644
--- includes/SkinLegacy.php
+++ includes/SkinLegacy.php
@@ -333,6 +333,10 @@ class LegacyTemplate extends BaseTemplate {
$s .= $sep . $this->protectThisPage();
}
+ if ( $wgUser->canRestrict() ) {
+ $s .= $sep . $this->restrictThisPage();
+ }
+
if ( $wgUser->isAllowed( 'move' ) ) {
$s .= $sep . $this->moveThisPage();
}
@@ -856,5 +860,26 @@ class LegacyTemplate extends BaseTemplate {
return $ret;
}
+# ----------------------------------------------------------------------------
+# Page access restriction
+# ----------------------------------------------------------------------------
+
+ function restrictThisPage() {
+ global $wgTitle, $wgRequest;
+ $diff = $wgRequest->getVal( 'diff' );
+ if ( $wgTitle->getArticleId() && ( ! $diff ) ) {
+ if ( $wgTitle->isRestricted() ) {
+ $t = wfMsg( 'unrestrictthispage' );
+ $q = array( 'action' => 'unrestrict' );
+ } else {
+ $t = wfMsg( 'restrictthispage' );
+ $q = array( 'action' => 'restrict' );
+ }
+ $s = $this->linkKnown( $wgTitle, $t, $q );
+ } else {
+ $s = '';
+ }
+ return $s;
+ }
}
diff --git includes/SkinTemplate.php includes/SkinTemplate.php
index 2dd0098..beeaf09 100644
--- includes/SkinTemplate.php
+++ includes/SkinTemplate.php
@@ -878,9 +878,44 @@ class SkinTemplate extends Skin {
'href' => $title->getLocalURL( $this->editUrlOptions() ),
'primary' => true, // don't collapse this in vector
);
+
+ // page restriction
+ if ( $user->canRestrict() ) {
+ if ( !$title->isRestricted() ) {
+ $content_navigation['actions']['restrict'] = array(
+ 'class' => ($action == 'restrict') ? 'selected' : false,
+ 'text' => wfMessageFallback( "$skname-action-restrict", 'restrict' )->text(),
+ 'href' => $title->getLocalUrl( 'action=restrict' )
+ );
+ } else {
+ if ( $title->isRegexRestricted() ) {
+ $content_navigation['actions']['unrestrict'] = array(
+ 'class' => ($action == 'unrestrict') ? 'selected' : false,
+ 'text' => wfMessageFallback( "$skname-action-restricttitle", 'restricttitle' )->text(),
+ 'href' => $title->getLocalUrl( '' )
+ );
+ } else {
+ $content_navigation['actions']['unrestrict'] = array(
+ 'class' => ($action == 'unrestrict') ? 'selected' : false,
+ 'text' => wfMessageFallback( "$skname-action-unrestrict", 'unrestrict' )->text(),
+ 'href' => $title->getLocalUrl( 'action=unrestrict' )
+ );
+ }
+ }
+ } else if ( $user->canViewRestricted() ) {
+ if ( $this->mTitle->isRestricted() ) {
+ $content_navigation['actions']['unrestrict'] = array(
+ 'class' => ($action == 'unrestrict') ? 'selected' : false,
+ 'text' => wfMessageFallback( "$skname-action-restricttitle", 'restricttitle' )->text(),
+ 'href' => $title->getLocalUrl( '' )
+ );
+ }
+ }
+
+
// section link
- if ( $showNewSection ) {
+ if ( $showNewSection ) {
// Adds new section link
//$content_navigation['actions']['addsection']
$content_navigation['views']['addsection'] = array(
diff --git includes/SpecialPageFactory.php includes/SpecialPageFactory.php
index 0a1631b..8780856 100644
--- includes/SpecialPageFactory.php
+++ includes/SpecialPageFactory.php
@@ -57,6 +57,7 @@ class SpecialPageFactory {
'Wantedfiles' => 'WantedfilesPage',
'Wantedpages' => 'WantedpagesPage',
'Wantedtemplates' => 'WantedtemplatesPage',
+ 'Restrictedpages' => 'RestrictedpagesPage',
// List of pages
'Allpages' => 'SpecialAllpages',
@@ -162,6 +163,7 @@ class SpecialPageFactory {
global $wgSpecialPages;
global $wgDisableCounters, $wgDisableInternalSearch, $wgEmailAuthentication;
global $wgEnableEmail;
+ global $wgEnableRestrict;
if ( !is_object( self::$mList ) ) {
wfProfileIn( __METHOD__ );
diff --git includes/Title.php includes/Title.php
index f3cf79d..50d203e 100644
--- includes/Title.php
+++ includes/Title.php
@@ -1975,6 +1975,7 @@ class Title {
*/
private function checkReadPermissions( $action, $user, $errors, $doExpensiveQueries, $short ) {
global $wgWhitelistRead, $wgGroupPermissions, $wgRevokePermissions;
+ global $wgEnableRestrict, $wgUserPageRestrict, $wgUserReadRestrict, $wgUserPagePrivate;
static $useShortcut = null;
# Initialize the $useShortcut boolean, to determine if we can skip quite a bit of code below
@@ -2000,6 +2001,28 @@ class Title {
}
}
+ // restricted page ?
+ if ( !$this->userCanViewRestricted() ) {
+ $errors[] = $this->missingPermissionError( $action, $short );
+ }
+
+ // restricted user pages ?
+ if ( $wgEnableRestrict && $wgUserPageRestrict && $this->getNamespace() == NS_USER && $user->getName() != $this->getText() ) {
+ if ( !$wgUserReadRestrict ) {
+ if ( !$user->canViewRestricted() ) {
+ $errors[] = $this->missingPermissionError( $action, $short );
+ }
+ } else if ( $wgUserPagePrivate ) {
+ foreach ( $wgUserPagePrivate as $k => $v ) {
+ if ( ereg( substr( $v, 2 ), $this->makeName( $this->mNamespace, $this->mTextform) ) &&
+ !substr_count( $this->getText(), $wgUser->getName() ) ) {
+ $errors[] = $this->missingPermissionError( $action, $short );
+ }
+ }
+ }
+ }
+
+
$whitelisted = false;
if ( $useShortcut ) {
# Shortcut for public wikis, allows skipping quite a bit of code
@@ -2334,6 +2357,15 @@ class Title {
*/
public function isNamespaceProtected( User $user ) {
global $wgNamespaceProtection;
+ global $wgEnableRestrict, $wgUserPageRestrict;
+
+ if ( $wgEnableRestrict && $wgUserPageRestrict ) {
+ if ( $this->getNamespace() == NS_USER && !substr_count( $this->getText(), $user->getName() ) ) {
+ if ( !$user->isAllowed('viewrestrict') && !$user->isAllowed('edituser') ) {
+ return true;
+ }
+ }
+ }
if ( isset( $wgNamespaceProtection[$this->mNamespace] ) ) {
foreach ( (array)$wgNamespaceProtection[$this->mNamespace] as $right ) {
@@ -4471,4 +4503,57 @@ class Title {
wfRunHooks( 'PageContentLanguage', array( $this, &$pageLang, $wgLang ) );
return wfGetLangObj( $pageLang );
}
+
+# ----------------------------------------------------------------------------
+# Page access restriction
+# ----------------------------------------------------------------------------
+
+ /*
+ * Does the title correspond to a restricted article?
+ * (restrict-patch by Jerome Combaz)
+ * @return boolean
+ * @access public
+ */
+ public function isRestricted() {
+ global $wgEnableRestrict;
+ if ( $wgEnableRestrict ) {
+ $a = $this->getRestrictions("view");
+ if ( $this->isRegexRestricted() || ( !empty($a) && $a[0] == true ) ) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public function isRegexRestricted() {
+ global $wgEnableRestrict, $wgRegexRestrict;
+ if ( $wgEnableRestrict ) {
+ foreach ( $wgRegexRestrict as $k => $v ) {
+ // Reverse restriction START
+ // If an entry starts with "!!" and the remaining string matches the namespace,
+ // the page is NOT restricted
+ if ( substr( $v, 0, 2 ) == "!!" ) {
+ if ( ereg( substr( $v, 2 ), $this->makeName( $this->mNamespace, $this->mTextform ) ) ) {
+ return false;
+ }
+ } else {
+ // Reverse restriction END
+ if ( ereg( $v, $this->makeName( $this->mNamespace, $this->mTextform ) ) ) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public function areRecentChangesSupressed() {
+ global $wgEnableRestrict, $wgNoRecentChangesRestrict;
+ return $wgEnableRestrict && $wgNoRecentChangesRestrict && $this->isRestricted();
+ }
+
+ public function userCanViewRestricted() {
+ global $wgUser;
+ return !$this->isRestricted() || $wgUser->canViewRestricted();
+ }
}
diff --git includes/User.php includes/User.php
index 8625910..e8a3af8 100644
--- includes/User.php
+++ includes/User.php
@@ -139,6 +139,7 @@ class User {
'proxyunbannable',
'purge',
'read',
+ 'restrict',
'reupload',
'reupload-shared',
'rollback',
@@ -4134,4 +4135,23 @@ class User {
return $ret;
}
+
+# ----------------------------------------------------------------------------
+# Page access restriction
+# ----------------------------------------------------------------------------
+
+ public function canRestrict() {
+ global $wgEnableRestrict;
+ return $wgEnableRestrict && $this->isAllowed('restrict');
+ }
+
+ public function canViewRestricted() {
+ global $wgEnableRestrict;
+ return $wgEnableRestrict && $this->isAllowed('viewrestrict');
+ }
+
+ public function shouldRestrictNewPages() {
+ global $wgRestrictNewPages;
+ return $wgRestrictNewPages && $this->canRestrict();
+ }
}
diff --git includes/Wiki.php includes/Wiki.php
index 6ead57c..5629986 100644
--- includes/Wiki.php
+++ includes/Wiki.php
@@ -146,6 +146,7 @@ class MediaWiki {
*/
private function performRequest() {
global $wgServer, $wgUsePathInfo, $wgTitle;
+ global $wgOut;
wfProfileIn( __METHOD__ );
@@ -185,6 +186,13 @@ class MediaWiki {
// The skin mostly uses $this->context->getTitle() these days, but some extensions
// still use $wgTitle.
+ //restrict check
+ if($title->isRestricted()){
+ $wgOut->restrictGroupRequired();
+ $wgOut->output();
+ $wgOut->disable();
+ }
+
$badTitle = SpecialPage::getTitleFor( 'Badtitle' );
$this->context->setTitle( $badTitle );
$wgTitle = $badTitle;
diff --git includes/WikiPage.php includes/WikiPage.php
index acc9831..37da32f 100644
--- includes/WikiPage.php
+++ includes/WikiPage.php
@@ -1407,7 +1407,7 @@ class WikiPage extends Page {
# Add the page record; stake our claim on this title!
# This will return false if the article already exists
- $newid = $this->insertOn( $dbw );
+ $newid = $this->insertOn( $dbw, $wgUser->shouldRestrictNewPages() ? 'view=1' : '' );
if ( $newid === false ) {
$dbw->rollback();
diff --git includes/actions/RestrictAction.php includes/actions/RestrictAction.php
new file mode 100644
index 0000000..ede5d28
--- /dev/null
+++ includes/actions/RestrictAction.php
@@ -0,0 +1,17 @@
+<?php
+
+class RestrictAction extends FormlessAction {
+
+ public function getName() {
+ return 'restrict';
+ }
+
+ public function onView(){
+ return null;
+ }
+
+ public function show(){
+ $page = $this->page;
+ $page->restrict();
+ }
+}
diff --git includes/actions/UnrestrictAction.php includes/actions/UnrestrictAction.php
new file mode 100644
index 0000000..37f0928
--- /dev/null
+++ includes/actions/UnrestrictAction.php
@@ -0,0 +1,17 @@
+<?php
+
+class UnrestrictAction extends FormlessAction {
+
+ public function getName() {
+ return 'unrestrict';
+ }
+
+ public function onView(){
+ return null;
+ }
+
+ public function show(){
+ $page = $this->page;
+ $page->unrestrict();
+ }
+}
diff --git includes/api/ApiPageSet.php includes/api/ApiPageSet.php
index 7b84c47..d800ab1 100644
--- includes/api/ApiPageSet.php
+++ includes/api/ApiPageSet.php
@@ -369,6 +369,10 @@ class ApiPageSet extends ApiQueryBase {
// Store Title object in various data structures
$title = Title::makeTitle( $row->page_namespace, $row->page_title );
+ if ( !$title->userCanViewRestricted() ) {
+ return;
+ }
+
$pageId = intval( $row->page_id );
$this->mAllPages[$row->page_namespace][$row->page_title] = $pageId;
$this->mTitles[] = $title;
@@ -668,7 +672,7 @@ class ApiPageSet extends ApiQueryBase {
foreach ( $titles as $title ) {
$titleObj = is_string( $title ) ? Title::newFromText( $title ) : $title;
- if ( !$titleObj ) {
+ if ( !$titleObj || !$title->userCanViewRestricted() ) {
// Handle invalid titles gracefully
$this->mAllpages[0][$title] = $this->mFakePageId;
$this->mInvalidTitles[$this->mFakePageId] = $title;
diff --git includes/api/ApiQueryAllpages.php includes/api/ApiQueryAllpages.php
index e003ee9..d965b21 100644
--- includes/api/ApiQueryAllpages.php
+++ includes/api/ApiQueryAllpages.php
@@ -157,6 +157,8 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
$forceNameTitleIndex = false;
}
+ $this->addRestrict();
+
if ( $forceNameTitleIndex ) {
$this->addOption( 'USE INDEX', 'name_title' );
}
@@ -330,4 +332,17 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
public function getVersion() {
return __CLASS__ . ': $Id$';
}
+
+# ----------------------------------------------------------------------------
+# Page access restriction
+# ----------------------------------------------------------------------------
+
+ protected function addRestrict() {
+ global $wgUser;
+ $db = $this->getDB();
+ if ( !$wgUser->canViewRestricted() ) {
+ $this->addWhere( 'page_restrictions NOT' . $db->buildLike( $db->anyString(), 'view=1', $db->anyString() ) );
+ }
+ }
+
}
diff --git includes/logging/LogPage.php includes/logging/LogPage.php
index bbb4de8..569823d 100644
--- includes/logging/LogPage.php
+++ includes/logging/LogPage.php
@@ -57,7 +57,7 @@ class LogPage {
* Constructor
*
* @param $type String: one of '', 'block', 'protect', 'rights', 'delete',
- * 'upload', 'move'
+ * 'upload', 'move', 'restrict'
* @param $rc Boolean: whether to update recent changes as well as the logging table
* @param $udp String: pass 'UDP' to send to the UDP feed if NOT sent to RC
*/
@@ -414,7 +414,7 @@ class LogPage {
/**
* Add a log entry
*
- * @param $action String: one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'
+ * @param $action String: one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir', 'restrict'
* @param $target Title object
* @param $comment String: description associated
* @param $params Array: parameters passed later to wfMsg.* functions
diff --git includes/parser/Parser.php includes/parser/Parser.php
index 8bdfa0e..ef60bdd 100644
--- includes/parser/Parser.php
+++ includes/parser/Parser.php
@@ -3291,7 +3291,7 @@ class Parser {
wfDebug( __METHOD__.": template inclusion denied for " . $title->getPrefixedDBkey() );
} else {
list( $text, $title ) = $this->getTemplateDom( $title );
- if ( $text !== false ) {
+ if ( $text !== false && $title->userCanRead() ) {
$found = true;
$isChildObj = true;
}
diff --git includes/search/SearchEngine.php includes/search/SearchEngine.php
index 2f7dfd7..c34af7a 100644
--- includes/search/SearchEngine.php
+++ includes/search/SearchEngine.php
@@ -170,40 +170,42 @@ class SearchEngine {
return null;
}
- if ( $title->isSpecialPage() || $title->isExternal() || $title->exists() ) {
- return $title;
- }
-
- # See if it still otherwise has content is some sane sense
- $page = WikiPage::factory( $title );
- if ( $page->hasViewableContent() ) {
- return $title;
- }
-
- # Now try all lower case (i.e. first letter capitalized)
- #
- $title = Title::newFromText( $wgContLang->lc( $term ) );
- if ( $title && $title->exists() ) {
- return $title;
+ if ( $title->userCanViewRestricted() ) {
+ if ( $title->isSpecialPage() || $title->isExternal() || $title->exists() ) {
+ return $title;
+ }
+
+ # See if it still otherwise has content is some sane sense
+ $page = WikiPage::factory( $title );
+ if ( $page->hasViewableContent() ) {
+ return $title;
+ }
+
+ # Now try all lower case (i.e. first letter capitalized)
+ #
+ $title = Title::newFromText( $wgContLang->lc( $term ) );
+ if ( $title && $title->exists() ) {
+ return $title;
+ }
}
# Now try capitalized string
#
$title = Title::newFromText( $wgContLang->ucwords( $term ) );
- if ( $title && $title->exists() ) {
+ if ( $title && $title->exists() && $title->userCanViewRestricted() ) {
return $title;
}
# Now try all upper case
#
$title = Title::newFromText( $wgContLang->uc( $term ) );
- if ( $title && $title->exists() ) {
+ if ( $title && $title->exists() && $title->userCanViewRestricted() ) {
return $title;
}
# Now try Word-Caps-Breaking-At-Word-Breaks, for hyphenated names etc
$title = Title::newFromText( $wgContLang->ucwordbreaks( $term ) );
- if ( $title && $title->exists() ) {
+ if ( $title && $title->exists() && $title->userCanViewRestricted() ) {
return $title;
}
diff --git includes/search/SearchIBM_DB2.php includes/search/SearchIBM_DB2.php
index c02a009..8d93c6c 100644
--- includes/search/SearchIBM_DB2.php
+++ includes/search/SearchIBM_DB2.php
@@ -116,6 +116,7 @@ class SearchIBM_DB2 extends SearchEngine {
return $this->queryLimit($this->queryMain($filteredTerm, $fulltext) . ' ' .
$this->queryRedirect() . ' ' .
$this->queryNamespaces() . ' ' .
+ $this->queryRestrict() . ' ' .
$this->queryRanking( $filteredTerm, $fulltext ) . ' ');
}
@@ -228,4 +229,16 @@ class SearchIBM_DB2 extends SearchEngine {
'SearchIBM_DB2::updateTitle',
array());
}
+
+# ----------------------------------------------------------------------------
+# Page access restriction
+# ----------------------------------------------------------------------------
+
+ protected function queryRestrict() {
+ global $wgUser;
+ if ( !$wgUser->canViewRestricted() ) {
+ return "AND page_restrictions NOT LIKE '%view=1%'";
+ }
+ return '';
+ }
}
diff --git includes/search/SearchMssql.php includes/search/SearchMssql.php
index ebf19d3..4d4d664 100644
--- includes/search/SearchMssql.php
+++ includes/search/SearchMssql.php
@@ -120,6 +120,7 @@ class SearchMssql extends SearchEngine {
return $this->queryLimit( $this->queryMain( $filteredTerm, $fulltext ) . ' ' .
$this->queryRedirect() . ' ' .
$this->queryNamespaces() . ' ' .
+ $this->queryRestrict() . ' ' .
$this->queryRanking( $filteredTerm, $fulltext ) . ' ' );
}
@@ -222,6 +223,18 @@ class SearchMssql extends SearchEngine {
$sql .= "INSERT INTO $table (si_page, si_title, si_text) VALUES ($id, $si_title, 0x00)";
return $this->db->query( $sql, 'SearchMssql::updateTitle' );
}
+
+# ----------------------------------------------------------------------------
+# Page access restriction
+# ----------------------------------------------------------------------------
+
+ protected function queryRestrict() {
+ global $wgUser;
+ if ( !$wgUser->canViewRestricted() ) {
+ return "AND page_restrictions NOT LIKE '%view=1%'";
+ }
+ return '';
+ }
}
/**
diff --git includes/search/SearchMySQL.php includes/search/SearchMySQL.php
index af8f387..aaee722 100644
--- includes/search/SearchMySQL.php
+++ includes/search/SearchMySQL.php
@@ -273,6 +273,7 @@ class SearchMySQL extends SearchEngine {
$this->queryMain( $query, $filteredTerm, $fulltext );
$this->queryFeatures( $query );
$this->queryNamespaces( $query );
+ $this->queryRestrict( $query );
$this->limitResult( $query );
return $query;
@@ -322,6 +323,7 @@ class SearchMySQL extends SearchEngine {
$this->queryFeatures( $query );
$this->queryNamespaces( $query );
+ $this->queryRestrict( $query );
return $query;
}
@@ -440,6 +442,18 @@ class SearchMySQL extends SearchEngine {
}
return self::$mMinSearchLength;
}
+
+# ----------------------------------------------------------------------------
+# Page access restriction
+# ----------------------------------------------------------------------------
+
+ protected function queryRestrict( &$query ) {
+ global $wgUser;
+ $db = $this->db;
+ if ( !$wgUser->canViewRestricted() ) {
+ $query['conds'][] = 'page_restrictions NOT' . $db->buildLike( $db->anyString(), 'view=1', $db->anyString() );
+ }
+ }
}
/**
diff --git includes/search/SearchOracle.php includes/search/SearchOracle.php
index 2d6fc3e..73bfe6d 100644
--- includes/search/SearchOracle.php
+++ includes/search/SearchOracle.php
@@ -152,6 +152,7 @@ class SearchOracle extends SearchEngine {
return $this->queryLimit($this->queryMain($filteredTerm, $fulltext) . ' ' .
$this->queryRedirect() . ' ' .
$this->queryNamespaces() . ' ' .
+ $this->queryRestrict() . ' ' .
$this->queryRanking( $filteredTerm, $fulltext ) . ' ');
}
@@ -283,4 +284,16 @@ class SearchOracle extends SearchEngine {
public static function legalSearchChars() {
return "\"" . parent::legalSearchChars();
}
+
+# ----------------------------------------------------------------------------
+# Page access restriction
+# ----------------------------------------------------------------------------
+
+ protected function queryRestrict() {
+ global $wgUser;
+ if ( !$wgUser->canViewRestricted() ) {
+ return "AND page_restrictions NOT LIKE '%view=1%'";
+ }
+ return '';
+ }
}
diff --git includes/search/SearchPostgres.php includes/search/SearchPostgres.php
index cfe283b..e57527a 100644
--- includes/search/SearchPostgres.php
+++ includes/search/SearchPostgres.php
@@ -194,6 +194,8 @@ class SearchPostgres extends SearchEngine {
}
}
+ $this->queryRestrict( $query );
+
$query .= " ORDER BY score DESC, page_id DESC";
$query .= $this->db->limitResult( '', $this->limit, $this->offset );
@@ -218,6 +220,17 @@ class SearchPostgres extends SearchEngine {
return true;
}
+# ----------------------------------------------------------------------------
+# Page access restriction
+# ----------------------------------------------------------------------------
+
+ protected function queryRestrict( &$query ) {
+ global $wgUser;
+ if ( !$wgUser->canViewRestricted() ) {
+ $query .= " AND page_restrictions NOT LIKE '%view=1%'";
+ }
+ }
+
} ## end of the SearchPostgres class
/**
diff --git includes/search/SearchSqlite.php includes/search/SearchSqlite.php
index cd59eea..3df911a 100644
--- includes/search/SearchSqlite.php
+++ includes/search/SearchSqlite.php
@@ -243,7 +243,8 @@ class SearchSqlite extends SearchEngine {
return $this->limitResult(
$this->queryMain( $filteredTerm, $fulltext ) . ' ' .
$this->queryRedirect() . ' ' .
- $this->queryNamespaces()
+ $this->queryNamespaces() . ' ' .
+ $this->queryRestrict()
);
}
@@ -280,7 +281,8 @@ class SearchSqlite extends SearchEngine {
"FROM $page,$searchindex " .
"WHERE page_id=$searchindex.rowid AND $match" .
$this->queryRedirect() . ' ' .
- $this->queryNamespaces();
+ $this->queryNamespaces() . ' ' .
+ $this->queryRestrict();
}
/**
@@ -327,6 +329,18 @@ class SearchSqlite extends SearchEngine {
array( 'rowid' => $id ),
__METHOD__ );
}
+
+# ----------------------------------------------------------------------------
+# Page access restriction
+# ----------------------------------------------------------------------------
+
+ protected function queryRestrict() {
+ global $wgUser;
+ if ( !$wgUser->canViewRestricted() ) {
+ return "AND page_restrictions NOT LIKE '%view=1%'";
+ }
+ return '';
+ }
}
/**
diff --git includes/specials/SpecialAllpages.php includes/specials/SpecialAllpages.php
index 960a327..6c86e30 100644
--- includes/specials/SpecialAllpages.php
+++ includes/specials/SpecialAllpages.php
@@ -166,6 +166,11 @@ class SpecialAllpages extends IncludableSpecialPage {
if( isset($to) )
$where[] = 'page_title <= '.$dbr->addQuotes( $to );
+ global $wgUser;
+ if ( !$wgUser->canViewRestricted() ) {
+ $where[] = "page_restrictions NOT LIKE '%view=1%'";
+ }
+
global $wgMemc;
$key = wfMemcKey( 'allpages', 'ns', $namespace, $from, $to );
$lines = $wgMemc->get( $key );
@@ -323,6 +328,11 @@ class SpecialAllpages extends IncludableSpecialPage {
$conds[] = 'page_title <= ' . $dbr->addQuotes( $toKey );
}
+ global $wgUser;
+ if ( !$wgUser->canViewRestricted() ) {
+ $conds[] = "page_restrictions NOT LIKE '%view=1%'";
+ }
+
$res = $dbr->select( 'page',
array( 'page_namespace', 'page_title', 'page_is_redirect', 'page_id' ),
$conds,
diff --git includes/specials/SpecialCategories.php includes/specials/SpecialCategories.php
index 338cd70..2cedfe3 100644
--- includes/specials/SpecialCategories.php
+++ includes/specials/SpecialCategories.php
@@ -117,6 +117,11 @@ class CategoryPager extends AlphabeticPager {
function formatRow($result) {
$title = Title::makeTitle( NS_CATEGORY, $result->cat_title );
+
+ if ( !$title->userCanViewRestricted() ) {
+ return "<em>" . wfMsgHtml( 'restricttitle' ) . "</em>";
+ }
+
$titleText = Linker::link( $title, htmlspecialchars( $title->getText() ) );
$count = $this->msg( 'nmembers' )->numParams( $result->cat_pages )->escaped();
return Xml::tags( 'li', null, $this->getLanguage()->specialList( $titleText, $count ) ) . "\n";
diff --git includes/specials/SpecialDoubleRedirects.php includes/specials/SpecialDoubleRedirects.php
index a6df66f..6563c17 100644
--- includes/specials/SpecialDoubleRedirects.php
+++ includes/specials/SpecialDoubleRedirects.php
@@ -42,6 +42,7 @@ class DoubleRedirectsPage extends PageQueryPage {
}
function reallyGetQueryInfo( $namespace = null, $title = null ) {
+ global $wgEnableRestrict, $wgUser;
$limitToTitle = !( $namespace === null && $title === null );
$retval = array (
'tables' => array ( 'ra' => 'redirect',
@@ -61,6 +62,9 @@ class DoubleRedirectsPage extends PageQueryPage {
'pc.page_namespace = rb.rd_namespace',
'pc.page_title = rb.rd_title' )
);
+ if ( $wgEnableRestrict && !$wgUser->canViewRestricted() ) {
+ $retval['conds'][] = "pa.page_restrictions NOT LIKE '%view=1%'";
+ }
if ( $limitToTitle ) {
$retval['conds']['pa.page_namespace'] = $namespace;
$retval['conds']['pa.page_title'] = $title;
diff --git includes/specials/SpecialMIMEsearch.php includes/specials/SpecialMIMEsearch.php
index 2213ffa..e0cf999 100644
--- includes/specials/SpecialMIMEsearch.php
+++ includes/specials/SpecialMIMEsearch.php
@@ -87,6 +87,11 @@ class MIMEsearchPage extends QueryPage {
global $wgContLang;
$nt = Title::makeTitle( $result->namespace, $result->title );
+
+ if ( !$nt->userCanViewRestricted() ) {
+ return "<em>" . wfMsgHtml( 'restricttitle' ) . "</em>";
+ }
+
$text = $wgContLang->convert( $nt->getText() );
$plink = Linker::link(
Title::newFromText( $nt->getPrefixedText() ),
diff --git includes/specials/SpecialMostlinkedcategories.php includes/specials/SpecialMostlinkedcategories.php
index 7fb9dea..82c185f 100644
--- includes/specials/SpecialMostlinkedcategories.php
+++ includes/specials/SpecialMostlinkedcategories.php
@@ -77,6 +77,11 @@ class MostlinkedCategoriesPage extends QueryPage {
global $wgContLang;
$nt = Title::makeTitle( NS_CATEGORY, $result->title );
+
+ if ( !$nt->userCanViewRestricted() ) {
+ return "<em>" . wfMsgHtml( 'restricttitle' ) . "</em>";
+ }
+
$text = $wgContLang->convert( $nt->getText() );
$plink = Linker::link( $nt, htmlspecialchars( $text ) );
diff --git includes/specials/SpecialNewimages.php includes/specials/SpecialNewimages.php
index b88123d..151e06b 100644
--- includes/specials/SpecialNewimages.php
+++ includes/specials/SpecialNewimages.php
@@ -120,6 +120,10 @@ class NewFilesPager extends ReverseChronologicalPager {
$title = Title::makeTitle( NS_FILE, $name );
$ul = Linker::link( $user->getUserpage(), $user->getName() );
+ if ( !$title->userCanViewRestricted() ) {
+ return;
+ }
+
$this->gallery->add(
$title,
"$ul<br />\n<i>"
diff --git includes/specials/SpecialPrefixindex.php includes/specials/SpecialPrefixindex.php
index 495f15f..a340cb1 100644
--- includes/specials/SpecialPrefixindex.php
+++ includes/specials/SpecialPrefixindex.php
@@ -147,13 +147,20 @@ class SpecialPrefixindex extends SpecialAllpages {
$dbr = wfGetDB( DB_SLAVE );
+ $conds = array(
+ 'page_namespace' => $namespace,
+ 'page_title' . $dbr->buildLike( $prefixKey, $dbr->anyString() ),
+ 'page_title >= ' . $dbr->addQuotes( $fromKey ),
+ );
+
+ global $wgUser;
+ if ( !$wgUser->canViewRestricted() ) {
+ $conds[] = "page_restrictions NOT LIKE '%view=1%'";
+ }
+
$res = $dbr->select( 'page',
array( 'page_namespace', 'page_title', 'page_is_redirect' ),
- array(
- 'page_namespace' => $namespace,
- 'page_title' . $dbr->buildLike( $prefixKey, $dbr->anyString() ),
- 'page_title >= ' . $dbr->addQuotes( $fromKey ),
- ),
+ $conds,
__METHOD__,
array(
'ORDER BY' => 'page_title',
diff --git includes/specials/SpecialRandompage.php includes/specials/SpecialRandompage.php
index 0b6239b..307cbb6 100644
--- includes/specials/SpecialRandompage.php
+++ includes/specials/SpecialRandompage.php
@@ -62,7 +62,7 @@ class RandomPage extends SpecialPage {
$title = $this->getRandomTitle();
- if( is_null( $title ) ) {
+ if( is_null( $title ) || !$title->userCanViewRestricted() ) {
$this->setHeaders();
$this->getOutput()->addWikiMsg( strtolower( $this->getName() ) . '-nopages',
$this->getNsList(), count( $this->namespaces ) );
diff --git includes/specials/SpecialRecentchanges.php includes/specials/SpecialRecentchanges.php
index daf47f6..1f8f1a8 100644
--- includes/specials/SpecialRecentchanges.php
+++ includes/specials/SpecialRecentchanges.php
@@ -358,6 +358,12 @@ class SpecialRecentChanges extends IncludableSpecialPage {
$conds[] = $condition;
}
+
+ global $wgUser, $wgEnableRestrict, $wgHideRestrictLog;
+ if ( $wgEnableRestrict && $wgHideRestrictLog && !$wgUser->canViewRestricted() ) {
+ $conds[] = "rc_log_action NOT IN ('restrict', 'unrestrict')";
+ }
+
return $conds;
}
diff --git includes/specials/SpecialRestrictedpages.php includes/specials/SpecialRestrictedpages.php
new file mode 100644
index 0000000..b5b6570
--- /dev/null
+++ includes/specials/SpecialRestrictedpages.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Implements Special:Restrictedpages
+ *
+ * @file
+ * @ingroup SpecialPage
+ */
+
+/**
+ * Implements Special:Restrictedpages
+ *
+ * @ingroup SpecialPage
+ */
+class RestrictedPagesPage extends QueryPage {
+
+ function __construct() {
+ parent::__construct( 'Restrictedpages', 'viewrestrict' );
+ }
+
+ function isExpensive() { return true; }
+ function isSyndicated() { return false; }
+ function sortDescending() { return false; }
+
+ function getPageHeader() {
+ global $wgRegexRestrict;
+ $string = wfMsg('restrictedpagespagetext');
+ if ( !empty( $wgRegexRestrict ) ) {
+ $string .= " (".wfMsg('regexrestrictedpagespagetext');
+ foreach ( $wgRegexRestrict as $k => $v ) {
+ $string .= "<strong>{$v}</strong>, ";
+ }
+ $string = substr( $string, 0, -2 ) . ")";
+ }
+ return $string;
+ }
+
+ function getQueryInfo() {
+ return array(
+ 'tables' => array( 'page', 'page_restrictions' ),
+ 'fields' => array( "'Restrictedpages' AS type",
+ 'page_namespace AS namespace',
+ 'page_title AS title',
+ 'page_title AS value',
+ 'pr_page',
+ 'pr_type',
+ 'pr_level'
+ ),
+ 'join_conds' => array(
+ 'page' => array( 'LEFT JOIN', 'page_id=pr_page')
+ ),
+ 'conds' => array( // 'page_namespace' => "'" . NS_MAIN . "'",
+ // 'page_is_redirect' => 0,
+ "page_restrictions LIKE '%view=1%' OR (pr_type='view' AND pr_level='1')"
+ )
+ );
+ }
+
+ function formatResult( $skin, $result ) {
+ global $wgLang, $wgContLang;
+ $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true );
+ $title = Title::makeTitle( $result->namespace, $result->title );
+ $link = $skin->linkKnown( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
+ return "{$link} ({$d})";
+ }
+}
+
+?>
diff --git includes/specials/SpecialSearch.php includes/specials/SpecialSearch.php
index 3fa8687..1bdf1b3 100644
--- includes/specials/SpecialSearch.php
+++ includes/specials/SpecialSearch.php
@@ -540,6 +540,10 @@ class SpecialSearch extends SpecialPage {
$t = $result->getTitle();
+ if ( !$t->userCanViewRestricted() ) {
+ return "<li><em>" . wfMsgHtml( 'restricttitle' ) . "</em></li>";
+ }
+
$titleSnippet = $result->getTitleSnippet($terms);
if( $titleSnippet == '' )
diff --git includes/specials/SpecialUnwatchedpages.php includes/specials/SpecialUnwatchedpages.php
index 22c6485..fe24eb8 100644
--- includes/specials/SpecialUnwatchedpages.php
+++ includes/specials/SpecialUnwatchedpages.php
@@ -69,6 +69,11 @@ class UnwatchedpagesPage extends QueryPage {
global $wgContLang;
$nt = Title::makeTitle( $result->namespace, $result->title );
+
+ if ( !$nt->userCanViewRestricted() ) {
+ return "<em>" . wfMsgHtml( 'restricttitle' ) . "</em>";
+ }
+
$text = $wgContLang->convert( $nt->getPrefixedText() );
$plink = Linker::linkKnown(
diff --git includes/specials/SpecialWhatlinkshere.php includes/specials/SpecialWhatlinkshere.php
index d5129bf..d8b23d3 100644
--- includes/specials/SpecialWhatlinkshere.php
+++ includes/specials/SpecialWhatlinkshere.php
@@ -298,7 +298,7 @@ class SpecialWhatLinksHere extends SpecialPage {
$query = array();
}
- $link = Linker::linkKnown(
+ $link = Linker::restrictedLinkKnown(
$nt,
null,
array(),
@@ -321,7 +321,9 @@ class SpecialWhatLinksHere extends SpecialPage {
# Space for utilities links, with a what-links-here link provided
$wlhLink = $this->wlhLink( $nt, $msgcache['whatlinkshere-links'] );
- $wlh = Xml::wrapClass( "($wlhLink)", 'mw-whatlinkshere-tools' );
+ if ( $nt->userCanViewRestricted() ) {
+ $wlh = Xml::wrapClass( "($wlhLink)", 'mw-whatlinkshere-tools' );
+ }
return $notClose ?
Xml::openElement( 'li' ) . "$link $propsText $dirmark $wlh\n" :
diff --git languages/messages/MessagesCa.php languages/messages/MessagesCa.php
index 05f35e1..91d7d63 100644
--- languages/messages/MessagesCa.php
+++ languages/messages/MessagesCa.php
@@ -186,6 +186,7 @@ $specialPageAliases = array(
'Watchlist' => array( 'Llista de seguiment' ),
'Whatlinkshere' => array( 'Enllaços' ),
'Withoutinterwiki' => array( 'Sense interwiki' ),
+ 'Restrictedpages' => array( 'Pàgines restringides' ),
);
$linkTrail = "/^((?:[a-zàèéíòóúç·ïü]|'(?!'))+)(.*)$/sDu";
@@ -3758,4 +3759,31 @@ Altrament, podeu fer servir un senzill formulari a continuació. El vostre comen
'api-error-uploaddisabled' => 'Estan desactivades les càrregues en aquest wiki',
'api-error-verification-error' => 'Aquest fitxer pot estar danyat, o tenir una extensió incorrecta.',
+# Restrict patch (http://www.mediawiki.org/wiki/Extension:Page_access_restriction)
+# Pau 05-02-06
+'restrict' => 'Restringeix',
+'restrictthispage' => 'Restringeix aquesta pàgina',
+'unrestrict' => 'Desrentringeix',
+'unrestrictthispage' => 'Permet el lliure accés aquesta pàgina',
+'restricttitle' => 'Pàgina restringida',
+'restricttext' => 'Aquesta pàgina és restringida. Per veure-la, heu d\'esser membres del grup \'restrict\' o del grup \'viewrestrict\'.',
+'restrictedpages' => 'Pàgines restringides',
+'restrictlogpage' => 'Log_restriccions',
+'restrictlogtext' => 'A continuació, teniu una llista de restriccions de pàgina. Vegeu [[{{ns:4}}:Restricted page]] per més informació.',
+'restrictedarticle' => '[[$1]] restringida',
+'unrestrictedarticle' => '[[$1]] desrentringida',
+'restrictsub' => '(Restringeix \'[[$1]]\')',
+'confirmrestrict' => 'Confirma la restricció',
+'confirmrestricttext' => 'Segur que voleu restringir aquesta pàgina?',
+'restrictcomment' => 'Raó per la restricció',
+'unrestrictsub' => '(Desrestringeix \'[[$1]]\')',
+'confirmunrestricttext' => 'Segur que voleu desrestringir aquesta pàgina?',
+'confirmunrestrict' => 'Confirmeu la desrestricció',
+'unrestrictcomment' => 'Raó per la desrestricció',
+'restrictreason' => '(doneu una raó)',
+'tooltip-restrict' => 'Restringeix aquesta pàgina',
+'notallowedtomoverestrictedpagetext' => 'Per moure aquesta pàgina, heu de ser membre del grup \'restrict\'.',
+'restrictedpagespagetext' => 'Aquesta pàgina llista totes les pàgines restringides del wiki. ',
+'regexrestrictedpagespagetext' => 'Totes les pàgines amb títols que compleixin aquesta/aquestes expressió(ns) regulars també seran restringides: ',
+
);
diff --git languages/messages/MessagesCs.php languages/messages/MessagesCs.php
index 756e7a4..e45d75b 100644
--- languages/messages/MessagesCs.php
+++ languages/messages/MessagesCs.php
@@ -354,6 +354,7 @@ $specialPageAliases = array(
'Watchlist' => array( 'Sledované_stránky', 'Sledovane_stranky' ),
'Whatlinkshere' => array( 'Co_odkazuje_na', 'Odkazuje_sem' ),
'Withoutinterwiki' => array( 'Bez_interwiki', 'Stránky_bez_interwiki_odkazů' ),
+ 'Restrictedpages' => array( 'Stránky_s_omezeným_přístupem' ),
);
$messages = array(
@@ -4010,4 +4011,30 @@ Jinak můžete využít jednoduchý formulář níže. Váš komentář bude př
'api-error-uploaddisabled' => 'Načítání souborů je na této wiki vypnuto.',
'api-error-verification-error' => 'Soubor je možná poškozen nebo má špatnou příponu.',
+# Restrict patch (http://www.mediawiki.org/wiki/Extension:Page_access_restriction)
+'restrict' => 'Omezit přístup',
+'restrictthispage' => 'Omezit přístup na tuto stránku',
+'unrestrict' => 'Zveřejnit',
+'unrestrictthispage' => 'Zveřejnit tuto stránku',
+'restricttitle' => 'Stránka s omezeným přístupem',
+'restricttext' => 'Na tuto stránku je omezený přístup. Zřejmě nemáte oprávnění k jejímu čtení',
+'restrictedpages' => 'Stránky s omezeným přístupem',
+'restrictlogpage' => 'Restriction_log',
+'restrictlogtext' => 'Zde je seznam omezení stránky. Pro více informací se podívejte na [[{{ns:4}}:Restricted page]] .',
+'restrictedarticle' => 'omezený [[$1]]',
+'unrestrictedarticle' => 'neomezený [[$1]]',
+'restrictsub' => '(Omezit přístup \'[[$1]]\')',
+'confirmrestrict' => 'Potvrzení omezení přístupu',
+'confirmrestricttext' => 'Opravdu chcete omezit přístup k této stránce?',
+'restrictcomment' => 'Důvod pro omezení',
+'unrestrictsub' => '(Neomezovat \'[[$1]]\')',
+'confirmunrestricttext' => 'Opravdu chcete zveřejnit tuto stránku?',
+'confirmunrestrict' => 'Potvrzení zveřejnění',
+'unrestrictcomment' => 'Důvod zveřejnění',
+'restrictreason' => '(udejte důvod)',
+'tooltip-restrict' => 'Omezit přístup',
+'notallowedtomoverestrictedpagetext' => 'Pro přesunutí této stránky musíte být členem skupiny \'restrict\' ',
+'restrictedpagespagetext' => 'Na této stránce je seznam všech omezených stránek ve wiki.',
+'regexrestrictedpagespagetext' => 'Všechny stránky s názvem obsahující tento/tyto výraz(y) jsou také omezeny : ',
+
);
diff --git languages/messages/MessagesDe.php languages/messages/MessagesDe.php
index 2137f21..e21d59b 100644
--- languages/messages/MessagesDe.php
+++ languages/messages/MessagesDe.php
@@ -216,6 +216,7 @@ $specialPageAliases = array(
'Watchlist' => array( 'Beobachtungsliste' ),
'Whatlinkshere' => array( 'Linkliste', 'Verweisliste' ),
'Withoutinterwiki' => array( 'Fehlende_Interwikis' ),
+ 'Restrictedpages' => array( 'Gesperrte_Seiten' ),
);
$datePreferences = array(
@@ -4014,4 +4015,28 @@ Anderenfalls kannst du auch das untenstehende einfache Formular nutzen. Dein Kom
'api-error-uploaddisabled' => 'Das Hochladen ist in diesem Wiki deaktiviert.',
'api-error-verification-error' => 'Die hochzuladende Datei ist entweder fehlerhaft oder hat keine Dateinamenserweiterung.',
+# Restrict patch (http://www.mediawiki.org/wiki/Extension:Page_access_restriction)
+'restrict' => 'Sperren',
+'restrictthispage' => 'Diese Seite sperren',
+'unrestrict' => 'Sperrung aufheben',
+'unrestrictthispage' => 'Sperrung der Seite aufheben',
+'restricttitle' => 'Gesperrte Seite',
+'restricttext' => 'Diese Seite ist gesperrt. Um sie zu betrachten, musst du ein Mitglied der Gruppe \'restrict\' oder \'viewrestrict\' sein.',
+'restrictedpages' => 'Gesperrte Seiten',
+'restrictlogpage' => 'Log der Sperrungen',
+'restrictlogtext' => 'Unten folgt eine Liste mit gesperrten Seiten. Vgl. [[{{ns:4}}:Gesperrte Seiten]] für mehr Information.',
+'restrictedarticle' => 'Gesperrt: [[$1]]',
+'unrestrictedarticle' => 'Ungesperrt: [[$1]]',
+'restrictsub' => '(Gesperrt: \'[[$1]]\')',
+'confirmrestrict' => 'Sperrung bestätigen',
+'confirmrestricttext' => 'Willst du die Seite wirklich sperren?',
+'restrictcomment' => 'Grund für die Sperrung',
+'unrestrictsub' => '(Entsperren \'[[$1]]\')',
+'confirmunrestricttext' => 'Willst du die Seite wirklich entsperren?',
+'confirmunrestrict' => 'Entsperrung bestätigen',
+'unrestrictcomment' => 'Grund für Entsperrung',
+'restrictreason' => '(einen Grund angeben)',
+'tooltip-restrict' => 'Diese Seite sperren',
+'notallowedtomoverestrictedpagetext' => 'Um diese Seite zu verschieben, musst du ein Mitglied der Gruppe \'restrict\' sein.',
+
);
diff --git languages/messages/MessagesEn.php languages/messages/MessagesEn.php
index 6df76df..391b754 100644
--- languages/messages/MessagesEn.php
+++ languages/messages/MessagesEn.php
@@ -463,6 +463,7 @@ $specialPageAliases = array(
'Watchlist' => array( 'Watchlist' ),
'Whatlinkshere' => array( 'WhatLinksHere' ),
'Withoutinterwiki' => array( 'WithoutInterwiki' ),
+ 'Restrictedpages' => array( 'RestrictedPages' ),
);
/**
@@ -4763,4 +4764,30 @@ Otherwise, you can use the easy form below. Your comment will be added to the pa
'api-error-uploaddisabled' => 'Uploading is disabled on this wiki.',
'api-error-verification-error' => 'This file might be corrupt, or have the wrong extension.',
+# Restrict patch (http://www.mediawiki.org/wiki/Extension:Page_access_restriction)
+'restrict' => 'Restrict',
+'restrictthispage' => 'Restrict this page',
+'unrestrict' => 'Unrestrict',
+'unrestrictthispage' => 'Unrestrict this page',
+'restricttitle' => 'Restricted page',
+'restricttext' => 'This page is restricted. To view it you have to be member of the \'restrict\' group or \'viewrestrict\' group.',
+'restrictedpages' => 'Restricted pages',
+'restrictlogpage' => 'Restriction_log',
+'restrictlogtext' => 'Below is a list of page restrictions. See [[{{ns:4}}:Restricted page]] for more information.',
+'restrictedarticle' => 'restricted [[$1]]',
+'unrestrictedarticle' => 'unrestricted [[$1]]',
+'restrictsub' => '(Restrict \'[[$1]]\')',
+'confirmrestrict' => 'Confirm the restriction',
+'confirmrestricttext' => 'Do you really want to restrict this page?',
+'restrictcomment' => 'Reason for restricting',
+'unrestrictsub' => '(Unrestrict \'[[$1]]\')',
+'confirmunrestricttext' => 'Do you really want to unrestrict this page?',
+'confirmunrestrict' => 'Confirm unrestriction',
+'unrestrictcomment' => 'Reason for unrestricting',
+'restrictreason' => '(give a reason)',
+'tooltip-restrict' => 'Restrict this page',
+'notallowedtomoverestrictedpagetext' => 'To move this page, you have to be member of the \'restrict\' group.',
+'restrictedpagespagetext' => 'This page lists all restricted pages in the wiki. ',
+'regexrestrictedpagespagetext' => 'All page titles matching this/these regular expression(s) are also restricted : ',
+
);
diff --git languages/messages/MessagesEs.php languages/messages/MessagesEs.php
index 4c6bc18..bd5e50f 100644
--- languages/messages/MessagesEs.php
+++ languages/messages/MessagesEs.php
@@ -221,6 +221,7 @@ $specialPageAliases = array(
'Watchlist' => array( 'Seguimiento', 'Lista_de_seguimiento' ),
'Whatlinkshere' => array( 'LoQueEnlazaAquí', 'Lo_que_enlaza_aquí' ),
'Withoutinterwiki' => array( 'SinInterwikis', 'Sin_interwikis' ),
+ 'Restrictedpages' => array( 'PáginasRestringidas' ),
);
$magicWords = array(
@@ -3991,4 +3992,31 @@ En otro caso, puedes usar el siguiente formulario. Tu comentario será añadido
'api-error-uploaddisabled' => 'Las subidas están desactivadas en este wiki.',
'api-error-verification-error' => 'Este archivo puede estar dañado, o tiene una extensión incorrecta.',
+# Restrict patch (http://www.mediawiki.org/wiki/Extension:Page_access_restriction)
+# Coffman 18-07-06
+'restrict' => 'Restringir',
+'restrictthispage' => 'Restringir esta página',
+'unrestrict' => 'Quitar restricción',
+'unrestrictthispage' => 'Quitar restricción en esta página',
+'restricttitle' => 'Página restringida',
+'restricttext' => 'Esta página esta restringida. Para verla tienes que pertenecer al grupo \'restrict\' o al grupo \'viewrestrict\'.',
+'restrictedpages' => 'Páginas restringidas',
+'restrictlogpage' => 'Restriction_log',
+'restrictlogtext' => 'A continuación está una lista de las páginas restringidas. Mira [[{{ns:4}}:Restricted page]] para más información.',
+'restrictedarticle' => 'restringido [[$1]]',
+'unrestrictedarticle' => 'no restringido [[$1]]',
+'restrictsub' => '(Restringir \'[[$1]]\')',
+'confirmrestrict' => 'Confirma la restricción',
+'confirmrestricttext' => '¿ Quieres realmente restringir esta página ?',
+'restrictcomment' => 'Razon de la restricción',
+'unrestrictsub' => '(Quitar restriccion \'[[$1]]\')',
+'confirmunrestricttext' => '¿ Quieres realmente quitar la restricción de esta página ?',
+'confirmunrestrict' => 'Confirma que quieres quitar la restricción',
+'unrestrictcomment' => 'Razon para quitar la restricción',
+'restrictreason' => '(da una razon)',
+'tooltip-restrict' => 'Restringir esta página',
+'notallowedtomoverestrictedpagetext' => 'Para mover esta página, debes ser miembro del grupo \'restrict\'.',
+'restrictedpagespagetext' => 'Esta página lista todas las páginas restringidas del wiki. ',
+'regexrestrictedpagespagetext' => 'Todas las páginas cuyos títulos cumplan alguna de estas expresiones regulares están restringidas : ',
+
);
diff --git languages/messages/MessagesFi.php languages/messages/MessagesFi.php
index 779b972..3175f0c 100644
--- languages/messages/MessagesFi.php
+++ languages/messages/MessagesFi.php
@@ -309,6 +309,7 @@ $specialPageAliases = array(
'Watchlist' => array( 'Tarkkailulista' ),
'Whatlinkshere' => array( 'Tänne_viittaavat_sivut' ),
'Withoutinterwiki' => array( 'Kielilinkittömät_sivut' ),
+ 'Restrictedpages' => array( 'Rajoitetut_sivut' ),
);
$linkTrail = '/^([a-zäö]+)(.*)$/sDu';
@@ -3877,4 +3878,32 @@ Muussa tapauksessa voit käyttää alla olevaa helpompaa lomaketta. Kommenttisi
'api-error-uploaddisabled' => 'Tiedostojen tallentaminen ei ole käytössä.',
'api-error-verification-error' => 'Tiedosto voi olla vioittunut, tai sillä saattaa olla väärä tiedostopääte.',
+# Restrict patch (http://www.mediawiki.org/wiki/Extension:Page_access_restriction)
+'restrict' => 'Rajoita',
+'restrictthispage' => 'Rajoita sivua',
+'unrestrict' => 'Poista rajoitukset',
+'unrestrictthispage' => 'Poista rajoitukset sivulta',
+'restricttitle' => 'Rajoitettu aihe',
+//##title is different from page in Finnish, I had to make a semantic change: page = sivu, title = aihe . Hope it works.##
+'restricttext' => 'Tällä sivulla on rajoituksia. Nähdäksesi sivun sinun on oltava \'restrict\' tai \'viewrestrict\' -ryhmän jäsen.',
+'restrictedpages' => 'Rajoitetut sivut',
+'restrictlogpage' => 'Rajoitusten_seuranta',
+'restrictlogtext' => 'Alla on listaus sivun rajoituksista. Lue enemmän [[{{ns:4}}:rajoitetuista sivuista]] täältä.',
+'restrictedarticle' => 'rajoitettu [[$1]]',
+'unrestrictedarticle' => 'rajoittamaton [[$1]]',
+'restrictsub' => '(Rajoita aihetta: \'[[$1]]\')',
+//##I had to include "aihe"; $1 refers to a variable, which is probably a new topic/ title (=aihe). Finnish language uses postpositioned suffixes (which are difficult to include in code without making silly sounding sentences). Like this: aihe = title, aiheesta = about a title, aiheeseen = to the title. See what I mean?##
+'confirmrestrict' => 'Vahvista rajoitukset',
+'confirmrestricttext' => 'Haluatko varmasti luoda rajoituksia tälle sivulle?',
+'restrictcomment' => 'Kommentti',
+'unrestrictsub' => '(Poista rajoitus aiheesta: \'[[$1]]\')',
+'confirmunrestricttext' => 'Haluatko varmasti poistaa rajoitukset?',
+'confirmunrestrict' => 'Vahvista rajoitus',
+'unrestrictcomment' => 'Kommentti',
+'restrictreason' => '(syy)',
+'tooltip-restrict' => 'Rajoita',
+'notallowedtomoverestrictedpagetext' => 'Siirtääksesi tätä sivua sinun on oltava jäsen \'restrict\' ryhmässä.',
+'restrictedpagespagetext' => 'Tämä sivu listaa kaikki wikissä olevat rajoitetut sivut...',
+'regexrestrictedpagespagetext' => 'Tätä lauseketta vastaavilla sivuilla on rajoituksia:',
+
);
diff --git languages/messages/MessagesFr.php languages/messages/MessagesFr.php
index 067d288..a52a4d8 100644
--- languages/messages/MessagesFr.php
+++ languages/messages/MessagesFr.php
@@ -375,6 +375,7 @@ $specialPageAliases = array(
'Watchlist' => array( 'Liste_de_suivi', 'ListeDeSuivi', 'Suivi' ),
'Whatlinkshere' => array( 'Pages_liées', 'PagesLiées', 'Pages_liees', 'PagesLiees' ),
'Withoutinterwiki' => array( 'Sans_interwiki', 'Sansinterwiki', 'Sans_interwikis', 'Sansinterwikis' ),
+ 'Restrictedpages' => array( 'Pages_restreintes' ),
);
$separatorTransformTable = array( ',' => "\xc2\xa0", '.' => ',' );
@@ -4088,4 +4089,30 @@ Sinon, vous pouvez utiliser le formulaire simplifié ci-dessous. Votre commentai
'api-error-uploaddisabled' => 'Le téléversement est désactivé sur ce wiki.',
'api-error-verification-error' => 'Ce fichier peut être corrompu, ou son extension est incorrecte.',
+# Restrict patch (http://www.mediawiki.org/wiki/Extension:Page_access_restriction)
+'restrict' => 'Restreindre',
+'restrictthispage' => 'Restreindre cette page',
+'unrestrict' => 'Autoriser',
+'unrestrictthispage' => 'Autoriser cette page',
+'restricttitle' => 'Page restreinte',
+'restricttext' => 'L\'accès à cette page a été restreint. Pour pouvoir y accéder vous devez être membre du groupe \'restrict\' ou \'viewrestrict\'',
+'restrictedpages' => 'Pages restreintes',
+'restrictlogpage' => 'Log_de_restriction',
+'restrictlogtext' => 'Voir les [[{{ns:4}}:Page restreinte|directives concernant les pages restreintes]].',
+'restrictedarticle' => 'a restreint [[$1]]',
+'unrestrictedarticle' => 'a autorisé [[$1]]',
+'restrictsub' => '(Restreint \'[[$1]]\')',
+'confirmrestrict' => 'Confirmer la restriction',
+'confirmrestricttext' => 'Voulez vous vraiment restreindre l\'accès à cette page ?',
+'restrictcomment' => 'Raison de la restriction',
+'unrestrictsub' => '(Autorise \'[[$1]]\')',
+'confirmunrestricttext' => 'Voulez-vous vraiment autoriser l\'accès à cette page ?',
+'confirmunrestrict' => 'Confirmer l\'autorisation',
+'unrestrictcomment' => 'Raison de l\'autorisation',
+'restrictreason' => '(indiquez une raison)',
+'tooltip-restrict' => 'Restreindre cette page',
+'notallowedtomoverestrictedpagetext' => 'Pour pouvoir déplacer cette page, vous devez être membre du groupe \'restrict\'',
+'restrictedpagespagetext' => 'Cette page liste les pages restreintes de ce wiki.',
+'regexrestrictedpagespagetext' => 'Les pages dont le titre correspond à cette/ces expressions(s) régulière(s) sont également restreintes : ',
+
);
diff --git languages/messages/MessagesHe.php languages/messages/MessagesHe.php
index d5e698b..9151249 100644
--- languages/messages/MessagesHe.php
+++ languages/messages/MessagesHe.php
@@ -324,6 +324,7 @@ $specialPageAliases = array(
'Watchlist' => array( 'רשימת_המעקב', 'רשימת_מעקב', 'רשימת_המעקב_שלי' ),
'Whatlinkshere' => array( 'דפים_המקושרים_לכאן' ),
'Withoutinterwiki' => array( 'דפים_ללא_קישורי_שפה' ),
+ 'Restrictedpages' => array( 'דפים_מוגבלים' ),
);
$namespaceNames = array(
@@ -4074,4 +4075,30 @@ $5
'api-error-uploaddisabled' => 'ההעלאה מבוטלת באתר הוויקי הזה.',
'api-error-verification-error' => 'קובץ זה עשוי להיות פגום או בעל סיומת שגויה.',
+# Restrict patch (http://www.mediawiki.org/wiki/Extension:Page_access_restriction)
+'restrict' => 'הגבל',
+'restrictthispage' => 'הגבל דף זה',
+'unrestrict' => 'בטל הגבלה',
+'unrestrictthispage' => 'בטל הגבלת דף זה',
+'restricttitle' => 'דף מוגבל',
+'restricttext' => 'דף זה מוגבל לצפיה. על מנת לראותו עליך להיות חבר בקבוצת \'restrict\' או \'viewrestrict\'.',
+'restrictedpages' => 'דפים מוגבלים',
+'restrictlogpage' => 'יומן הגבלות',
+'restrictlogtext' => 'זהו יומן דפים מוגבלים. ראו [[{{ns:4}}:Restricted page]] למידע נוסף.',
+'restrictedarticle' => 'הגבל את [[$1]]',
+'unrestrictedarticle' => 'בטל הגבלה על [[$1]]',
+'restrictsub' => '(הגבל \'[[$1]]\')',
+'confirmrestrict' => 'האם אתם בטוחים שברצונכם להגביל דף זה?',
+'confirmrestricttext' => 'מאשר את ההגבלה',
+'restrictcomment' => 'סיבת ההגבלה',
+'unrestrictsub' => '(בטל הגבלת \'[[$1]]\')',
+'confirmunrestricttext' => 'האם אתם בטוחים שברצונכם לבטל הגבלת דף זה?',
+'confirmunrestrict' => 'מאשר את ביטול ההגבלה',
+'unrestrictcomment' => 'סיבת ביטול ההגבלה',
+'restrictreason' => 'סיבה',
+'tooltip-restrict' => 'הגבל עמוד זה',
+'notallowedtomoverestrictedpagetext' => 'על מנת להעביר דף זה עליך להיות חבר בקבוצת \'restrict\'',
+'restrictedpagespagetext' => 'ראו רשימת כל הדפים המוגבלים בויקי',
+'regexrestrictedpagespagetext' => 'כל הדפים שמתאימים לביטוי הרגולרי הזה מוגבלים גם כן :',
+
);
diff --git languages/messages/MessagesNl.php languages/messages/MessagesNl.php
index 57ba855..0afb0ed 100644
--- languages/messages/MessagesNl.php
+++ languages/messages/MessagesNl.php
@@ -350,6 +350,7 @@ $specialPageAliases = array(
'Watchlist' => array( 'Volglijst' ),
'Whatlinkshere' => array( 'VerwijzingenNaarHier', 'Verwijzingen', 'LinksNaarHier' ),
'Withoutinterwiki' => array( 'ZonderInterwiki' ),
+ 'Restrictedpages' => array( 'BeperktePaginas' ),
);
$linkTrail = '/^([a-zäöüïëéèà]+)(.*)$/sDu';
@@ -4084,4 +4085,30 @@ Uw reactie wordt dan toegevoegd aan de pagina "[$3 $2]", samen met uw gebruikers
'api-error-uploaddisabled' => 'Uploaden is niet mogelijk in deze wiki.',
'api-error-verification-error' => 'Dit bestand is mogelijk beschadigd of heeft een onjuiste extensie.',
+# Restrict patch (http://www.mediawiki.org/wiki/Extension:Page_access_restriction)
+'restrict' => 'Beperk',
+'restrictthispage' => 'Beperk deze pagina',
+'unrestrict' => 'Onbeperk',
+'unrestrictthispage' => 'Onbeperk deze pagina',
+'restricttitle' => 'Beperkte pagina',
+'restricttext' => 'Deze pagina is beperkt. Om deze te zien moet u lid zijn van de \'restrict\' groep of \'viewrestrict\' groep.',
+'restrictedpages' => 'Beperkte paginas',
+'restrictlogpage' => 'Beperkingen_log',
+'restrictlogtext' => 'Hier is een lijst met pagina beperkingen. Zie [[{{ns:4}}:Restricted page]] voor meer informatie.',
+'restrictedarticle' => 'beperkt [[$1]]',
+'unrestrictedarticle' => 'onbeperkt [[$1]]',
+'restrictsub' => '(Beperk \'[[$1]]\')',
+'confirmrestrict' => 'Bevestig de beperking',
+'confirmrestricttext' => 'Wilt u deze pagina echt beperken?',
+'restrictcomment' => 'Reden voor de beperking',
+'unrestrictsub' => '(Unrestrict \'[[$1]]\')',
+'confirmunrestricttext' => 'Wilt u deze pagina echt onbeperken?',
+'confirmunrestrict' => 'Bevestig de onbeperking',
+'unrestrictcomment' => 'Reden voor de onbeperking',
+'restrictreason' => '(geef een reden)',
+'tooltip-restrict' => 'Beperk deze pagina',
+'notallowedtomoverestrictedpagetext' => 'Om de locatie van deze pagina te veranderen, moet u lid zijn van de \'restrict\' groep.',
+'restrictedpagespagetext' => 'Deze pagina geeft een lijst van alle beperkte paginas in deze wiki. ',
+'regexrestrictedpagespagetext' => 'Alle pagina titels die aan deze uitdrukking voldoen zijn ook beperkt : ',
+
);
diff --git languages/messages/MessagesPl.php languages/messages/MessagesPl.php
index 0e2eff9..c30b134 100644
--- languages/messages/MessagesPl.php
+++ languages/messages/MessagesPl.php
@@ -212,6 +212,7 @@ $specialPageAliases = array(
'Watchlist' => array( 'Obserwowane' ),
'Whatlinkshere' => array( 'Linkujące' ),
'Withoutinterwiki' => array( 'Strony_bez_interwiki' ),
+ 'Restrictedpages' => array( 'Zastrzeżone_strony' ),
);
$magicWords = array(
@@ -4009,4 +4010,31 @@ W przeciwnym wypadku można użyć prostego formularza poniżej. Komentarz zosta
'api-error-uploaddisabled' => 'Na tej wiki przesyłanie zostało wyłączone.',
'api-error-verification-error' => 'Plik może być uszkodzony lub nazwa pliku ma nieprawidłowe rozszerzenie.',
+# Restrict patch (http://www.mediawiki.org/wiki/Extension:Page_access_restriction)
+# Janusz 'Ency' Dorożyński 16-05-06
+'restrict' => 'Zastrzeżenie',
+'restrictthispage' => 'Zastrzeżenie tej strony',
+'unrestrict' => 'Zdjęcie zastrzeżenia',
+'unrestrictthispage' => 'Zdjęcie zastrzeżenia tej strony',
+'restricttitle' => 'Strona zastrzeżona',
+'restricttext' => 'Ta strona jest zastrzeżona. Aby mieć do niej wgląd musisz być w grupie użytkowników \'restrict\' lub \'viewrestrict\'.',
+'restrictedpages' => 'Strony zastrzeżone',
+'restrictlogpage' => 'Dziennik (log) zastrzeżeń',
+'restrictlogtext' => 'Poniżej jest lista zastrzeżeń stron. Zobacz [[{{ns:4}}:Strony zastrzeżone]] z dodatkowymi informacjami.',
+'restrictedarticle' => 'zastrzeżono [[$1]]',
+'unrestrictedarticle' => 'zdjęto zastrzeżenie [[$1]]',
+'restrictsub' => '(Zastrzeżenie \'[[$1]]\')',
+'confirmrestrict' => 'Potwierdź zastrzeżenie',
+'confirmrestricttext' => 'Czy naprawdę chcesz zastrzec tę stronę?',
+'restrictcomment' => 'Powod zastrzeżenia',
+'unrestrictsub' => '(Zdjęcie zastrzeżenia \'[[$1]]\')',
+'confirmunrestricttext' => 'Czy naprawdę chcesz zdjąć zastrzeżenie tej stronę?',
+'confirmunrestrict' => 'Potwierdź zdjęcie zastrzeżenia',
+'unrestrictcomment' => 'Powód zdjęcia zastrzeżenia',
+'restrictreason' => '(podaj powód)',
+'tooltip-restrict' => 'Zastrzeż tę stronę',
+'notallowedtomoverestrictedpagetext' => 'Przeniesienie tej strony mogą wykonać tylko użytkownicy z grupy \'restrict\'.',
+'restrictedpagespagetext' => 'Ta strona podaje listę wszystkich zastrzeżonych stron tej wiki.',
+'regexrestrictedpagespagetext' => 'Zastrzeżenie dotyczy wszytkich tytułów artykułów spełniających warunki regularnych wyrażeń: '
+
);
diff --git languages/messages/MessagesRu.php languages/messages/MessagesRu.php
index 9ff4ccb..d6823a5 100644
--- languages/messages/MessagesRu.php
+++ languages/messages/MessagesRu.php
@@ -4043,4 +4043,30 @@ MediaWiki распространяется в надежде, что она бу
'api-error-uploaddisabled' => 'В этой вики отключена возможность загрузки файлов.',
'api-error-verification-error' => 'Возможно, этот файл повреждён или имеет неправильное расширение.',
+# Restrict patch (http://www.mediawiki.org/wiki/Extension:Page_access_restriction)
+'restrict' => 'Ограничить',
+'restrictthispage' => 'Ограничить статью',
+'unrestrict' => 'Не ограничивать',
+'unrestrictthispage' => 'Не ограничивать статью',
+'restricttitle' => 'Доступ к статье ограничен',
+'restricttext' => 'Данная страница ограничена для публичного просмотра. Для просмотра вы должны быть проверенны.',
+'restrictedpages' => 'Ограниченные статьи',
+'restrictlogpage' => 'Журнал ограничений',
+'restrictlogtext' => 'Ниже список страниц с ограничениями. См. [[{{ns:4}}:Ограниченные статьи]] для большей информации.',
+'restrictedarticle' => 'Ограниченно [[$1]]',
+'unrestrictedarticle' => 'Не ограниченно [[$1]]',
+'restrictsub' => '(Ограничить \'[[$1]]\')',
+'confirmrestrict' => 'Подтвердить ограничение',
+'confirmrestricttext' => 'Вы действительно желаете ограничить эту статью?',
+'restrictcomment' => 'Причины для ограничения',
+'unrestrictsub' => '(Не ограничивать \'[[$1]]\')',
+'confirmunrestricttext' => 'Вы действительно желаете снять ограничение?',
+'confirmunrestrict' => 'Подтвердить снятие ограничений',
+'unrestrictcomment' => 'Причины снятия ограничений',
+'restrictreason' => '(укажите причину)',
+'tooltip-restrict' => 'Ограничить статью',
+'notallowedtomoverestrictedpagetext' => 'Для перемещения этой страницы, Вы должны быть членом \'restrict\' группы.',
+'restrictedpagespagetext' => 'В этом списке страниц ограниченные для просмотра статьи. ',
+'regexrestrictedpagespagetext' => 'Все названия статей удовлетворяющих этому/этим семантическим выражениям будут так же ограниченны: ',
+
);
diff --git languages/messages/MessagesSv.php languages/messages/MessagesSv.php
index 7502e84..5cc02d8 100644
--- languages/messages/MessagesSv.php
+++ languages/messages/MessagesSv.php
@@ -173,6 +173,7 @@ $specialPageAliases = array(
'Watchlist' => array( 'Bevakningslista', 'Övervakningslista' ),
'Whatlinkshere' => array( 'Länkar_hit' ),
'Withoutinterwiki' => array( 'Utan_interwikilänkar' ),
+ 'Restrictedpages' => array( 'Begränsad_åtkomst_sidor' ),
);
$magicWords = array(
@@ -3947,4 +3948,30 @@ Annars kan du använda det enkla formuläret nedan. Din kommentar kommer att lä
'api-error-uploaddisabled' => 'Uppladdning är inaktiverad på denna wiki.',
'api-error-verification-error' => 'Denna fil kan vara skadad eller har fel filändelse.',
+# Restrict patch (http://www.mediawiki.org/wiki/Extension:Page_access_restriction)
+'restrict' => 'Begränsa åtkomst',
+'restrictthispage' => "Begränsa åtkomst för denna sida",
+'unrestrict' => 'Upphäv begränsning av åtkomst',
+'unrestrictthispage' => 'Upphäv begränsning av åtkomst för denna sida',
+'restricttitle' => 'Åtkomstbegränsad',
+'restricttext' => 'Denna sida har begränsad åtkomst. För att visa sidan måste du vara medlem i \'åtkomstbegränsa\' - eller \'visaåtkomstbegränsade\' - gruppen.',
+'restrictedpages' => 'Sidor med begränsad åtkomst',
+'restrictlogpage' => 'Logg för åtkomstbegränsning',
+'restrictlogtext' => 'Nedan finns en lista över åtkomstbegränsade sidor. Se [[{{ns:4}}:Åtkomstbegränsadesidor]] för ytterligare information.',
+'restrictedarticle' => 'Begränsade åtkomst för [[$1]]',
+'unrestrictedarticle' => 'Upphävde åtkomstbegränsning för [[$1]]',
+'restrictsub' => '(Begränsa åtkomst för \'[[$1]]\')',
+'confirmrestrict' => 'Bekräfta begränsning av åtkomst',
+'confirmrestricttext' => 'Är du säker på att du vill begränsa åtkomsten för denna sida?',
+'restrictcomment' => 'Orsak till begränsning av åtkomst',
+'unrestrictsub' => '(Upphäv begränsning av åtkomst för \'[[$1]]\')',
+'confirmunrestricttext' => 'Är du säker på att du vill upphäva åtkomstbegränsningen för denna sida?',
+'confirmunrestrict' => 'Bekräfta upphävning av åtkomstbegränsning',
+'unrestrictcomment' => 'Orsak till upphävning av åtkomstbegränsning',
+'restrictreason' => '(ange orsak)',
+'tooltip-restrict' => 'Begränsa åtkomst för denna sida',
+'notallowedtomoverestrictedpagetext' => 'För att kunna flytta denna sida måste du vara medlem i \'åtkomstbegränsa\' - gruppen.',
+'restrictedpagespagetext' => 'Denna sida listar alla sidor med begränsad åtkomst i hela wikin. ',
+'regexrestrictedpagespagetext' => 'Alla titlar som matchar denna/dessa regular expression(s) begränsas också: ',
+
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment