diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/Article.php ./includes/Article.php
--- ../mediawiki-1.5rc4/includes/Article.php 2005-08-30 01:45:27.000000000 +0200
+++ ./includes/Article.php 2005-09-11 21:50:03.602933904 +0200
@@ -744,7 +744,12 @@
# Another whitelist check in case oldid or redirects are altering the title
if ( !$this->mTitle->userCanRead() ) {
- $wgOut->loginToUse();
+ if ( $this->mTitle->isRestricted() ) {
+ $wgOut->restrictGroupRequired();
+ } else {
+ $wgOut->loginToUse();
+ }
+
$wgOut->output();
exit;
}
@@ -1549,6 +1554,9 @@
if( !$moveonly ) {
$restrictions .= ":edit=" . $limit;
}
+ if(current($this->mTitle->getRestrictions('view'))) {
+ $restrictions .= ":view=1";
+ }
if (wfRunHooks('ArticleProtect', array(&$this, &$wgUser, $limit == 'sysop', $reason, $moveonly))) {
$dbw =& wfGetDB( DB_MASTER );
@@ -1652,6 +1660,143 @@
function unprotect() {
return $this->protect( '' );
}
+
+
+ /**
+ * Restrict a page
+ * (restrict-patch by Jerome Combaz)
+ */
+ function restrict( $limit = true ) {
+ global $wgUser, $wgOut, $wgRequest, $wgEnableRestrict;
+
+ if ( ! $wgEnableRestrict == true ) return;
+
+ if ( ! $wgUser->isAllowed('restrict') ) {
+ $wgOut->restrictGroupRequired();
+ return;
+ }
+ if ( wfReadOnly() ) {
+ $wgOut->readOnlyPage();
+ return;
+ }
+ $id = $this->mTitle->getArticleID();
+ if ( 0 == $id ) {
+ $wgOut->fatalError( wfMsg( '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('ArticleProtectComplete', 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( 'confirmrestricttext' ) );
+ $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( "
+
" );
+
+ $wgOut->returnToMain( false );
+ }
+
+ /**
+ * Unrestrict the pages
+ */
+ function unrestrict() {
+ return $this->restrict( '' );
+ }
/*
* UI entry point for page deletion
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/DefaultSettings.php ./includes/DefaultSettings.php
--- ../mediawiki-1.5rc4/includes/DefaultSettings.php 2005-08-30 01:45:27.000000000 +0200
+++ ./includes/DefaultSettings.php 2005-09-07 12:16:35.000000000 +0200
@@ -1615,4 +1615,26 @@
*/
$wgUseTrackbacks = false;
+
+/**
+ *
+ * Restriction patch (by Jerome Combaz)
+ * see http://meta...
+ *
+ */
+
+/**
+ * If true, a new menu action allows to restrict pages access to sysop
+ */
+$wgEnableRestrict = false;
+
+/**
+ * Restrict user pages to their owner (as well as viewrestrict members)
+ */
+$wgUserPageRestrict = false;
+
+$wgGroupPermissions['restrict']['restrict'] =
+$wgGroupPermissions['restrict']['viewrestrict'] = true;
+$wgGroupPermissions['viewrestrict']['viewrestrict'] = true;
+
?>
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/Defines.php ./includes/Defines.php
--- ../mediawiki-1.5rc4/includes/Defines.php 2005-07-25 08:57:11.000000000 +0200
+++ ./includes/Defines.php 2005-09-05 18:46:10.000000000 +0200
@@ -76,7 +76,7 @@
* @todo Is this necessary?
*/
$wgAvailableRights = array('read', 'edit', 'move', 'delete', 'undelete',
-'protect', 'block', 'userrights', 'createaccount', 'upload',
+'protect', 'restrict', 'block', 'userrights', 'createaccount', 'upload',
'rollback', 'patrol', 'editinterface', 'siteadmin', 'bot', 'validate',
'import', 'importupload', 'renameuser' );
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/LogPage.php ./includes/LogPage.php
--- ../mediawiki-1.5rc4/includes/LogPage.php 2005-07-22 20:55:58.000000000 +0200
+++ ./includes/LogPage.php 2005-09-06 17:28:04.000000000 +0200
@@ -39,7 +39,7 @@
* Constructor
*
* @param string $type One of '', 'block', 'protect', 'rights', 'delete',
- * 'upload', 'move'
+ * 'upload', 'move', 'restrict'
*/
function LogPage( $type ) {
$this->type = $type;
@@ -88,7 +88,7 @@
* @static
*/
function validTypes() {
- static $types = array( '', 'block', 'protect', 'rights', 'delete', 'upload', 'move' );
+ static $types = array( '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'restrict' );
wfRunHooks( 'LogPageValidTypes', array( &$types) );
return $types;
}
@@ -101,6 +101,7 @@
'' => NULL,
'block' => array( 'block', 'unblock' ),
'protect' => array( 'protect', 'unprotect' ),
+ 'restrict'=> array( 'restrict', 'unrestrict' ),
'rights' => array( 'rights' ),
'delete' => array( 'delete', 'restore' ),
'upload' => array( 'upload' ),
@@ -124,6 +125,7 @@
'' => 'log',
'block' => 'blocklogpage',
'protect' => 'protectlogpage',
+ 'restrict'=> 'restrictlogpage',
'rights' => 'bureaucratlog',
'delete' => 'dellogpage',
'upload' => 'uploadlogpage',
@@ -142,6 +144,7 @@
'' => 'alllogstext',
'block' => 'blocklogtext',
'protect' => 'protectlogtext',
+ 'restrict'=> 'restrictlogtext',
'rights' => 'rightslogtext',
'delete' => 'dellogpagetext',
'upload' => 'uploadlogpagetext',
@@ -161,6 +164,8 @@
'block/unblock' => 'unblocklogentry',
'protect/protect' => 'protectedarticle',
'protect/unprotect' => 'unprotectedarticle',
+ 'restrict/restrict' => 'restrictedarticle',
+ 'restrict/unrestrict'=> 'unrestrictedarticle',
'rights/rights' => 'bureaucratlogentry',
'rights/addgroup' => 'addgrouplogentry',
'rights/rngroup' => 'renamegrouplogentry',
@@ -209,7 +214,7 @@
/**
* Add a log entry
- * @param string $action one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'
+ * @param string $action one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir', 'restrict'
* @param object &$target A title object.
* @param string $comment Description associated
* @param array $params Parameters passed later to wfMsg.* functions
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/OutputPage.php ./includes/OutputPage.php
--- ../mediawiki-1.5rc4/includes/OutputPage.php 2005-08-18 18:06:20.000000000 +0200
+++ ./includes/OutputPage.php 2005-09-05 18:31:46.000000000 +0200
@@ -147,6 +147,10 @@
return wfMsg('protect');
case 'unprotect':
return wfMsg('unprotect');
+ case 'restrict':
+ return wfMsg('restrict');
+ case 'unrestrict':
+ return wfMsg('unrestrict');
case 'delete':
return wfMsg('delete');
case 'watch':
@@ -632,6 +636,21 @@
$this->returnToMain();
}
+ function restrictGroupRequired() {
+ global $wgUser, $wgTitle;
+
+ $this->setPageTitle( wfMsg( 'restricttitle' ) );
+ $this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
+ $this->setRobotpolicy( 'noindex,nofollow' );
+ $this->setArticleRelated( false );
+ $this->mBodytext = '';
+
+ $sk = $wgUser->getSkin();
+ $ap = $sk->makeKnownLink( wfMsgForContent( 'administrators' ), '' );
+ $this->addHTML( wfMsg( 'restricttext', $ap ) );
+ $this->returnToMain( false );
+ }
+
function loginToUse() {
global $wgUser, $wgTitle, $wgContLang;
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/Parser.php ./includes/Parser.php
--- ../mediawiki-1.5rc4/includes/Parser.php 2005-08-30 01:45:27.000000000 +0200
+++ ./includes/Parser.php 2005-09-05 18:51:19.000000000 +0200
@@ -2236,7 +2236,15 @@
}
} else {
$article = new Article( $title );
- $articleContent = $article->getContentWithoutUsingSoManyDamnGlobals();
+
+ /**
+ * remplace with an empty string if the template is a restricted page
+ * (restriction-patch)
+ */
+ if (!$title->userCanRead())
+ $articleContent = "";
+ else
+ $articleContent = $article->getContentWithoutUsingSoManyDamnGlobals();
if ( $articleContent !== false ) {
$found = true;
$text = $articleContent;
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/QueryPage.php ./includes/QueryPage.php
--- ../mediawiki-1.5rc4/includes/QueryPage.php 2005-08-15 05:03:19.000000000 +0200
+++ ./includes/QueryPage.php 2005-09-06 22:53:36.000000000 +0200
@@ -325,11 +325,16 @@
* feedItemDesc()
*/
function feedResult( $row ) {
+ global $wgEnableRestrict, $wgUser;
+
if( !isset( $row->title ) ) {
return NULL;
}
$title = Title::MakeTitle( IntVal( $row->namespace ), $row->title );
if( $title ) {
+ if ( $wgEnableRestrict == true && $title->isRestricted() && ! $wgUser->isAllowed('viewrestrict'))
+ return NULL;
+
if( isset( $row->timestamp ) ) {
$date = $row->timestamp;
} else {
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SearchMySQL.php ./includes/SearchMySQL.php
--- ../mediawiki-1.5rc4/includes/SearchMySQL.php 2005-08-10 23:13:49.000000000 +0200
+++ ./includes/SearchMySQL.php 2005-09-06 22:53:47.000000000 +0200
@@ -100,6 +100,22 @@
}
/**
+ * Return a partial WHERE clause to limit the search to
+ * the unrestricted pages if user not in 'restrict' group
+ * (restrict-patch by Jerome Combaz)
+ * @return string
+ * @access private
+ */
+ function queryRestricted() {
+ global $wgUser, $wgEnableRestrict;
+
+ if ( $wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') )
+ return 'AND page_restrictions NOT LIKE "%view=1%"';
+ else
+ return '';
+ }
+
+ /**
* Construct the full SQL query to do the search.
* The guts shoulds be constructed in queryMain()
* @param string $filteredTerm
@@ -110,6 +126,7 @@
return $this->queryMain( $filteredTerm, $fulltext ) . ' ' .
$this->queryRedirect() . ' ' .
$this->queryNamespaces() . ' ' .
+ $this->queryRestricted() . ' ' .
$this->queryRanking( $filteredTerm, $fulltext ) . ' ' .
$this->queryLimit();
}
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/Skin.php ./includes/Skin.php
--- ../mediawiki-1.5rc4/includes/Skin.php 2005-08-25 02:45:45.000000000 +0200
+++ ./includes/Skin.php 2005-09-06 22:54:11.000000000 +0200
@@ -740,7 +740,7 @@
}
function bottomLinks() {
- global $wgOut, $wgUser, $wgTitle, $wgUseTrackbacks;
+ global $wgOut, $wgUser, $wgTitle, $wgUseTrackbacks, $wgEnableRestrict;
$sep = " |\n";
$s = '';
@@ -775,6 +775,8 @@
$s .= "\n
";
if($wgUser->isAllowed('delete')) { $s .= $this->deleteThisPage(); }
if($wgUser->isAllowed('protect')) { $s .= $sep . $this->protectThisPage(); }
+ if( $wgEnableRestrict == true
+ && $wgUser->isAllowed('viewrestrict')) { $s .= $sep . $this->restrictThisPage(); }
if($wgUser->isAllowed('move')) { $s .= $sep . $this->moveThisPage(); }
}
$s .= "
\n" . $this->otherLanguages();
@@ -1043,6 +1045,31 @@
return $s;
}
+ /**
+ * (restrict-patch by Jerome Combaz)
+ * @access private
+ */
+ function restrictThisPage() {
+ global $wgUser, $wgOut, $wgTitle, $wgRequest;
+
+ $diff = $wgRequest->getVal( 'diff' );
+ if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isAllowed('restrict') ) {
+ $n = $wgTitle->getPrefixedText();
+
+ if ( $wgTitle->isRestricted() ) {
+ $t = wfMsg( 'unrestrictthispage' );
+ $q = 'action=unrestrict';
+ } else {
+ $t = wfMsg( 'restrictthispage' );
+ $q = 'action=restrict';
+ }
+ $s = $this->makeKnownLink( $n, $t, $q );
+ } else {
+ $s = '';
+ }
+ return $s;
+ }
+
function watchThisPage() {
global $wgUser, $wgOut, $wgTitle;
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SkinTemplate.php ./includes/SkinTemplate.php
--- ../mediawiki-1.5rc4/includes/SkinTemplate.php 2005-08-28 23:59:17.000000000 +0200
+++ ./includes/SkinTemplate.php 2005-09-06 22:52:15.000000000 +0200
@@ -534,7 +534,7 @@
* @access private
*/
function buildContentActionUrls () {
- global $wgContLang, $wgUseValidation, $wgDBprefix, $wgValidationForAnons;
+ global $wgContLang, $wgUseValidation, $wgDBprefix, $wgValidationForAnons, $wgEnableRestrict;
$fname = 'SkinTemplate::buildContentActionUrls';
wfProfileIn( $fname );
@@ -614,6 +614,34 @@
);
}
}
+ if($wgEnableRestrict == true){
+ if($wgUser->isAllowed('restrict')){
+ if(!$this->mTitle->isRestricted()){
+ $content_actions['restrict'] = array(
+ 'class' => ($action == 'restrict') ? 'selected' : false,
+ 'text' => wfMsg('restrict'),
+ 'href' => $this->mTitle->getLocalUrl( 'action=restrict' )
+ );
+
+ } else {
+ $content_actions['unrestrict'] = array(
+ 'class' => ($action == 'unrestrict') ? 'selected' : false,
+ 'text' => wfMsg('unrestrict'),
+ 'href' => $this->mTitle->getLocalUrl( 'action=unrestrict' )
+ );
+ }
+ } else {
+ if($wgUser->isAllowed('viewrestrict')){
+ if($this->mTitle->isRestricted()){
+ $content_actions['unrestrict'] = array(
+ 'class' => ($action == 'unrestrict') ? 'selected' : false,
+ 'text' => wfMsg('restrictedpage'),
+ 'href' => $this->mTitle->getLocalUrl( 'action=unrestrict' )
+ );
+ }
+ }
+ }
+ }
if($wgUser->isAllowed('delete')){
$content_actions['delete'] = array(
'class' => ($action == 'delete') ? 'selected' : false,
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialAllpages.php ./includes/SpecialAllpages.php
--- ../mediawiki-1.5rc4/includes/SpecialAllpages.php 2005-08-02 13:08:19.000000000 +0200
+++ ./includes/SpecialAllpages.php 2005-09-06 22:43:28.000000000 +0200
@@ -75,7 +75,7 @@
* @param integer $namespace (default NS_MAIN)
*/
function indexShowToplevel ( $namespace = NS_MAIN, $including = false ) {
- global $wgOut, $indexMaxperpage, $toplevelMaxperpage, $wgContLang, $wgRequest, $wgUser;
+ global $wgOut, $indexMaxperpage, $toplevelMaxperpage, $wgContLang, $wgRequest, $wgUser, $wgEnableRestrict;
$sk = $wgUser->getSkin();
$fname = "indexShowToplevel";
@@ -85,6 +85,11 @@
$dbr =& wfGetDB( DB_SLAVE );
$page = $dbr->tableName( 'page' );
$fromwhere = "FROM $page WHERE page_namespace=$namespace";
+
+ if ( $wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) {
+ $fromwhere .= " AND page_restrictions NOT LIKE '%view=1%'";
+ }
+
$order_arr = array ( 'ORDER BY' => 'page_title' );
$order_str = 'ORDER BY page_title';
$out = "";
@@ -201,7 +206,7 @@
* @param string $from list all pages from this name (default FALSE)
*/
function indexShowChunk( $namespace = NS_MAIN, $from, $including = false ) {
- global $wgOut, $wgUser, $indexMaxperpage, $wgContLang;
+ global $wgOut, $wgUser, $indexMaxperpage, $wgContLang, $wgEnableRestrict;
$fname = 'indexShowChunk';
@@ -215,7 +220,8 @@
array( 'page_namespace', 'page_title', 'page_is_redirect' ),
array(
'page_namespace' => $namespace,
- 'page_title >= ' . $dbr->addQuotes( $fromKey )
+ 'page_title >= ' . $dbr->addQuotes( $fromKey ),
+ ( $wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? 'page_restrictions NOT LIKE "%view=1%"' : '1',
),
$fname,
array(
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialAncientpages.php ./includes/SpecialAncientpages.php
--- ../mediawiki-1.5rc4/includes/SpecialAncientpages.php 2005-06-28 07:47:36.000000000 +0200
+++ ./includes/SpecialAncientpages.php 2005-09-06 22:55:08.000000000 +0200
@@ -28,6 +28,8 @@
function isSyndicated() { return false; }
function getSQL() {
+ global $wgEnableRestrict, $wgUser;
+
$db =& wfGetDB( DB_SLAVE );
$page = $db->tableName( 'page' );
$revision = $db->tableName( 'revision' );
@@ -39,7 +41,8 @@
UNIX_TIMESTAMP(rev_timestamp) as value
FROM $page, $revision
WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0
- AND page_latest=rev_id";
+ AND page_latest=rev_id" .
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%'" : "");
}
function sortDescending() {
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialBrokenRedirects.php ./includes/SpecialBrokenRedirects.php
--- ../mediawiki-1.5rc4/includes/SpecialBrokenRedirects.php 2005-06-30 21:06:32.000000000 +0200
+++ ./includes/SpecialBrokenRedirects.php 2005-09-07 08:29:35.000000000 +0200
@@ -30,6 +30,8 @@
}
function getSQL() {
+ global $wgEnableRestrict, $wgUser;
+
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'page', 'pagelinks' ) );
@@ -43,7 +45,8 @@
ON pl_namespace=p2.page_namespace AND pl_title=p2.page_title
WHERE p1.page_is_redirect=1
AND pl_from=p1.page_id
- AND p2.page_namespace IS NULL";
+ AND p2.page_namespace IS NULL".
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%'" : "");
return $sql;
}
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialContributions.php ./includes/SpecialContributions.php
--- ../mediawiki-1.5rc4/includes/SpecialContributions.php 2005-08-26 16:13:43.000000000 +0200
+++ ./includes/SpecialContributions.php 2005-09-07 08:36:42.000000000 +0200
@@ -113,6 +113,8 @@
}
/* private */ function make_sql() {
+ global $wgUser, $wgEnableRestrict;
+
$userCond = $condition = $index = $offsetQuery = $limitQuery = "";
extract($this->dbr->tableNames('page', 'revision'));
@@ -129,7 +131,8 @@
rev_id,rev_timestamp,rev_comment,rev_minor_edit,rev_user_text,
rev_deleted
FROM $page,$revision $use_index
- WHERE page_id=rev_page AND $userCond $nscond $offsetQuery
+ WHERE page_id=rev_page AND $userCond $nscond $offsetQuery".
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%' " : " ")."
ORDER BY rev_timestamp DESC $limitQuery";
return $sql;
}
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialDeadendpages.php ./includes/SpecialDeadendpages.php
--- ../mediawiki-1.5rc4/includes/SpecialDeadendpages.php 2005-05-26 12:23:35.000000000 +0200
+++ ./includes/SpecialDeadendpages.php 2005-09-06 22:55:23.000000000 +0200
@@ -43,13 +43,16 @@
* @return string an sqlquery
*/
function getSQL() {
+ global $wgEnableRestrict, $wgUser;
+
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'page', 'pagelinks' ) );
return "SELECT 'Deadendpages' as type, page_namespace AS namespace, page_title as title, page_title AS value " .
"FROM $page LEFT JOIN $pagelinks ON page_id = pl_from " .
"WHERE pl_from IS NULL " .
"AND page_namespace = 0 " .
- "AND page_is_redirect = 0";
+ "AND page_is_redirect = 0" .
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%'" : "");
}
}
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialDisambiguations.php ./includes/SpecialDisambiguations.php
--- ../mediawiki-1.5rc4/includes/SpecialDisambiguations.php 2005-07-11 22:47:34.000000000 +0200
+++ ./includes/SpecialDisambiguations.php 2005-09-07 08:45:19.000000000 +0200
@@ -33,6 +33,8 @@
}
function getSQL() {
+ global $wgEnableRestrict, $wgUser;
+
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'page', 'pagelinks' ) );
@@ -47,7 +49,8 @@
." WHERE lb.pl_namespace = $dns AND lb.pl_title = $dtitle" # disambiguation template
." AND pa.page_id = lb.pl_from"
." AND pa.page_namespace = la.pl_namespace"
- ." AND pa.page_title = la.pl_title";
+ ." AND pa.page_title = la.pl_title"
+ .(($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%'" : "");
return $sql;
}
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialDoubleRedirects.php ./includes/SpecialDoubleRedirects.php
--- ../mediawiki-1.5rc4/includes/SpecialDoubleRedirects.php 2005-05-26 12:23:35.000000000 +0200
+++ ./includes/SpecialDoubleRedirects.php 2005-09-07 08:47:04.000000000 +0200
@@ -30,6 +30,8 @@
}
function getSQL() {
+ global $wgEnableRestrict, $wgUser;
+
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'page', 'pagelinks' ) );
@@ -44,7 +46,8 @@
" AND la.pl_title=pb.page_title" .
" AND lb.pl_from=pb.page_id" .
" AND lb.pl_namespace=pc.page_namespace" .
- " AND lb.pl_title=pc.page_title";
+ " AND lb.pl_title=pc.page_title" .
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%'" : "");
return $sql;
}
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialExport.php ./includes/SpecialExport.php
--- ../mediawiki-1.5rc4/includes/SpecialExport.php 2005-07-13 03:59:12.000000000 +0200
+++ ./includes/SpecialExport.php 2005-09-06 22:55:36.000000000 +0200
@@ -252,6 +252,8 @@
// -------------------- private implementation below --------------------
function dumpFrom( $cond = '' ) {
+ global $wgEnableRestrict, $wgUser;
+
$fname = 'WikiExporter::dumpFrom';
wfProfileIn( $fname );
@@ -285,7 +287,8 @@
$page $pageindex,
$revision $revindex,
$text
- WHERE $where $join AND rev_text_id=old_id
+ WHERE $where $join AND rev_text_id=old_id".
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%'" : "")."
ORDER BY page_id", $fname );
$wrapper = $this->db->resultObject( $result );
$this->outputStream( $wrapper );
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialLonelypages.php ./includes/SpecialLonelypages.php
--- ../mediawiki-1.5rc4/includes/SpecialLonelypages.php 2005-05-26 12:23:35.000000000 +0200
+++ ./includes/SpecialLonelypages.php 2005-09-06 22:55:48.000000000 +0200
@@ -31,6 +31,8 @@
function isSyndicated() { return false; }
function getSQL() {
+ global $wgEnableRestrict, $wgUser;
+
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'page', 'pagelinks' ) );
@@ -44,7 +46,8 @@
ON page_namespace=pl_namespace AND page_title=pl_title
WHERE pl_namespace IS NULL
AND page_namespace=".NS_MAIN."
- AND page_is_redirect=0";
+ AND page_is_redirect=0" .
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%'" : "");
}
}
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialMostlinked.php ./includes/SpecialMostlinked.php
--- ../mediawiki-1.5rc4/includes/SpecialMostlinked.php 2005-08-15 05:03:19.000000000 +0200
+++ ./includes/SpecialMostlinked.php 2005-09-07 08:51:11.000000000 +0200
@@ -24,6 +24,8 @@
function isSyndicated() { return false; }
function getSQL() {
+ global $wgEnableRestrict, $wgUser;
+
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'pagelinks', 'page' ) );
return
@@ -33,7 +35,8 @@
COUNT(*) AS value,
page_namespace
FROM $pagelinks
- LEFT JOIN $page ON pl_namespace=page_namespace AND pl_title=page_title
+ LEFT JOIN $page ON pl_namespace=page_namespace AND pl_title=page_title".
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " WHERE page_restrictions NOT LIKE '%view=1%'" : "")."
GROUP BY pl_namespace,pl_title
HAVING COUNT(*) > 1";
}
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialMovepage.php ./includes/SpecialMovepage.php
--- ../mediawiki-1.5rc4/includes/SpecialMovepage.php 2005-08-26 23:42:34.000000000 +0200
+++ ./includes/SpecialMovepage.php 2005-09-07 10:39:44.000000000 +0200
@@ -59,7 +59,7 @@
}
function showForm( $err ) {
- global $wgOut, $wgUser, $wgLang;
+ global $wgOut, $wgUser, $wgLang, $wgEnableRestrict;
$wgOut->setPagetitle( wfMsg( 'movepage' ) );
@@ -68,6 +68,10 @@
$wgOut->errorpage( 'notargettitle', 'notargettext' );
return;
}
+ if( $wgEnableRestrict == true and $ot->isRestricted() and ! $wgUser->isAllowed('restrict') ) {
+ $wgOut->errorpage( 'restricttitle', 'notallowedtomoverestrictedpagetext' );
+ return;
+ }
$oldTitle = $ot->getPrefixedText();
$encOldTitle = htmlspecialchars( $oldTitle );
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialNewpages.php ./includes/SpecialNewpages.php
--- ../mediawiki-1.5rc4/includes/SpecialNewpages.php 2005-07-06 16:09:40.000000000 +0200
+++ ./includes/SpecialNewpages.php 2005-09-07 10:26:31.000000000 +0200
@@ -28,7 +28,7 @@
}
function getSQL() {
- global $wgUser, $wgOnlySysopsCanPatrol, $wgUseRCPatrol;
+ global $wgUser, $wgOnlySysopsCanPatrol, $wgUseRCPatrol, $wgEnableRestrict;
$usepatrol = ( $wgUseRCPatrol && $wgUser->isLoggedIn() &&
( $wgUser->isAllowed('patrol') || !$wgOnlySysopsCanPatrol ) ) ? 1 : 0;
$dbr =& wfGetDB( DB_SLAVE );
@@ -51,7 +51,8 @@
page_latest as rev_id
FROM $recentchanges,$page
WHERE rc_cur_id=page_id AND rc_new=1
- AND rc_namespace=".NS_MAIN." AND page_is_redirect=0";
+ AND rc_namespace=".NS_MAIN." AND page_is_redirect=0".
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%'" : "");
}
function formatResult( $skin, $result ) {
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialPage.php ./includes/SpecialPage.php
--- ../mediawiki-1.5rc4/includes/SpecialPage.php 2005-08-15 05:04:06.000000000 +0200
+++ ./includes/SpecialPage.php 2005-09-07 10:51:14.000000000 +0200
@@ -86,6 +86,10 @@
$wgSpecialPages['Confirmemail'] = new UnlistedSpecialPage( 'Confirmemail' );
}
+if( $wgEnableRestrict ) {
+ $wgSpecialPages['Restrictedpages'] = new SpecialPage( 'Restrictedpages', 'viewrestrict' );
+}
+
/**
* Parent special page class, also static functions for handling the special
* page list
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialPopularpages.php ./includes/SpecialPopularpages.php
--- ../mediawiki-1.5rc4/includes/SpecialPopularpages.php 2005-06-05 09:55:54.000000000 +0200
+++ ./includes/SpecialPopularpages.php 2005-09-06 22:56:02.000000000 +0200
@@ -28,6 +28,8 @@
function isSyndicated() { return false; }
function getSQL() {
+ global $wgEnableRestrict, $wgUser;
+
$dbr =& wfGetDB( DB_SLAVE );
$page = $dbr->tableName( 'page' );
@@ -37,7 +39,8 @@
page_title as title,
page_counter as value
FROM $page
- WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0";
+ WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0" .
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%'" : "");
}
function formatResult( $skin, $result ) {
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialRandompage.php ./includes/SpecialRandompage.php
--- ../mediawiki-1.5rc4/includes/SpecialRandompage.php 2005-08-02 02:01:45.000000000 +0200
+++ ./includes/SpecialRandompage.php 2005-09-06 22:56:10.000000000 +0200
@@ -11,7 +11,7 @@
* used as e.g. Special:Randompage/Category
*/
function wfSpecialRandompage( $par = NS_MAIN ) {
- global $wgOut, $wgTitle, $wgArticle, $wgExtraRandompageSQL, $wgContLang;
+ global $wgOut, $wgTitle, $wgArticle, $wgExtraRandompageSQL, $wgContLang, $wgEnableRestrict, $wgUser;
$fname = 'wfSpecialRandompage';
# Determine the namespace to get a random page from.
@@ -40,7 +40,8 @@
$sql = "SELECT page_id,page_title
FROM $page $use_index
WHERE page_namespace=$namespace AND page_is_redirect=0 $extra
- AND page_random>$randstr
+ AND page_random>$randstr" .
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%'" : "") . "
ORDER BY page_random
LIMIT 1";
$res = $db->query( $sql, $fname );
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialRecentchangeslinked.php ./includes/SpecialRecentchangeslinked.php
--- ../mediawiki-1.5rc4/includes/SpecialRecentchangeslinked.php 2005-08-25 06:32:20.000000000 +0200
+++ ./includes/SpecialRecentchangeslinked.php 2005-09-07 10:29:17.000000000 +0200
@@ -15,7 +15,7 @@
* @param string $par parent page we will look at
*/
function wfSpecialRecentchangeslinked( $par = NULL ) {
- global $wgUser, $wgOut, $wgLang, $wgContLang, $wgTitle, $wgRequest;
+ global $wgUser, $wgOut, $wgLang, $wgContLang, $wgTitle, $wgRequest, $wgEnableRestrict;
$fname = 'wfSpecialRecentchangeslinked';
$days = $wgRequest->getInt( 'days' );
@@ -93,7 +93,8 @@
AND rev_page=page_id
AND pl_namespace=page_namespace
AND pl_title=page_title
- AND pl_from=$id
+ AND pl_from=$id".
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%'" : "")."
GROUP BY page_id,page_namespace,page_title,
rev_user,rev_comment,rev_user_text,rev_timestamp,rev_minor_edit,
page_is_new
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialRestrictedpages.php ./includes/SpecialRestrictedpages.php
--- ../mediawiki-1.5rc4/includes/SpecialRestrictedpages.php 1970-01-01 01:00:00.000000000 +0100
+++ ./includes/SpecialRestrictedpages.php 2005-09-07 10:51:48.000000000 +0200
@@ -0,0 +1,65 @@
+tableName( 'page' );
+ return
+ "SELECT 'Restrictedpages' as type,
+ page_namespace as namespace,
+ page_title as title,
+ page_title as value
+ FROM $page
+ WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0 AND page_restrictions LIKE '%view=1%'";
+ }
+
+ function sortDescending() {
+ return false;
+ }
+
+ function formatResult( $skin, $result ) {
+ global $wgLang, $wgContLang;
+
+ $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true );
+ $link = $skin->makeKnownLink( $result->title, $wgContLang->convert( $result->title) );
+ return "{$link} ({$d})";
+ }
+}
+
+function wfSpecialRestrictedpages() {
+ list( $limit, $offset ) = wfCheckLimits();
+
+ $app = new RestrictedPagesPage();
+
+ $app->doQuery( $offset, $limit );
+}
+
+?>
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialShortpages.php ./includes/SpecialShortpages.php
--- ../mediawiki-1.5rc4/includes/SpecialShortpages.php 2005-03-12 12:51:01.000000000 +0100
+++ ./includes/SpecialShortpages.php 2005-09-06 22:56:50.000000000 +0200
@@ -34,6 +34,8 @@
}
function getSQL() {
+ global $wgEnableRestrict, $wgUser;
+
$dbr =& wfGetDB( DB_SLAVE );
$page = $dbr->tableName( 'page' );
$name = $dbr->addQuotes( $this->getName() );
@@ -44,7 +46,8 @@
page_title as title,
page_len AS value
FROM $page
- WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0";
+ WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0" .
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%'" : "");
}
function sortDescending() {
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialUncategorizedpages.php ./includes/SpecialUncategorizedpages.php
--- ../mediawiki-1.5rc4/includes/SpecialUncategorizedpages.php 2005-07-20 01:43:35.000000000 +0200
+++ ./includes/SpecialUncategorizedpages.php 2005-09-06 22:56:59.000000000 +0200
@@ -32,13 +32,16 @@
function isSyndicated() { return false; }
function getSQL() {
+ global $wgEnableRestrict, $wgUser;
+
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'page', 'categorylinks' ) );
$name = $dbr->addQuotes( $this->getName() );
return "SELECT $name as type, page_namespace AS namespace, page_title AS title, page_title AS value " .
"FROM $page LEFT JOIN $categorylinks ON page_id=cl_from ".
- "WHERE cl_from IS NULL AND page_namespace=$this->requestedNamespace AND page_is_redirect=0";
+ "WHERE cl_from IS NULL AND page_namespace=$this->requestedNamespace AND page_is_redirect=0".
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%'" : "");
}
}
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/SpecialWhatlinkshere.php ./includes/SpecialWhatlinkshere.php
--- ../mediawiki-1.5rc4/includes/SpecialWhatlinkshere.php 2005-06-29 02:59:38.000000000 +0200
+++ ./includes/SpecialWhatlinkshere.php 2005-09-07 10:45:12.000000000 +0200
@@ -10,7 +10,7 @@
* @param string $par An article name ??
*/
function wfSpecialWhatlinkshere($par = NULL) {
- global $wgUser, $wgOut, $wgRequest;
+ global $wgUser, $wgOut, $wgRequest, $wgEnableRestrict;
$fname = 'wfSpecialWhatlinkshere';
$target = isset($par) ? $par : $wgRequest->getVal( 'target' );
@@ -26,6 +26,10 @@
$wgOut->errorpage( 'notargettitle', 'notargettext' );
return;
}
+ if( $wgEnableRestrict == true and $nt->isRestricted() and ! $wgUser->isAllowed('viewrestrict') ) {
+ $wgOut->errorpage( 'restricttitle', 'restricttext' );
+ return;
+ }
$wgOut->setPagetitle( $nt->getPrefixedText() );
$wgOut->setSubtitle( wfMsg( 'linklistsub' ) );
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/includes/Title.php ./includes/Title.php
--- ../mediawiki-1.5rc4/includes/Title.php 2005-08-26 23:42:34.000000000 +0200
+++ ./includes/Title.php 2005-09-07 11:40:47.000000000 +0200
@@ -877,6 +877,23 @@
}
/**
+ * Does the title correspond to a restricted article?
+ * (restrict-patch by Jerome Combaz)
+ * @return boolean
+ * @access public
+ */
+ function isRestricted() {
+ global $wgEnableRestrict;
+
+ if ( $wgEnableRestrict == true ) {
+ $a = $this->getRestrictions("view");
+ if ( !empty($a) && $a[0] == true ) return true;
+ }
+
+ return false;
+ }
+
+ /**
* Is $wgUser is watching this page?
* @return boolean
* @access public
@@ -996,7 +1013,24 @@
* @access public
*/
function userCanRead() {
- global $wgUser;
+ global $wgUser, $wgUserPageRestrict;
+
+ if ( $wgUserPageRestrict == true ) {
+ // restricted page ?
+ if ( $this->isRestricted() ) {
+ if ( ! $wgUser->isAllowed('viewrestrict') ) {
+ return false;
+ };
+ }
+
+ // restricted user pages ?
+ if ( $this->getNamespace() == NS_USER
+ && $wgUser->getName() != $this->getText() ) {
+ if ( ! $wgUser->isAllowed('viewrestrict') ) {
+ return false;
+ }
+ };
+ }
if( $wgUser->isAllowed('read') ) {
return true;
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/index.php ./index.php
--- ../mediawiki-1.5rc4/index.php 2005-07-23 08:30:22.000000000 +0200
+++ ./index.php 2005-09-05 18:37:27.000000000 +0200
@@ -96,7 +96,11 @@
# the Read array in order for the user to see it. (We have to check here to
# catch special pages etc. We check again in Article::view())
if ( !is_null( $wgTitle ) && !$wgTitle->userCanRead() ) {
- $wgOut->loginToUse();
+ if ( $wgTitle->isRestricted() ) {
+ $wgOut->restrictGroupRequired();
+ } else {
+ $wgOut->loginToUse();
+ }
$wgOut->output();
exit;
}
@@ -168,6 +172,8 @@
case 'rollback':
case 'protect':
case 'unprotect':
+ case 'restrict':
+ case 'unrestrict':
case 'info':
case 'markpatrolled':
case 'validate':
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/languages/LanguageDe.php ./languages/LanguageDe.php
--- ../mediawiki-1.5rc4/languages/LanguageDe.php 2005-08-18 18:01:12.000000000 +0200
+++ ./languages/LanguageDe.php 2005-09-07 12:07:00.000000000 +0200
@@ -1182,7 +1182,32 @@
Wenn Sie *nicht* $2 sind, folgen Sie dem Link bitte nicht.
Der Bestätigungskode läuft am $4 ab.
-"
+",
+
+#Restrict patch (http://meta.wikimedia.org/wiki/Page_access_restriction_with_MediaWiki)
+'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\' sein.',
+'restrictedpages' => 'Gesperrte Seiten',
+'restrictlogpage' => 'Log der Sperrungen',
+'restrictlogtext' => 'Unten folgt eine Liste mit gesperrten Seiten. Vgl. [[Project:Restricted page]] für mehr Information.',
+'restrictedarticle' => 'Gesperrter [[$1]]',
+'unrestrictedarticle' => 'Ungesperrter [[$1]]',
+'restrictsub' => '(Gesperrter \'[[$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' => 'To move this page, you have to be member of the \'restrict\' group.',
+'restrictedpages' => 'Restricted pages',
);
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/languages/LanguageFr.php ./languages/LanguageFr.php
--- ../mediawiki-1.5rc4/languages/LanguageFr.php 2005-08-25 15:24:30.000000000 +0200
+++ ./languages/LanguageFr.php 2005-09-07 11:56:47.000000000 +0200
@@ -843,7 +843,7 @@
'unprotectedarticle' => 'a déprotégé [[$1]]',
'protectsub' => '(Protéger « $1 »)',
-'confirmprotect' => 'Confimer la protection',
+'confirmprotect' => 'Confirmer la protection',
'confirmprotecttext' => 'Voulez-vous réellement protéger cette page ?',
'protectcomment' => 'Raison du bloquage',
@@ -1171,7 +1171,29 @@
'exif-orientation-8' => 'Tournée de 90° à gauche',
'exif-componentsconfiguration-0' => 'n\'existe pas',
-
+#Restrict patch (http://meta.wikimedia.org/wiki/Page_access_restriction_with_MediaWiki)
+'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\'',
+'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\'',
+'restrictedpages' => 'Pages restreintes',
// exifgps:
);
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/languages/Language.php ./languages/Language.php
--- ../mediawiki-1.5rc4/languages/Language.php 2005-08-18 19:17:49.000000000 +0200
+++ ./languages/Language.php 2005-09-07 12:08:07.000000000 +0200
@@ -2126,6 +2126,30 @@
'unit-pixel' => 'px',
+#Restrict patch (http://meta.wikimedia.org/wiki/Page_access_restriction_with_MediaWiki)
+'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 \'viewrestrict\' group.',
+'restrictlogpage' => 'Restriction_log',
+'restrictlogtext' => 'Below is a list of page restrictions. See [[Project: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.',
+'restrictedpages' => 'Restricted pages',
+
);
/* a fake language converter */
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/README.restriction-patch ./README.restriction-patch
--- ../mediawiki-1.5rc4/README.restriction-patch 1970-01-01 01:00:00.000000000 +0100
+++ ./README.restriction-patch 2005-09-11 21:52:50.402576504 +0200
@@ -0,0 +1,48 @@
+
+Article restriction patch for MediaWiki 1.5rc4
+---------------------------------------------
+
+Here is a patch to enable article restriction under MediaWiki. Pages can be articles or categories. It adds a new |restrict| tab link allowing members of the group ''restrict'' to restrict pages. Users member of the group ''viewrestrict'' can read (and modify) the restricted pages. Others users cannot see, search, export, etc, the restricted pages. You can still |protect| them for editing. A restricted page is distinguished by a red background tab, and you have a special page (Special:Restrictedpages) to list the restricted pages. All restriction/unrestriction actions are loggued in the wiki log. Optionaly the user's pages can be restricted to their owner. Currently it is localized in english, german and french.
+
+This feature is mainly useful for intranet relying on WikiMedia as a non-encyclopedic content management system, like e-learning platforms or informational systems. To respect the wiki philosophy, it is not appropriate to use it to restrict public access!
+
+To install restriction-patch, download MediaWiki (do a security backup if you patch your own installation).
+
+- Apply patch :
+
+ mv restriction-beta-0.56.mediawiki-1.5rc4.patch ./mediawiki-1.5rc4
+ cd ./mediawiki-1.5rc4
+ patch -p0 < restriction-beta-0.56.mediawiki-1.5rc4.patch
+
+- Configure :
+
+Restriction is disabled by default. Add in your ''./LocalSettings.php'' file (below require_once( "includes/DefaultSettings.php" );) :
+
+ // Enable the restriction feature.
+ // If set to false, all protected pages are accessible.
+ $wgEnableRestrict = true;
+
+ // Restrict user pages to their owner (as well as restrict members)
+ $wgUserPageRestrict = true;
+
+Go to the ''User rights management'' page (in special pages) and add users in group ''restrict'' (allow to view and restrict pages) or ''viewrestrict'' (allow only to view restricted pages). If $wgUserPageRestrict is true, user pages are restricted to their respective owner, as well as members of the ''viewrestrict'' group.
+
+Don't write sensible information in page titles, they could be retrieved in some cases. This is beta and GPL, test and feedback welcome !
+
+
+Jerome Combaz (restrict-mediawiki/at/conseil-recherche-innovation.net)
+
+
+ Download patch, updates, screenshots and comments here :
+ http://conseil-recherche-innovation.net/index.php/1974/04/10/31-restrict-pages-under-mediawiki
+
+
+ChangeLog
+---------
+
+Version beta-0.56 (09-11-2005)
+- Bug "variables can be passed by reference in [mediawiki]\includes\Article.php on line 1703" (thanks to Chunho Lee)
+
+Version beta-0.55 (09-07-2005)
+- First public release for MediaWiki 1.5
+
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -Naur ../mediawiki-1.5rc4/skins/monobook/main.css ./skins/monobook/main.css
--- ../mediawiki-1.5rc4/skins/monobook/main.css 2005-08-03 00:37:50.000000000 +0200
+++ ./skins/monobook/main.css 2005-09-06 16:10:27.000000000 +0200
@@ -823,7 +823,6 @@
padding: 0 0 .2em 0;
}
#p-cactions li a {
- background-color: white;
color: #002bb8;
border: none;
padding: 0 .8em .3em .8em;
@@ -1157,6 +1156,8 @@
margin-right: 0.33em;
}
+li#ca-unrestrict { background-color: #ba0000; }
+li#ca-unrestrict a { color: white; }
/* Classes for article validation */