39 'wgBlockDisablesLogin' =>
false,
46 $this->blockRestrictionStore->insert( [
52 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
64 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
74 $restrictions = $this->blockRestrictionStore->loadByBlockId( [] );
90 $this->
insertRestriction( $block->getId(), PageRestriction::TYPE_ID, $pageFoo->getId() );
91 $this->
insertRestriction( $block->getId(), NamespaceRestriction::TYPE_ID, NS_USER );
97 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
108 $title =
'Lady Macbeth';
112 $this->blockRestrictionStore->insert( [
116 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
118 list( $pageRestriction ) = $restrictions;
120 $this->
assertEquals( $block->getId(), $pageRestriction->getBlockId() );
121 $this->
assertEquals( $page->getId(), $pageRestriction->getValue() );
122 $this->
assertEquals( $pageRestriction->getType(), PageRestriction::TYPE );
123 $this->
assertEquals( $pageRestriction->getTitle()->getText(), $title );
134 $this->blockRestrictionStore->insert( [
138 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
140 list( $namespaceRestriction ) = $restrictions;
141 $this->
assertInstanceOf( NamespaceRestriction::class, $namespaceRestriction );
142 $this->
assertEquals( $block->getId(), $namespaceRestriction->getBlockId() );
143 $this->
assertSame( NS_USER, $namespaceRestriction->getValue() );
144 $this->
assertEquals( $namespaceRestriction->getType(), NamespaceRestriction::TYPE );
163 $result = $this->blockRestrictionStore->insert( $restrictions );
170 $result = $this->blockRestrictionStore->insert( $restrictions );
173 $result = $this->blockRestrictionStore->insert( [] );
186 $invalid = $this->
createMock( Restriction::class );
187 $invalid->method(
'toRow' )
189 'ir_ipb_id' => $block->getId(),
202 $result = $this->blockRestrictionStore->insert( $restrictions );
205 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
218 $this->blockRestrictionStore->insert( [
222 $this->blockRestrictionStore->update( [
230 [
'ipblocks_restrictions' ],
232 [
'ir_ipb_id' => $block->getId() ]
236 $row = $result->fetchObject();
237 $this->
assertEquals( $block->getId(), $row->ir_ipb_id );
238 $this->
assertEquals( $pageBar->getId(), $row->ir_value );
250 $this->blockRestrictionStore->update( [
256 [
'ipblocks_restrictions' ],
258 [
'ir_ipb_id' => $block->getId() ]
262 $row = $result->fetchObject();
263 $this->
assertEquals( $block->getId(), $row->ir_ipb_id );
275 $this->blockRestrictionStore->update( [] );
279 [
'ipblocks_restrictions' ],
281 [
'ir_ipb_id' => $block->getId() ]
295 $this->blockRestrictionStore->insert( [
299 $this->blockRestrictionStore->update( [
305 [
'ipblocks_restrictions' ],
307 [
'ir_ipb_id' => $block->getId() ]
311 $row = $result->fetchObject();
312 $this->
assertEquals( $block->getId(), $row->ir_ipb_id );
324 $this->blockRestrictionStore->insert( [
327 $autoblockId = $block->doAutoblock(
'127.0.0.1' );
330 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
332 $this->
assertEquals( $pageFoo->getId(), $restrictions[0]->getValue() );
335 $restrictions = $this->blockRestrictionStore->loadByBlockId( $autoblockId );
337 $this->
assertEquals( $pageFoo->getId(), $restrictions[0]->getValue() );
340 $this->blockRestrictionStore->updateByParentBlockId( $block->getId(), [
345 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
347 $this->
assertEquals( $pageFoo->getId(), $restrictions[0]->getValue() );
350 $restrictions = $this->blockRestrictionStore->loadByBlockId( $autoblockId );
352 $this->
assertEquals( $pageBar->getId(), $restrictions[0]->getValue() );
362 $this->blockRestrictionStore->insert( [
365 $autoblockId = $block->doAutoblock(
'127.0.0.1' );
368 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
372 $restrictions = $this->blockRestrictionStore->loadByBlockId( $autoblockId );
376 $this->blockRestrictionStore->updateByParentBlockId( $block->getId(), [] );
379 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
383 $restrictions = $this->blockRestrictionStore->loadByBlockId( $autoblockId );
394 $this->blockRestrictionStore->insert( [
399 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
403 $this->blockRestrictionStore->updateByParentBlockId( $block->getId(), $restrictions );
406 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
416 $this->blockRestrictionStore->insert( [
420 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
423 $result = $this->blockRestrictionStore->delete(
428 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
438 $this->blockRestrictionStore->insert( [
442 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
445 $result = $this->blockRestrictionStore->deleteByBlockId( $block->getId() );
448 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
459 $this->blockRestrictionStore->insert( [
462 $autoblockId = $block->doAutoblock(
'127.0.0.1' );
465 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
469 $restrictions = $this->blockRestrictionStore->loadByBlockId( $autoblockId );
473 $result = $this->blockRestrictionStore->deleteByParentBlockId( $block->getId() );
478 $restrictions = $this->blockRestrictionStore->loadByBlockId( $block->getId() );
482 $restrictions = $this->blockRestrictionStore->loadByBlockId( $autoblockId );
495 $this->
assertSame( $expected, $this->blockRestrictionStore->equals( $a, $b ) );
571 $this->
assertSame( 1, $restrictions[1]->getBlockId() );
572 $this->
assertSame( 1, $restrictions[2]->getBlockId() );
573 $this->
assertSame( 1, $restrictions[3]->getBlockId() );
575 $result = $this->blockRestrictionStore->setBlockId( 2, $restrictions );
577 foreach ( $result as $restriction ) {
578 $this->
assertSame( 2, $restriction->getBlockId() );
587 'address' => $badActor->getName(),
588 'user' => $badActor->getId(),
589 'by' => $sysop->getId(),
590 'expiry' =>
'infinity',
592 'enableAutoblock' =>
true,
601 $this->db->insert(
'ipblocks_restrictions', [
602 'ir_ipb_id' => $blockId,
609 $this->db->delete(
'ipblocks',
'*', __METHOD__ );
610 $this->db->delete(
'ipblocks_restrictions',
'*', __METHOD__ );
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
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
processing should stop and the error should be shown to the user * false
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))