Project

General

Profile

1
<?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: delete_droplet.php 1503 2011-08-18 02:18:59Z Luisehahne $
15
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/modules/droplets/delete_droplet.php $
16
 * @lastmodified    $Date: 2011-08-18 04:18:59 +0200 (Thu, 18 Aug 2011) $
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
$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
27

    
28
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
$droplet_id = intval($admin->checkIDKEY('droplet_id', false, 'GET'));
35
if (!$droplet_id) {
36
 $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $module_edit_link);
37
 exit();
38
}
39
$sql  = 'DELETE FROM `'.TABLE_PREFIX.'mod_droplets` ';
40
$sql .= 'WHERE id = '.$droplet_id;
41

    
42
// Delete droplet
43
$database->query($sql);
44

    
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();
(5-5/16)