Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
ludotheque
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
18
Issues
18
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Denis S. Valdenaire
ludotheque
Commits
acf76cc8
Commit
acf76cc8
authored
Apr 22, 2017
by
Denis S. Valdenaire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ajout sessions sur saas
parent
0460d0e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
webroot/classes/session_saas.php
webroot/classes/session_saas.php
+21
-9
No files found.
webroot/classes/session_saas.php
View file @
acf76cc8
...
@@ -29,12 +29,14 @@ class session_saas {
...
@@ -29,12 +29,14 @@ class session_saas {
session_set_cookie_params
(
$this
->
life_time
);
session_set_cookie_params
(
$this
->
life_time
);
}
}
session_start
();
session_start
();
return
true
;
}
}
public
function
__destruct
()
{
public
function
__destruct
()
{
if
(
$this
->
debug
)
{
if
(
$this
->
debug
)
{
trigger_error
(
'session_saas::__destruct called'
,
E_USER_NOTICE
);
trigger_error
(
'session_saas::__destruct called'
,
E_USER_NOTICE
);
}
}
return
true
;
}
}
public
function
open
()
{
public
function
open
()
{
...
@@ -60,10 +62,12 @@ class session_saas {
...
@@ -60,10 +62,12 @@ class session_saas {
if
(
$this
->
debug
)
{
if
(
$this
->
debug
)
{
trigger_error
(
'session_saas::read called'
,
E_USER_NOTICE
);
trigger_error
(
'session_saas::read called'
,
E_USER_NOTICE
);
}
}
if
(
$session
=
json_decode
(
file_get_contents
(
$GLOBALS
[
"saas_auth_url"
]
.
if
(
$session
=
json_decode
(
file_get_contents
(
$GLOBALS
[
"saas_sessions_url"
]
.
"?o=saas_sessions&a=read&i="
.
$id
)))
{
"?a=read&i="
.
$id
)))
{
if
(
isset
(
$session
->
data
))
{
return
base64_decode
(
$session
->
data
);
return
base64_decode
(
$session
->
data
);
}
}
}
return
''
;
return
''
;
}
}
...
@@ -74,7 +78,6 @@ class session_saas {
...
@@ -74,7 +78,6 @@ class session_saas {
$postdata
=
http_build_query
(
$postdata
=
http_build_query
(
array
(
array
(
'o'
=>
'saas_sessions'
,
'a'
=>
'write'
,
'a'
=>
'write'
,
'i'
=>
$id
,
'i'
=>
$id
,
'data'
=>
base64_encode
(
$data
)
'data'
=>
base64_encode
(
$data
)
...
@@ -90,7 +93,10 @@ class session_saas {
...
@@ -90,7 +93,10 @@ class session_saas {
);
);
$context
=
stream_context_create
(
$opts
);
$context
=
stream_context_create
(
$opts
);
return
json_decode
(
file_get_contents
(
$GLOBALS
[
"saas_auth_url"
],
false
,
$context
));
if
(
file_get_contents
(
$GLOBALS
[
"saas_sessions_url"
],
false
,
$context
))
{
return
false
;
}
return
true
;
}
}
public
function
destroy
(
$id
,
$key_only
=
FALSE
)
{
public
function
destroy
(
$id
,
$key_only
=
FALSE
)
{
...
@@ -99,7 +105,6 @@ class session_saas {
...
@@ -99,7 +105,6 @@ class session_saas {
}
}
$postdata
=
http_build_query
(
$postdata
=
http_build_query
(
array
(
array
(
'o'
=>
'saas_sessions'
,
'a'
=>
'destroy'
,
'a'
=>
'destroy'
,
'i'
=>
$id
'i'
=>
$id
)
)
...
@@ -114,14 +119,21 @@ class session_saas {
...
@@ -114,14 +119,21 @@ class session_saas {
);
);
$context
=
stream_context_create
(
$opts
);
$context
=
stream_context_create
(
$opts
);
return
json_decode
(
file_get_contents
(
$GLOBALS
[
"saas_auth_url"
],
false
,
$context
));
if
(
!
file_get_contents
(
$GLOBALS
[
"saas_sessions_url"
],
false
,
$context
))
{
return
false
;
}
return
true
;
}
}
public
function
gc
(
$max
)
{
public
function
gc
(
$max
)
{
/*
if($this->debug) {
if($this->debug) {
trigger_error('session_saas::gc called', E_USER_NOTICE);
trigger_error('session_saas::gc called', E_USER_NOTICE);
}
}
return
json_decode
(
file_get_contents
(
$GLOBALS
[
"saas_auth_url"
]
.
if(!file_get_contents($GLOBALS["saas_sessions_url"]."?a=gc")) {
"?o=saas_sessions&a=gc"
));
return false;
}
*/
return
true
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment