forked from shamilcm/wireus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroupmembership.php
executable file
·63 lines (48 loc) · 1.95 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");
include('lib/connectionfile.php');
$username=$_POST['username'];
$type=$_POST['type'];
$status=$_POST['status'];
$gid=$_POST['gid'];
if($status=='A')
{
$count1=dbconfn()->prepare("DELETE FROM w_membership WHERE username='$username' and groupid='$gid';");
$count1->execute();
header("Location:groups?id=$gid");
}
if($status=='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");
}
if($status=='R' )
{
$sql=dbconfn()->prepare("DELETE from w_membership where username='$username' and groupid='$gid';");
$sql->execute();
header("Location:groups?id=$gid");
}
if($status=='I')
{
$sql=dbconfn()->prepare("INSERT into w_membership values ('$username','$gid','R');");
$sql->execute();
header("Location:groups?id=$gid");
}
if($status=='J')
{
$sql=dbconfn()->prepare("INSERT into w_membership values ('$username','$gid','A');");
$sql->execute();
header("Location:groups?id=$gid");
}
if($status=='K')
{
$sql=dbconfn()->prepare("UPDATE w_membership set status='A' where username='$username' and groupid='$gid'");
$sql->execute();
header("Location:home");
}
?>