Revision 1457
Added by Dietmar over 13 years ago
tool.php | ||
---|---|---|
11 | 11 |
* @platform WebsiteBaker 2.8.x |
12 | 12 |
* @requirements PHP 5.2.2 and higher |
13 | 13 |
* @version $Id$ |
14 |
* @filesource $HeadURL: $
|
|
15 |
* @lastmodified $Date: $
|
|
14 |
* @filesource $HeadURL$ |
|
15 |
* @lastmodified $Date$ |
|
16 | 16 |
* |
17 | 17 |
*/ |
18 | 18 |
|
... | ... | |
20 | 20 |
require_once(WB_PATH.'/framework/class.admin.php'); |
21 | 21 |
require_once(WB_PATH.'/framework/functions.php'); |
22 | 22 |
|
23 |
$admin = new admin('admintools', 'admintools'); |
|
24 |
|
|
25 | 23 |
if(!isset($_GET['tool'])) { |
26 | 24 |
header("Location: index.php"); |
27 | 25 |
exit(0); |
26 |
} else { |
|
27 |
$array = array(); |
|
28 |
preg_match("/[a-z,_,a-z]+/i",$_GET['tool'],$array); |
|
29 |
$tool = $array[0]; |
|
28 | 30 |
} |
29 | 31 |
|
32 |
$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 |
|
|
30 | 48 |
// Check if tool is installed |
31 |
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'tool' AND directory = '".preg_replace("/\W/", "", $_GET['tool'])."'");
|
|
49 |
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'tool' AND directory = '".preg_replace("/\W/", "", $tool)."'");
|
|
32 | 50 |
if($result->numRows() == 0) { |
33 | 51 |
header("Location: index.php"); |
34 | 52 |
exit(0); |
35 | 53 |
} |
36 | 54 |
$tool = $result->fetchRow(); |
55 |
if(!isset($_POST['save_settings'])) { |
|
37 | 56 |
|
38 | 57 |
?> |
39 | 58 |
<h4> |
... | ... | |
42 | 61 |
<?php echo $tool['name']; ?> |
43 | 62 |
</h4> |
44 | 63 |
<?php |
64 |
} |
|
45 | 65 |
require(WB_PATH.'/modules/'.$tool['directory'].'/tool.php'); |
46 | 66 |
|
47 | 67 |
$admin->print_footer(); |
48 |
|
|
49 |
?> |
|
50 | 68 |
Also available in: Unified diff
Preparing 2.8.2 stable, last tests