<?php /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Script: Maian Support Written by: David Ian Bennett E-Mail: support@maianscriptworld.co.uk Software Website: http://www.maiansupport.com Script Portal: http://www.maianscriptworld.co.uk ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ This File: user.php Description: Installer File ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ if (!defined('PARENT')) { msw403(); } $data = array(); //========================= // INSTALL USER //========================= $q = mysql_query("INSERT INTO `" . DB_PREFIX . "users` (\n`id`, `ts`, `name`, `email`, `accpass`, `signature`, `notify`, `pageAccess`, `emailSigs`, `notePadEnable`, `delPriv`, `helplink`\n) VALUES (\n1, UNIX_TIMESTAMP(UTC_TIMESTAMP), '" . mswSafeImportString($_POST['user']) . "', '" . mswSafeImportString($_POST['email']) . "', \n'" . md5(SECRET_KEY . $_POST['pass']) . "', '', 'yes', '', 'no', 'yes', 'yes', 'yes'\n)"); if (!$q) { $data[] = DB_PREFIX . 'users'; mswlogDBError(DB_PREFIX . 'users', mysql_error(), mysql_errno(), __LINE__, __FILE__, 'Insert'); }
if (!$query) { $tableD[] = DB_PREFIX . 'userdepts'; mswlogDBError(DB_PREFIX . 'userdepts', mysql_error(), mysql_errno(), __LINE__, __FILE__); } //============================================================ // INSTALL TABLE...USERS.. //============================================================ mysql_query("DROP TABLE IF EXISTS `" . DB_PREFIX . "users`"); $query = mysql_query("\nCREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "users` (\n `id` int(5) NOT NULL AUTO_INCREMENT,\n `ts` int(30) NOT NULL DEFAULT '0',\n `name` varchar(100) NOT NULL DEFAULT '',\n `email` varchar(250) NOT NULL DEFAULT '',\n `email2` text default null,\n `accpass` varchar(32) NOT NULL DEFAULT '',\n `signature` text default null,\n `notify` enum('yes','no') NOT NULL DEFAULT 'yes',\n `pageAccess` text default null,\n `emailSigs` enum('yes','no') NOT NULL DEFAULT 'no',\n `notePadEnable` enum('yes','no') NOT NULL DEFAULT 'yes',\n `delPriv` enum('yes','no') NOT NULL DEFAULT 'no',\n `nameFrom` varchar(250) NOT NULL DEFAULT '',\n `emailFrom` varchar(250) NOT NULL DEFAULT '',\n `assigned` enum('yes','no') NOT NULL DEFAULT 'no',\n `timezone` varchar(50) NOT NULL DEFAULT 'Europe/London',\n `enabled` enum('yes','no') NOT NULL DEFAULT 'yes',\n `notes` text default null,\n `ticketHistory` enum('yes','no') NOT NULL DEFAULT 'yes',\n `enableLog` enum('yes','no') NOT NULL DEFAULT 'yes',\n `mailbox` enum('yes','no') NOT NULL DEFAULT 'yes',\n `mailFolders` int(3) NOT NULL DEFAULT '5',\n `mailDeletion` enum('yes','no') NOT NULL DEFAULT 'yes',\n `mailScreen` enum('yes','no') NOT NULL DEFAULT 'yes',\n `mailCopy` enum('yes','no') NOT NULL DEFAULT 'yes',\n `mailPurge` int(3) NOT NULL DEFAULT '0',\n `addpages` text default null,\n `mergeperms` enum('yes','no') NOT NULL DEFAULT 'yes',\n `digest` enum('yes','no') NOT NULL DEFAULT 'yes',\n `digestasg` enum('yes','no') NOT NULL DEFAULT 'no',\n `profile` enum('yes','no') NOT NULL DEFAULT 'yes',\n `helplink` enum('yes','no') NOT NULL DEFAULT 'no',\n `defDays` int(3) NOT NULL DEFAULT '45',\n PRIMARY KEY (`id`),\n INDEX `email_index` (`email`),\n INDEX `nty_index` (`notify`)\n) {$tableType}"); if (!$query) { $tableD[] = DB_PREFIX . 'users'; mswlogDBError(DB_PREFIX . 'users', mysql_error(), mysql_errno(), __LINE__, __FILE__); } //============================================================ // INSTALL TABLE...USERSACCESS.. //============================================================ mysql_query("DROP TABLE IF EXISTS `" . DB_PREFIX . "usersaccess`"); $query = mysql_query("\nCREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "usersaccess` (\n `id` int(5) NOT NULL AUTO_INCREMENT,\n `page` varchar(100) NOT NULL DEFAULT '',\n `userID` varchar(250) NOT NULL DEFAULT '',\n `type` varchar(32) NOT NULL DEFAULT '',\n PRIMARY KEY (`id`),\n INDEX `user_index` (`userID`)\n) {$tableType}"); if (!$query) { $tableD[] = DB_PREFIX . 'tickets'; mswlogDBError(DB_PREFIX . 'tickets', mysql_error(), mysql_errno(), __LINE__, __FILE__); } //============================================================ // INSTALL TABLE...ROLES.. //============================================================ mysql_query("DROP TABLE IF EXISTS `" . DB_PREFIX . "roles`"); $query = mysql_query("\nCREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "roles` (\n `id` int(5) NOT NULL AUTO_INCREMENT,\n `name` varchar(100) NOT NULL DEFAULT '',\n PRIMARY KEY (`id`)\n) {$tableType}"); if (!$query) { $tableD[] = DB_PREFIX . 'roles'; mswlogDBError(DB_PREFIX . 'roles', mysql_error(), mysql_errno(), __LINE__, __FILE__); }
//========================= $levels = array('Low', 'Medium', 'High'); mysql_query("TRUNCATE TABLE `" . DB_PREFIX . "levels`"); for ($i = 0; $i < count($levels); $i++) { $levelID = $i + 1; $q = mysql_query("INSERT INTO `" . DB_PREFIX . "levels` (`id`, `name`, `display`, `marker`, `orderBy`) VALUES (" . $levelID . ", '" . $levels[$i] . "', 'yes', '" . strtolower($levels[$i]) . "', " . $levelID . ")"); if (!$q) { $data[] = DB_PREFIX . 'levels'; mswlogDBError(DB_PREFIX . 'levels', mysql_error(), mysql_errno(), __LINE__, __FILE__, 'Insert ' . $levelID); } } //========================= // B8 Filters //========================= mysql_query("TRUNCATE TABLE `" . DB_PREFIX . "imap_b8`"); mysql_query("TRUNCATE TABLE `" . DB_PREFIX . "imap_b8_filter`"); $q = mysql_query("INSERT INTO `" . DB_PREFIX . "imap_b8` (`id`, `tokens`, `min_size`, `max_size`, `min_dev`, `x_constant`, `s_constant`, `learning`, \n`num_parse`, `uri_parse`, `html_parse`, `multibyte`, `encoder`, `skipFilters`\n) VALUES (\n1, 15, 3, 30, '0.5', '0.5', '0.3', 'yes', 'no', 'yes', 'yes', 'yes', 'UTF-8', 'mailer-daemon')"); if (!$q) { $data[] = DB_PREFIX . 'imap_b8'; mswlogDBError(DB_PREFIX . 'imap_b8', mysql_error(), mysql_errno(), __LINE__, __FILE__, 'Insert 1'); } $q = mysql_query("INSERT INTO `" . DB_PREFIX . "imap_b8_filter` (`token`, `count_ham`, `count_spam`, `ts`) VALUES ('b8*dbversion', 3, 0, 0)"); if (!$q) { $data[] = DB_PREFIX . 'imap_b8_filter'; mswlogDBError(DB_PREFIX . 'imap_b8_filter', mysql_error(), mysql_errno(), __LINE__, __FILE__, 'Insert 1'); } $q = mysql_query("INSERT INTO `" . DB_PREFIX . "imap_b8_filter` (`token`, `count_ham`, `count_spam`, `ts`) VALUES ('b8*texts', 0, 0, 0)"); if (!$q) { $data[] = DB_PREFIX . 'imap_b8_filter'; mswlogDBError(DB_PREFIX . 'imap_b8_filter', mysql_error(), mysql_errno(), __LINE__, __FILE__, 'Insert 2'); }