<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="it">
	<id>https://wiki.minerva-apps.com/index.php?action=history&amp;feed=atom&amp;title=Pagine_private_agli_utenti_loggati</id>
	<title>Pagine private agli utenti loggati - Cronologia</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.minerva-apps.com/index.php?action=history&amp;feed=atom&amp;title=Pagine_private_agli_utenti_loggati"/>
	<link rel="alternate" type="text/html" href="https://wiki.minerva-apps.com/index.php?title=Pagine_private_agli_utenti_loggati&amp;action=history"/>
	<updated>2026-05-01T17:06:27Z</updated>
	<subtitle>Cronologia della pagina su questo sito</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.minerva-apps.com/index.php?title=Pagine_private_agli_utenti_loggati&amp;diff=74&amp;oldid=prev</id>
		<title>Andrea il 20:44, 23 apr 2020</title>
		<link rel="alternate" type="text/html" href="https://wiki.minerva-apps.com/index.php?title=Pagine_private_agli_utenti_loggati&amp;diff=74&amp;oldid=prev"/>
		<updated>2020-04-23T20:44:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;it&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Versione meno recente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Versione delle 20:44, 23 apr 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l112&quot; &gt;Riga 112:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Riga 112:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Abbiamo importato l'estensione modificando il file {{code|}} aggiungendo le righe&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Abbiamo importato l'estensione modificando il file {{code|&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;LocalSettings.php&lt;/ins&gt;}} aggiungendo le righe&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;// estensione protezione accesso alle pagine private&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;// estensione protezione accesso alle pagine private&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Andrea</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.minerva-apps.com/index.php?title=Pagine_private_agli_utenti_loggati&amp;diff=73&amp;oldid=prev</id>
		<title>Andrea: Creata pagina con &quot;&amp;larr; MediaWiki   == Estensione Restrict access by category and group ==  https://www.mediawiki.org/wiki/Extension:Restrict_access_by_category_and_group  Abbiam...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.minerva-apps.com/index.php?title=Pagine_private_agli_utenti_loggati&amp;diff=73&amp;oldid=prev"/>
		<updated>2020-04-23T20:44:18Z</updated>

		<summary type="html">&lt;p&gt;Creata pagina con &amp;quot;&lt;a href=&quot;/index.php?title=MediaWiki&quot; title=&quot;MediaWiki&quot;&gt;← MediaWiki&lt;/a&gt;   == Estensione Restrict access by category and group ==  https://www.mediawiki.org/wiki/Extension:Restrict_access_by_category_and_group  Abbiam...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nuova pagina&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[MediaWiki|&amp;amp;larr; MediaWiki]] &lt;br /&gt;
&lt;br /&gt;
== Estensione Restrict access by category and group ==&lt;br /&gt;
&lt;br /&gt;
https://www.mediawiki.org/wiki/Extension:Restrict_access_by_category_and_group&lt;br /&gt;
&lt;br /&gt;
Abbiamo modificato questa estensione per:&lt;br /&gt;
* permettere agli utenti loggati di vedere le pagine definite private&lt;br /&gt;
* Impedire ai visitatori non loggati di vedere suddette pagine&lt;br /&gt;
&lt;br /&gt;
== Installazione ==&lt;br /&gt;
&lt;br /&gt;
Abbiamo creato il file {{code|extensions/RestrictAccessByCategoryAndGroup/RestrictAccessByCategoryAndGroup.php}} con questo contenuto:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
if ( !defined( 'MEDIAWIKI' ) ) {&lt;br /&gt;
	die( 'Not a valid entry point.' );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$wgExtensionCredits['parserhook'][] = array(&lt;br /&gt;
	'name' =&amp;gt; 'Restrict access by category and group',&lt;br /&gt;
	'author' =&amp;gt; 'Andrés Orencio Ramirez Perez',&lt;br /&gt;
	'url' =&amp;gt; 'https://www.mediawiki.org/wiki/Extension:Restrict_access_by_category_and_group',&lt;br /&gt;
	'description' =&amp;gt; 'Allows to restrict access to pages by users groups and page categories',&lt;br /&gt;
	'version' =&amp;gt; '2.0.1'&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
$wgHooks['userCan'][] = 'restrictAccessByCategoryAndGroup';&lt;br /&gt;
&lt;br /&gt;
function restrictAccessByCategoryAndGroup( $title, $user, $action, $result ) {&lt;br /&gt;
	global $wgGroupPermissions;&lt;br /&gt;
	global $wgWhitelistRead;&lt;br /&gt;
	global $wgLang;&lt;br /&gt;
	global $wgHooks;&lt;br /&gt;
	global $wgContLang;&lt;br /&gt;
	global $wgWhitelistRead;&lt;br /&gt;
	global $wgVersion;&lt;br /&gt;
&lt;br /&gt;
	if ( $user-&amp;gt;isLoggedIn() ) {&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	//The Main Page, Login and Logout pages should always be accessible&lt;br /&gt;
	if ( $wgVersion &amp;gt;= '1.17' ) {&lt;br /&gt;
		$wgWhitelistRead[] = wfMessage( 'mainpage' )-&amp;gt;plain();&lt;br /&gt;
	} else {&lt;br /&gt;
		$wgWhitelistRead[] = wfMsgForContent( 'mainpage' );&lt;br /&gt;
	}&lt;br /&gt;
        $wgWhitelistRead[] = SpecialPage::getTitleFor( 'Userlogin' )-&amp;gt;getLocalUrl();&lt;br /&gt;
        $wgWhitelistRead[] = SpecialPage::getTitleFor( 'Userlogout' )-&amp;gt;getLocalUrl();&lt;br /&gt;
&lt;br /&gt;
	$validCategory = false;&lt;br /&gt;
	$groupExists = false;&lt;br /&gt;
	$pageHasCategories = false;&lt;br /&gt;
	$privateCategory = false;&lt;br /&gt;
	$privateCategoryTemp = false;&lt;br /&gt;
	$categoryNamespace = $wgLang-&amp;gt;getNsText( NS_CATEGORY );&lt;br /&gt;
	$whitePage = true;&lt;br /&gt;
&lt;br /&gt;
	//System categories&lt;br /&gt;
	$systemCategory = array();&lt;br /&gt;
	foreach ( array_change_key_case( $title-&amp;gt;getParentCategories(), CASE_LOWER ) as $key =&amp;gt; $value ) {&lt;br /&gt;
		$formatedKey = substr( $key, ( strpos( $key, &amp;quot;:&amp;quot; ) + 1 ) );&lt;br /&gt;
		$systemCategory[ $formatedKey ] = $value;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	//Is this page a white page?&lt;br /&gt;
	if ( isset( $wgWhitelistRead[0] ) ) {&lt;br /&gt;
		$whitePage = in_array( $title, $wgWhitelistRead );&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	//If the page has no categories, it's public.&lt;br /&gt;
	if ( count( $title-&amp;gt;getParentCategories() ) == 0 ) {&lt;br /&gt;
		$validCategory = true;&lt;br /&gt;
	} else {&lt;br /&gt;
		//For each system categories&lt;br /&gt;
		foreach ( $wgGroupPermissions as $key =&amp;gt; $value ) {&lt;br /&gt;
			//If current system category is defined as private, then tmpCatP is true&lt;br /&gt;
			if ( isset( $wgGroupPermissions[ $key ]['private'] ) ) {&lt;br /&gt;
				$privateCategoryTemp = $wgGroupPermissions[ $key ]['private'];&lt;br /&gt;
			} else {&lt;br /&gt;
				$privateCategoryTemp = false;&lt;br /&gt;
			}&lt;br /&gt;
			//If current system category exist in the document category array ...&lt;br /&gt;
			if ( array_key_exists( strtolower( str_replace( &amp;quot; &amp;quot;, &amp;quot;_&amp;quot;, $key ) ), $systemCategory ) ) {&lt;br /&gt;
				if ( $privateCategoryTemp and !$privateCategory ) {&lt;br /&gt;
					$privateCategory = true;&lt;br /&gt;
					$validCategory = false;&lt;br /&gt;
				}&lt;br /&gt;
				//We see that the user belongs to one of the groups (like of category)&lt;br /&gt;
				if ( in_array( $key, $user-&amp;gt;getGroups() ) and ( !$privateCategory or ( $privateCategoryTemp and $privateCategory ) ) ) {&lt;br /&gt;
					$validCategory = true;&lt;br /&gt;
				}&lt;br /&gt;
				$groupExists = true;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		$pageHasCategories = count( $title-&amp;gt;getParentCategories() ) &amp;gt; 0;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if ( !$pageHasCategories ) {&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
	if ( !$groupExists and !$whitePage ) {&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
	if ( ( $user-&amp;gt;isLoggedIn() and $validCategory ) or $whitePage ) {&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
	return false;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Abbiamo importato l'estensione modificando il file {{code|}} aggiungendo le righe&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// estensione protezione accesso alle pagine private&lt;br /&gt;
require_once &amp;quot;$IP/extensions/RestrictAccessByCategoryAndGroup/RestrictAccessByCategoryAndGroup.php&amp;quot;;&lt;br /&gt;
// blocco delle pagine con categoria &amp;quot;Private&amp;quot; &lt;br /&gt;
$wgGroupPermissions['Private']['private'] = true;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ora basta inserire nella pagina la categoria inserendo il codice &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[[Category:Private]]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Andrea</name></author>
		
	</entry>
</feed>