forked from simongameryt16/net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swift.php
51 lines (38 loc) · 1.13 KB
/
swift.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
<?php
require 'static/php/system/database.php';
require 'static/php/system/config.php';
?>
<?php
if(isset($_COOKIE['iduser']) and (isset($_COOKIE['inisession']))){
$idperfil = DBEscape( strip_tags(trim($_GET['id']) ) );
$perfil = DBRead('profiles', "WHERE id = '{$idperfil}' LIMIT 1 ");
$perfil = $perfil[0];
$iduser = DBEscape( strip_tags(trim($_COOKIE['iduser']) ) );
$user = DBRead('user', "WHERE id = '{$iduser}' LIMIT 1 ");
$user = $user[0];
if($user){
$user = $user[0];
}else{
echo '<script>location.href="/dashboard";</script>';
}
if($perfil['iduser'] <> $user['id']){
echo '';
setcookie("usuario" , $perfil['id']);
echo '<script>location.href="/dashboard";</script>';
}
else{
setcookie("iduser" , "");
setcookie("inisession" , "");
setcookie("perfil" , "");
setcookie("usuario" , "");
header("location: /account");
}
}
else{
setcookie("iduser" , "");
setcookie("inisession" , "");
setcookie("perfil" , "");
setcookie("usuario" , "");
header("location: account");
}
?>