wiki:TableUsers

Version 1 (modified by julian, 12 years ago) (diff)

page created

Database layout -> Table users

  • Columns
    • userID MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT
      The user's id.
    • userIsActivated TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'
      If 1, the account of the user is activated, otherwise deactivated. This value is used to verify an account after registration.
    • userIsAdmin TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'
      1 = user is an administrator, 0 = user is not an administrator. An administrator has all possible rights in the system.
    • userIsSupermod TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'
      1 = user is a supermoderator, 0 = user is not a supermoderator. A supermoderator is moderator in all forums.
    • userHash VARCHAR(255) DEFAULT '' NOT NULL
      An unique random string. It can be used for verification purpose or for another possibility to identify an user.
    • userNick VARCHAR(255) DEFAULT '' NOT NULL
      An unique phantasy (or real) name the user has to choose.
    • userEmail VARHCAR(255) DEFAULT '' NOT NULL
      The user's email address.
    • userPassword VARCHAR(255) DEFAULT '' NOT NULL
      The hash of the user's password, salted with userPasswordSalt. By default, SHA256 is used as hash algorithm.
    • userPasswordSalt VARCHAR(255) DEFAULT '' NOT NULL
      A random string which is used to salt the hash of the user's password. Salted hashes are very important to avoid rainbow table attacks.
    • userNewPassword VARCHAR(255) DEFAULT '' NOT NULL
      Equivalent to userPassword for a newly requested password.
    • userNewPasswordSalt VARCHAR(255) DEFAULT '' NOT NULL
      The salt for userNewPassword.
    • userPostsCounter MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL
      The number of posts the user already posted.
    • userRegistrationTimestamp INT(10) UNSIGNED DEFAULT '0' NOT NULL
      The date of the user's registration stored in unix time format.
    • userSignature TEXT DEFAULT '' NOT NULL
      The user's signature which he can specify in his profile and which is appended to posts and private messages if desired and allowed.
    • groupID MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL
      The id of the user's main group. An user can be member of different groups but he can also specify one special group which is shown together with the user's posts.
    • userLastAction INT(10) UNSIGNED DEFAULT '0' NOT NULL
      The date of the user's last 'click' stored in unix time format.
    • rankID SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL
      The id of the rank an admin can give to an user. 0 means the user has no special rank.
    • userAvatarAddress VARCHAR(255) DEFAULT '' NOT NULL
      The (http) address of the user's avatar. An avatar is a small picture which is shown together with the user's posts for example.
    • userTimezone VARCHAR(255) DEFAULT 'gmt' NOT NULL
      The user's favourite timezone. This feature is not yet completed so it is possible that this column will be altered.
    • userReceiveEmails TINYINT(1) DEFAULT '1' NOT NULL
      1 = the user wants to receive emails by the board system (such as notifications); 0 = the user doesn't want to receive emails (except password requests).
    • userHideEmailAddress TINYINT(1) DEFAULT '0' NOT NULL}
      1 = the user's email address is shown to the public; 0 = the user's email address can only be seen by administrators.
    • userIsLocked TINYINT(1) DEFAULT '0' NOT NULL
      If 1, the user has been locked by an administrator. This has nothing to do with the account activation! For more information check TableUsersLocks?.
    • userMemo TEXT DEFAULT '' NOT NULL
      Just a private memo to write things the user doesn't want to forget.
    • userAuthProfileNotes TINYINT(1) DEFAULT '2' NOT NULL
      (TODO)
    • userLanguage VARHCAR(255) DEFAULT '' NOT NULL
      The code of the user's favourite language. As the language system is still under developement, it is possible that column will be altered.
  • Keys
    • PRIMARY userID (userID)
    • KEY userLastAction (userLastAction)
    • KEY rankID (rankID)

MySQL-Code

CREATE TABLE `tbb2_users` (
  `userID` mediumint(8) unsigned NOT NULL auto_increment,
  `userIsActivated` tinyint(1) unsigned NOT NULL default '0',
  `userIsAdmin` tinyint(1) unsigned NOT NULL default '0',
  `userIsSupermod` tinyint(1) unsigned NOT NULL default '0',
  `userHash` varchar(32) NOT NULL default '',
  `userNick` varchar(255) NOT NULL default '',
  `userEmail` varchar(255) NOT NULL default '',
  `userPassword` varchar(255) NOT NULL default '',
  `userPasswordSalt` varchar(255) default NULL,
  `userNewPassword` varchar(255) default NULL,
  `userNewPasswordSalt` varchar(255) default NULL,
  `userPostsCounter` mediumint(8) unsigned NOT NULL default '0',
  `userRegistrationTimestamp` int(10) unsigned NOT NULL default '0',
  `userSignature` text NOT NULL,
  `groupID` mediumint(8) unsigned NOT NULL default '0',
  `userLastAction` int(10) unsigned NOT NULL default '0',
  `rankID` smallint(5) unsigned NOT NULL default '0',
  `userAvatarAddress` varchar(255) NOT NULL default '',
  `userTimezone` varchar(255) NOT NULL default 'gmt',
  `userReceiveEmails` tinyint(1) unsigned NOT NULL default '1',
  `userHideEmailAddress` tinyint(1) unsigned NOT NULL default '0',
  `userIsLocked` tinyint(1) unsigned NOT NULL default '0',
  `userMemo` text NOT NULL,
  `userAuthProfileNotes` tinyint(1) unsigned NOT NULL default '2',
  `userLanguage` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`userID`),
  KEY `userLastAction` (`userLastAction`),
  KEY `rankID` (`rankID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8