home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / CMS / drupal-6.0.exe / drupal-6.0 / modules / user / user.install < prev    next >
Encoding:
Text File  |  2008-01-08  |  8.3 KB  |  291 lines

  1. <?php
  2. // $Id: user.install,v 1.5 2008/01/08 07:46:41 goba Exp $
  3.  
  4. /**
  5.  * Implementation of hook_schema().
  6.  */
  7. function user_schema() {
  8.   $schema['access'] = array(
  9.     'description' => t('Stores site access rules.'),
  10.     'fields' => array(
  11.       'aid' => array(
  12.         'type' => 'serial',
  13.         'not null' => TRUE,
  14.         'description' => t('Primary Key: Unique access ID.'),
  15.       ),
  16.       'mask' => array(
  17.         'type' => 'varchar',
  18.         'length' => 255,
  19.         'not null' => TRUE,
  20.         'default' => '',
  21.         'description' => t('Text mask used for filtering access.'),
  22.       ),
  23.       'type' => array(
  24.         'type' => 'varchar',
  25.         'length' => 255,
  26.         'not null' => TRUE,
  27.         'default' => '',
  28.         'description' => t('Type of access rule: name, mail or host.'),
  29.       ),
  30.       'status' => array(
  31.         'type' => 'int',
  32.         'not null' => TRUE,
  33.         'default' => 0,
  34.         'size' => 'tiny',
  35.         'description' => t('Whether rule is to allow(1) or deny(0) access.'),
  36.       ),
  37.     ),
  38.     'primary key' => array('aid'),
  39.   );
  40.  
  41.   $schema['authmap'] = array(
  42.     'description' => t('Stores distributed authentication mapping.'),
  43.     'fields' => array(
  44.       'aid' => array(
  45.         'description' => t('Primary Key: Unique authmap ID.'),
  46.         'type' => 'serial',
  47.         'unsigned' => TRUE,
  48.         'not null' => TRUE,
  49.       ),
  50.       'uid' => array(
  51.         'type' => 'int',
  52.         'not null' => TRUE,
  53.         'default' => 0,
  54.         'description' => t("User's {users}.uid."),
  55.       ),
  56.       'authname' => array(
  57.         'type' => 'varchar',
  58.         'length' => 128,
  59.         'not null' => TRUE,
  60.         'default' => '',
  61.         'description' => t('Unique authentication name.'),
  62.       ),
  63.       'module' => array(
  64.         'type' => 'varchar',
  65.         'length' => 128,
  66.         'not null' => TRUE,
  67.         'default' => '',
  68.         'description' => t('Module which is controlling the authentication.'),
  69.       ),
  70.     ),
  71.     'unique keys' => array('authname' => array('authname')),
  72.     'primary key' => array('aid'),
  73.   );
  74.  
  75.   $schema['permission'] = array(
  76.     'description' => t('Stores permissions for users.'),
  77.     'fields' => array(
  78.       'pid' => array(
  79.         'type' => 'serial',
  80.         'not null' => TRUE,
  81.         'description' => t('Primary Key: Unique permission ID.'),
  82.       ),
  83.       'rid' => array(
  84.         'type' => 'int',
  85.         'unsigned' => TRUE,
  86.         'not null' => TRUE,
  87.         'default' => 0,
  88.         'description' => t('The {role}.rid to which the permissions are assigned.'),
  89.       ),
  90.       'perm' => array(
  91.         'type' => 'text',
  92.         'not null' => FALSE,
  93.         'size' => 'big',
  94.         'description' => t('List of permissions being assigned.'),
  95.       ),
  96.       'tid' => array(
  97.         'type' => 'int',
  98.         'unsigned' => TRUE,
  99.         'not null' => TRUE,
  100.         'default' => 0,
  101.         'description' => t('Originally intended for taxonomy-based permissions, but never used.'),
  102.       ),
  103.     ),
  104.     'primary key' => array('pid'),
  105.     'indexes' => array('rid' => array('rid')),
  106.   );
  107.  
  108.   $schema['role'] = array(
  109.     'description' => t('Stores user roles.'),
  110.     'fields' => array(
  111.       'rid' => array(
  112.         'type' => 'serial',
  113.         'unsigned' => TRUE,
  114.         'not null' => TRUE,
  115.         'description' => t('Primary Key: Unique role id.'),
  116.       ),
  117.       'name' => array(
  118.         'type' => 'varchar',
  119.         'length' => 64,
  120.         'not null' => TRUE,
  121.         'default' => '',
  122.         'description' => t('Unique role name.'),
  123.       ),
  124.     ),
  125.     'unique keys' => array('name' => array('name')),
  126.     'primary key' => array('rid'),
  127.   );
  128.  
  129.   $schema['users'] = array(
  130.     'description' => t('Stores user data.'),
  131.     'fields' => array(
  132.       'uid' => array(
  133.         'type' => 'serial',
  134.         'unsigned' => TRUE,
  135.         'not null' => TRUE,
  136.         'description' => t('Primary Key: Unique user ID.'),
  137.       ),
  138.       'name' => array(
  139.         'type' => 'varchar',
  140.         'length' => 60,
  141.         'not null' => TRUE,
  142.         'default' => '',
  143.         'description' => t('Unique user name.'),
  144.       ),
  145.       'pass' => array(
  146.         'type' => 'varchar',
  147.         'length' => 32,
  148.         'not null' => TRUE,
  149.         'default' => '',
  150.         'description' => t("User's password (md5 hash)."),
  151.       ),
  152.       'mail' => array(
  153.         'type' => 'varchar',
  154.         'length' => 64,
  155.         'not null' => FALSE,
  156.         'default' => '',
  157.         'description' => t("User's email address."),
  158.       ),
  159.       'mode' => array(
  160.         'type' => 'int',
  161.         'not null' => TRUE,
  162.         'default' => 0,
  163.         'size' => 'tiny',
  164.         'description' => t('Per-user comment display mode (threaded vs. flat), used by the {comment} module.'),
  165.       ),
  166.       'sort' => array(
  167.         'type' => 'int',
  168.         'not null' => FALSE,
  169.         'default' => 0,
  170.         'size' => 'tiny',
  171.         'description' => t('Per-user comment sort order (newest vs. oldest first), used by the {comment} module.'),
  172.       ),
  173.       'threshold' => array(
  174.         'type' => 'int',
  175.         'not null' => FALSE,
  176.         'default' => 0,
  177.         'size' => 'tiny',
  178.         'description' => t('Previously used by the {comment} module for per-user preferences; no longer used.'),
  179.       ),
  180.       'theme' => array(
  181.         'type' => 'varchar',
  182.         'length' => 255,
  183.         'not null' => TRUE,
  184.         'default' => '',
  185.         'description' => t("User's default theme."),
  186.       ),
  187.       'signature' => array(
  188.         'type' => 'varchar',
  189.         'length' => 255,
  190.         'not null' => TRUE,
  191.         'default' => '',
  192.         'description' => t("User's signature."),
  193.       ),
  194.       'created' => array(
  195.         'type' => 'int',
  196.         'not null' => TRUE,
  197.         'default' => 0,
  198.         'description' => t('Timestamp for when user was created.'),
  199.       ),
  200.       'access' => array(
  201.         'type' => 'int',
  202.         'not null' => TRUE,
  203.         'default' => 0,
  204.         'description' => t('Timestamp for previous time user accessed the site.'),
  205.       ),
  206.       'login' => array(
  207.         'type' => 'int',
  208.         'not null' => TRUE,
  209.         'default' => 0,
  210.         'description' => t("Timestamp for user's last login."),
  211.       ),
  212.       'status' => array(
  213.         'type' => 'int',
  214.         'not null' => TRUE,
  215.         'default' => 0,
  216.         'size' => 'tiny',
  217.         'description' => t('Whether the user is active(1) or blocked(0).'),
  218.       ),
  219.       'timezone' => array(
  220.         'type' => 'varchar',
  221.         'length' => 8,
  222.         'not null' => FALSE,
  223.         'description' => t("User's timezone."),
  224.       ),
  225.       'language' => array(
  226.         'type' => 'varchar',
  227.         'length' => 12,
  228.         'not null' => TRUE,
  229.         'default' => '',
  230.         'description' => t("User's default language."),
  231.       ),
  232.       'picture' => array(
  233.         'type' => 'varchar',
  234.         'length' => 255,
  235.         'not null' => TRUE,
  236.         'default' => '',
  237.         'description' => t("Path to the user's uploaded picture."),
  238.       ),
  239.       'init' => array(
  240.         'type' => 'varchar',
  241.         'length' => 64,
  242.         'not null' => FALSE,
  243.         'default' => '',
  244.         'description' => t('Email address used for initial account creation.'),
  245.       ),
  246.       'data' => array(
  247.         'type' => 'text',
  248.         'not null' => FALSE,
  249.         'size' => 'big',
  250.         'description' => t('A serialized array of name value pairs that are related to the user. Any form values posted during user edit are stored and are loaded into the $user object during user_load(). Use of this field is discouraged and it will likely disappear in a future version of Drupal.'),
  251.       ),
  252.     ),
  253.     'indexes' => array(
  254.       'access' => array('access'),
  255.       'created' => array('created'),
  256.       'mail' => array('mail'),
  257.     ),
  258.     'unique keys' => array(
  259.       'name' => array('name'),
  260.     ),
  261.     'primary key' => array('uid'),
  262.   );
  263.  
  264.   $schema['users_roles'] = array(
  265.     'description' => t('Maps users to roles.'),
  266.     'fields' => array(
  267.       'uid' => array(
  268.         'type' => 'int',
  269.         'unsigned' => TRUE,
  270.         'not null' => TRUE,
  271.         'default' => 0,
  272.         'description' => t('Primary Key: {users}.uid for user.'),
  273.       ),
  274.       'rid' => array(
  275.         'type' => 'int',
  276.         'unsigned' => TRUE,
  277.         'not null' => TRUE,
  278.         'default' => 0,
  279.         'description' => t('Primary Key: {role}.rid for role.'),
  280.       ),
  281.     ),
  282.     'primary key' => array('uid', 'rid'),
  283.     'indexes' => array(
  284.       'rid' => array('rid'),
  285.     ),
  286.   );
  287.  
  288.   return $schema;
  289. }
  290.  
  291.