-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgCalSync-uninstall.php
63 lines (57 loc) · 2.41 KB
/
gCalSync-uninstall.php
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/************************************************************************
* gCalSync-uninstall.php *
*************************************************************************
* gCalSync *
* Copyright 2009-2015 Armen Kaleshian <armen@kriation.com> *
* License: GNU GPL (v3 or later). See LICENSE.txt for details. *
* *
* An enhancement for SMF to synchronize forum calendar entries with a *
* Google Calendar. *
* ********************************************************************* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
if ( !defined( 'SMF' ) )
die( 'Hacking attempt...' );
// List of gCalSync parameters to remove from settings
$gcalsync_settings = array(
'gcal_sec_include',
'gcal_sec',
'gcal_auth',
'gcal_calid');
foreach ( $gcalsync_settings as $setting )
{
// Remove the gCalSync settings from the settings table
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}settings
WHERE variable = {string:gcalsync_setting}',
array( 'gcalsync_setting' => $setting )
);
}
// Without this definition, we don't have access to db_drop_table
db_extend('packages');
// Drop gCalSync table
$smcFunc['db_drop_table']( '{db_prefix}gcalsync' );
// Database is cleansed. Remove hooks
remove_integration_function('integrate_pre_include',
'$sourcedir/google-api/autoload.php' );
remove_integration_function('integrate_pre_include',
'$sourcedir/gCalSync.php' );
remove_integration_function('integrate_admin_include',
'$sourcedir/gCalSync-admin.php');
remove_integration_function('integrate_admin_areas',
'add_gCalSync_menu' );
remove_integration_function('integrate_modify_modifications',
'add_gCalSync_admin' );
?>