Project

General

Profile

1 1457 Luisehahne
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9
 * @copyright       2009-2011, Website Baker Org. e.V.
10
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13
 * @requirements    PHP 5.2.2 and higher
14
 * @version         $Id$
15
 * @filesource		$HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
19
20
require('../../config.php');
21
22
// Include WB admin wrapper script
23
require_once(WB_PATH.'/framework/class.admin.php');
24
require_once(WB_PATH.'/framework/functions.php');
25
26 1473 Luisehahne
$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
27 1503 Luisehahne
28 1457 Luisehahne
if(file_exists(ADMIN_PATH .'/admintools/tool.php')) {
29
	$admintool_link = ADMIN_URL .'/admintools/index.php';
30
	$admin = new admin('admintools', 'admintools');
31
}
32
33
// Get id
34 1503 Luisehahne
$droplet_id = intval($admin->checkIDKEY('droplet_id', false, 'GET'));
35 1457 Luisehahne
if (!$droplet_id) {
36 1473 Luisehahne
 $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $module_edit_link);
37 1457 Luisehahne
 exit();
38
}
39 1503 Luisehahne
$sql  = 'DELETE FROM `'.TABLE_PREFIX.'mod_droplets` ';
40
$sql .= 'WHERE id = '.$droplet_id;
41 1457 Luisehahne
42
// Delete droplet
43 1503 Luisehahne
$database->query($sql);
44 1457 Luisehahne
45
// Check if there is a db error, otherwise say successful
46
if($database->is_error()) {
47
	$admin->print_error($database->get_error(), WB_URL.'/modules/droplets/modify_droplet.php?droplet_id='.$droplet_id);
48
} else {
49
    $admin->print_success($TEXT['SUCCESS'], $module_edit_link);
50
}
51
52
// Print admin footer
53
$admin->print_footer();