-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmailhive.php
108 lines (84 loc) · 3.19 KB
/
mailhive.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
/*
MailBeez Automatic Trigger Email Campaigns
http://www.mailbeez.com
Copyright (c) 2010 - 2014 MailBeez
inspired and in parts based on
Copyright (c) 2003 osCommerce
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
*/
// set MH_ROOT_PATH
if (!defined('MH_ROOT_PATH')) {
// default location
$_MH_ROOT_PATH = 'mailhive/';
$_mh_search_paths = array('mailhive/', 'ext/mailhive/', 'includes/external/mailhive/');
foreach ($_mh_search_paths as $_MH_ROOT_PATH_TRY) {
if (file_exists($_MH_ROOT_PATH_TRY . 'cloudbeez/cloudloader_core.php')) {
$_MH_ROOT_PATH = $_MH_ROOT_PATH_TRY;
break;
}
}
define('MH_ROOT_PATH', $_MH_ROOT_PATH);
}
if (file_exists(MH_ROOT_PATH . 'common/main/inc_mailhive.php')) {
include_once(MH_ROOT_PATH . 'common/main/inc_mailhive.php');
} else {
// cloudloader installation
require_once('includes/application_top.php');
if (function_exists('xtc_db_query')) {
function mh_db_check_field_exists($table, $field)
{
$query_raw = "SHOW COLUMNS FROM " . $table . "";
$query = xtc_db_query($query_raw);
while ($item = xtc_db_fetch_array($query)) {
if ($item['Field'] == $field) {
return $item;
}
}
// not found
return false;
}
function mh_db_add_field($table, $field, $sql)
{
// check if exists
$result = mh_db_check_field_exists($table, $field);
if ($result === false) {
if (is_array($sql)) {
while (list(, $sql_item) = each($sql)) {
xtc_db_query($sql_item);
}
} else {
xtc_db_query($sql);
}
}
}
// gambio has removed TABLE_ADMIN_ACCESS from storefront context...
if (!defined('TABLE_ADMIN_ACCESS')) {
define('TABLE_ADMIN_ACCESS', 'admin_access');
};
echo "<br />Adding Admin-Right<br>
<br />
";
$sql = array();
$sql[] = "ALTER TABLE " . TABLE_ADMIN_ACCESS . " ADD mailbeez INT(1) DEFAULT '0' NOT NULL ;";
mh_db_add_field(TABLE_ADMIN_ACCESS, 'mailbeez', $sql);
$field_info = mh_db_check_field_exists(TABLE_ADMIN_ACCESS, 'mailbeez');
if ($field_info != false) {
echo 'TABLE_ADMIN_ACCESS (' . TABLE_ADMIN_ACCESS . ') updated - added column "mailbeez"<br />';
}
xtc_db_query("UPDATE " . TABLE_ADMIN_ACCESS . " SET mailbeez = '2' WHERE customers_id = 'groups' LIMIT 1");
xtc_db_query("UPDATE " . TABLE_ADMIN_ACCESS . " SET mailbeez = '1' WHERE customers_id = '1' LIMIT 1");
// UPDATE `admin_access` SET mailbeez = 1;
echo "<br />done<br><br />";
echo "<b>please go to admin > tools > mailbeez to finish your installation</b>";
} else {
?>
Please follow the installation manual on
<a href="http://www.mailbeez.com/documentation/installation/">http://www.mailbeez.com/documentation/installation/</a>
<?php
}
?>
Please install MailBeez
<?php
}