我想限制所有管理员对任何php文件的编辑权限(如Theme+plugin editor 等等……)
我开发了一个插件,名为System Edit Restriction.
目前,我使用此代码进行限制:
define( \'DISALLOW_FILE_EDIT\', true );
define( \'DISALLOW_FILE_MODS\', true );
$restricted_places = array(\'widgets.php\',\'widgets.php\',\'user-new.php\', \'upgrade-functions.php\',\'upgrade.php\', \'themes.php\', \'theme-install.php\', \'theme-editor.php\',\'setup-config.php\',\'plugins.php\', \'plugin-install.php\',\'options-head.php\',\'network.php\', \'ms-users.php\',\'ms-upgrade-network.php\',\'ms-themes.php\', \'ms-sites.php\',\'ms-options.php\',\'ms-edit.php\',\'ms-delete-site.php\',\'ms-admin.php\',\'moderation.php\',\'menu-header.php\',\'menu.php\',\'edit-comments.php\',
//any 3rd party plugins\' menu pages, added under "settings"
\'page=\'
);
foreach ( $restricted_places as $restriction ) { if ( stripos($_SERVER[\'REQUEST_URI\'],$restriction) !== false) {exit;} }
我错过什么了吗?任何管理员都可以进行AJAX调用(或etc),从而绕过me代码吗?