root / deleteUser.php

1
<?php
2
3
/*
4
5
  Copyright (C) 2010, All Rights Reserved.
6
7
  This file is part of RPInventory.
8
9
  RPInventory is free software: you can redistribute it and/or modify
10
  it under the terms of the GNU General Public License as published by
11
  the Free Software Foundation, either version 3 of the License, or
12
  (at your option) any later version.
13
14
  RPInventory is distributed in the hope that it will be useful,
15
  but WITHOUT ANY WARRANTY; without even the implied warranty of
16
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
  GNU General Public License for more details.
18
19
  You should have received a copy of the GNU General Public License
20
  along with RPInventory.  If not, see <http://www.gnu.org/licenses/>.
21
22
 */
23
24
require_once('lib/users.lib.php');
25
require_once("lib/auth.lib.php");  //Session
26
require_once('class/database.class.php');
27
28
// Connect
29
$db = new database();
30
31
//Authenticate
32
$auth = GetAuthority();        
33
if ($auth < 2)
34
{
35
    die("You dont have permission to access this page");
36
}
37
38
//id
39
$id = (int)$_GET["id"];
40
if ($id == 0)
41
{
42
    die("Invalid ID");
43
}
44
45
//Remove login
46
deleteUser($id, $db);
47
48
$db->close();
49
50
header('Location: manageUsers.php');
51
52
?>
53