-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsendMessage.php
More file actions
62 lines (37 loc) · 1.53 KB
/
Copy pathsendMessage.php
File metadata and controls
62 lines (37 loc) · 1.53 KB
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
<?php
include('security.php');
include('connect_db.php');
$collection = $_GET["collection"];
$id = $_GET["id"];
$me = $_SESSION["actualUser"];
$type = $_GET["type"];
//Enviar mensajes de invitación o de eliminación de permisos sobre la colección. También para mandar mensajes entre usuarios para pedir acceso a una colección
if ($type == "invitation") {
$query = "INSERT INTO Fleckr.Send_mail VALUES ('$me','$id','Plz take a look of my collection $collection k thx')";
//echo $query;
$result = mysql_query($query);
header("Location: inviteUsersCollection.php?collection=$collection");
}
if ($type == "deleteInvitation") {
$query = "INSERT INTO Fleckr.Send_mail VALUES ('$me','$id','Your permits have been removed from the collection $collection')";
//echo $query;
$result = mysql_query($query);
$query2 = " DELETE FROM Fleckr.Send_mail WHERE ID_COLLECTION = '$collection' AND ID_USER = '$id'";
$result2 = mysql_query($query2);
header("Location: inviteUsersCollection.php?collection=$collection");
}
if ($type == "request") {
$query = "INSERT INTO Fleckr.Send_mail VALUES ('$me','$id','Let me take a look at your collection $collection. Thanks.')";
//echo $query;
$result = mysql_query($query);
$query = "SELECT * FROM Fleckr.Authorize WHERE ID_USER = '$me'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
if ($row['PERMITS'] == 'Complete') {
header("Location: userControlPanel.php");
}
else if ($row['PERMITS'] == 'Basic') {
header("Location: basicUserControlPanel.php");
}
}
?>