forked from Repox/SimpleUsers
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremoveinfo.php
More file actions
32 lines (23 loc) · 743 Bytes
/
removeinfo.php
File metadata and controls
32 lines (23 loc) · 743 Bytes
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
<?php
/**
* Make sure you started your'e sessions!
* You need to include su.inc.php to make SimpleUsers Work
* After that, create an instance of SimpleUsers and your'e all set!
*/
session_start();
require_once(dirname(__FILE__)."/simpleusers/su.inc.php");
$SimpleUsers = new SimpleUsers();
// This is a simple way of validating if a user is logged in or not.
// If the user is logged in, the value is (bool)true - otherwise (bool)false.
if( !$SimpleUsers->logged_in )
{
header("Location: login.php");
exit;
}
// If the user is logged in, we can safely proceed.
$userId = $_GET["userId"];
$db_key = urldecode($_GET["db_key"]);
$SimpleUsers->removeInfo($db_key, $userId);
header("Location: users.php");
exit;
?>