about summary refs log tree commit diff stats
path: root/series/trunk/admin/deleteuser.php
blob: 7d1b0a019534d36f4a48993bd22abf5a33b7e9d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php

/* InstaDisc Series - A Four Island Project */

/** 
 * require_once() is used to ensure
 * the ACP files are being called by
 * admin.php instead of their actual
 * locations admin/.
 * The _once() part ensures no problem
 * arises as includes/instadisc.php has
 * already been included from admin.php
 */
require_once('includes/instadisc.php');

if (!isset($_SESSION['username']))
{
	header('Location: index.php');
	exit;
}

if (!instaDisc_isAdmin($_SESSION['username']))
{
	header('Location: index.php');
	exit;
}

if (!isset($_GET['submit']))
{
	$template = new FITemplate('deleteuser');
	$template->add('SITENAME',instaDisc_getConfig('siteName'));
	$template->add('ID',$_GET['userid']);

	$sub = instaDisc_getUserByID($_GET['userid']);
	$template->add('USERNAME',$sub['username']);
	$template->display();
} else {
	if ($_POST['submit'] == 'Yes')
	{
		instaDisc_deleteUser($_POST['id']);
		
		$template = new FITemplate('deleteduser');
		$template->display();
	} else {
		header('Location: admin.php?id=main');
	}
}

?>