Project

General

Profile

« Previous | Next » 

Revision 1457

Added by Dietmar almost 13 years ago

Preparing 2.8.2 stable, last tests

View differences:

delete_droplet.php
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$

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
// check website baker platform (with WB 2.7, Admin-Tools were moved out of settings dialogue)

27
if(file_exists(ADMIN_PATH .'/admintools/tool.php')) {

28
	$admintool_link = ADMIN_URL .'/admintools/index.php';

29
	$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';

30
	$admin = new admin('admintools', 'admintools');

31
} else {

32
	$admintool_link = ADMIN_URL .'/settings/index.php?advanced=yes#administration_tools"';

33
	$module_edit_link = ADMIN_URL .'/settings/tool.php?tool=droplets';

34
	$admin = new admin('Settings', 'settings_advanced');

35
}

36

  
37
// Get id

38
$droplet_id = $admin->checkIDKEY('droplet_id', false, 'GET');

39
if (!$droplet_id) {

40
 $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL);

41
 exit();

42
}

43

  
44
// Delete droplet

45
$database->query("DELETE FROM ".TABLE_PREFIX."mod_droplets WHERE id = '$droplet_id' LIMIT 1");

46

  
47
// Check if there is a db error, otherwise say successful

48
if($database->is_error()) {

49
	$admin->print_error($database->get_error(), WB_URL.'/modules/droplets/modify_droplet.php?droplet_id='.$droplet_id);

50
} else {

51
    $admin->print_success($TEXT['SUCCESS'], $module_edit_link);

52
}

53

  
54
// Print admin footer

55
$admin->print_footer();

56

  
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$
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
// check website baker platform (with WB 2.7, Admin-Tools were moved out of settings dialogue)
27
if(file_exists(ADMIN_PATH .'/admintools/tool.php')) {
28
	$admintool_link = ADMIN_URL .'/admintools/index.php';
29
	$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
30
	$admin = new admin('admintools', 'admintools');
31
} else {
32
	$admintool_link = ADMIN_URL .'/settings/index.php?advanced=yes#administration_tools"';
33
	$module_edit_link = ADMIN_URL .'/settings/tool.php?tool=droplets';
34
	$admin = new admin('Settings', 'settings_advanced');
35
}
36

  
37
// Get id
38
$droplet_id = $admin->checkIDKEY('droplet_id', false, 'GET');
39
if (!$droplet_id) {
40
 $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL);
41
 exit();
42
}
43

  
44
// Delete droplet
45
$database->query("DELETE FROM ".TABLE_PREFIX."mod_droplets WHERE id = '$droplet_id' LIMIT 1");
46

  
47
// Check if there is a db error, otherwise say successful
48
if($database->is_error()) {
49
	$admin->print_error($database->get_error(), WB_URL.'/modules/droplets/modify_droplet.php?droplet_id='.$droplet_id);
50
} else {
51
    $admin->print_success($TEXT['SUCCESS'], $module_edit_link);
52
}
53

  
54
// Print admin footer
55
$admin->print_footer();
56

  
57 57
?>
58 58

  

Also available in: Unified diff