Open Sencillo
2014.008
Main Page
Related Pages
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Files
Functions
Variables
Pages
cookies.php
Go to the documentation of this file.
1
<?php
2
/*~ cookies.php
3
.---------------------------------------------------------------------------.
4
| Software: Sencillo Cookies |
5
| Version: 2014.002 |
6
| Contact:
[email protected]
|
7
| ------------------------------------------------------------------------- |
8
| Author: Bc. Peter Horváth (original founder) |
9
| Copyright (c) 2014, Bc. Peter Horváth. All Rights Reserved. |
10
| ------------------------------------------------------------------------- |
11
| License: Distributed under the General Public License (GPL) |
12
| http://www.gnu.org/copyleft/gpl.html |
13
| This program is distributed in the hope that it will be useful - WITHOUT |
14
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
15
| FITNESS FOR A PARTICULAR PURPOSE. |
16
'---------------------------------------------------------------------------'
17
~*/
18
if
((isset(
$cookie1
))&&(isset(
$cookie2
))&&(isset(
$LoginExp
))&&(
$LoginExp
>3600))
19
{
20
setcookie(
"ulid"
,
$cookie1
,
$LoginExp
);
21
setcookie(
"uid"
,
$cookie2
,
$LoginExp
);
22
}
23
$SiteStatusMessage
=null;
24
//OAKEY subsystem
25
if
(
$SiteOnlyAdmin
==1)
26
{
27
if
((
$SiteOAkey
==$_GET[
'oakey'
]) || ($_COOKIE[
'oakey'
]==
$SiteOAkey
))
28
{
29
if
((
$SiteOAKcookies
==1) && ($_COOKIE[
'oakey'
]!=
$SiteOAkey
)){setcookie(
"oakey"
, $_GET[
'oakey'
],
$OAkeyexpire
);}
30
$SiteStatusMessage
=
"<span class='oakeyunlock'>Access granted by OAKEY=$SiteOAkey. Access only for you!</span><br>"
;
31
}
32
else
33
{
34
$SiteOffLine
=1;
35
}
36
}
37
if
(
$SiteOffLine
==1)
38
{
39
die(
"<html>$SiteOffMessage $footbox</html>"
);
40
}
41
51
class
getCookies
52
{
53
private
$name;
54
private
$expiration;
55
private
$data;
56
60
public
function
__construct
()
61
{
62
$this->expiration = time()+3600;
63
}
64
69
public
function
setExpiration
($time)
70
{
71
$this->expiration = time()+($time*60);
72
}
73
79
public
function
addCookie
($name,$data)
80
{
81
$this->name = $name;
82
83
$this->data = $data;
84
setcookie($this->name,$this->data,$this->expiration);
85
}
86
91
public
function
removeCookie
($name)
92
{
93
$this->name = $name;
94
95
setcookie($this->name,
""
,time()-3600);
96
}
97
103
public
function
getCookie
($name)
104
{
105
$this->name = $name;
106
107
return
$_COOKIE[$this->name];
108
}
109
}
110
?>
$SiteOAKcookies
$SiteOAKcookies
Definition:
main-config.php:85
getCookies\addCookie
addCookie($name, $data)
Definition:
cookies.php:79
$cookie1
$cookie1
Definition:
session.php:146
getCookies\setExpiration
setExpiration($time)
Definition:
cookies.php:69
$SiteStatusMessage
if((isset($cookie1))&&(isset($cookie2))&&(isset($LoginExp))&&($LoginExp >3600)) $SiteStatusMessage
Definition:
cookies.php:23
$SiteOAkey
$SiteOAkey
Definition:
main-config.php:84
getCookies\removeCookie
removeCookie($name)
Definition:
cookies.php:91
getCookies
Definition:
cookies.php:51
getCookies\getCookie
getCookie($name)
Definition:
cookies.php:103
$OAkeyexpire
$OAkeyexpire
Definition:
main-config.php:88
$SiteOnlyAdmin
$SiteOnlyAdmin
Definition:
main-config.php:83
$LoginExp
$LoginExp
Definition:
session.php:149
$cookie2
$cookie2
Definition:
session.php:147
getCookies\__construct
__construct()
Definition:
cookies.php:60
$SiteOffLine
$SiteOffLine
Definition:
main-config.php:81
fw_headers
cookies.php
Generated on Mon Aug 11 2014 23:52:16 for Open Sencillo by
1.8.6