Event Timeline
Comment Actions
Current table
CREATE TABLE /*_*/ipblocks_restrictions ( -- The ipb_id from ipblocks ir_ipb_id int NOT NULL, -- The restriction type id. ir_type tinyint(1) NOT NULL, -- The restriction id that corrposponds to the type. Typically a Page ID or a -- Namespace ID. ir_value int NOT NULL, PRIMARY KEY (ir_ipb_id, ir_type, ir_value) ) /*$wgDBTableOptions*/;
Example query
MariaDB [enwiki_p]> SELECT ir_ipb_id, CASE WHEN ( ir_type = 1 ) THEN 'page' ELSE 'namespace' END AS 'type', ir_value FROM ipblocks_restrictions LIMIT 25; +-----------+-----------+----------+ | ir_ipb_id | type | ir_value | +-----------+-----------+----------+ | 9435157 | namespace | 4 | | 9495590 | page | 57861199 | | 9497043 | page | 30859855 | | 9498101 | page | 2333491 | | 9498101 | page | 42165878 | | 9517403 | page | 28280067 | | 9517475 | page | 50803 | | 9517475 | page | 87276 | | 9517475 | page | 19629641 | | 9517475 | page | 21347867 | | 9517475 | page | 23871476 | | 9517475 | page | 25169060 | | 9517475 | page | 61818020 | | 9531962 | page | 24758230 | | 9533323 | page | 497526 | | 9536130 | page | 2015570 | | 9540101 | namespace | 0 | | 9542727 | page | 165094 | | 9559276 | namespace | 0 | | 9559540 | page | 654157 | | 9561071 | page | 59625567 | | 9561107 | page | 62990726 | | 9562223 | page | 585629 | | 9562223 | page | 21486360 | | 9563237 | page | 34355486 | +-----------+-----------+----------+
Comment Actions
Restriction::matches only receives a title - use the special page? Or don't use, and instead implement some other way?
Comment Actions
Special:MovePage and Special:Upload (and Special:Thanks) exist, but there isn't one for page creation. Hack Special:CreatePage?
Comment Actions
AbstractBlock::appliesToRight
/** * Determine whether the block prevents a given right. A right * may be blacklisted or whitelisted, or determined from a * property on the block object. For certain rights, the property * may be overridden according to global configs. * * @since 1.33 * @param string $right * @return bool|null The block applies to the right, or null if * unsure (e.g. unrecognized right or unset property) */ public function appliesToRight( $right ) { $config = RequestContext::getMain()->getConfig(); $blockDisablesLogin = $config->get( 'BlockDisablesLogin' ); $res = null; switch ( $right ) { case 'edit': // TODO: fix this case to return proper value $res = true; break; case 'createaccount': $res = $this->isCreateAccountBlocked(); break; case 'sendemail': $res = $this->isEmailBlocked(); break; case 'upload': // Until T6995 is completed $res = $this->isSitewide(); break; case 'read': $res = false; break; case 'purge': $res = false; break; } if ( !$res && $blockDisablesLogin ) { // If a block would disable login, then it should // prevent any right that all users cannot do $permissionManager = MediaWikiServices::getInstance()->getPermissionManager(); $anon = new User; $res = $permissionManager->userHasRight( $anon, $right ) ? $res : true; } return $res; }
Should work for create, move, and upload - no right is needed for thanks?