MediaWiki  1.23.13
PermissionsError.php
Go to the documentation of this file.
1 <?php
30 
31  public function __construct( $permission, $errors = array() ) {
33 
34  $this->permission = $permission;
35 
36  if ( !count( $errors ) ) {
37  $groups = array_map(
38  array( 'User', 'makeGroupLinkWiki' ),
39  User::getGroupsWithPermission( $this->permission )
40  );
41 
42  if ( $groups ) {
43  $errors[] = array( 'badaccess-groups', $wgLang->commaList( $groups ), count( $groups ) );
44  } else {
45  $errors[] = array( 'badaccess-group0' );
46  }
47  }
48 
49  $this->errors = $errors;
50  }
51 
52  public function report() {
53  global $wgOut;
54 
55  $wgOut->showPermissionsErrorPage( $this->errors, $this->permission );
56  $wgOut->output();
57  }
58 }
PermissionsError\__construct
__construct( $permission, $errors=array())
Definition: PermissionsError.php:31
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
PermissionsError
Show an error when a user tries to do something they do not have the necessary permissions for.
Definition: PermissionsError.php:28
$wgOut
$wgOut
Definition: Setup.php:582
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
errors
if the prop value should be in the metadata multi language array can modify can modify indexed by page_id indexed by prefixed DB keys can modify can modify can modify this should be populated with an alert message to that effect to be fed to an HTMLForm object and populate $result with the reason in the form of error messages should be plain text with no special etc to show that they re errors
Definition: hooks.txt:1318
PermissionsError\$permission
$permission
Definition: PermissionsError.php:29
PermissionsError\$errors
$errors
Definition: PermissionsError.php:29
$wgLang
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
Definition: design.txt:56
ErrorPageError
An error page which can definitely be safely rendered using the OutputPage.
Definition: ErrorPageError.php:27
PermissionsError\report
report()
Output a report about the exception and takes care of formatting.
Definition: PermissionsError.php:52
User\getGroupsWithPermission
static getGroupsWithPermission( $role)
Get all the groups who have a given permission.
Definition: User.php:4124