aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/account.php3
-rw-r--r--include/session.php28
2 files changed, 15 insertions, 16 deletions
diff --git a/include/account.php b/include/account.php
index 6f3499a0f..1b45a1244 100644
--- a/include/account.php
+++ b/include/account.php
@@ -107,7 +107,8 @@ function create_account($arr) {
$parent = ((x($arr,'parent')) ? intval($arr['parent']) : 0 );
$flags = ((x($arr,'account_flags')) ? intval($arr['account_flags']) : ACCOUNT_OK);
$roles = ((x($arr,'account_roles')) ? intval($arr['account_roles']) : 0 );
-
+ $expires = ((x($arr,'expires')) ? intval($arr['expires']) : '0000-00-00 00:00:00');
+
$default_service_class = get_config('system','default_service_class');
if($default_service_class === false)
$default_service_class = '';
diff --git a/include/session.php b/include/session.php
index 0a6576bdd..a8c466450 100644
--- a/include/session.php
+++ b/include/session.php
@@ -6,12 +6,12 @@
$session_exists = 0;
$session_expire = 180000;
-if(! function_exists('ref_session_open')) {
+
function ref_session_open ($s,$n) {
return true;
-}}
+}
+
-if(! function_exists('ref_session_read')) {
function ref_session_read ($id) {
global $session_exists;
if(x($id))
@@ -21,9 +21,9 @@ function ref_session_read ($id) {
return $r[0]['data'];
}
return '';
-}}
+}
+
-if(! function_exists('ref_session_write')) {
function ref_session_write ($id,$data) {
global $session_exists, $session_expire;
if(! $id || ! $data) {
@@ -44,25 +44,25 @@ function ref_session_write ($id,$data) {
dbesc($id), dbesc($default_expire), dbesc($data));
return true;
-}}
+}
+
-if(! function_exists('ref_session_close')) {
function ref_session_close() {
return true;
-}}
+}
+
-if(! function_exists('ref_session_destroy')) {
function ref_session_destroy ($id) {
q("DELETE FROM `session` WHERE `sid` = '%s'", dbesc($id));
return true;
-}}
+}
+
-if(! function_exists('ref_session_gc')) {
function ref_session_gc($expire) {
q("DELETE FROM `session` WHERE `expire` < %d", dbesc(time()));
q("OPTIMIZE TABLE `sess_data`");
return true;
-}}
+}
$gc_probability = 50;
@@ -71,6 +71,4 @@ ini_set('session.use_only_cookies', 1);
ini_set('session.cookie_httponly', 1);
-session_set_save_handler ('ref_session_open', 'ref_session_close',
- 'ref_session_read', 'ref_session_write',
- 'ref_session_destroy', 'ref_session_gc');
+session_set_save_handler ('ref_session_open', 'ref_session_close', 'ref_session_read', 'ref_session_write', 'ref_session_destroy', 'ref_session_gc');