maintenance: Script to rename titles for Unicode uppercasing changes
[lhc/web/wiklou.git] / tests / phpunit / includes / BlockTest.php
1 <?php
2
3 use MediaWiki\Block\BlockRestrictionStore;
4 use MediaWiki\Block\Restriction\PageRestriction;
5 use MediaWiki\Block\Restriction\NamespaceRestriction;
6 use MediaWiki\MediaWikiServices;
7
8 /**
9 * @group Database
10 * @group Blocking
11 */
12 class BlockTest extends MediaWikiLangTestCase {
13
14 /**
15 * @return User
16 */
17 private function getUserForBlocking() {
18 $testUser = $this->getMutableTestUser();
19 $user = $testUser->getUser();
20 $user->addToDatabase();
21 TestUser::setPasswordForUser( $user, 'UTBlockeePassword' );
22 $user->saveSettings();
23 return $user;
24 }
25
26 /**
27 * @param User $user
28 *
29 * @return Block
30 * @throws MWException
31 */
32 private function addBlockForUser( User $user ) {
33 // Delete the last round's block if it's still there
34 $oldBlock = Block::newFromTarget( $user->getName() );
35 if ( $oldBlock ) {
36 // An old block will prevent our new one from saving.
37 $oldBlock->delete();
38 }
39
40 $blockOptions = [
41 'address' => $user->getName(),
42 'user' => $user->getId(),
43 'by' => $this->getTestSysop()->getUser()->getId(),
44 'reason' => 'Parce que',
45 'expiry' => time() + 100500,
46 ];
47 $block = new Block( $blockOptions );
48
49 $block->insert();
50 // save up ID for use in assertion. Since ID is an autoincrement,
51 // its value might change depending on the order the tests are run.
52 // ApiBlockTest insert its own blocks!
53 if ( !$block->getId() ) {
54 throw new MWException( "Failed to insert block for BlockTest; old leftover block remaining?" );
55 }
56
57 $this->addXffBlocks();
58
59 return $block;
60 }
61
62 /**
63 * @covers Block::newFromTarget
64 */
65 public function testINewFromTargetReturnsCorrectBlock() {
66 $user = $this->getUserForBlocking();
67 $block = $this->addBlockForUser( $user );
68
69 $this->assertTrue(
70 $block->equals( Block::newFromTarget( $user->getName() ) ),
71 "newFromTarget() returns the same block as the one that was made"
72 );
73 }
74
75 /**
76 * @covers Block::newFromID
77 */
78 public function testINewFromIDReturnsCorrectBlock() {
79 $user = $this->getUserForBlocking();
80 $block = $this->addBlockForUser( $user );
81
82 $this->assertTrue(
83 $block->equals( Block::newFromID( $block->getId() ) ),
84 "newFromID() returns the same block as the one that was made"
85 );
86 }
87
88 /**
89 * per T28425
90 * @covers Block::__construct
91 */
92 public function testT28425BlockTimestampDefaultsToTime() {
93 $user = $this->getUserForBlocking();
94 $block = $this->addBlockForUser( $user );
95 $madeAt = wfTimestamp( TS_MW );
96
97 // delta to stop one-off errors when things happen to go over a second mark.
98 $delta = abs( $madeAt - $block->getTimestamp() );
99 $this->assertLessThan(
100 2,
101 $delta,
102 "If no timestamp is specified, the block is recorded as time()"
103 );
104 }
105
106 /**
107 * CheckUser since being changed to use Block::newFromTarget started failing
108 * because the new function didn't accept empty strings like Block::load()
109 * had. Regression T31116.
110 *
111 * @dataProvider provideT31116Data
112 * @covers Block::newFromTarget
113 */
114 public function testT31116NewFromTargetWithEmptyIp( $vagueTarget ) {
115 $user = $this->getUserForBlocking();
116 $initialBlock = $this->addBlockForUser( $user );
117 $block = Block::newFromTarget( $user->getName(), $vagueTarget );
118
119 $this->assertTrue(
120 $initialBlock->equals( $block ),
121 "newFromTarget() returns the same block as the one that was made when "
122 . "given empty vagueTarget param " . var_export( $vagueTarget, true )
123 );
124 }
125
126 public static function provideT31116Data() {
127 return [
128 [ null ],
129 [ '' ],
130 [ false ]
131 ];
132 }
133
134 /**
135 * @covers Block::appliesToRight
136 */
137 public function testBlockedUserCanNotCreateAccount() {
138 $username = 'BlockedUserToCreateAccountWith';
139 $u = User::newFromName( $username );
140 $u->addToDatabase();
141 $userId = $u->getId();
142 $this->assertNotEquals( 0, $userId, 'sanity' );
143 TestUser::setPasswordForUser( $u, 'NotRandomPass' );
144 unset( $u );
145
146 // Sanity check
147 $this->assertNull(
148 Block::newFromTarget( $username ),
149 "$username should not be blocked"
150 );
151
152 // Reload user
153 $u = User::newFromName( $username );
154 $this->assertFalse(
155 $u->isBlockedFromCreateAccount(),
156 "Our sandbox user should be able to create account before being blocked"
157 );
158
159 // Foreign perspective (blockee not on current wiki)...
160 $blockOptions = [
161 'address' => $username,
162 'user' => $userId,
163 'reason' => 'crosswiki block...',
164 'timestamp' => wfTimestampNow(),
165 'expiry' => $this->db->getInfinity(),
166 'createAccount' => true,
167 'enableAutoblock' => true,
168 'hideName' => true,
169 'blockEmail' => true,
170 'byText' => 'm>MetaWikiUser',
171 ];
172 $block = new Block( $blockOptions );
173 $block->insert();
174
175 // Reload block from DB
176 $userBlock = Block::newFromTarget( $username );
177 $this->assertTrue(
178 (bool)$block->appliesToRight( 'createaccount' ),
179 "Block object in DB should block right 'createaccount'"
180 );
181
182 $this->assertInstanceOf(
183 Block::class,
184 $userBlock,
185 "'$username' block block object should be existent"
186 );
187
188 // Reload user
189 $u = User::newFromName( $username );
190 $this->assertTrue(
191 (bool)$u->isBlockedFromCreateAccount(),
192 "Our sandbox user '$username' should NOT be able to create account"
193 );
194 }
195
196 /**
197 * @covers Block::insert
198 */
199 public function testCrappyCrossWikiBlocks() {
200 // Delete the last round's block if it's still there
201 $oldBlock = Block::newFromTarget( 'UserOnForeignWiki' );
202 if ( $oldBlock ) {
203 // An old block will prevent our new one from saving.
204 $oldBlock->delete();
205 }
206
207 // Local perspective (blockee on current wiki)...
208 $user = User::newFromName( 'UserOnForeignWiki' );
209 $user->addToDatabase();
210 $userId = $user->getId();
211 $this->assertNotEquals( 0, $userId, 'sanity' );
212
213 // Foreign perspective (blockee not on current wiki)...
214 $blockOptions = [
215 'address' => 'UserOnForeignWiki',
216 'user' => $user->getId(),
217 'reason' => 'crosswiki block...',
218 'timestamp' => wfTimestampNow(),
219 'expiry' => $this->db->getInfinity(),
220 'createAccount' => true,
221 'enableAutoblock' => true,
222 'hideName' => true,
223 'blockEmail' => true,
224 'byText' => 'Meta>MetaWikiUser',
225 ];
226 $block = new Block( $blockOptions );
227
228 $res = $block->insert( $this->db );
229 $this->assertTrue( (bool)$res['id'], 'Block succeeded' );
230
231 $user = null; // clear
232
233 $block = Block::newFromID( $res['id'] );
234 $this->assertEquals(
235 'UserOnForeignWiki',
236 $block->getTarget()->getName(),
237 'Correct blockee name'
238 );
239 $this->assertEquals( $userId, $block->getTarget()->getId(), 'Correct blockee id' );
240 $this->assertEquals( 'Meta>MetaWikiUser', $block->getBlocker()->getName(),
241 'Correct blocker name' );
242 $this->assertEquals( 'Meta>MetaWikiUser', $block->getByName(), 'Correct blocker name' );
243 $this->assertEquals( 0, $block->getBy(), 'Correct blocker id' );
244 }
245
246 protected function addXffBlocks() {
247 static $inited = false;
248
249 if ( $inited ) {
250 return;
251 }
252
253 $inited = true;
254
255 $blockList = [
256 [ 'target' => '70.2.0.0/16',
257 'type' => Block::TYPE_RANGE,
258 'desc' => 'Range Hardblock',
259 'ACDisable' => false,
260 'isHardblock' => true,
261 'isAutoBlocking' => false,
262 ],
263 [ 'target' => '2001:4860:4001::/48',
264 'type' => Block::TYPE_RANGE,
265 'desc' => 'Range6 Hardblock',
266 'ACDisable' => false,
267 'isHardblock' => true,
268 'isAutoBlocking' => false,
269 ],
270 [ 'target' => '60.2.0.0/16',
271 'type' => Block::TYPE_RANGE,
272 'desc' => 'Range Softblock with AC Disabled',
273 'ACDisable' => true,
274 'isHardblock' => false,
275 'isAutoBlocking' => false,
276 ],
277 [ 'target' => '50.2.0.0/16',
278 'type' => Block::TYPE_RANGE,
279 'desc' => 'Range Softblock',
280 'ACDisable' => false,
281 'isHardblock' => false,
282 'isAutoBlocking' => false,
283 ],
284 [ 'target' => '50.1.1.1',
285 'type' => Block::TYPE_IP,
286 'desc' => 'Exact Softblock',
287 'ACDisable' => false,
288 'isHardblock' => false,
289 'isAutoBlocking' => false,
290 ],
291 ];
292
293 $blocker = $this->getTestUser()->getUser();
294 foreach ( $blockList as $insBlock ) {
295 $target = $insBlock['target'];
296
297 if ( $insBlock['type'] === Block::TYPE_IP ) {
298 $target = User::newFromName( IP::sanitizeIP( $target ), false )->getName();
299 } elseif ( $insBlock['type'] === Block::TYPE_RANGE ) {
300 $target = IP::sanitizeRange( $target );
301 }
302
303 $block = new Block();
304 $block->setTarget( $target );
305 $block->setBlocker( $blocker );
306 $block->setReason( $insBlock['desc'] );
307 $block->setExpiry( 'infinity' );
308 $block->isCreateAccountBlocked( $insBlock['ACDisable'] );
309 $block->isHardblock( $insBlock['isHardblock'] );
310 $block->isAutoblocking( $insBlock['isAutoBlocking'] );
311 $block->insert();
312 }
313 }
314
315 public static function providerXff() {
316 return [
317 [ 'xff' => '1.2.3.4, 70.2.1.1, 60.2.1.1, 2.3.4.5',
318 'count' => 2,
319 'result' => 'Range Hardblock'
320 ],
321 [ 'xff' => '1.2.3.4, 50.2.1.1, 60.2.1.1, 2.3.4.5',
322 'count' => 2,
323 'result' => 'Range Softblock with AC Disabled'
324 ],
325 [ 'xff' => '1.2.3.4, 70.2.1.1, 50.1.1.1, 2.3.4.5',
326 'count' => 2,
327 'result' => 'Exact Softblock'
328 ],
329 [ 'xff' => '1.2.3.4, 70.2.1.1, 50.2.1.1, 50.1.1.1, 2.3.4.5',
330 'count' => 3,
331 'result' => 'Exact Softblock'
332 ],
333 [ 'xff' => '1.2.3.4, 70.2.1.1, 50.2.1.1, 2.3.4.5',
334 'count' => 2,
335 'result' => 'Range Hardblock'
336 ],
337 [ 'xff' => '1.2.3.4, 70.2.1.1, 60.2.1.1, 2.3.4.5',
338 'count' => 2,
339 'result' => 'Range Hardblock'
340 ],
341 [ 'xff' => '50.2.1.1, 60.2.1.1, 2.3.4.5',
342 'count' => 2,
343 'result' => 'Range Softblock with AC Disabled'
344 ],
345 [ 'xff' => '1.2.3.4, 50.1.1.1, 60.2.1.1, 2.3.4.5',
346 'count' => 2,
347 'result' => 'Exact Softblock'
348 ],
349 [ 'xff' => '1.2.3.4, <$A_BUNCH-OF{INVALID}TEXT\>, 60.2.1.1, 2.3.4.5',
350 'count' => 1,
351 'result' => 'Range Softblock with AC Disabled'
352 ],
353 [ 'xff' => '1.2.3.4, 50.2.1.1, 2001:4860:4001:802::1003, 2.3.4.5',
354 'count' => 2,
355 'result' => 'Range6 Hardblock'
356 ],
357 ];
358 }
359
360 /**
361 * @dataProvider providerXff
362 * @covers Block::getBlocksForIPList
363 * @covers Block::chooseBlock
364 */
365 public function testBlocksOnXff( $xff, $exCount, $exResult ) {
366 $user = $this->getUserForBlocking();
367 $this->addBlockForUser( $user );
368
369 $list = array_map( 'trim', explode( ',', $xff ) );
370 $xffblocks = Block::getBlocksForIPList( $list, true );
371 $this->assertEquals( $exCount, count( $xffblocks ), 'Number of blocks for ' . $xff );
372 $block = Block::chooseBlock( $xffblocks, $list );
373 $this->assertEquals(
374 $exResult, $block->getReason(), 'Correct block type for XFF header ' . $xff
375 );
376 }
377
378 /**
379 * @covers Block::getSystemBlockType
380 * @covers Block::insert
381 * @covers Block::doAutoblock
382 */
383 public function testSystemBlocks() {
384 $user = $this->getUserForBlocking();
385 $this->addBlockForUser( $user );
386
387 $blockOptions = [
388 'address' => $user->getName(),
389 'reason' => 'test system block',
390 'timestamp' => wfTimestampNow(),
391 'expiry' => $this->db->getInfinity(),
392 'byText' => 'MediaWiki default',
393 'systemBlock' => 'test',
394 'enableAutoblock' => true,
395 ];
396 $block = new Block( $blockOptions );
397
398 $this->assertSame( 'test', $block->getSystemBlockType() );
399
400 try {
401 $block->insert();
402 $this->fail( 'Expected exception not thrown' );
403 } catch ( MWException $ex ) {
404 $this->assertSame( 'Cannot insert a system block into the database', $ex->getMessage() );
405 }
406
407 try {
408 $block->doAutoblock( '192.0.2.2' );
409 $this->fail( 'Expected exception not thrown' );
410 } catch ( MWException $ex ) {
411 $this->assertSame( 'Cannot autoblock from a system block', $ex->getMessage() );
412 }
413 }
414
415 /**
416 * @covers Block::newFromRow
417 */
418 public function testNewFromRow() {
419 $badActor = $this->getTestUser()->getUser();
420 $sysop = $this->getTestSysop()->getUser();
421
422 $block = new Block( [
423 'address' => $badActor->getName(),
424 'user' => $badActor->getId(),
425 'by' => $sysop->getId(),
426 'expiry' => 'infinity',
427 ] );
428 $block->insert();
429
430 $blockQuery = Block::getQueryInfo();
431 $row = $this->db->select(
432 $blockQuery['tables'],
433 $blockQuery['fields'],
434 [
435 'ipb_id' => $block->getId(),
436 ],
437 __METHOD__,
438 [],
439 $blockQuery['joins']
440 )->fetchObject();
441
442 $block = Block::newFromRow( $row );
443 $this->assertInstanceOf( Block::class, $block );
444 $this->assertEquals( $block->getBy(), $sysop->getId() );
445 $this->assertEquals( $block->getTarget()->getName(), $badActor->getName() );
446 $block->delete();
447 }
448
449 /**
450 * @covers Block::equals
451 */
452 public function testEquals() {
453 $block = new Block();
454
455 $this->assertTrue( $block->equals( $block ) );
456
457 $partial = new Block( [
458 'sitewide' => false,
459 ] );
460 $this->assertFalse( $block->equals( $partial ) );
461 }
462
463 /**
464 * @covers Block::isSitewide
465 */
466 public function testIsSitewide() {
467 $block = new Block();
468 $this->assertTrue( $block->isSitewide() );
469
470 $block = new Block( [
471 'sitewide' => true,
472 ] );
473 $this->assertTrue( $block->isSitewide() );
474
475 $block = new Block( [
476 'sitewide' => false,
477 ] );
478 $this->assertFalse( $block->isSitewide() );
479
480 $block = new Block( [
481 'sitewide' => false,
482 ] );
483 $block->isSitewide( true );
484 $this->assertTrue( $block->isSitewide() );
485 }
486
487 /**
488 * @covers Block::getRestrictions
489 * @covers Block::setRestrictions
490 */
491 public function testRestrictions() {
492 $block = new Block();
493 $restrictions = [
494 new PageRestriction( 0, 1 )
495 ];
496 $block->setRestrictions( $restrictions );
497
498 $this->assertSame( $restrictions, $block->getRestrictions() );
499 }
500
501 /**
502 * @covers Block::getRestrictions
503 * @covers Block::insert
504 */
505 public function testRestrictionsFromDatabase() {
506 $badActor = $this->getTestUser()->getUser();
507 $sysop = $this->getTestSysop()->getUser();
508
509 $block = new Block( [
510 'address' => $badActor->getName(),
511 'user' => $badActor->getId(),
512 'by' => $sysop->getId(),
513 'expiry' => 'infinity',
514 ] );
515 $page = $this->getExistingTestPage( 'Foo' );
516 $restriction = new PageRestriction( 0, $page->getId() );
517 $block->setRestrictions( [ $restriction ] );
518 $block->insert();
519
520 // Refresh the block from the database.
521 $block = Block::newFromID( $block->getId() );
522 $restrictions = $block->getRestrictions();
523 $this->assertCount( 1, $restrictions );
524 $this->assertTrue( $restriction->equals( $restrictions[0] ) );
525 $block->delete();
526 }
527
528 /**
529 * @covers Block::insert
530 */
531 public function testInsertExistingBlock() {
532 $badActor = $this->getTestUser()->getUser();
533 $sysop = $this->getTestSysop()->getUser();
534
535 $block = new Block( [
536 'address' => $badActor->getName(),
537 'user' => $badActor->getId(),
538 'by' => $sysop->getId(),
539 'expiry' => 'infinity',
540 ] );
541 $page = $this->getExistingTestPage( 'Foo' );
542 $restriction = new PageRestriction( 0, $page->getId() );
543 $block->setRestrictions( [ $restriction ] );
544 $block->insert();
545
546 // Insert the block again, which should result in a failur
547 $result = $block->insert();
548
549 $this->assertFalse( $result );
550
551 // Ensure that there are no restrictions where the blockId is 0.
552 $count = $this->db->selectRowCount(
553 'ipblocks_restrictions',
554 '*',
555 [ 'ir_ipb_id' => 0 ],
556 __METHOD__
557 );
558 $this->assertSame( 0, $count );
559
560 $block->delete();
561 }
562
563 /**
564 * @covers Block::appliesToTitle
565 */
566 public function testAppliesToTitleReturnsTrueOnSitewideBlock() {
567 $this->setMwGlobals( [
568 'wgBlockDisablesLogin' => false,
569 ] );
570 $user = $this->getTestUser()->getUser();
571 $block = new Block( [
572 'expiry' => wfTimestamp( TS_MW, wfTimestamp() + ( 40 * 60 * 60 ) ),
573 'allowUsertalk' => true,
574 'sitewide' => true
575 ] );
576
577 $block->setTarget( $user );
578 $block->setBlocker( $this->getTestSysop()->getUser() );
579 $block->insert();
580
581 $title = $this->getExistingTestPage( 'Foo' )->getTitle();
582
583 $this->assertTrue( $block->appliesToTitle( $title ) );
584
585 // appliesToTitle() ignores allowUsertalk
586 $title = $user->getTalkPage();
587 $this->assertTrue( $block->appliesToTitle( $title ) );
588
589 $block->delete();
590 }
591
592 /**
593 * @covers Block::appliesToTitle
594 */
595 public function testAppliesToTitleOnPartialBlock() {
596 $this->setMwGlobals( [
597 'wgBlockDisablesLogin' => false,
598 ] );
599 $user = $this->getTestUser()->getUser();
600 $block = new Block( [
601 'expiry' => wfTimestamp( TS_MW, wfTimestamp() + ( 40 * 60 * 60 ) ),
602 'allowUsertalk' => true,
603 'sitewide' => false
604 ] );
605
606 $block->setTarget( $user );
607 $block->setBlocker( $this->getTestSysop()->getUser() );
608 $block->insert();
609
610 $pageFoo = $this->getExistingTestPage( 'Foo' );
611 $pageBar = $this->getExistingTestPage( 'Bar' );
612 $pageJohn = $this->getExistingTestPage( 'User:John' );
613
614 $pageRestriction = new PageRestriction( $block->getId(), $pageFoo->getId() );
615 $namespaceRestriction = new NamespaceRestriction( $block->getId(), NS_USER );
616 $this->getBlockRestrictionStore()->insert( [ $pageRestriction, $namespaceRestriction ] );
617
618 $this->assertTrue( $block->appliesToTitle( $pageFoo->getTitle() ) );
619 $this->assertFalse( $block->appliesToTitle( $pageBar->getTitle() ) );
620 $this->assertTrue( $block->appliesToTitle( $pageJohn->getTitle() ) );
621
622 $block->delete();
623 }
624
625 /**
626 * @covers Block::appliesToNamespace
627 * @covers Block::appliesToPage
628 */
629 public function testAppliesToReturnsTrueOnSitewideBlock() {
630 $this->setMwGlobals( [
631 'wgBlockDisablesLogin' => false,
632 ] );
633 $user = $this->getTestUser()->getUser();
634 $block = new Block( [
635 'expiry' => wfTimestamp( TS_MW, wfTimestamp() + ( 40 * 60 * 60 ) ),
636 'allowUsertalk' => true,
637 'sitewide' => true
638 ] );
639
640 $block->setTarget( $user );
641 $block->setBlocker( $this->getTestSysop()->getUser() );
642 $block->insert();
643
644 $title = $this->getExistingTestPage()->getTitle();
645
646 $this->assertTrue( $block->appliesToPage( $title->getArticleID() ) );
647 $this->assertTrue( $block->appliesToNamespace( NS_MAIN ) );
648 $this->assertTrue( $block->appliesToNamespace( NS_USER_TALK ) );
649
650 $block->delete();
651 }
652
653 /**
654 * @covers Block::appliesToPage
655 */
656 public function testAppliesToPageOnPartialPageBlock() {
657 $this->setMwGlobals( [
658 'wgBlockDisablesLogin' => false,
659 ] );
660 $user = $this->getTestUser()->getUser();
661 $block = new Block( [
662 'expiry' => wfTimestamp( TS_MW, wfTimestamp() + ( 40 * 60 * 60 ) ),
663 'allowUsertalk' => true,
664 'sitewide' => false
665 ] );
666
667 $block->setTarget( $user );
668 $block->setBlocker( $this->getTestSysop()->getUser() );
669 $block->insert();
670
671 $title = $this->getExistingTestPage()->getTitle();
672
673 $pageRestriction = new PageRestriction(
674 $block->getId(),
675 $title->getArticleID()
676 );
677 $this->getBlockRestrictionStore()->insert( [ $pageRestriction ] );
678
679 $this->assertTrue( $block->appliesToPage( $title->getArticleID() ) );
680
681 $block->delete();
682 }
683
684 /**
685 * @covers Block::appliesToNamespace
686 */
687 public function testAppliesToNamespaceOnPartialNamespaceBlock() {
688 $this->setMwGlobals( [
689 'wgBlockDisablesLogin' => false,
690 ] );
691 $user = $this->getTestUser()->getUser();
692 $block = new Block( [
693 'expiry' => wfTimestamp( TS_MW, wfTimestamp() + ( 40 * 60 * 60 ) ),
694 'allowUsertalk' => true,
695 'sitewide' => false
696 ] );
697
698 $block->setTarget( $user );
699 $block->setBlocker( $this->getTestSysop()->getUser() );
700 $block->insert();
701
702 $namespaceRestriction = new NamespaceRestriction( $block->getId(), NS_MAIN );
703 $this->getBlockRestrictionStore()->insert( [ $namespaceRestriction ] );
704
705 $this->assertTrue( $block->appliesToNamespace( NS_MAIN ) );
706 $this->assertFalse( $block->appliesToNamespace( NS_USER ) );
707
708 $block->delete();
709 }
710
711 /**
712 * @covers Block::appliesToRight
713 */
714 public function testBlockAllowsPurge() {
715 $this->setMwGlobals( [
716 'wgBlockDisablesLogin' => false,
717 ] );
718 $block = new Block();
719 $this->assertFalse( $block->appliesToRight( 'purge' ) );
720 }
721
722 /**
723 * Get an instance of BlockRestrictionStore
724 *
725 * @return BlockRestrictionStore
726 */
727 protected function getBlockRestrictionStore() : BlockRestrictionStore {
728 return MediaWikiServices::getInstance()->getBlockRestrictionStore();
729 }
730 }