You are here

function login_security_install in Login Security 5

Same name and namespace in other branches
  1. 6 login_security.install \login_security_install()

File

./login_security.install, line 3

Code

function login_security_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {login_security_track} (" . "id int unsigned NOT NULL auto_increment, " . "host varchar(39) NOT NULL, " . "name varchar(64) NOT NULL, " . "timestamp int(11) unsigned NOT NULL, " . "PRIMARY KEY (id,name,host), " . "INDEX (timestamp) " . ") /*!40100 DEFAULT CHARACTER SET utf8 */;");
      drupal_set_message(t('Created security table'));
      break;
    case 'pgsql':
      db_query("CREATE TABLE {login_security_track} (" . "id serial NOT NULL, " . "host varchar(39) NOT NULL, " . "name varchar(64) NOT NULL, " . "timestamp int_unsigned NOT NULL, " . "PRIMARY KEY (id,name,host) " . ")");
      db_query("CREATE INDEX {login_security_track}_timestamp_idx " . "ON {login_security_track} " . "USING btree " . "(timestamp)");
      drupal_set_message(t('Created security table'));
      break;
  }
}