Manual:Block and unblock/zh

管理员可以封禁或解除封禁IP地址（如果用户名封禁被启用还可以封禁或解除封禁注册用户）. 被封禁用户无法编辑页面、上传文件、移动页面，并且如果被封禁的用户先前拥有保护页面、解除页面保护以及删除、还原页面的权限，被封禁后他们将不能进行这些操作. 非常重要的一点是封禁是属于保护性质的操作而非惩罚性质的操作.

封禁
封禁操作可以通过特殊页面 Special:Block 做出. 进行封禁操作有以下几个步骤：


 * 1) 明确封禁的是IP地址还是注册用户.  在表单的“”字段中输入被封禁的IP地址或者注册用户的用户名.  请注意：不存在的用户也能被封禁，所以请确定您输入的用户名是正确的.  您也可以封禁IP段，参考中的操作步骤.
 * 2) 决定封禁的期限.  您可以在下拉菜单“”中选择一个预先定义好的封禁期限，也可选择“其他”选项后输入一个自定义的符合GNU标准形式的值.  如果被封禁的期限是“永久”，那么封禁将永不失效，除非被封禁的IP或者注册用户在将来被管理员解除封禁.
 * 3) 确定封禁的理由（可选）.  这个理由将被显示在被封禁用户尝试编辑页面的错误提示中.

点击“”完成封禁操作. 所有的封禁会被记录在封禁日志中，并且所有当前生效中的封禁会被列在被封禁用户中.

您除了可以在Special:Block中手动输入被封禁的IP地址或用户名，还可以在访问用户或者用户讨论页时点击侧边栏工具的“”链接. 在最近更改或者页面历史中，您也可以点击用户名或IP地址右侧的“”链接.

封禁选项
在MediaWiki 1.8及之后的版本中，一些额外的封禁选项被加入. 这些选项可以通过勾选封禁页面中的确认框来启用.


 * 仅封禁匿名用户（这也被称为软封禁）: 这个选项修改了封禁IP地址时的影响. 当该选项启用时，这个封禁将仅对匿名用户使用该IP地址的产生影响.  注册用户以该IP地址进行编辑不会受到影响. 这个选项对于封禁注册用户没有任何作用，但对由此产生的自动封禁是有效的.


 * 阻止创建新用户: 这个选项在封禁IP地址以及封禁注册用户时有效 当该选项被启用时，在封禁期间使用该IP地址进行创建新用户的操作将被阻止.


 * 自动封禁该用户使用的IP地址及其之后尝试使用的IP地址: 这个选项将会在封禁注册用户时起作用. 如果启用，自动封禁将会对被封禁用户使用的最后一个IP地址以及之后该被封禁用户尝试使用的IP地址进行封禁.

解除封禁
可以通过被封禁用户特殊页面来解除对IP地址或注册用户的封禁. Find the IP address or registered user account you wish to unblock in the list (you can enter the address or name in the "search" field to help you find the entry), and click the "Unblock" link displayed to the right of the block's expiry time.

This will lead you to a confirmation page. Enter the reason for unblocking (optional) in the "reason" field, and click "unblock this address" to remove the block. All unblockings are recorded in the block log.

Note that if a range is blocked, then the unblock must cover the whole range to be effective. Attempting to unblock an individual IP address in the range will not be effective.

Effects of being blocked
Blocked users may still read pages, but they may not create, edit or move pages, or upload files. Users with certain other user rights will not be able to use those rights when they are blocked. For example, users with the rights to delete and undelete or protect and unprotect pages will not be able to do so when they are blocked. However, users with the rights to block and unblock users will still be able to do so when they are blocked, including any blocks on their own account.

Users who are blocked and attempt to edit a page (or move a page, or upload a file) will see the "user is blocked" message informing them that they have been blocked.

If the autoblock option has been enabled with respect to a block, and the blocked user attempts to edit (or move a page, or upload a file), the IP address being used by that user will also be blocked.

Configuration settings related to blocking
The configuration options below can be set in and can be used to enable or disable certain aspects of the blocking interface.


 * - controls the ability for sysops to block usernames. This is true by default. If a sysop tries to block a registered user account and this setting is not enabled, then an error message will be displayed, informing the sysop that the "IP Address does not exist".
 * - controls the ability for sysops to block ranges of IP address. This is true by default.
 * - controls how many seconds need to pass until a block on an "autoblocked" IP address will expire. The default is 86400 seconds, which is the same as 24 hours (one day)
 * - controls whether or not a blocked user is able to edit their own user talk page. This is false by default. The ability to disable the ability of a blocked user to edit their own user talk page, when this variable is true, is an option available in Special:Block.
 * and the blockemail user right control the ability for sysops to prevent users from using the Special:EmailUser interface.  is true by default.
 * - controls if blocked users will be allowed to login. This is false by default.
 * The hideuser user right controls the ability for sysops to prevent a blocked user from appearing in the block log, the active block list, and the user list.

MediaWiki: pages

 * MediaWiki:ipboptions - contains a list of suggested block durations
 * MediaWiki:ipb-default-expiry - allows customization of the default duration in the blocking form (if left unchanged, the default duration is "other")
 * More blocking-related interface messages

URL parameters
Special:Block accepts some URL parameters to prepopulate the HTML form:


 * - username/IP address
 * - expiry time
 * - autoblock setting (=1 or =0)
 * - hard block setting (=1 or =0)
 * - prevent account creation (=1 or =0)
 * - reason, from selection of MediaWiki:Ipbreason-dropdown
 * - prepopulating "other reason" text field

''Example use: w:Template:Emergency-bot-shutoff. See also: ''

Hooks

 * Manual:Hooks/BlockIp, occurs whenever the software receives a request to block an IP address or user
 * Manual:Hooks/BlockIpComplete, occurs after the request to block an IP or user has been processed
 * Manual:Hooks/GetBlockedStatus, fired after the user's getBlockStatus is set