-
Notifications
You must be signed in to change notification settings - Fork 1
/
tool.php
76 lines (71 loc) · 2.42 KB
/
tool.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
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* WebsiteBaker CMS AdminTool: wbSeoTool
*
* tool.php
*
* @platform CMS WebsiteBaker 2.8.x
* @package wbSeoTool
* @author Christian M. Stefan (Stefek)
* @copyright Christian M. Stefan
* @license http://www.gnu.org/licenses/gpl-2.0.html
*/
//no direct file access
if(count(get_included_files())==1) die(header("Location: ../index.php", TRUE, 301));
// user needs permission for admintools OR pages
if(!$admin->get_permission('admintools')) {
exit("insuficient privileges");
}
// Load Functions File
$sFunctionsFile = __DIR__.'/functions.php';
if(file_exists($sFunctionsFile)) require_once $sFunctionsFile;
// include language file (old way)
include WB_PATH.'/framework/module.functions.php';
include get_module_language_file($sDirname);
$pos = isset($_GET["pos"]) ? $_GET["pos"] : 'modify_strings';
// FEE link? (Comes from the FE to change FEE setting)
if(isset($_GET['backlink']) && isset($_GET['fee'])){
if(in_array($_GET['fee'], array('yes', 'no'))){
updateCfg('fe_edit', $_GET['fee']);
header('Location:'.$_GET['backlink']);
}
}
include __DIR__.'/functions/droplets.functions.php';
if(isset($_GET['func']) && ($_GET['func'] == "install_droplet")){
$sDropletFile = __DIR__.'/droplets/string.php';
if(is_readable($sDropletFile)){
#wb_dump(dirname($sDropletFile), '$sDropletFile');
if(importDropletFromFile($sDropletFile)){
$sMsg = '&msg=&msgtype=success';
$params = array(
'pos' => $pos, //same
'msg' => 'TOOL_TEXT:DROPLET_REINSTALLED',
'msgtype' => 'success'
);
header('Location:'.$toolUrl.'&'.http_build_query($params));
}
}else{
$aMsg['error'] = str_replace(WB_PATH, '[ROOT]', $sDropletFile).' was not found!';
}
}
// initiate $aMsg array for later output.
$aMsg = array();
$config = getStringsCfg();
$oCfg = getStringsCfg();
$aStringTypes = explode(',', $oCfg->string_types); // wysiwyg, textarea, shorttext
// include the file based on $_GET['pos']
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$sFileName = '';
switch ($pos) {
// no switch yet
case 'help': $sFileName = 'help'; break;
case 'modify_config': $sFileName = 'modify_config'; break;
case 'modify_strings':
default: $sFileName = 'modify_strings'; break;
}
$sFile = __DIR__.'/'.$sFileName.'.php';
if(file_exists($sFile)) {
include $sFile;
} else {
echo "file <tt>{$sFileName}.php</tt> not found";
}