Manual:User table/zh

user表是MediaWiki用來儲存用戶資訊的地方. 如果使用Postgres，這個表會被命名為mwuser.

字段
''有的信息从 MediaWiki  目录的   改写而来. ''

user_id
user_id是主鍵，用於唯一地辨識用戶.

user_name
user_name: 用戶名必須是獨一無二的，並且不能是IP地址的格式. 不應該允許斜線或大小寫衝突. 参见. 允許空格，並下劃線會被轉換為空格（與頁面名稱相反）.

user_real_name
user_real_name儲存用戶在「偏好設定」中提供的真實姓名（選填）.

user_password
user_password使以下三種之一的格式，根據了和的設定：


 * 從MediaWiki 1.24開始，$wgPasswordDefault預設為pbkdf2. 这时你会得到以下各项的连接：
 * 字串「:pbkdf2:」.
 * pbkdf2层用的散列函数，默认是“sha512”.
 * 冒号（“:”）.
 * 算法的成本，默认“30000”.
 * 冒号（“:”）.
 * 子密钥长度；默认“64”.
 * 冒号（“:”）.
 * 散列算法的Base64编码的盐，例如“kkdejKlBYFV7+LP2m2thYA==”
 * 冒号（“:”）.
 * 最终是Base64编码的散列算法的结果（base64编码前（默认）长度是128字节） 用户密码明文的哈希值.
 * 自MediaWiki 1.24起，如果使用了維護腳本，密碼應以「:pbkdf2-legacyA:」或「:pbkdf2-legacyB:」為前綴，例如「:pbkdf2-legacyB:!sha256:10000:128!...」.
 * 在MediaWiki 1.23或更早版本，如果$wgPasswordSalt為true（預設），則是串聯以下內容：
 * 字符串“:B:”，
 * 偽隨機在0x0到0x7fff ffff（包含）之間的十六進位31位元鹽，
 * 冒號（「:」），和
 * 鹽、破折號（「-」）和密碼MD5雜湊串聯後的MD5雜湊.
 * 在MediaWiki 1.23或更早版本，如果$wgPasswordSalt為false，則是串聯以下內容：
 * 字符串":A:" 和
 * 密码的MD5哈希值.

user_newpassword
user_newpassword是寄送新密碼功能產生的值.

user_newpass_time
user_newpass_time在新密碼設定時被設為目前時間戳（wfTimestampNow）. 像是其他時間戳，這是以MediaWiki時間戳的格式（yyyymmddhhmmss，例如20130824025644）.

user_options
自MediaWiki 1.16起「user_options」不再使用. 参见.

On older versions of mediawiki, it is a newline-separated list of name=value pairs of the information of Special:Preferences. Old user accounts who haven't logged in since the field stopped being used may still have this field set.

user_touched
user_touched the last time a user logged in (not just mere visiting using an existing session), modified user settings, or got promoted into new user groups.

user_token
user_token是伪随机方法产生的值. When a user checks "Keep me logged in (for up to 365 days)" the value is stored in a persistent browser cookie  that authenticates the user while being resistant to spoofing.

user_email_authenticated
user_email_authenticated是用户验证了电子邮箱的时间的时间戳. 默认是NULL

user_email_token
user_email_token是用于确认电子邮箱地址的令牌. 参见 User.php 中的 User::newFromConfirmationCode

user_email_token_expires
user_email_token_expires is the expiration timestamp of the email token.

user_registration
user_registration是用户注册时间的时间戳. 对于老用户，此域可能有NULL值. 脚本可以用于事后填写此域.

user_editcount
user_editcount是用户大致的编辑次数和用户完成的像编辑一样的操作. 下列操作属于编辑：


 * Creating or modifying a MediaWiki page even if the revision or page is later deleted (i.e. making a non-null edit)
 * Creating or modifying a post on a Structured Discussions (former "Flow") board
 * Moving a page to a new title (since version 1.30)
 * The redirect created from a page move (since version 1.38, but see T296035 for the proposed revert)

This field is not an exactly accurate copy of. However, it should be roughly accurate if the update scripts are consistently run and it's the only place edit count data is available to the software, so it's still used for serious purposes like deciding whether accounts have been autopromoted.

有许多事情可以导致此值错误. 例如，它可能过时，或者对于老用户来说如果升级脚本（）没有运行，就会是NULL. 而且，某些删除操作可能不会正确影响它.

user_emailauthenticationtimestamp
在v1.4版本中移除.

user_password_expires
使用者密碼逾期日期；無逾期日期為null.

模式摘要
+--+--+--+-+--++ +--+--+--+-+--++ +--+--+--+-+--++
 * Field                   | Type             | Null | Key | Default                          | Extra          |
 * user_id                 | int(10) unsigned | NO   | PRI | NULL                             | auto_increment |
 * user_name               | varbinary(255)   | NO   | UNI |                                  |                |
 * user_real_name          | varbinary(255)   | NO   |     |                                  |                |
 * user_password           | tinyblob         | NO   |     | NULL                             |                |
 * user_newpassword        | tinyblob         | NO   |     | NULL                             |                |
 * user_newpass_time       | binary(14)       | YES  |     | NULL                             |                |
 * user_email              | tinyblob         | NO   | MUL | NULL                             |                |
 * user_touched            | binary(14)       | NO   |     | NULL                             |                |
 * user_token              | binary(32)       | NO   |     |                                  |                |
 * user_email_authenticated | binary(14)      | YES  |     | NULL                             |                |
 * user_email_token        | binary(32)       | YES  | MUL | NULL                             |                |
 * user_email_token_expires | binary(14)      | YES  |     | NULL                             |                |
 * user_registration       | binary(14)       | YES  |     | NULL                             |                |
 * user_editcount          | int(10) unsigned | YES  |     | NULL                             |                |
 * user_password_expires   | varbinary(14)    | YES  |     | NULL                             |                |

+--+--+--+-+--++ +--+--+--+-+--++ +--+--+--+-+--++
 * Field                   | Type             | Null | Key | Default                          | Extra          |
 * user_id                 | int(10) unsigned | NO   | PRI | NULL                             | auto_increment |
 * user_name               | varbinary(255)   | NO   | UNI |                                  |                |
 * user_real_name          | varbinary(255)   | NO   |     |                                  |                |
 * user_password           | tinyblob         | NO   |     | NULL                             |                |
 * user_newpassword        | tinyblob         | NO   |     | NULL                             |                |
 * user_newpass_time       | binary(14)       | YES  |     | NULL                             |                |
 * user_email              | tinyblob         | NO   | MUL | NULL                             |                |
 * user_touched            | binary(14)       | NO   |     | NULL                             |                |
 * user_token              | binary(32)       | NO   |     |                                  |                |
 * user_email_authenticated | binary(14)      | YES  |     | NULL                             |                |
 * user_email_token        | binary(32)       | YES  | MUL | NULL                             |                |
 * user_email_token_expires | binary(14)      | YES  |     | NULL                             |                |
 * user_registration       | binary(14)       | YES  |     | NULL                             |                |
 * user_editcount          | int(11)          | YES  |     | NULL                             |                |
 * user_password_expires   | varbinary(14)    | YES  |     | NULL                             |                |

+--+--+--+-+--++ +--+--+--+-+--++ +--+--+--+-+--++
 * Field                   | Type             | Null | Key | Default                          | Extra          |
 * user_id                 | int(10) unsigned | NO   | PRI | NULL                             | auto_increment |
 * user_name               | varbinary(255)   | NO   | UNI |                                  |                |
 * user_real_name          | varbinary(255)   | NO   |     |                                  |                |
 * user_password           | tinyblob         | NO   |     | NULL                             |                |
 * user_newpassword        | tinyblob         | NO   |     | NULL                             |                |
 * user_newpass_time       | binary(14)       | YES  |     | NULL                             |                |
 * user_email              | tinyblob         | NO   | MUL | NULL                             |                |
 * user_touched            | binary(14)       | NO   |     |                                  |                |
 * user_token              | binary(32)       | NO   |     |                                  |                |
 * user_email_authenticated | binary(14)      | YES  |     | NULL                             |                |
 * user_email_token        | binary(32)       | YES  | MUL | NULL                             |                |
 * user_email_token_expires | binary(14)      | YES  |     | NULL                             |                |
 * user_registration       | binary(14)       | YES  |     | NULL                             |                |
 * user_editcount          | int(11)          | YES  |     | NULL                             |                |
 * user_password_expires   | varbinary(14)    | YES  |     | NULL                             |                |

+--+-+--+-+-++ +--+-+--+-+-++ +--+-+--+-+-++
 * Field                   | Type                | Null | Key | Default | Extra          |
 * user_id                 | int(10) unsigned    | NO   | PRI | NULL    | AUTO_INCREMENT |
 * user_name               | varchar(255) binary | NO   | MUL | NULL    |                |
 * user_real_name          | varchar(255) binary | NO   |     | NULL    |                |
 * user_password           | tinyblob            | NO   |     | NULL    |                |
 * user_newpassword        | tinyblob            | NO   |     | NULL    |                |
 * user_newpass_time       | binary(14)          | YES  |     | NULL    |                |
 * user_email              | tinytext            | NO   | MUL | NULL    |                |
 * user_touched            | binary(14)          | NO   |     | NULL    |                |
 * user_token              | binary(32)          | NO   |     | NULL    |                |
 * user_email_authenticated | binary(14)         | YES  |     | NULL    |                |
 * user_email_token        | binary(32)          | YES  | MUL | NULL    |                |
 * user_email_token_expires | binary(14)         | YES  |     | NULL    |                |
 * user_registration       | binary(14)          | YES  |     | NULL    |                |
 * user_editcount          | int(11)             | YES  |     | NULL    |                |

+--+-+--+-+-++ +--+-+--+-+-++ +--+-+--+-+-++
 * Field                   | Type                | Null | Key | Default | Extra          |
 * user_id                 | int(10) unsigned    | NO   | PRI | NULL    | AUTO_INCREMENT |
 * user_name               | varchar(255) binary | NO   | MUL | NULL    |                |
 * user_real_name          | varchar(255) binary | NO   |     | NULL    |                |
 * user_password           | tinyblob            | NO   |     | NULL    |                |
 * user_newpassword        | tinyblob            | NO   |     | NULL    |                |
 * user_newpass_time       | binary(14)          | YES  |     | NULL    |                |
 * user_email              | tinytext            | NO   | MUL | NULL    |                |
 * user_options            | blob                | NO   |     | NULL    |                |
 * user_touched            | binary(14)          | NO   |     | NULL    |                |
 * user_token              | binary(32)          | NO   |     | NULL    |                |
 * user_email_authenticated | binary(14)         | YES  |     | NULL    |                |
 * user_email_token        | binary(32)          | YES  | MUL | NULL    |                |
 * user_email_token_expires | binary(14)         | YES  |     | NULL    |                |
 * user_registration       | binary(14)          | YES  |     | NULL    |                |
 * user_editcount          | int(11)             | YES  |     | NULL    |                |

+--+-+--+-+-++ +--+-+--+-+-++ +--+-+--+-+-++
 * Field                   | Type                | Null | Key | Default | Extra          |
 * user_id                 | int(10) unsigned    | NO   | PRI | NULL    | AUTO_INCREMENT |
 * user_name               | varchar(255) binary | NO   | MUL | NULL    |                |
 * user_real_name          | varchar(255) binary | NO   |     | NULL    |                |
 * user_password           | tinyblob            | NO   |     | NULL    |                |
 * user_newpassword        | tinyblob            | NO   |     | NULL    |                |
 * user_newpass_time       | binary(14)          | YES  |     | NULL    |                |
 * user_email              | tinytext            | NO   |     | NULL    |                |
 * user_options            | blob                | NO   |     | NULL    |                |
 * user_touched            | binary(14)          | NO   |     | NULL    |                |
 * user_token              | binary(32)          | NO   |     | NULL    |                |
 * user_email_authenticated | binary(14)         | YES  |     | NULL    |                |
 * user_email_token        | binary(32)          | YES  | MUL | NULL    |                |
 * user_email_token_expires | binary(14)         | YES  |     | NULL    |                |
 * user_registration       | binary(14)          | YES  |     | NULL    |                |
 * user_editcount          | int(11)             | YES  |     | NULL    |                |

+--+-+--+-+-++ +--+-+--+-+-++ +--+-+--+-+-++
 * Field                   | Type                | Null | Key | Default | Extra          |
 * user_id                 | int(5) unsigned     | NO   | PRI | NULL    | AUTO_INCREMENT |
 * user_name               | varchar(255) binary | NO   | MUL | NULL    |                |
 * user_real_name          | varchar(255) binary | NO   |     | NULL    |                |
 * user_password           | tinyblob            | NO   |     | NULL    |                |
 * user_newpassword        | tinyblob            | NO   |     | NULL    |                |
 * user_newpass_time       | char(14) binary     | YES  |     | NULL    |                |
 * user_email              | tinytext            | NO   |     | NULL    |                |
 * user_options            | blob                | NO   |     | NULL    |                |
 * user_touched            | char(14) binary     | NO   |     | NULL    |                |
 * user_token              | char(32) binary     | NO   |     | NULL    |                |
 * user_email_authenticated | char(14) binary    | YES  |     | NULL    |                |
 * user_email_token        | char(32) binary     | YES  | MUL | NULL    |                |
 * user_email_token_expires | char(14) binary    | YES  |     | NULL    |                |
 * user_registration       | char(14) binary     | YES  |     | NULL    |                |
 * user_editcount          | int(11)             | YES  |     | NULL    |                |

+--+-+--+-+-++ +--+-+--+-+-++ +--+-+--+-+-++
 * Field                   | Type                | Null | Key | Default | Extra          |
 * user_id                 | int(5) unsigned     | NO   | PRI | NULL    | AUTO_INCREMENT |
 * user_name               | varchar(255) binary | NO   | MUL | NULL    |                |
 * user_real_name          | varchar(255) binary | NO   |     | NULL    |                |
 * user_password           | tinyblob            | NO   |     | NULL    |                |
 * user_newpassword        | tinyblob            | NO   |     | NULL    |                |
 * user_email              | tinytext            | NO   |     | NULL    |                |
 * user_options            | blob                | NO   |     | NULL    |                |
 * user_touched            | char(14) binary     | NO   |     | NULL    |                |
 * user_token              | char(32) binary     | NO   |     | NULL    |                |
 * user_email_authenticated | char(14) binary    | YES  |     | NULL    |                |
 * user_email_token        | char(32) binary     | YES  | MUL | NULL    |                |
 * user_email_token_expires | char(14) binary    | YES  |     | NULL    |                |
 * user_registration       | char(14) binary     | YES  |     | NULL    |                |

+--+-+--+-+-++ +--+-+--+-+-++ +--+-+--+-+-++
 * Field                   | Type                | Null | Key | Default | Extra          |
 * user_id                 | int(5) unsigned     | NO   | PRI | NULL    | AUTO_INCREMENT |
 * user_name               | varchar(255) binary | NO   | MUL | NULL    |                |
 * user_real_name          | varchar(255) binary | NO   |     | NULL    |                |
 * user_password           | tinyblob            | NO   |     | NULL    |                |
 * user_newpassword        | tinyblob            | NO   |     | NULL    |                |
 * user_email              | tinytext            | NO   |     | NULL    |                |
 * user_options            | blob                | NO   |     | NULL    |                |
 * user_touched            | char(14) binary     | NO   |     | NULL    |                |
 * user_token              | char(32) binary     | NO   |     | NULL    |                |
 * user_email_authenticated | char(14) binary    | YES  |     | NULL    |                |
 * user_email_token        | char(32) binary     | YES  | MUL | NULL    |                |
 * user_email_token_expires | char(14) binary    | YES  |     | NULL    |                |

+--+-+--+-+-++ +--+-+--+-+-++ +--+-+--+-+-++
 * Field           | Type                | Null | Key | Default | Extra          |
 * user_id         | int(5) unsigned     | NO   | PRI | NULL    | AUTO_INCREMENT |
 * user_name       | varchar(255) binary | NO   | MUL | NULL    |                |
 * user_real_name  | varchar(255) binary | NO   |     | NULL    |                |
 * user_password   | tinyblob            | NO   |     | NULL    |                |
 * user_newpassword | tinyblob           | NO   |     | NULL    |                |
 * user_email      | tinytext            | NO   |     | NULL    |                |
 * user_options    | blob                | NO   |     | NULL    |                |
 * user_touched    | char(14) binary     | NO   |     | NULL    |                |

+--+-+--+-+-++ +--+-+--+-+-++ +--+-+--+-+-++
 * Field           | Type                | Null | Key | Default | Extra          |
 * user_id         | int(5) unsigned     | NO   | PRI | NULL    | AUTO_INCREMENT |
 * user_name       | varchar(255) binary | NO   | MUL | NULL    |                |
 * user_real_name  | varchar(255) binary | NO   |     | NULL    |                |
 * user_rights     | tinyblob            | NO   |     | NULL    |                |
 * user_password   | tinyblob            | NO   |     | NULL    |                |
 * user_newpassword | tinyblob           | NO   |     | NULL    |                |
 * user_email      | tinytext            | NO   |     | NULL    |                |
 * user_options    | blob                | NO   |     | NULL    |                |
 * user_touched    | char(14) binary     | NO   |     | NULL    |                |

+--+-+--+-+-++ +--+-+--+-+-++ +--+-+--+-+-++
 * Field           | Type                | Null | Key | Default | Extra          |
 * user_id         | int(5) unsigned     | NO   | PRI | NULL    | AUTO_INCREMENT |
 * user_name       | varchar(255) binary | NO   | MUL | NULL    |                |
 * user_rights     | tinyblob            | NO   |     | NULL    |                |
 * user_password   | tinyblob            | NO   |     | NULL    |                |
 * user_newpassword | tinyblob           | NO   |     | NULL    |                |
 * user_email      | tinytext            | NO   |     | NULL    |                |
 * user_options    | blob                | NO   |     | NULL    |                |
 * user_touched    | char(14) binary     | NO   |     | NULL    |                |

Indexes
 +---++--+--+--+---+-+--++--++-+---+ +---++--+--+--+---+-+--++--++-+---+ +---++--+--+--+---+-+--++--++-+---+
 * Table | Non_unique | Key_name        | Seq_in_index | Column_name      | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
 * user |          0 | PRIMARY          |            1 | user_id          | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
 * user |          0 | user_name        |            1 | user_name        | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
 * user |          1 | user_email_token |            1 | user_email_token | A         |           0 |     NULL | NULL   | YES  | BTREE      |         |               |
 * user |          1 | user_email       |            1 | user_email       | A         |           0 |       50 | NULL   |      | BTREE      |         |               |