Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
1194ce95
Commit
1194ce95
authored
10 years ago
by
Jaime Perez Crespo
Browse files
Options
Downloads
Patches
Plain Diff
Remove deprecated SimpleSAML_MemcacheStore class. This closes #152.
parent
6e13e83f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config-templates/config.php
+3
-3
3 additions, 3 deletions
config-templates/config.php
lib/SimpleSAML/MemcacheStore.php
+0
-90
0 additions, 90 deletions
lib/SimpleSAML/MemcacheStore.php
lib/SimpleSAML/SessionHandlerStore.php
+1
-21
1 addition, 21 deletions
lib/SimpleSAML/SessionHandlerStore.php
with
4 additions
and
114 deletions
config-templates/config.php
+
3
−
3
View file @
1194ce95
...
@@ -623,8 +623,8 @@ $config = array(
...
@@ -623,8 +623,8 @@ $config = array(
/*
/*
* Configuration for the
M
emcache
Store class
. This allows you to store
* Configuration for the
'm
emcache
' session store
. This allows you to store
* multiple redudant copies of sessions on different memcache servers.
* multiple redu
n
dant copies of sessions on different memcache servers.
*
*
* 'memcache_store.servers' is an array of server groups. Every data
* 'memcache_store.servers' is an array of server groups. Every data
* item will be mirrored in every server group.
* item will be mirrored in every server group.
...
@@ -645,7 +645,7 @@ $config = array(
...
@@ -645,7 +645,7 @@ $config = array(
* - 'timeout': The timeout for this server. By default, the timeout
* - 'timeout': The timeout for this server. By default, the timeout
* is 3 seconds.
* is 3 seconds.
*
*
* Example of redudant configuration with load balancing:
* Example of redu
n
dant configuration with load balancing:
* This configuration makes it possible to lose both servers in the
* This configuration makes it possible to lose both servers in the
* a-group or both servers in the b-group without losing any sessions.
* a-group or both servers in the b-group without losing any sessions.
* Note that sessions will be lost if one server is lost from both the
* Note that sessions will be lost if one server is lost from both the
...
...
This diff is collapsed.
Click to expand it.
lib/SimpleSAML/MemcacheStore.php
deleted
100644 → 0
+
0
−
90
View file @
6e13e83f
<?php
/**
* This class provides a class with behaviour similar to the $_SESSION variable.
* Data is automatically saved on exit.
*
* Care should be taken when using this class to store objects. It will not detect changes to objects
* automatically. Instead, a call to set(...) should be done to notify this class of changes.
*
* @author Olav Morken, UNINETT AS.
* @package simpleSAMLphp
* @deprecated This class will be removed in version 1.8 of simpleSAMLphp.
*/
class
SimpleSAML_MemcacheStore
{
/**
* This variable contains an array with all key-value pairs stored
* in this object.
*/
private
$data
=
NULL
;
/**
* This function is used to find an existing storage object. It will return NULL if no storage object
* with the given id is found.
*
* @param $id The id of the storage object we are looking for. A id consists of lowercase
* alphanumeric characters.
* @return The corresponding MemcacheStorage object if the data is found or NULL if it isn't found.
*/
public
static
function
find
(
$id
)
{
assert
(
self
::
isValidID
(
$id
));
$serializedData
=
SimpleSAML_Memcache
::
get
(
$id
);
if
(
$serializedData
===
NULL
)
{
return
NULL
;
}
$data
=
unserialize
(
$serializedData
);
if
(
!
(
$data
instanceof
self
))
{
SimpleSAML_Logger
::
warning
(
'Retrieved key from memcache did not contain a MemcacheStore object.'
);
return
NULL
;
}
return
$data
;
}
/**
* This function retrieves the specified key from this storage object.
*
* @param $key The key we should retrieve the value of.
* @return The value of the specified key, or NULL of the key wasn't found.
*/
public
function
get
(
$key
)
{
if
(
!
array_key_exists
(
$key
,
$this
->
data
))
{
return
NULL
;
}
return
$this
->
data
[
$key
];
}
/**
* This function determines whether the argument is a valid id.
* A valid id is a string containing lowercase alphanumeric
* characters.
*
* @param $id The id we should validate.
* @return TRUE if the id is valid, FALSE otherwise.
*/
private
static
function
isValidID
(
$id
)
{
if
(
!
is_string
(
$id
))
{
return
FALSE
;
}
if
(
strlen
(
$id
)
<
1
)
{
return
FALSE
;
}
if
(
preg_match
(
'/[^0-9a-z]/'
,
$id
))
{
return
FALSE
;
}
return
TRUE
;
}
}
This diff is collapsed.
Click to expand it.
lib/SimpleSAML/SessionHandlerStore.php
+
1
−
21
View file @
1194ce95
...
@@ -41,27 +41,7 @@ class SimpleSAML_SessionHandlerStore extends SimpleSAML_SessionHandlerCookie {
...
@@ -41,27 +41,7 @@ class SimpleSAML_SessionHandlerStore extends SimpleSAML_SessionHandlerCookie {
return
$session
;
return
$session
;
}
}
if
(
!
(
$this
->
store
instanceof
SimpleSAML_Store_Memcache
))
{
return
NULL
;
return
NULL
;
}
/* For backwards compatibility, check the MemcacheStore object. */
$store
=
SimpleSAML_MemcacheStore
::
find
(
$sessionId
);
if
(
$store
===
NULL
)
{
return
NULL
;
}
$session
=
$store
->
get
(
'SimpleSAMLphp_SESSION'
);
if
(
$session
===
NULL
)
{
return
NULL
;
}
assert
(
'is_string($session)'
);
$session
=
unserialize
(
$session
);
assert
(
'$session instanceof SimpleSAML_Session'
);
return
$session
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment