1 |
536
|
doc
|
<?php
|
2 |
1398
|
FrankH
|
/**
|
3 |
|
|
*
|
4 |
|
|
* @category admin
|
5 |
|
|
* @package admintools
|
6 |
|
|
* @author WebsiteBaker Project
|
7 |
|
|
* @copyright 2004-2009, Ryan Djurovich
|
8 |
|
|
* @copyright 2009-2011, Website Baker Org. e.V.
|
9 |
|
|
* @link http://www.websitebaker2.org/
|
10 |
|
|
* @license http://www.gnu.org/licenses/gpl.html
|
11 |
|
|
* @platform WebsiteBaker 2.8.x
|
12 |
|
|
* @requirements PHP 5.2.2 and higher
|
13 |
|
|
* @version $Id$
|
14 |
1457
|
Luisehahne
|
* @filesource $HeadURL$
|
15 |
|
|
* @lastmodified $Date$
|
16 |
1398
|
FrankH
|
*
|
17 |
|
|
*/
|
18 |
536
|
doc
|
|
19 |
|
|
require('../../config.php');
|
20 |
|
|
require_once(WB_PATH.'/framework/class.admin.php');
|
21 |
|
|
require_once(WB_PATH.'/framework/functions.php');
|
22 |
|
|
|
23 |
|
|
if(!isset($_GET['tool'])) {
|
24 |
|
|
header("Location: index.php");
|
25 |
|
|
exit(0);
|
26 |
1457
|
Luisehahne
|
} else {
|
27 |
|
|
$array = array();
|
28 |
|
|
preg_match("/[a-z,_,a-z]+/i",$_GET['tool'],$array);
|
29 |
|
|
$tool = $array[0];
|
30 |
536
|
doc
|
}
|
31 |
|
|
|
32 |
1457
|
Luisehahne
|
$list = array();
|
33 |
|
|
if(isset($_POST['save_settings'])) {
|
34 |
|
|
$ModulesUsingFTAN = ADMIN_PATH.'/admintools/modules.inc';
|
35 |
|
|
if(file_exists($ModulesUsingFTAN)){
|
36 |
|
|
if(($list = file($ModulesUsingFTAN, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES)) !== false)
|
37 |
|
|
{
|
38 |
|
|
// remove remark-lines
|
39 |
|
|
$list = preg_grep('/^\s*?[^#;]/', $list);
|
40 |
|
|
}
|
41 |
|
|
}
|
42 |
|
|
}
|
43 |
|
|
|
44 |
|
|
$admin_header = (in_array($tool, $list) ? false : true);
|
45 |
|
|
$admin = new admin('admintools', 'admintools',$admin_header );
|
46 |
|
|
unset($list);
|
47 |
|
|
|
48 |
536
|
doc
|
// Check if tool is installed
|
49 |
1457
|
Luisehahne
|
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'tool' AND directory = '".preg_replace("/\W/", "", $tool)."'");
|
50 |
536
|
doc
|
if($result->numRows() == 0) {
|
51 |
|
|
header("Location: index.php");
|
52 |
|
|
exit(0);
|
53 |
|
|
}
|
54 |
|
|
$tool = $result->fetchRow();
|
55 |
1457
|
Luisehahne
|
if(!isset($_POST['save_settings'])) {
|
56 |
536
|
doc
|
|
57 |
|
|
?>
|
58 |
944
|
Ruebenwurz
|
<h4>
|
59 |
536
|
doc
|
<a href="<?php echo ADMIN_URL; ?>/admintools/index.php"><?php echo $HEADING['ADMINISTRATION_TOOLS']; ?></a>
|
60 |
1035
|
Ruebenwurz
|
»
|
61 |
536
|
doc
|
<?php echo $tool['name']; ?>
|
62 |
|
|
</h4>
|
63 |
|
|
<?php
|
64 |
1457
|
Luisehahne
|
}
|
65 |
536
|
doc
|
require(WB_PATH.'/modules/'.$tool['directory'].'/tool.php');
|
66 |
|
|
|
67 |
|
|
$admin->print_footer();
|