-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.php
More file actions
47 lines (40 loc) · 1.04 KB
/
uninstall.php
File metadata and controls
47 lines (40 loc) · 1.04 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
global $smcFunc, $user_info, $boardurl;
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
require_once(dirname(__FILE__) . '/SSI.php');
elseif (!defined('SMF'))
die('<b>Error:</b> Cannot uninstall - please verify you put this in the same place as SMF\'s Settings.php.');
// If you uninstall manually, you have to be logged in!
if(!$user_info['is_admin'])
{
if($user_info['is_guest'])
{
echo $txt['admin_login'] . ':<br />';
ssi_login($boardurl . '/uninstall.php');
die();
}
else
{
loadLanguage('Errors');
fatal_error($txt['cannot_admin_forum']);
}
}
// Okay, get down to business.
db_extend('packages');
// Delete our three settings.
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}settings
WHERE variable IN ({array_string:ca_settings})',
array(
'ca_settings' => array('ca_enabled', 'ca_cache', 'ca_menu_cache'),
)
);
// Any extra permissions?
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}permissions
WHERE SUBSTRING(permission, 1, 3) = {string:ca_prefix}',
array(
'ca_prefix' => 'ca_',
)
);
?>