-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.php
50 lines (44 loc) · 1.35 KB
/
install.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* The following functions are used by the extension engine to generate a new table
* for the plugin / destroy it on removal.
*/
/**
* This function is called on installation and is used to
* create database schema for the plugin
*/
function extension_install_firewallrules() {
$commonObject = new ExtensionCommon;
$commonObject -> sqlQuery("DROP TABLE IF EXISTS `firewallrules`");
$commonObject -> sqlQuery(
"CREATE TABLE IF NOT EXISTS `firewallrules` (
RULE_ID INT(11) NOT NULL AUTO_INCREMENT,
HARDWARE_ID INT(11) NOT NULL,
DISPLAYNAME VARCHAR(255) NOT NULL,
DESCRIPTION VARCHAR(255) NOT NULL,
ENABLED VARCHAR(255) NOT NULL,
SOURCE VARCHAR(255) NOT NULL,
DESTINATION VARCHAR(255) NOT NULL,
DIRECTION VARCHAR(255) NOT NULL,
ACTION VARCHAR(255) NOT NULL,
PORT VARCHAR(255) NOT NULL,
PROTOCOL VARCHAR(255) NOT NULL,
PRIMARY KEY (RULE_ID, HARDWARE_ID)) ENGINE=INNODB;"
);
}
/**
* This function is called on removal and is used to
* destroy database schema for the plugin
*/
function extension_delete_firewallrules()
{
$commonObject = new ExtensionCommon;
$commonObject -> sqlQuery("DROP TABLE IF EXISTS `firewallrules`");
}
/**
* This function is called on plugin upgrade
*/
function extension_upgrade_firewallrules()
{
}
?>