You are here

function protected_node_install in Protected Node 5

Same name and namespace in other branches
  1. 6 protected_node.install \protected_node_install()
  2. 7 protected_node.install \protected_node_install()
  3. 1.0.x protected_node.install \protected_node_install()

Implementation of hook_install()

File

./protected_node.install, line 14

Code

function protected_node_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query('
				CREATE TABLE {protected_nodes} (
					nid int(10) unsigned NOT NULL,
					passwd CHAR(40) NOT NULL,
					PRIMARY KEY (nid)
				) /*!40100 DEFAULT CHARACTER SET utf8 */;
			');
      break;
    case 'pgsql':
      db_query('
				CREATE TABLE {protected_nodes} (
					nid INTEGER PRIMARY KEY,
					passwd CHAR(40) NOT NULL
				);
			');
      break;
  }
  db_query("UPDATE {system} SET weight = 80 WHERE name = 'protected_node' AND type = 'module'");
}