Aide:Aide

Un article de IE-Lobbying.info.

Jump to: navigation, search

Sommaire

Général

Particulier

Edition

Modération

Administration

Raccourcir l'URL

Restrendre le wiki de manière partielle ou totale

 $wgGroupPermissions['trusted']['upload'] = true;
  /**
  * 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 ...'
  */
  $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)

Créer un "user_group"


 /**
 * Permission keys given to users in each group.
 * All users are implicitly in the '*' group including anonymous visitors;
 * logged-in users are all implicitly in the 'user' group. These will be
 * combined with the permissions of all groups that a given user is listed
 * in in the user_groups table.
 *
 * Functionality to make pages inaccessible has not been extensively tested
 * for security. Use at your own risk!
 *
 * This replaces wgWhitelistAccount and wgWhitelistEdit
 */
$wgGroupPermissions = array();

// Implicit group for all anonymous
$wgGroupPermissions['*'    ]['createaccount']   = true;
$wgGroupPermissions['*'    ]['read']            = true;
$wgGroupPermissions['*'    ]['edit']            = true;
$wgGroupPermissions['*'    ]['createpage']      = true;
$wgGroupPermissions['*'    ]['createtalk']      = true;

// Implicit group for all logged-in accounts
$wgGroupPermissions['user' ]['move']            = true;
$wgGroupPermissions['user' ]['read']            = true;
$wgGroupPermissions['user' ]['edit']            = true;
$wgGroupPermissions['user' ]['createpage']      = true;
$wgGroupPermissions['user' ]['createtalk']      = true;
$wgGroupPermissions['user' ]['upload']          = true;
$wgGroupPermissions['user' ]['reupload']        = true;
$wgGroupPermissions['user' ]['reupload-shared'] = true;
$wgGroupPermissions['user' ]['minoredit']       = true;

// Implicit group for accounts that pass $wgAutoConfirmAge
$wgGroupPermissions['autoconfirmed']['autoconfirmed'] = true;

// Implicit group for accounts with confirmed email addresses
// This has little use when email address confirmation is off
$wgGroupPermissions['emailconfirmed']['emailconfirmed'] = true; // not in version 1.6.9

// Users with bot privilege can have their edits hidden
// from various log pages by default
$wgGroupPermissions['bot'  ]['bot']             = true;
$wgGroupPermissions['bot'  ]['autoconfirmed']   = true;
$wgGroupPermissions['bot'  ]['nominornewtalk']  = true; // not in version 1.6.9, 1.8.2, 1.8.3

// Most extra permission abilities go to this group
$wgGroupPermissions['sysop']['block']           = true;
$wgGroupPermissions['sysop']['createaccount']   = true;
$wgGroupPermissions['sysop']['delete']          = true;
$wgGroupPermissions['sysop']['deletedhistory']  = true; // can view deleted history entries, 
but not see or restore the text
$wgGroupPermissions['sysop']['editinterface']   = true;
$wgGroupPermissions['sysop']['import']          = true;
$wgGroupPermissions['sysop']['importupload']    = true;
$wgGroupPermissions['sysop']['move']            = true;
$wgGroupPermissions['sysop']['patrol']          = true;
$wgGroupPermissions['sysop']['autopatrol']	= true; // not in version 1.6.9, 1.8.2, 1.8.3
$wgGroupPermissions['sysop']['protect']         = true;
$wgGroupPermissions['sysop']['proxyunbannable'] = true; //not in version 1.6.9
$wgGroupPermissions['sysop']['rollback']        = true;
$wgGroupPermissions['sysop']['trackback']       = true; //not in version 1.6.9
$wgGroupPermissions['sysop']['upload']          = true;
$wgGroupPermissions['sysop']['reupload']        = true;
$wgGroupPermissions['sysop']['reupload-shared'] = true;
$wgGroupPermissions['sysop']['unwatchedpages']  = true;
$wgGroupPermissions['sysop']['autoconfirmed']   = true;
$wgGroupPermissions['sysop']['upload_by_url']   = true; //not in version 1.6.9
$wgGroupPermissions['sysop']['ipblock-exempt']	= true; // not in version 1.6.9, 1.8.2, 1.8.3

// Permission to change users' group assignments
$wgGroupPermissions['bureaucrat']['userrights'] = true;

"Preventing access"

  • Prevent new user registrations

1.5 upwards


 # This snippet prevents new registrations from anonymous users
 # (Sysops can still create user accounts)
 $wgGroupPermissions['*']['createaccount'] = false;

  • Note: New users will still be able to be created by sysops, in the following manner:
Go to [[Special:Userlogin]], when logged in as a sysop. The link to this page differs from language, (f.ex. in Dutch it is [[Special:Userlogin]]). Enter a username and an email address, and click the "by email" button. The account will be created with a random password which is then emailed to the given address.
  • Note: It may be appropriate to edit the text displayed when a non-user attempts to log in. This can be done at [[MediaWiki:Nosuchuser]], when logged in as a sysop. Use plain text without any special formatting; as the formatting is ignored and the text is literally rendered.


  • Disable anonymous edits

1.5 upwards


 # This snippet prevents editing from anonymous users
 $wgGroupPermissions['*']['edit'] = false;

Users will still be able to read the page and can view the source by using Special:Export/Article name.

Note that you have to add the above entry below the line:


 require_once( "includes/DefaultSettings.php" ); 

For it to work properly.