<?php
// +-------------------------------------------------------------+
// | HiveMail™ version 1.3.1
// +-------------------------------------------------------------+
// | HIVEMAIL™ IS NOT FREE SOFTWARE
// | If you have downloaded this software from a website other
// | than Hivemail or if you have otherwise received
// | this software from someone who is not a representative of
// | this organization you are involved in an illegal activity.
// +-------------------------------------------------------------+
// +-------------------------------------------------------------+

// ############################################################################
// Table structure
$tables[3] = array (
	'cplink' => 'CREATE TABLE cplink (
		cplinkid smallint(5) unsigned NOT NULL auto_increment,
		title varchar(255) NOT NULL default \'\',
		url varchar(255) NOT NULL default \'\',
		display tinyint(3) unsigned NOT NULL default \'0\',
		newwin tinyint(3) unsigned NOT NULL default \'1\',
		PRIMARY KEY  (cplinkid),
		UNIQUE KEY cplinkid (cplinkid)
	) TYPE=MyISAM',
	'eventlog' => 'CREATE TABLE eventlog (
		eventlogid int(10) unsigned NOT NULL auto_increment,
		dateline int(10) unsigned NOT NULL default \'0\',
		userid int(10) unsigned NOT NULL default \'0\',
		level tinyint(3) unsigned NOT NULL default \'0\',
		event smallint(5) unsigned default NULL,
		debuginfo text,
		PRIMARY KEY  (eventlogid),
		KEY userid (userid)
	) TYPE=MyISAM',
	'field' => 'CREATE TABLE field (
		fieldid int(10) unsigned NOT NULL auto_increment,
		title varchar(50) NOT NULL default \'\',
		description text NOT NULL,
		module varchar(10) NOT NULL default \'user\',
		type varchar(15) NOT NULL default \'text\',
		display smallint(6) NOT NULL default \'0\',
		required tinyint(3) unsigned NOT NULL default \'0\',
		min smallint(5) unsigned NOT NULL default \'0\',
		max smallint(5) unsigned NOT NULL default \'0\',
		width tinyint(3) unsigned NOT NULL default \'0\',
		perline smallint(5) unsigned NOT NULL default \'0\',
		height tinyint(3) unsigned NOT NULL default \'0\',
		defvalue varchar(255) NOT NULL default \'\',
		signup tinyint(3) unsigned NOT NULL default \'0\',
		error text NOT NULL,
		data text NOT NULL,
		custom tinyint(3) unsigned NOT NULL default \'0\',
		PRIMARY KEY  (fieldid),
		UNIQUE KEY fieldid (fieldid)
	) TYPE=MyISAM',
	'fieldinfo' => 'CREATE TABLE fieldinfo (
		fieldid int(10) unsigned NOT NULL default \'0\',
		userid int(10) unsigned NOT NULL default \'0\',
		contactid int(10) unsigned NOT NULL default \'0\',
		choices varchar(255) NOT NULL default \'\',
		value text NOT NULL,
		dateline int(10) unsigned NOT NULL default \'0\',
		PRIMARY KEY  (fieldid,userid,contactid)
	) TYPE=MyISAM',
	'message' => 'ALTER TABLE message
		CHANGE email email varchar(255) NOT NULL default \'\',
		ADD popsize int(10) unsigned NOT NULL default \'0\'',
	'messagefile' => 'CREATE TABLE messagefile (
		filename varchar(65) NOT NULL default \'\',
		messages int(10) unsigned NOT NULL default \'0\',
		PRIMARY KEY  (filename),
		UNIQUE KEY filename (filename)
	) TYPE=MyISAM',
	'response' => 'CREATE TABLE response (
		responseid int(10) unsigned NOT NULL auto_increment,
		userid int(10) unsigned NOT NULL default \'0\',
		name varchar(50) NOT NULL default \'\',
		response text NOT NULL,
		isdefault tinyint(3) unsigned NOT NULL default \'1\',
		UNIQUE KEY autoresponsesid (responseid),
		KEY userid (userid)
	) TYPE=MyISAM',
	'rule' => 'ALTER TABLE rule
		ADD allowoverride tinyint(3) unsigned NOT NULL default \'1\'',
	'sound' => 'ALTER TABLE sound
		CHANGE userid userid int(11) NOT NULL default \'0\',
		ADD title varchar(50) NOT NULL default \'\'',
	'user' => 'ALTER TABLE user
		ADD spamaction tinyint(4) default \'-4\',
		ADD vbuserid int(10) unsigned NOT NULL default \'0\',
		ADD spampass varchar(50) NOT NULL default \'\',
		ADD domain varchar(255) NOT NULL default \'\',
		ADD KEY visitgroup (lastvisit, usergroupid)',
	'usergroup' => 'ALTER TABLE usergroup
		ADD maxcontacts smallint(5) unsigned NOT NULL default \'0\',
		ADD maxresponses smallint(5) unsigned NOT NULL default \'0\',
		ADD maxrecips smallint(5) unsigned NOT NULL default \'0\',
		ADD emptytime smallint(5) unsigned NOT NULL default \'0\',
		ADD removetime smallint(5) unsigned NOT NULL default \'0\',
		ADD notifytime varchar(50) NOT NULL default \'\'',
);

// ############################################################################
// Records
$inserts[3] = array (
	'INSERT INTO templategroup VALUES (17, \'Expiry Notifications\', 16, \'\')',
	'INSERT INTO cplink VALUES (1, \'HiveMail\', \'#\', 1, 1)',
	'INSERT INTO cplink VALUES (2, \'HiveMail&trade; Support\', \'#\', 2, 1)',
	'INSERT INTO cplink VALUES (3, \'HiveMail&trade; Forums\', \'#\', 3, 1)',
	'INSERT INTO cplink VALUES (5, \'PHP Manual\', \'http://www.php.net/manual/en/\', 4, 1)',
	'INSERT INTO cplink VALUES (6, \'MySQL Manual\', \'http://www.mysql.com/doc/en/\', 5, 1)',
	'INSERT INTO setting VALUES (38, 8, \'Upload attachments in safe mode\', \'If your server is running in Safe Mode or if open_basedir restrictions are in effect, enable this option and update the setting below.\', \'safeupload\', 0, \'yesno\', 1)',
	'INSERT INTO setting VALUES (39, 8, \'Temporary director for attachments\', \'If you enable uploads in Safe Mode, this must be set to the folder in which the attachments will be <i>temporarily</i> stored. PHP must have write permission in this folder, i.e CHMOD 0777.\', \'tmppath\', \'/tmp\', \'text\', 2)',
	'INSERT INTO setting VALUES (41, 9, \'Terms of Service\', \'If the service you offer has any terms, enter them in this box. When users sign up, they will be required to agree to these terms.\', \'termsofservice\', \'\', \'area\', 5)',
	'INSERT INTO setting VALUES (42, 9, \'Registration code check\', \'Turning this on will force users to enter a random number, as it appears in an image. This protection method drastically reduces the chances of having a machine create new accounts automatically.\', \'regcodecheck\', 1, \'yesno\', 8)',
	'INSERT INTO setting VALUES (43, 9, \'Use the same effect for all numbers\', \'If you enable the registration code check above, users will be presented with a series of random images. Each image uses a different effect to \\"hide\\" the number from machines. However, you have the option to use the same effect on all numbers. This will make it somewhat easier for users to enter the number, but at the same time also make it easier for automatic bots to detect the number.\', \'regcodesameset\', 1, \'yesno\', 9)',
	'INSERT INTO setting VALUES (44, 10, \'Open links in frames\', \'If you would like to open outside links in new windows with a top frame, that will allow users to return to the message they were reading, enable this option. Otherwise new links will open in their own window.\', \'framelinks\', 1, \'yesno\', 2)',
	'INSERT INTO setting VALUES (45, 10, \'Allow manual bouncing\', \'Turn this on to give users the option to bounce messages back to their sender, so it looks like they never reached their mailbox.\', \'allowbouncing\', 1, \'yesno\', 3)',
	'INSERT INTO setting VALUES (46, 11, \'DNS Blocking Lists\', \'If you wish to use anti-spam DNS blocking lists, please input each server you would like e-mail checked against. One entry per line.<br />\\nE.g. relays.osirusoft.com\', \'dnsbls\', \'\', \'area\', 3)',
	'INSERT INTO setting VALUES (47, 11, \'Global blocked senders\', \'Any addresses you enter here will be blocked for all users, <i>even</i> if they are defined as \\"safe\\" for a user. Please use with care!<br />Specify one email address per line. Use only the domain name (e.g \\"yourdomain.c0m\\") to block all messages from it.\', \'globalblock\', \'\', \'area\', 1)',
	'INSERT INTO setting VALUES (48, 11, \'Global safe senders\', \'Addresses that you add here will never be blocked, for any user in the system, <i>even</i> if the user would like to block it. Useful, for example, if you don\\\'t want users to ignore emails from the webmaster.<br />Specify one email address per line. Use only the domain name (e.g \\"yourdomain.c0m\\") to block all messages from it.\', \'globalsafe\', \'\', \'area\', 2)',
	'INSERT INTO setting VALUES (49, 5, \'Display quick links\', \'Whether or not to show the list of quick links in the control panel navigation. You can edit those links <a href=\\"cplink.php\\">here</a>.\', \'cp_links\', 1, \'yesno\', 4)',
	'INSERT INTO setting VALUES (50, 1, \'Maintenance mode\', \'During maintenance mode, users can only login and logout - they cannot use any other functions. Useful for when you upgrading the program or performing back-ups. Administrators are unaffected by this setting.\', \'maintain\', 0, \'yesno\', 1)',
	'INSERT INTO setting VALUES (51, 12, \'Store messages in files\', \'Turn this on if you would like to store the message data in the file-system, and not in the database. If this is enabled, you must set the other options in this section as well for this feature to work correctly. You can ignore the rest of the options if this is disabled.\', \'flat_use\', 0, \'yesno\', 1)',
	'INSERT INTO setting VALUES (52, 12, \'Directory to save files in\', \'The full path to the directory in which the message files will be stored. It is <b>STRONGLY</b> recommended that this directory will not be below the \\"web root\\", so users will not be able to access the files directly. PHP must have write permission in this folder, i.e CHMOD 0777.<br /><b>NOTE:</b> If you change this setting, you must rename the original directory to reflect the change. The script will <b>not</b> do this for you.\', \'flat_path\', \'\', \'text\', 2)',
	'INSERT INTO setting VALUES (53, 3, \'File prefix\', \'The message files will be named \\"&lt;prefix&gt;&lt;random hash&gt;.dat\\". You can set the &lt;prefix&gt; in this option, for example \\"message_\\".\', \'flat_prefix\', \'message_\', \'text\', 3)',
	'INSERT INTO setting VALUES (54, 1, \'Display skin menu on login\', \'Whether or not to show the skin selection menu on the login screen, so users can choose a different skin while logging into their account.\', \'skinonlogin\', 1, \'yesno\', 8)',
	'INSERT INTO setting VALUES (55, 1, \'Usergroup permissions for skin menu\', \'If you have turned on the skin menu above, please select the usergroup whose skin permissions will be used to determine which skins to show.\', \'skinonlogingroup\', 2, \'select_usergroup\', 9)',
	'INSERT INTO setting VALUES (56, 2, \'Automatic trash collection maximum value\', \'Limit the number of days for users to automatically empty their trash can.\', \'maxemptybindays\', 30, \'text\', 3)',
	'INSERT INTO setting VALUES (57, 6, \'Send messages with IP address\', \'Turn this on to have IP addresses of users sent with all outgoing messages.\', \'sendipaddress\', 1, \'yesno\', 2)',
	'INSERT INTO setting VALUES (58, 13, \'Enable GZIP compression\', \'Whether or not to use GZIP compression, which would reduce the size of HiveMail&trade; generated pages and respectively reduce the loading time of those pages.\', \'gzip_use\', 0, \'yesno\', 1)',
	'INSERT INTO setting VALUES (59, 13, \'Level of compression\', \'The level of GZIP compression, from 1 to 9. The higher the level is, the better the compression rate but the slower it takes to compress the pages. 0 means no compression at all.\', \'gzip_level\', 1, \'text\', 2)',
	'INSERT INTO setting VALUES (60, 9, \'Require secondary email\', \'If you have enabled manual validation of new users (see above), new registrants will be required to enter a secondary email address through which they will be notified when their account is activated. You can cancel this requirement by turning off this option.\', \'reg_requirealtemail\', -1, \'altemail\', 3)',
	'INSERT INTO setting VALUES (61, 14, \'Server name\', \'The hostname or IP address of the SMTP server you would like to use. Leave this empty to use PHP\\\'s built-in functions.\', \'smtp_host\', \'\', \'text\', 1)',
	'INSERT INTO setting VALUES (62, 14, \'Server port\', \'The port that\\\'s used to connect to the SMTP server above, usually this is either 25, 465, 24 or 209.\', \'smtp_port\', 25, \'text\', 2)',
	'INSERT INTO setting VALUES (63, 14, \'HELO greeting\', \'The \\\'greeting\\\' that will be used when connecting to the SMTP server. This setting is not very important, and is typically the same as your domain name or hostname.\', \'smtp_helo\', \'\', \'text\', 3)',
	'INSERT INTO setting VALUES (64, 14, \'Use authentication\', \'Whether or not the SMTP server requires authentication. If you turn this on, you must specify a username and password in	the settings below.\', \'smtp_auth\', 0, \'yesno\', 4)',
	'INSERT INTO setting VALUES (65, 14, \'Username\', \'The username that will be used for authenticating to the SMTP server. If the server requires a username and password, the setting above (Use authentication) must be turned on.\', \'smtp_user\', \'\', \'text\', 5)',
	'INSERT INTO setting VALUES (66, 14, \'Password\', \'The password that will be used for authenticating to the SMTP server.\', \'smtp_pass\', \'\', \'text\', 6)',
	'INSERT INTO setting VALUES (71, 1, \'Allow login from domains\', \'If set, logins will <b>only</b> be allowed from these domains. To specify multiple domain names, put each one on its own line.<br />\\n<br />\\ne.g. yourdomain.c0m would allow logins from users who login at mail.yourdomain.c0m, while users who fill out a login form at example2.net will be rejected<br />\\n<br />\\nLeaving this box blank allows logins from any domain.\', \'logindomains\', \'\', \'area\', 10)',
	'INSERT INTO setting VALUES (72, 1, \'Banned IP addresses or hostnames\', \'IP addresses or hostnames which you wish to ban from using HiveMail&trade;. Wildcards may be used. One entry per line.<br />\\n<br />\\ne.g. 127.* would ban all users with IP addresses beginning with 127.<br />\\n*.yourdomain.c0m would ban all users in the yourdomain.c0m domain.\', \'bannedips\', \'\', \'area\', 11)',
	'INSERT INTO setting VALUES (73, 14, \'Enable keep-alive\', \'HiveMail&trade; can open one connection to the SMTP server when sending multiple messages, which reduces the load on the server and improves performance. However, some SMTP server do not support this feature and will not allow HiveMail&trade; to stay connected for a very long, and as a result messages may not be sent correctly. If you are experiencing such probelms, please disable this option.\', \'smtp_persistent\', 1, \'yesno\', 7)',
	'INSERT INTO setting VALUES (74, 15, \'Enable vBulletin integration\', \'Turn this on to enable the integration with vBulletin. You must first read Install document, to learn more about the integration with vBulletin as well as make the necessary changes to the vBulletin system as described in the manual. If this is enabled please be sure to fill in the rest of the settings in this category.\', \'vb_use\', 0, \'yesno\', 1)',
	'INSERT INTO setting VALUES (75, 15, \'Location of vBulletin files\', \'Please enter the complete absolute path to the vBulletin program files. This is <i>not</i> the URL to your board! If you are not sure what the path to the files is, please contact your host.\', \'vb_filepath\', \'\', \'text\', 2)',
	'INSERT INTO setting VALUES (76, 15, \'URL to forums\', \'The complete URL of your forums, same as the one you input in vBulletin\\\'s control panel. Please do not add a trailing slash.\', \'vb_url\', \'\', \'text\', 3)',
	'INSERT INTO setting VALUES (77, 15, \'Allow regular registration\', \'Enable this option if you want to allow users to sign up for a HiveMail&trade; account only, without referring them to vBulletin.\', \'vb_allownormal\', 1, \'yesno\', 4)',
	'INSERT INTO setting VALUES (78, 3, \'Last expiry check\', \'\', \'last_expiry_check\', 1045897810, \'text\', 0)',
	'INSERT INTO settinggroup VALUES (8, \'Safe Mode\', \'If PHP is running in Safe Mode you should modify these settings to make sure the program operates fine.\', 11)',
	'INSERT INTO settinggroup VALUES (9, \'Registration Options\', \'\', 3)',
	'INSERT INTO settinggroup VALUES (10, \'Email Reading Options\', \'\', 4)',
	'INSERT INTO settinggroup VALUES (11, \'Spam Filtering\', \'\', 5)',
	'INSERT INTO settinggroup VALUES (12, \'Message Storage\', \'storage\', 0)',
	'INSERT INTO settinggroup VALUES (13, \'GZIP Compression\', \'\', 12)',
	'INSERT INTO settinggroup VALUES (14, \'SMTP Settings\', \'\', 8)',
	'INSERT INTO settinggroup VALUES (15, \'vBulletin Integration\', \'\', 13)',
	'INSERT INTO sound VALUES (1, -1, \'Default\', \'youvegotmail.wav\', \''.base64_decode('[encoded data, 41340 characters]').'\')',
	'EVAL UPDATE setting SET value = \'$smtp_config[host]\' WHERE variable = \'smtp_host\'',
	'EVAL UPDATE setting SET value = \'$smtp_config[port]\' WHERE variable = \'smtp_port\'',
	'EVAL UPDATE setting SET value = \'$smtp_config[helo]\' WHERE variable = \'smtp_helo\'',
	'EVAL UPDATE setting SET value = \'$smtp_config[auth]\' WHERE variable = \'smtp_auth\'',
	'EVAL UPDATE setting SET value = \'$smtp_config[user]\' WHERE variable = \'smtp_user\'',
	'EVAL UPDATE setting SET value = \'$smtp_config[pass]\' WHERE variable = \'smtp_pass\'',
	'UPDATE templategroup SET display = 17 WHERE display = 0',
	'UPDATE settinggroup SET display = 3 WHERE display = 6',
	'UPDATE settinggroup SET display = 4 WHERE display = 7',
	'UPDATE settinggroup SET display = 5 WHERE display = 9',
	'UPDATE settinggroup SET display = 6 WHERE display = 10',
	'UPDATE usergroup SET perms = perms + 2048',
	'UPDATE setting SET settinggroupid = 9 WHERE variable = \'regopen\'',
	'UPDATE setting SET settinggroupid = 9 WHERE variable = \'moderate\'',
	'UPDATE setting SET value = \'1.2\' WHERE variable = \'versionnum\'',
	'UPDATE setting SET display = 2 WHERE variable = \'appname\'',
	'UPDATE setting SET display = 5 WHERE variable = \'select_skin\'',
	'UPDATE setting SET display = 6 WHERE variable = \'minpercentforgauge\'',
	'UPDATE setting SET display = 4 WHERE variable = \'domainname\'',
	'UPDATE setting SET display = 1 WHERE variable = \'maxperpage\'',
	'UPDATE setting SET display = 3 WHERE variable = \'appurl\'',
	'UPDATE setting SET settinggroupid = 9, display = 6 WHERE variable = \'sendgreeting\'',
	'UPDATE setting SET settinggroupid = 9, display = 4 WHERE variable = \'reservedtext\'',
	'UPDATE setting SET settinggroupid = 10, display = 1 WHERE variable = \'allowcid\'',
	'UPDATE setting SET settinggroupid = 9, display = 7 WHERE variable = \'newuseremail\'',
	'UPDATE setting SET title = \'Domain names\' WHERE variable = \'domainname\'',
	'UPDATE setting SET title = \'Maximum size of sound files (in bytes)\', description = \'This is the maximum file size of custom sound files users can upload. 1024 bytes = 1kb.\', display = 2 WHERE variable = \'maxsoundfile\'',
	'UPDATE user SET answer = MD5(answer) WHERE LENGTH(answer) <> 32',
	'INSERT INTO setting (settingid, settinggroupid, title, description, variable, value, type, display) VALUES (NULL, 3, \'Current messages subfolder\', \'DO NOT ALTER\', \'flat_curfolder\', \'\', \'text\', 0)',
	'INSERT INTO setting (settingid, settinggroupid, title, description, variable, value, type, display) VALUES (NULL, 3, \'Current message count in subfolder\', \'DO NOT ALTER\', \'flat_curcount\', \'0\', \'text\', 0)',
	'INSERT INTO setting (settingid, settinggroupid, title, description, variable, value, type, display) VALUES (NULL, 4, \'Maximum size of processed messages\', \'The maximum accumulated size of all messages that are proccesed per session, in megabytes. Please note that if one message alone is larger than this limit, it will still be processed alone but only after all other messages are. Set this to 0 to have messages processed in the order of their arrival without any size limits.\', \'pop3_maxsize\', \'2\', \'text\', 11)',
);

?>