forked from realslacker/Downloads-Plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.php
More file actions
27 lines (20 loc) · 1.19 KB
/
uninstall.php
File metadata and controls
27 lines (20 loc) · 1.19 KB
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
<?php
/*
* Downloads Plugin for WolfCMS <http://www.wolfcms.org>
* Copyright (C) 2011 Shannon Brooks <shannon@brooksworks.com>
*
* This file is part of Downloads Plugin. Downloads Plugin is licensed under the GNU GPLv3 license.
* Please see license.txt for the full license text.
*/
// Security Measure
if (!defined('IN_CMS')) { exit(); }
// include the Installer helper
use_helper('Installer');
if ( ! Installer::removeTable(TABLE_PREFIX.'downloads') ) Installer::failUninstall( 'downloads' );
if ( ! Installer::removeTable(TABLE_PREFIX.'downloadtags') ) Installer::failUninstall( 'downloads' );
if ( ! Installer::removeTable(TABLE_PREFIX.'downloads_tags') ) Installer::failUninstall( 'downloads' );
if ( ! Installer::removePermissions('downloads_view,downloads_new,downloads_edit,downloads_delete,downloads_settings') ) Installer::failUninstall( 'downloads' );
if ( ! Installer::removeRoles('download manager admin,download manager editor') ) Installer::failUninstall( 'downloads' );
if ( ! Plugin::deleteAllSettings('downloads') ) Installer::failUninstall( 'downloads', __('Could not remove plugin settings.') );
Flash::set('success', __('Successfully uninstalled plugin.'));
redirect(get_url('setting'));