-
Notifications
You must be signed in to change notification settings - Fork 5
/
groupmembership.php
executable file
·63 lines (54 loc) · 1.39 KB
/
groupmembership.php
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
session_start();
if($_SESSION['authuser']!=1)
{
header("Location:index.php");
exit;
}
include('lib/connectionfile.php');
$username=$_POST['username'];
$type=$_POST['type'];
$status=$_POST['status'];
$gid=$_POST['gid'];
switch ($status)
{
case "A":
$count1=dbconfn()->prepare("DELETE FROM w_membership WHERE username='$username' and groupid='$gid';");
$count1->execute();
header("Location:groups?id=$gid");
exit;
break;
case "O":
$sql=dbconfn()->prepare("DELETE from w_groups where groupid='$gid';");
$sql->execute();
$sql=dbconfn()->prepare("DELETE from w_membership where groupid='$gid';");
$sql->execute();
header("Location:home");
exit;
break;
case "R":
$sql=dbconfn()->prepare("DELETE from w_membership where username='$username' and groupid='$gid';");
$sql->execute();
header("Location:groups?id=$gid");
exit;
break;
case "I":
$sql=dbconfn()->prepare("INSERT into w_membership values ('$username','$gid','R');");
$sql->execute();
header("Location:groups?id=$gid");
exit;
break;
case "J":
$sql=dbconfn()->prepare("INSERT into w_membership values ('$username','$gid','A');");
$sql->execute();
header("Location:groups?id=$gid");
exit;
break;
case "K":
$sql=dbconfn()->prepare("UPDATE w_membership set status='A' where username='$username' and groupid='$gid'");
$sql->execute();
header("Location:home");
exit;
break;
}
?>