51 $this->mConds = $conds;
54 $this->
namespace = $namespace;
61 parent::__construct( $form->getContext() );
65 # Do a link batch query
69 foreach ( $result as $row ) {
70 $lb->
add( $row->page_namespace, $row->page_title );
72 if ( $row->log_user !==
null ) {
73 $userids[] = $row->log_user;
78 if ( count( $userids ) ) {
80 $userCache->doQuery( $userids, [], __METHOD__ );
81 foreach ( $userids as $userid ) {
82 $name = $userCache->getProp( $userid,
'name' );
83 if ( $name !==
false ) {
84 $lb->add( NS_USER, $name );
94 static $headers =
null;
96 if ( $headers == [] ) {
98 'log_timestamp' =>
'protectedpages-timestamp',
99 'pr_page' =>
'protectedpages-page',
100 'pr_expiry' =>
'protectedpages-expiry',
101 'log_user' =>
'protectedpages-performer',
102 'pr_params' =>
'protectedpages-params',
103 'log_comment' =>
'protectedpages-reason',
105 foreach ( $headers as $key => $val ) {
106 $headers[$key] = $this->
msg( $val )->text();
124 case 'log_timestamp':
127 $formatted = Html::rawElement(
129 [
'class' =>
'mw-protectedpages-unknown' ],
130 $this->
msg(
'protectedpages-unknown-timestamp' )->escaped()
139 $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
141 $formatted = Html::element(
143 [
'class' =>
'mw-invalidtitle' ],
146 $row->page_namespace,
151 $formatted = $this->linkRenderer->makeLink( $title );
153 if ( !
is_null( $row->page_len ) ) {
155 ' ' . Html::rawElement(
157 [
'class' =>
'mw-protectedpages-length' ],
166 $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
167 if ( $this->
getUser()->isAllowed(
'protect' ) && $title ) {
168 $changeProtection = $this->linkRenderer->makeKnownLink(
170 $this->
msg(
'protect_change' )->
text(),
172 [
'action' =>
'unprotect' ]
174 $formatted .=
' ' . Html::rawElement(
176 [
'class' =>
'mw-protectedpages-actions' ],
177 $this->
msg(
'parentheses' )->rawParams( $changeProtection )->escaped()
184 if ( $row->log_timestamp ===
null ) {
185 $formatted = Html::rawElement(
187 [
'class' =>
'mw-protectedpages-unknown' ],
188 $this->
msg(
'protectedpages-unknown-performer' )->escaped()
204 $formatted = $this->
msg(
'rev-deleted-user' )->escaped();
207 $formatted =
'<span class="history-deleted">' . $formatted .
'</span>';
215 $params[] = $this->
msg(
'restriction-level-' . $row->pr_level )->escaped();
216 if ( $row->pr_cascade ) {
217 $params[] = $this->
msg(
'protect-summary-cascade' )->escaped();
224 if ( $row->log_timestamp ===
null ) {
225 $formatted = Html::rawElement(
227 [
'class' =>
'mw-protectedpages-unknown' ],
228 $this->
msg(
'protectedpages-unknown-reason' )->escaped()
236 $value = CommentStore::getStore()->getComment(
'log_comment', $row )->text;
239 $formatted = $this->
msg(
'rev-deleted-comment' )->escaped();
242 $formatted =
'<span class="history-deleted">' . $formatted .
'</span>';
256 $conds[] =
'pr_expiry > ' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
257 ' OR pr_expiry IS NULL';
258 $conds[] =
'page_id=pr_page';
259 $conds[] =
'pr_type=' . $this->mDb->addQuotes( $this->
type );
261 if ( $this->sizetype ==
'min' ) {
263 }
elseif ( $this->sizetype ==
'max' ) {
267 if ( $this->indefonly ) {
268 $infinity = $this->mDb->addQuotes( $this->mDb->getInfinity() );
269 $conds[] =
"pr_expiry = $infinity OR pr_expiry IS NULL";
271 if ( $this->cascadeonly ) {
272 $conds[] =
'pr_cascade = 1';
274 if ( $this->noredirect ) {
275 $conds[] =
'page_is_redirect = 0';
278 if ( $this->level ) {
279 $conds[] =
'pr_level=' . $this->mDb->addQuotes( $this->level );
281 if ( !
is_null( $this->
namespace ) ) {
282 $conds[] =
'page_namespace=' . $this->mDb->addQuotes( $this->
namespace );
285 $commentQuery = CommentStore::getStore()->getJoin(
'log_comment' );
286 $actorQuery = ActorMigration::newMigration()->getJoin(
'log_user' );
290 'page',
'page_restrictions',
'log_search',
291 'logparen' => [
'logging' ] + $commentQuery[
'tables'] + $actorQuery[
'tables'],
304 ] + $commentQuery[
'fields'] + $actorQuery[
'fields'],
309 'ls_field' =>
'pr_id',
'ls_value = ' . $this->mDb->buildStringCast(
'pr_id' )
317 ] + $commentQuery[
'joins'] + $actorQuery[
'joins']
322 return parent::getTableClass() .
' mw-protectedpages';
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
getContext()
Get the base IContextSource object.
Class representing a list of titles The execute() method checks them all for existence and adds them ...
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
static formatRevisionSize( $size)
static userToolLinks( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null, $useParentheses=true)
Generate standard user tool links (talk, contributions, block link, etc.)
static formatComment( $comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
static userCanBitfield( $bitfield, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row,...
static isDeleted( $row, $field)
this hook is for auditing only or null if authentication failed before getting that far $username
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN type