-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathremovehook.php
More file actions
56 lines (47 loc) · 1.42 KB
/
removehook.php
File metadata and controls
56 lines (47 loc) · 1.42 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
48
49
50
51
52
53
54
55
56
<?php
/******************************
* file removehook *
* Remove the PortaMx hooks *
* Coypright by PortaMx corp. *
*******************************/
global $sourcedir, $boarddir, $boardurl, $smcFunc, $user_info, $txt;
// Load the SSI.php
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
{
function _write($string) { echo $string; }
require_once(dirname(__FILE__) . '/SSI.php');
// on manual installation you have to logged in
if(!$user_info['is_admin'])
{
if($user_info['is_guest'])
{
echo '<b>', $txt['admin_login'],':</b><br />';
ssi_login($boardurl.'/removehook.php');
die();
}
else
{
loadLanguage('Errors');
fatal_error($txt['cannot_admin_forum']);
}
}
}
// no SSI.php and no SMF?
elseif (!defined('SMF'))
die('<b>Error:</b> SSI.php not found. Please verify you put this in the same place as SMF\'s index.php.');
else
{
function _write($string) { return; }
}
// Load the SMF DB Functions
db_extend('packages');
db_extend('extra');
_write('Removing all PortaMx integration hooks.<br />');
remove_integration_function('integrate_pre_include', '$sourcedir/SubForums/Subforums.php');
remove_integration_function('integrate_admin_areas', 'Subforums_AdminMenu');
remove_integration_function('integrate_register', 'Subforums_Register');
_write('Clear the settings cache.<br />');
// clear the cache
cache_put_data('modSettings', null, 90);
_write('removehook done.<br />');
?>