diff options
Diffstat (limited to 'series/trunk/admin/deletesub.php')
-rw-r--r-- | series/trunk/admin/deletesub.php | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/series/trunk/admin/deletesub.php b/series/trunk/admin/deletesub.php new file mode 100644 index 0000000..37b0bee --- /dev/null +++ b/series/trunk/admin/deletesub.php | |||
@@ -0,0 +1,70 @@ | |||
1 | <?php | ||
2 | |||
3 | /* InstaDisc Series - A Four Island Project */ | ||
4 | |||
5 | /** | ||
6 | * require_once() is used to ensure | ||
7 | * the ACP files are being called by | ||
8 | * admin.php instead of their actual | ||
9 | * locations admin/. | ||
10 | * The _once() part ensures no problem | ||
11 | * arises as includes/instadisc.php has | ||
12 | * already been included from admin.php | ||
13 | */ | ||
14 | require_once('includes/instadisc.php'); | ||
15 | |||
16 | if (!isset($_SESSION['username'])) | ||
17 | { | ||
18 | header('Location: index.php'); | ||
19 | } | ||
20 | |||
21 | if (!instaDisc_isAdmin($_SESSION['username'])) | ||
22 | { | ||
23 | $subs = instaDisc_listSubscriptions($_SESSION['username']); | ||
24 | $i=0; | ||
25 | $notfound=1; | ||
26 | for ($i=0;isset($subs[$i]);$i++) | ||
27 | { | ||
28 | if (!isset($_GET['submit'])) | ||
29 | { | ||
30 | if ($subs[$i]['identity'] == $_POST['id']) | ||
31 | { | ||
32 | $notfound=0; | ||
33 | } | ||
34 | } else { | ||
35 | if ($subs[$i]['id'] == $_GET['subid']) | ||
36 | { | ||
37 | $notfound=0; | ||
38 | } | ||
39 | } | ||
40 | } | ||
41 | |||
42 | if ($notfound == 1) | ||
43 | { | ||
44 | header('Location: index.php'); | ||
45 | exit; | ||
46 | } | ||
47 | } | ||
48 | |||
49 | if (!isset($_GET['submit'])) | ||
50 | { | ||
51 | $template = new FITemplate('deletesub'); | ||
52 | $template->add('SITENAME',instaDisc_getConfig('siteName')); | ||
53 | $template->add('ID',$_GET['subid']); | ||
54 | |||
55 | $sub = instaDisc_getSubscription($_GET['subid']); | ||
56 | $template->add('IDENTITY',$sub['identity']); | ||
57 | $template->display(); | ||
58 | } else { | ||
59 | if ($_POST['submit'] == 'Yes') | ||
60 | { | ||
61 | instaDisc_deleteSubscription($_POST['id']); | ||
62 | |||
63 | $template = new FITemplate('deletedsub'); | ||
64 | $template->display(); | ||
65 | } else { | ||
66 | header('Location: admin.php?id=main'); | ||
67 | } | ||
68 | } | ||
69 | |||
70 | ?> | ||