You are here

function password_policy_install in Password Policy 5

Same name and namespace in other branches
  1. 8.3 password_policy.install \password_policy_install()
  2. 6 password_policy.install \password_policy_install()
  3. 7.2 password_policy.install \password_policy_install()
  4. 7 password_policy.install \password_policy_install()

Implementation of the hook_install() module.

File

./password_policy.install, line 6

Code

function password_policy_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {password_policy} (\n        id int(10) unsigned NOT NULL default '0',\n        name varchar(48) NOT NULL default '',\n        description longtext,\n        enabled int(1) unsigned NOT NULL default '0',\n        serialized_policy longtext NOT NULL,\n        created int(11) default NULL,\n        PRIMARY KEY (id)\n      ) /*!40100 DEFAULT CHARACTER SET utf8 */");
      db_query("CREATE TABLE {password_policy_users} (\n        uid int(10) unsigned NOT NULL default '0',\n        pass varchar(32) NOT NULL default '',\n        created int(11) NOT NULL default '0',\n        KEY (uid)\n      ) /*!40100 DEFAULT CHARACTER SET utf8 */");
      db_query("CREATE TABLE {password_policy_expiration} (\n        uid int(10) unsigned NOT NULL,\n        warning int(11) default NULL,\n        blocked int(11) default NULL,\n        unblocked int(11) default NULL,\n        KEY (uid)\n      ) /*!40100 DEFAULT CHARACTER SET utf8 */");
      break;
  }
  drupal_set_message('The password policy module has been installed.');
}