diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/Article.php ./includes/Article.php
--- ../mediawiki-1.6.3/includes/Article.php 2006-04-11 03:18:01.000000000 +0200
+++ ./includes/Article.php 2006-04-21 17:02:26.000000000 +0200
@@ -842,7 +842,12 @@
# Another whitelist check in case oldid is altering the title
if ( !$this->mTitle->userCanRead() ) {
- $wgOut->loginToUse();
+ if ( $this->mTitle->isRestricted() ) {
+ $wgOut->restrictGroupRequired();
+ } else {
+ $wgOut->loginToUse();
+ }
+
$wgOut->output();
exit;
}
@@ -1167,7 +1172,7 @@
* @access private
*/
function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC=false, $comment=false ) {
- global $wgUser;
+ global $wgUser, $wgRestrictNewPages;
$fname = 'Article::insertNewArticle';
wfProfileIn( $fname );
@@ -1198,8 +1203,8 @@
$dbw =& wfGetDB( DB_MASTER );
# Add the page record; stake our claim on this title!
- $newid = $this->insertOn( $dbw );
-
+ $newid = $this->insertOn( $dbw, ($wgRestrictNewPages && $wgUser->isAllowed('restrict') ? 'view=1' : '') );
+
# Save the revision text...
$revision = new Revision( array(
'page' => $newid,
@@ -1362,7 +1367,7 @@
* first set $wgUser, and clean up $wgDeferredUpdates after each edit.
*/
function updateArticle( $text, $summary, $minor, $watchthis, $forceBot = false, $sectionanchor = '' ) {
- global $wgUser, $wgDBtransactions, $wgUseSquid;
+ global $wgUser, $wgDBtransactions, $wgUseSquid, $wgEnableRestrict, $wgNoRecentChangesRestrict;
global $wgPostCommitUpdateList, $wgUseFileCache;
$fname = 'Article::updateArticle';
@@ -1430,10 +1435,10 @@
# Update recentchanges and purge cache and whatnot
require_once( 'RecentChange.php' );
$bot = (int)($wgUser->isBot() || $forceBot);
- $rcid = RecentChange::notifyEdit( $now, $this->mTitle, $isminor, $wgUser, $summary,
+ if (!$wgEnableRestrict || !$wgNoRecentChangesRestrict || !$this->mTitle->isRestricted())
+ $rcid = RecentChange::notifyEdit( $now, $this->mTitle, $isminor, $wgUser, $summary,
$lastRevision, $this->getTimestamp(), $bot, '', $oldsize, $newsize,
$revisionId );
-
# Mark as patrolled if the user can do so and has it set in their options
if( $wgUser->isAllowed( 'patrol' ) && $wgUser->getOption( 'autopatrol' ) ) {
RecentChange::markPatrolled( $rcid );
@@ -1677,8 +1682,144 @@
function unprotect() {
$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('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( '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( '' );
+ }
+
+ /**
* Update the article's restriction field, and leave a log entry.
*
* @param array $limit set of restriction keys
@@ -1703,7 +1844,9 @@
$flat = Article::flattenRestrictions( $limit );
$protecting = ($flat != '');
-
+ if(current($this->mTitle->getRestrictions('view'))) {
+ $restrictions .= ":view=1";
+ }
if( wfRunHooks( 'ArticleProtect', array( &$this, &$wgUser,
$limit, $reason ) ) ) {
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/DefaultSettings.php ./includes/DefaultSettings.php
--- ../mediawiki-1.6.3/includes/DefaultSettings.php 2006-04-11 03:18:03.000000000 +0200
+++ ./includes/DefaultSettings.php 2006-04-21 17:02:26.000000000 +0200
@@ -1920,5 +1920,49 @@
*/
$wgAjaxExportList = array( 'wfSajaxSearch' );
+/**
+ *
+ * Restriction patch (by Jerome Combaz)
+ * see http://meta.wikimedia.org/wiki/Page_access_restriction_with_MediaWiki
+ *
+ */
+
+/**
+ * If true, a new menu action allows to restrict pages access to 'restrict' group users
+ */
+$wgEnableRestrict = false;
+
+/**
+ * If true, new pages are restricted by default for 'restrict' group users
+ */
+$wgRestrictNewPages = false;
+
+/**
+ * Restrict user pages to their owner (as well as viewrestrict/restrict members)
+ */
+$wgUserPageRestrict = false;
+
+/**
+ * Regular expression array to restrict matching pages
+ * eg. $wgRegexRestrict = array("^Secure:", "^Secret "); // restrict all pages where title is like 'Secure:...' or 'Secret ...'
+ */
+$wgRegexRestrict = array();
+
+/**
+ * Hide recent changes entry for restricted pages
+ */
+$wgNoRecentChangesRestrict = true;
+
+/**
+ * Hide log entries related to restriction except for 'restrict' or 'viewrestrict' users (Special:Log page)
+ */
+$wgHideRestrictLog = true;
+
+/**
+ * MediaWiki permissions setup
+ */
+$wgGroupPermissions['restrict']['restrict'] =
+$wgGroupPermissions['restrict']['viewrestrict'] = true;
+$wgGroupPermissions['viewrestrict']['viewrestrict'] = true;
?>
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/Defines.php ./includes/Defines.php
--- ../mediawiki-1.6.3/includes/Defines.php 2006-04-11 03:18:01.000000000 +0200
+++ ./includes/Defines.php 2006-04-21 17:02:26.000000000 +0200
@@ -87,6 +87,7 @@
'move',
'patrol',
'protect',
+ 'restrict',
'read',
'rollback',
'siteadmin',
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/Export.php ./includes/Export.php
--- ../mediawiki-1.6.3/includes/Export.php 2006-04-11 03:18:02.000000000 +0200
+++ ./includes/Export.php 2006-04-21 17:02:26.000000000 +0200
@@ -162,6 +162,8 @@
}
function dumpFrom( $cond = '' ) {
+ global $wgEnableRestrict, $wgUser;
+
$fname = 'WikiExporter::dumpFrom';
wfProfileIn( $fname );
@@ -206,7 +208,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";
}
$result = $this->db->query( $sql, $fname );
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/LogPage.php ./includes/LogPage.php
--- ../mediawiki-1.6.3/includes/LogPage.php 2006-04-11 03:18:03.000000000 +0200
+++ ./includes/LogPage.php 2006-04-21 17:02:26.000000000 +0200
@@ -41,7 +41,7 @@
* Constructor
*
* @param string $type One of '', 'block', 'protect', 'rights', 'delete',
- * 'upload', 'move'
+ * 'upload', 'move', 'restrict'
* @param bool $rc Whether to update recent changes as well as the logging table
*/
function LogPage( $type, $rc = true ) {
@@ -94,7 +94,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;
}
@@ -114,6 +114,7 @@
'' => 'log',
'block' => 'blocklogpage',
'protect' => 'protectlogpage',
+ 'restrict'=> 'restrictlogpage',
'rights' => 'bureaucratlog',
'delete' => 'dellogpage',
'upload' => 'uploadlogpage',
@@ -137,6 +138,7 @@
'' => 'alllogstext',
'block' => 'blocklogtext',
'protect' => 'protectlogtext',
+ 'restrict'=> 'restrictlogtext',
'rights' => 'rightslogtext',
'delete' => 'dellogpagetext',
'upload' => 'uploadlogpagetext',
@@ -157,7 +159,9 @@
'block/unblock' => 'unblocklogentry',
'protect/protect' => 'protectedarticle',
'protect/unprotect' => 'unprotectedarticle',
-
+ 'restrict/restrict' => 'restrictedarticle',
+ 'restrict/unrestrict'=> 'unrestrictedarticle',
+
// TODO: This whole section should be moved to extensions/Makesysop/SpecialMakesysop.php
'rights/rights' => 'bureaucratlogentry',
'rights/addgroup' => 'addgrouplogentry',
@@ -224,7 +228,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' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/OutputPage.php ./includes/OutputPage.php
--- ../mediawiki-1.6.3/includes/OutputPage.php 2006-04-11 03:18:02.000000000 +0200
+++ ./includes/OutputPage.php 2006-05-01 23:23:51.000000000 +0200
@@ -140,6 +140,11 @@
case 'delete':
case 'protect':
case 'unprotect':
+ return '';
+ case 'restrict':
+ return wfMsg('restrict');
+ case 'unrestrict':
+ return wfMsg('unrestrict');
case 'watch':
case 'unwatch':
// Display title is already customized
@@ -744,6 +749,21 @@
$this->addHTML( wfMsgHtml( 'developertext', $ap ) );
$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' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/Parser.php ./includes/Parser.php
--- ../mediawiki-1.6.3/includes/Parser.php 2006-04-11 03:18:02.000000000 +0200
+++ ./includes/Parser.php 2006-04-21 17:02:26.000000000 +0200
@@ -2689,6 +2689,14 @@
$this->disableCache();
}
} else {
+
+ /**
+ * remplace with an empty string if the template is a restricted page
+ * (restriction-patch)
+ */
+ if (!$title->userCanRead())
+ $articleContent = "";
+ else
$articleContent = $this->fetchTemplate( $title );
if ( $articleContent !== false ) {
$found = true;
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/QueryPage.php ./includes/QueryPage.php
--- ../mediawiki-1.6.3/includes/QueryPage.php 2006-04-11 03:18:03.000000000 +0200
+++ ./includes/QueryPage.php 2006-04-21 17:02:26.000000000 +0200
@@ -376,11 +376,15 @@
* 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;
$date = isset( $row->timestamp ) ? $row->timestamp : '';
$comments = '';
if( $title ) {
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SearchMySQL.php ./includes/SearchMySQL.php
--- ../mediawiki-1.6.3/includes/SearchMySQL.php 2006-04-11 03:18:03.000000000 +0200
+++ ./includes/SearchMySQL.php 2006-04-21 17:02:26.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' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/Skin.php ./includes/Skin.php
--- ../mediawiki-1.6.3/includes/Skin.php 2006-04-11 03:18:03.000000000 +0200
+++ ./includes/Skin.php 2006-04-21 17:02:26.000000000 +0200
@@ -834,7 +834,7 @@
}
function bottomLinks() {
- global $wgOut, $wgUser, $wgTitle, $wgUseTrackbacks;
+ global $wgOut, $wgUser, $wgTitle, $wgUseTrackbacks, $wgEnableRestrict;
$sep = " |\n";
$s = '';
@@ -869,6 +869,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();
@@ -1159,6 +1161,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 $wgOut, $wgTitle;
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SkinTemplate.php ./includes/SkinTemplate.php
--- ../mediawiki-1.6.3/includes/SkinTemplate.php 2006-04-11 03:18:03.000000000 +0200
+++ ./includes/SkinTemplate.php 2006-04-21 17:02:26.000000000 +0200
@@ -584,7 +584,7 @@
* @access private
*/
function buildContentActionUrls () {
- global $wgContLang;
+ global $wgContLang, $wgEnableRestrict;
$fname = 'SkinTemplate::buildContentActionUrls';
wfProfileIn( $fname );
@@ -665,6 +665,42 @@
);
}
}
+ 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 {
+ if ($this->mTitle->isRegexRestricted()){
+ $content_actions['unrestrict'] = array(
+ 'class' => ($action == 'unrestrict') ? 'selected' : false,
+ 'text' => wfMsg('restricttitle'),
+ 'href' => $this->mTitle->getLocalUrl( '' )
+ );
+ } 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('restricttitle'),
+ 'href' => $this->mTitle->getLocalUrl( '' )
+ );
+ }
+ }
+ }
+ }
if($wgUser->isAllowed('delete')){
$content_actions['delete'] = array(
'class' => ($action == 'delete') ? 'selected' : false,
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialAllpages.php ./includes/SpecialAllpages.php
--- ../mediawiki-1.6.3/includes/SpecialAllpages.php 2006-04-11 03:18:01.000000000 +0200
+++ ./includes/SpecialAllpages.php 2006-04-21 17:02:26.000000000 +0200
@@ -82,7 +82,7 @@
* @param integer $namespace (default NS_MAIN)
*/
function showToplevel ( $namespace = NS_MAIN, $including = false ) {
- global $wgOut, $wgUser;
+ global $wgOut, $wgUser, $wgEnableRestrict;
$sk = $wgUser->getSkin();
$fname = "indexShowToplevel";
@@ -92,6 +92,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 = "";
@@ -211,7 +216,7 @@
* @param string $from list all pages from this name (default FALSE)
*/
function showChunk( $namespace = NS_MAIN, $from, $including = false ) {
- global $wgOut, $wgUser, $wgContLang;
+ global $wgOut, $wgUser, $wgContLang, $wgEnableRestrict;
$fname = 'indexShowChunk';
@@ -234,7 +239,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' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialAncientpages.php ./includes/SpecialAncientpages.php
--- ../mediawiki-1.6.3/includes/SpecialAncientpages.php 2006-04-11 03:18:04.000000000 +0200
+++ ./includes/SpecialAncientpages.php 2006-04-21 17:02:26.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' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialBrokenRedirects.php ./includes/SpecialBrokenRedirects.php
--- ../mediawiki-1.6.3/includes/SpecialBrokenRedirects.php 2006-04-11 03:18:03.000000000 +0200
+++ ./includes/SpecialBrokenRedirects.php 2006-04-21 17:02:26.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 p2.page_restrictions NOT LIKE '%view=1%'" : "");
return $sql;
}
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialCategories.php ./includes/SpecialCategories.php
--- ../mediawiki-1.6.3/includes/SpecialCategories.php 2006-04-11 03:18:03.000000000 +0200
+++ ./includes/SpecialCategories.php 2006-05-01 21:38:16.000000000 +0200
@@ -31,6 +31,8 @@
return wfMsgWikiHtml('categoriespagetext') . "
\n";
}
function getSQL() {
+ global $wgUser, $wgEnableRestrict;
+
$NScat = NS_CATEGORY;
$dbr =& wfGetDB( DB_SLAVE );
$categorylinks = $dbr->tableName( 'categorylinks' );
@@ -40,7 +42,9 @@
1 as value,
COUNT(*) as count
FROM $categorylinks
- GROUP BY cl_to";
+ ".
+ (( $wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? ", ".($page = $dbr->tableName( 'page' ))." WHERE cl_to = {$page}.page_title AND {$page}.page_restrictions NOT LIKE '%view=1%'" : '').
+ " GROUP BY cl_to";
return $s;
}
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialContributions.php ./includes/SpecialContributions.php
--- ../mediawiki-1.6.3/includes/SpecialContributions.php 2006-04-11 03:18:02.000000000 +0200
+++ ./includes/SpecialContributions.php 2006-04-21 17:02:26.000000000 +0200
@@ -113,6 +113,7 @@
}
/* private */ function make_sql() {
+ global $wgUser, $wgEnableRestrict;
$userCond = $condition = $index = $offsetQuery = $limitQuery = "";
extract($this->dbr->tableNames('page', 'revision'));
@@ -129,7 +130,8 @@
rev_id,rev_page,rev_text_id,rev_timestamp,rev_comment,rev_minor_edit,rev_user,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";
$sql = $this->dbr->limitResult($sql, $this->limit, 0);
return $sql;
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialDeadendpages.php ./includes/SpecialDeadendpages.php
--- ../mediawiki-1.6.3/includes/SpecialDeadendpages.php 2006-04-11 03:18:04.000000000 +0200
+++ ./includes/SpecialDeadendpages.php 2006-04-21 17:02:26.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' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialDisambiguations.php ./includes/SpecialDisambiguations.php
--- ../mediawiki-1.6.3/includes/SpecialDisambiguations.php 2006-04-11 03:18:01.000000000 +0200
+++ ./includes/SpecialDisambiguations.php 2006-04-21 17:02:26.000000000 +0200
@@ -33,6 +33,8 @@
}
function getSQL() {
+ global $wgEnableRestrict, $wgUser;
+
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'page', 'pagelinks', 'templatelinks' ) );
@@ -53,7 +55,8 @@
." WHERE lb.tl_namespace = $dns AND lb.tl_title = $dtitle" # disambiguation template
.' AND pa.page_id = lb.tl_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' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialDoubleRedirects.php ./includes/SpecialDoubleRedirects.php
--- ../mediawiki-1.6.3/includes/SpecialDoubleRedirects.php 2006-04-11 03:18:02.000000000 +0200
+++ ./includes/SpecialDoubleRedirects.php 2006-04-21 17:02:26.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' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialLog.php ./includes/SpecialLog.php
--- ../mediawiki-1.6.3/includes/SpecialLog.php 2006-04-11 03:18:03.000000000 +0200
+++ ./includes/SpecialLog.php 2006-04-21 17:02:26.000000000 +0200
@@ -59,11 +59,17 @@
* @access private
*/
function setupQuery( $request ) {
+ global $wgUser, $wgEnableRestrict, $wgHideRestrictLog;
+
$page = $this->db->tableName( 'page' );
$user = $this->db->tableName( 'user' );
$this->joinClauses = array( "LEFT OUTER JOIN $page ON log_namespace=page_namespace AND log_title=page_title" );
$this->whereClauses = array( 'user_id=log_user' );
+ if ( ($wgEnableRestrict and $wgHideRestrictLog == true and !($wgUser->isAllowed('restrict') || $wgUser->isAllowed('viewrestrict')))
+ or ! $wgEnableRestrict )
+ $this->whereClauses[] = 'log_type != "restrict"';
+
$this->limitType( $request->getVal( 'type' ) );
$this->limitUser( $request->getText( 'user' ) );
$this->limitTitle( $request->getText( 'page' ) );
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialLonelypages.php ./includes/SpecialLonelypages.php
--- ../mediawiki-1.6.3/includes/SpecialLonelypages.php 2006-04-11 03:18:02.000000000 +0200
+++ ./includes/SpecialLonelypages.php 2006-04-21 17:02:26.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' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialMostlinked.php ./includes/SpecialMostlinked.php
--- ../mediawiki-1.6.3/includes/SpecialMostlinked.php 2006-04-11 03:18:02.000000000 +0200
+++ ./includes/SpecialMostlinked.php 2006-04-21 17:02:26.000000000 +0200
@@ -27,6 +27,8 @@
* Note: Getting page_namespace only works if $this->isCached() is false
*/
function getSQL() {
+ global $wgEnableRestrict, $wgUser;
+
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'pagelinks', 'page' ) );
return
@@ -37,7 +39,8 @@
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' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialMovepage.php ./includes/SpecialMovepage.php
--- ../mediawiki-1.6.3/includes/SpecialMovepage.php 2006-04-11 03:18:02.000000000 +0200
+++ ./includes/SpecialMovepage.php 2006-04-21 17:02:26.000000000 +0200
@@ -54,7 +54,7 @@
}
function showForm( $err ) {
- global $wgOut, $wgUser;
+ global $wgOut, $wgUser, $wgEnableRestrict;
$wgOut->setPagetitle( wfMsg( 'movepage' ) );
@@ -63,6 +63,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' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialNewpages.php ./includes/SpecialNewpages.php
--- ../mediawiki-1.6.3/includes/SpecialNewpages.php 2006-04-11 03:18:02.000000000 +0200
+++ ./includes/SpecialNewpages.php 2006-04-21 17:02:26.000000000 +0200
@@ -32,7 +32,7 @@
}
function getSQL() {
- global $wgUser, $wgUseRCPatrol;
+ global $wgUser, $wgUseRCPatrol, $wgEnableRestrict;
$usepatrol = ( $wgUseRCPatrol && $wgUser->isAllowed( 'patrol' ) ) ? 1 : 0;
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'recentchanges', 'page', 'text' ) );
@@ -55,7 +55,8 @@
page_latest as rev_id
FROM $recentchanges,$page
WHERE rc_cur_id=page_id AND rc_new=1
- AND rc_namespace=" . $this->namespace . " AND page_is_redirect=0";
+ AND rc_namespace=" . $this->namespace . " AND page_is_redirect=0".
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%'" : "");
}
function preprocessResults( &$dbo, &$res ) {
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialPage.php ./includes/SpecialPage.php
--- ../mediawiki-1.6.3/includes/SpecialPage.php 2006-04-11 03:18:03.000000000 +0200
+++ ./includes/SpecialPage.php 2006-04-21 17:02:26.000000000 +0200
@@ -93,6 +93,10 @@
$wgSpecialPages['Confirmemail'] = new UnlistedSpecialPage( 'Confirmemail' );
}
+if( $wgEnableRestrict ) {
+ $wgSpecialPages['Restrictedpages'] = new SpecialPage( 'Restrictedpages', 'restrict' );
+}
+
/**
* Parent special page class, also static functions for handling the special
* page list
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialPopularpages.php ./includes/SpecialPopularpages.php
--- ../mediawiki-1.6.3/includes/SpecialPopularpages.php 2006-04-11 03:18:02.000000000 +0200
+++ ./includes/SpecialPopularpages.php 2006-04-21 17:02:26.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' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialRandompage.php ./includes/SpecialRandompage.php
--- ../mediawiki-1.6.3/includes/SpecialRandompage.php 2006-04-11 03:18:04.000000000 +0200
+++ ./includes/SpecialRandompage.php 2006-04-21 17:02:26.000000000 +0200
@@ -11,7 +11,7 @@
* used as e.g. Special:Randompage/Category
*/
function wfSpecialRandompage( $par = NS_MAIN ) {
- global $wgOut, $wgExtraRandompageSQL, $wgContLang;
+ global $wgOut, $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";
$sql = $db->limitResult($sql, 1, 0);
$res = $db->query( $sql, $fname );
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialRecentchangeslinked.php ./includes/SpecialRecentchangeslinked.php
--- ../mediawiki-1.6.3/includes/SpecialRecentchangeslinked.php 2006-04-11 03:18:01.000000000 +0200
+++ ./includes/SpecialRecentchangeslinked.php 2006-04-21 17:02:26.000000000 +0200
@@ -15,7 +15,7 @@
* @param string $par parent page we will look at
*/
function wfSpecialRecentchangeslinked( $par = NULL ) {
- global $wgUser, $wgOut, $wgContLang, $wgRequest;
+ global $wgUser, $wgOut, $wgContLang, $wgRequest, $wgEnableRestrict;
$fname = 'wfSpecialRecentchangeslinked';
$days = $wgRequest->getInt( 'days' );
@@ -121,7 +121,8 @@
{$cmq}
AND pl_namespace=rc_namespace
AND pl_title=rc_title
- AND pl_from=$id
+ AND pl_from=$id".
+ (($wgEnableRestrict == true and ! $wgUser->isAllowed('viewrestrict') ) ? " AND page_restrictions NOT LIKE '%view=1%'" : "")."
GROUP BY rc_cur_id,rc_namespace,rc_title,
rc_user,rc_comment,rc_user_text,rc_timestamp,rc_minor,
rc_new
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialRestrictedpages.php ./includes/SpecialRestrictedpages.php
--- ../mediawiki-1.6.3/includes/SpecialRestrictedpages.php 1970-01-01 01:00:00.000000000 +0100
+++ ./includes/SpecialRestrictedpages.php 2006-04-21 16:44:47.000000000 +0200
@@ -0,0 +1,80 @@
+'.wfMsg('restrictedpagespagetext');
+ if (! empty($wgRegexRestrict) ) {
+ $string .= "\n".wfMsg('regexrestrictedpagespagetext');
+ foreach( $wgRegexRestrict as $k => $v ) $string .= "{$v}, ";
+ $string = substr( $string, 0, -2);
+ }
+
+ $string .= "
\n
";
+
+ return $string;
+ }
+
+ function getSQL() {
+ global $wgEnableRestrict, $wgUser;
+
+ $db =& wfGetDB( DB_SLAVE );
+ $page = $db->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' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialShortpages.php ./includes/SpecialShortpages.php
--- ../mediawiki-1.6.3/includes/SpecialShortpages.php 2006-04-11 03:18:03.000000000 +0200
+++ ./includes/SpecialShortpages.php 2006-04-21 17:02:26.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 FORCE INDEX (page_len)
- 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' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialUncategorizedpages.php ./includes/SpecialUncategorizedpages.php
--- ../mediawiki-1.6.3/includes/SpecialUncategorizedpages.php 2006-04-11 03:18:02.000000000 +0200
+++ ./includes/SpecialUncategorizedpages.php 2006-04-21 17:02:26.000000000 +0200
@@ -32,6 +32,8 @@
function isSyndicated() { return false; }
function getSQL() {
+ global $wgEnableRestrict, $wgUser;
+
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'page', 'categorylinks' ) );
$name = $dbr->addQuotes( $this->getName() );
@@ -45,8 +47,8 @@
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' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/SpecialWhatlinkshere.php ./includes/SpecialWhatlinkshere.php
--- ../mediawiki-1.6.3/includes/SpecialWhatlinkshere.php 2006-04-11 03:18:02.000000000 +0200
+++ ./includes/SpecialWhatlinkshere.php 2006-04-21 17:02:26.000000000 +0200
@@ -10,7 +10,7 @@
* @param string $par An article name ??
*/
function wfSpecialWhatlinkshere($par = NULL) {
- global $wgRequest;
+ global $wgRequest, $wgEnableRestrict, $wgUser;
$page = new WhatLinksHerePage( $wgRequest, $par );
$page->execute();
}
@@ -46,7 +46,10 @@
$wgOut->errorpage( 'notargettitle', 'notargettext' );
return;
}
-
+ if( $wgEnableRestrict == true and $nt->isRestricted() and ! $wgUser->isAllowed('viewrestrict') ) {
+ $wgOut->errorpage( 'restricttitle', 'restricttext' );
+ return;
+ }
$this->target = Title::newFromURL( $targetString );
if( !$this->target ) {
$wgOut->errorpage( 'notargettitle', 'notargettext' );
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/Title.php ./includes/Title.php
--- ../mediawiki-1.6.3/includes/Title.php 2006-04-11 03:18:02.000000000 +0200
+++ ./includes/Title.php 2006-04-21 17:02:26.000000000 +0200
@@ -937,6 +937,36 @@
}
/**
+ * 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 ( $this->isRegexRestricted() || (!empty($a) && $a[0] == true) ) return true;
+ }
+
+ return false;
+ }
+
+ function isRegexRestricted() {
+ global $wgEnableRestrict, $wgRegexRestrict;
+
+ if ( $wgEnableRestrict == true ) {
+ foreach ( $wgRegexRestrict as $k=>$v ) {
+ if ( ereg ( $v, $this->mTextform ) ) return true;
+ }
+ }
+
+ return false;
+ }
+
+
+ /**
* Is $wgUser is watching this page?
* @return boolean
* @access public
@@ -1074,7 +1104,22 @@
* @access public
*/
function userCanRead() {
- global $wgUser;
+ global $wgUser, $wgUserPageRestrict;
+
+ // restricted page ?
+ if ( $this->isRestricted() && ! $wgUser->isAllowed('viewrestrict') ) {
+ return false;
+ }
+
+ // restricted user pages ?
+ if ( $wgUserPageRestrict == true ) {
+ if ( $this->getNamespace() == NS_USER
+ && $wgUser->getName() != $this->getText() ) {
+ if ( ! $wgUser->isAllowed('viewrestrict') ) {
+ return false;
+ }
+ };
+ }
$result = null;
wfRunHooks( 'userCan', array( &$this, &$wgUser, 'read', &$result ) );
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/includes/Wiki.php ./includes/Wiki.php
--- ../mediawiki-1.6.3/includes/Wiki.php 2006-04-11 03:18:02.000000000 +0200
+++ ./includes/Wiki.php 2006-04-21 17:02:26.000000000 +0200
@@ -107,7 +107,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( $title ) && !$title->userCanRead() ) {
- $output->loginToUse();
+ if ( $title->isRestricted() ) {
+ $output->restrictGroupRequired();
+ } else {
+ $output->loginToUse();
+ }
$output->output();
exit;
}
@@ -332,6 +336,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' -x .cvsignore -Naur ../mediawiki-1.6.3/languages/MessagesCa.php ./languages/MessagesCa.php
--- ../mediawiki-1.6.3/languages/MessagesCa.php 2006-04-11 03:18:24.000000000 +0200
+++ ./languages/MessagesCa.php 2006-04-24 11:56:58.000000000 +0200
@@ -743,6 +743,35 @@
'mw_math_html' => "HTML si és possible, si no PNG",
'mw_math_source' => "Deixa com a TeX (per a navegadors de text)",
+# Traducció del pedaç de les restriccions
+# http://meta.wikimedia.org/wiki/Page_access_restriction_with_MediaWiki
+# http://conseil-recherche-innovation.net/index.php/1974/04/11/41-restrict-pages-under-mediawiki-15
+# 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 -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/languages/MessagesDe.php ./languages/MessagesDe.php
--- ../mediawiki-1.6.3/languages/MessagesDe.php 2006-04-11 03:18:30.000000000 +0200
+++ ./languages/MessagesDe.php 2006-04-21 17:02:26.000000000 +0200
@@ -1140,6 +1140,29 @@
'articletitles' => "Artikel, die mit ''$1'' beginnen",
'hideresults' => 'Verbergen',
+#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\' 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 -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/languages/MessagesFi.php ./languages/MessagesFi.php
--- ../mediawiki-1.6.3/languages/MessagesFi.php 2006-04-11 03:18:23.000000000 +0200
+++ ./languages/MessagesFi.php 2006-04-24 11:56:17.000000000 +0200
@@ -1712,5 +1712,33 @@
'hideresults' => 'Piilota tulokset',
+#Restrict patch (http://meta.wikimedia.org/wiki/Page_access_restriction_with_MediaWiki)
+'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 -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/languages/MessagesFr.php ./languages/MessagesFr.php
--- ../mediawiki-1.6.3/languages/MessagesFr.php 2006-04-11 03:18:28.000000000 +0200
+++ ./languages/MessagesFr.php 2006-04-21 17:02:26.000000000 +0200
@@ -1079,7 +1079,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\' 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\'',
// exifgps:
);
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/languages/MessagesHe.php ./languages/MessagesHe.php
--- ../mediawiki-1.6.3/languages/MessagesHe.php 2006-04-11 03:18:25.000000000 +0200
+++ ./languages/MessagesHe.php 2006-05-01 21:46:04.000000000 +0200
@@ -1575,6 +1575,32 @@
"articletitles" => "חפש דפים המתחילים עם '''$1'''",
"hideresults" => "הסתר תוצאות",
+#Restrict patch ( http://meta.wikimedia.org/wiki/Page_access_restriction_with_MediaWiki )
+'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 -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/languages/MessagesNl.php ./languages/MessagesNl.php
--- ../mediawiki-1.6.3/languages/MessagesNl.php 2006-04-11 03:18:28.000000000 +0200
+++ ./languages/MessagesNl.php 2006-04-21 17:02:26.000000000 +0200
@@ -690,6 +690,33 @@
'mw_math_source' => "Laat de TeX broncode staan (voor tekstbrowsers)",
'mw_math_modern' => "Aanbevolen methode voor recente browsers",
'mw_math_mathml' => 'MathML',
+
+#Restrict patch (http://meta.wikimedia.org/wiki/Page_access_restriction_with_MediaWiki)
+'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 -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/languages/Messages.php ./languages/Messages.php
--- ../mediawiki-1.6.3/languages/Messages.php 2006-04-11 03:18:24.000000000 +0200
+++ ./languages/Messages.php 2006-04-21 17:02:26.000000000 +0200
@@ -1999,6 +1999,32 @@
'articletitles' => "Articles starting with ''$1''",
'hideresults' => 'Hide results',
+#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 \'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 -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/languages/MessagesRu.php ./languages/MessagesRu.php
--- ../mediawiki-1.6.3/languages/MessagesRu.php 2006-04-11 03:18:28.000000000 +0200
+++ ./languages/MessagesRu.php 2006-04-24 11:52:22.000000000 +0200
@@ -1890,6 +1890,33 @@
'searchnamed' => "Поиск статей называющихся «$1».",
'articletitles' => "Статьи начинающиеся с «$1»",
'hideresults' => 'Скрыть результаты',
+
+#Restrict patch (http://meta.wikimedia.org/wiki/Page_access_restriction_with_MediaWiki)
+'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 -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/languages/MessagesSv.php ./languages/MessagesSv.php
--- ../mediawiki-1.6.3/languages/MessagesSv.php 2006-04-11 03:18:30.000000000 +0200
+++ ./languages/MessagesSv.php 2006-04-21 17:02:26.000000000 +0200
@@ -785,7 +785,33 @@
"lastmodifiedby" => "Den här sidan var senaste ändrad $1 av $2.",
"and" => "och",
"othercontribs" => "Baserad på arbete utfört av $1.",
-"siteusers" => "{{SITENAME}} användare $1"
+"siteusers" => "{{SITENAME}} användare $1",
+
+#Restrict patch (http://meta.wikimedia.org/wiki/Page_access_restriction_with_MediaWiki)
+'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å: ',
);
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/README.restriction-patch ./README.restriction-patch
--- ../mediawiki-1.6.3/README.restriction-patch 1970-01-01 01:00:00.000000000 +0100
+++ ./README.restriction-patch 2006-05-01 23:25:28.000000000 +0200
@@ -0,0 +1,110 @@
+
+Article restriction patch for MediaWiki
+---------------------------------------
+
+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. It is also possible to restrict pages by providing a regular expression array matching titles. Optionaly the user's pages can be restricted to their owner. Currently it is localized in English, German, Dutch, Swedish, Finnish, Russian, Hebrew 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-version.mediawiki-version.patch ./mediawiki-version
+ cd ./mediawiki-version
+ patch -p0 < restriction-version.mediawiki-version.patch
+
+- Configure :
+
+Restriction is disabled by default. Add in your ''./LocalSettings.php'' file (below require_once( "includes/DefaultSettings.php" );) :
+
+ /**
+ * 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;
+
+ /**
+ * Regular expression array to restrict matching pages
+ * eg. $wgRegexRestrict = array("^Secure:", "^Secret "); // restrict all pages where title is like 'Secure:...' or 'Secret ...'
+ * Warning : titles can still be retrieved via the search engine (to be fixed)
+ */
+ $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;
+
+
+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/11/41-restrict-pages-under-mediawiki-15
+
+
+ChangeLog
+---------
+
+Version beta-0.64 for MW 1.6.3 (05-01-2006)
+- Bug when displaying SpecialCategories page (thanks to T O X I N)
+- Hebrew translation (thanks to Yuval Hager)
+- Bug in OutputPage.php (thanks again to Yuval Hager)
+
+Version beta-0.63 for MW 1.6.3 (04-20-2006)
+- Upgrade for 1.6.3 (thanks to Anthony for his help)
+- Russian translation (thanks to T O X I N)
+- Finnish translation (thanks to Tuomas Helin)
+
+Version beta-0.62 for MW 1.5.5/1.5.6 (02-13-2006) 1.5.7 (03-05-2006)
+- Catalan translation (thanks to Pau Cabot)
+- Small mistake (comma) in swedish translation
+
+Version beta-0.61 for MW 1.5.5/1.5.6 (01-18-2006)
+- Swedish translation (thanks to Samuel Lampa)
+- Dutch translation (thanks to Peter De Baets)
+
+Version beta-0.6 for MW 1.5.3 (12-15-2005)
+- $wgHideRestrictLog option is back
+
+Version beta-0.59 for MW 1.5.1/1.5.2 (10-31-2005)
+- Allow to restrict new pages by default ($wgRestrictNewPages option)
+- Bug : 'ArticleProtectComplete' hook function remplaced by 'ArticleRestrictComplete' (stupid mistake !)
+
+Version beta-0.58 for MW 1.5.0 (10-07-2005)
+- Restriction by regular expression test on title.
+- Bug which avoided to view restricted pages in special pages (only 'restrict' group can see it, not possible to add 'viewrestrict' group) (thanks to Karen O'Flaherty)
+- German translation updated (thanks to Hugo Wirz)
+- French and english translations updated.
+- Bug in Broken Redirects special page SQL request
+- Categories special page hide restricted categories for non allowed users
+- No more modifications in monobook stylesheet than one style added (see bottom of /skins/monobook/main.css file).
+
+Version beta-0.57 for MW 1.5.0 (09-18-2005)
+- Stupid cosmetic bug which avoid patch working if user page restriction enabled (thanks to Christophe Berger)
+
+Version beta-0.56 for MW 1.5.0 (09-11-2005)
+- Bug "variables can be passed by reference in [mediawiki]\includes\Article.php on line 1703" with some PHP configurations (thanks to Chunho Lee)
+
+Version beta-0.55 for MW 1.5.0 (09-07-2005)
+- First public release for MediaWiki 1.5
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/skins/monobook/main.css ./skins/monobook/main.css
--- ../mediawiki-1.6.3/skins/monobook/main.css 2006-04-11 03:17:43.000000000 +0200
+++ ./skins/monobook/main.css 2006-04-21 17:02:26.000000000 +0200
@@ -1441,3 +1441,8 @@
content: "\00BB \0020";
}
+/* restriction patch tab style (white link on red background) */
+li#ca-unrestrict a {
+ color: white !important;
+ background-color: #ba0000 !important;
+}
\ Pas de fin de ligne la fin du fichier.
diff -x '*~' -x LocalSettings.php -x '*.orig' -x '*.patch' -x .cvsignore -Naur ../mediawiki-1.6.3/skins/monobook/Thumbs.db ./skins/monobook/Thumbs.db
--- ../mediawiki-1.6.3/skins/monobook/Thumbs.db 1970-01-01 01:00:00.000000000 +0100
+++ ./skins/monobook/Thumbs.db 2006-04-21 17:02:26.000000000 +0200
@@ -0,0 +1,132 @@
+ࡱ >
+ R o o t E n t r y Qs̬d ! 1 2 3
+ ! " # % &