Update uninstaller
This commit is contained in:
parent
cc58d84311
commit
ac3ba746f6
@ -9,32 +9,8 @@ require('../sql/uninstallSql.php');
|
||||
$task = $_POST['task'];
|
||||
if ($task == 'status-change') {
|
||||
replaceStatusColumn();
|
||||
} elseif ($task == 'autorefresh') {
|
||||
removeAutorefresh();
|
||||
} elseif ($task == 'parent-child') {
|
||||
removeParentColumn();
|
||||
} elseif ($task == 'settings-access') {
|
||||
removeHelpDeskSettingsPermission();
|
||||
} elseif ($task == 'activate-user') {
|
||||
removeActiveColumn();
|
||||
} elseif ($task == 'notify-note-unassigned') {
|
||||
removeNotifyNoteUnassigned();
|
||||
} elseif ($task == 'user-manage-notification-settings') {
|
||||
removeUserManageOwnNotificationSettingsColumn();
|
||||
} elseif ($task == 'settings-table') {
|
||||
removeSettingsTable();
|
||||
} elseif ($task == 'verified-emails-table') {
|
||||
removeVerifiedEmailsTable();
|
||||
} elseif ($task == 'pending-verification-emails-table') {
|
||||
removePendingVerificationEmailsTable();
|
||||
} elseif ($task == 'pending-verification-tickets-table') {
|
||||
removeTicketsPendingVerificationTable();
|
||||
} elseif ($task == 'service-message-icon') {
|
||||
removeServiceMessageCustomIcon();
|
||||
} elseif ($task == 'location') {
|
||||
removeTicketLocation();
|
||||
} elseif ($task == 'miscellaneous') {
|
||||
executeMiscellaneousSql();
|
||||
} elseif ($task == 'drop-columns') {
|
||||
removeOtherColumns();
|
||||
} else {
|
||||
http_response_code(400);
|
||||
}
|
||||
|
@ -1,8 +1,5 @@
|
||||
function getTasks() {
|
||||
return ['status-change', 'autorefresh', 'parent-child', 'settings-access', 'activate-user',
|
||||
'notify-note-unassigned', 'user-manage-notification-settings', 'settings-table', 'verified-emails-table',
|
||||
'pending-verification-emails-table', 'pending-verification-tickets-table', 'service-message-icon', 'location',
|
||||
'miscellaneous'];
|
||||
return ['status-change', 'drop-columns'];
|
||||
}
|
||||
|
||||
function processUninstallation() {
|
||||
|
@ -59,97 +59,27 @@ function replaceStatusColumn() {
|
||||
executeQuery("DROP TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`");
|
||||
}
|
||||
|
||||
function removeAutorefresh() {
|
||||
global $hesk_settings;
|
||||
|
||||
hesk_dbConnect();
|
||||
function removeOtherColumns() {
|
||||
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` DROP COLUMN `autorefresh`");
|
||||
}
|
||||
|
||||
function removeParentColumn() {
|
||||
global $hesk_settings;
|
||||
|
||||
hesk_dbConnect();
|
||||
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` DROP COLUMN `parent`");
|
||||
}
|
||||
|
||||
function removeHelpDeskSettingsPermission() {
|
||||
global $hesk_settings;
|
||||
|
||||
hesk_dbConnect();
|
||||
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` DROP COLUMN `can_manage_settings`");
|
||||
}
|
||||
|
||||
function removeActiveColumn() {
|
||||
global $hesk_settings;
|
||||
|
||||
hesk_dbConnect();
|
||||
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` DROP COLUMN `active`");
|
||||
}
|
||||
|
||||
function removeNotifyNoteUnassigned() {
|
||||
global $hesk_settings;
|
||||
|
||||
hesk_dbConnect();
|
||||
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` DROP COLUMN `notify_note_unassigned`");
|
||||
}
|
||||
|
||||
function removeUserManageOwnNotificationSettingsColumn() {
|
||||
global $hesk_settings;
|
||||
|
||||
hesk_dbConnect();
|
||||
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` DROP COLUMN `can_change_notification_settings`");
|
||||
}
|
||||
|
||||
function removeSettingsTable() {
|
||||
global $hesk_settings;
|
||||
|
||||
hesk_dbConnect();
|
||||
executeQuery("DROP TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings`");
|
||||
}
|
||||
|
||||
function removeVerifiedEmailsTable() {
|
||||
global $hesk_settings;
|
||||
|
||||
hesk_dbConnect();
|
||||
executeQuery("DROP TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."verified_emails`");
|
||||
}
|
||||
|
||||
function removePendingVerificationEmailsTable() {
|
||||
global $hesk_settings;
|
||||
|
||||
hesk_dbConnect();
|
||||
executeQuery("DROP TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."pending_verification_emails`");
|
||||
}
|
||||
|
||||
function removeTicketsPendingVerificationTable() {
|
||||
global $hesk_settings;
|
||||
|
||||
hesk_dbConnect();
|
||||
executeQuery("DROP TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."stage_tickets`");
|
||||
}
|
||||
|
||||
function removeServiceMessageCustomIcon() {
|
||||
global $hesk_settings;
|
||||
|
||||
hesk_dbConnect();
|
||||
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."service_messages` DROP COLUMN `icon`");
|
||||
}
|
||||
|
||||
function removeTicketLocation() {
|
||||
global $hesk_settings;
|
||||
|
||||
hesk_dbConnect();
|
||||
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` DROP COLUMN `latitude`");
|
||||
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` DROP COLUMN `longitude`");
|
||||
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."stage_tickets` DROP COLUMN `latitude`");
|
||||
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."stage_tickets` DROP COLUMN `longitude`");
|
||||
}
|
||||
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."categories` DROP COLUMN `manager`");
|
||||
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` DROP COLUMN `permission_template`");
|
||||
executeQuery("DROP TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."permission_templates`");
|
||||
|
||||
function executeMiscellaneousSql() {
|
||||
global $hesk_settings;
|
||||
|
||||
hesk_dbConnect();
|
||||
// These queries are ran in case someone used an unfortunate installation they may have not properly cleaned up tables
|
||||
executeQuery('DROP TABLE IF EXISTS `'.hesk_dbEscape($hesk_settings['db_pfix']).'denied_ips`');
|
||||
executeQuery('DROP TABLE IF EXISTS `'.hesk_dbEscape($hesk_settings['db_pfix']).'denied_emails`');
|
||||
|
@ -5,20 +5,8 @@ require(HESK_PATH . 'install/install_functions.inc.php');
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
|
||||
function echoTaskRows() {
|
||||
printUninstallRow('Change status column to default HESK values', 'status-change');
|
||||
printUninstallRow('Remove autorefresh feature', 'autorefresh');
|
||||
printUninstallRow('Remove parent-child ticket relationships', 'parent-child');
|
||||
printUninstallRow('Remove explicit help desk settings permission', 'settings-access');
|
||||
printUninstallRow('Remove activate/deactivate users settings', 'activate-user');
|
||||
printUninstallRow('Remove Mods for HESK-added notification settings', 'notify-note-unassigned');
|
||||
printUninstallRow('Remove "user can manage notification settings" feature', 'user-manage-notification-settings');
|
||||
printUninstallRow('Remove settings table', 'settings-table');
|
||||
printUninstallRow('Remove verified emails table', 'verified-emails-table');
|
||||
printUninstallRow('Remove pending verification emails table', 'pending-verification-emails-table');
|
||||
printUninstallRow('Remove tickets pending verification table', 'pending-verification-tickets-table');
|
||||
printUninstallRow('Remove custom service messages icon', 'service-message-icon');
|
||||
printUninstallRow('Remove ticket location', 'location');
|
||||
printUninstallRow('Miscellaneous database cleanup changes', 'miscellaneous');
|
||||
printUninstallRow('Remove custom statuses', 'status-change');
|
||||
printUninstallRow('Reset other tables', 'drop-columns');
|
||||
}
|
||||
|
||||
function printUninstallRow($text, $id) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user