Skip to content

Commit b663d6a

Browse files
committed
🔧 Add resetSession() method to persistent session helpers and fix code formatting
Added missing resetSession() static methods to erLhcoreClassUserDep, erLhcoreClassRole, and erLhcoreClassMailconv to allow clearing cached ezcPersistentSession instances — matching the pattern already present in erLhcoreClassDepartament, erLhcoreClassPermission, and erLhcoreClassUser. 🛠️ Normalized whitespace and code style in erLhcoreClassDepartament, erLhcoreClassPermission, and erLhcoreClassUser for consistent formatting across all persistent session helper classes.
1 parent 6730c45 commit b663d6a

6 files changed

Lines changed: 40 additions & 24 deletions

File tree

lhc_web/lib/core/lhdepartament/lhdepartament.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,10 +1183,10 @@ public static function getSession()
11831183
return self::$persistentSession;
11841184
}
11851185

1186-
public static function resetSession()
1187-
{
1188-
self::$persistentSession = null;
1189-
}
1186+
public static function resetSession()
1187+
{
1188+
self::$persistentSession = null;
1189+
}
11901190

11911191
private static $persistentSession;
11921192

lhc_web/lib/core/lhdepartament/lhuserdep.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,11 @@ public static function getSession()
454454
return self::$persistentSession;
455455
}
456456

457+
public static function resetSession()
458+
{
459+
self::$persistentSession = null;
460+
}
461+
457462
private static $persistentSession;
458463

459464
}

lhc_web/lib/core/lhmailconv/lhmailconv.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ public static function getSession() {
99
return self::$persistentSession;
1010
}
1111

12+
public static function resetSession()
13+
{
14+
self::$persistentSession = null;
15+
}
1216

1317
public static $messagesAttributes = [
1418
'udate_front',
Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
<?php
22

3-
class erLhcoreClassPermission{
4-
5-
function __construct()
6-
{
7-
8-
}
3+
class erLhcoreClassPermission
4+
{
95

10-
11-
public static function getSession()
12-
{
13-
if ( !isset( self::$persistentSession ) )
14-
{
6+
function __construct() {}
7+
8+
public static function getSession()
9+
{
10+
if (!isset(self::$persistentSession)) {
1511
self::$persistentSession = new ezcPersistentSession(
1612
ezcDbInstance::get(),
17-
new ezcPersistentCodeManager( './pos/lhpermission' )
13+
new ezcPersistentCodeManager('./pos/lhpermission')
1814
);
1915
}
2016
return self::$persistentSession;
21-
}
22-
23-
private static $persistentSession;
24-
25-
}
17+
}
2618

19+
public static function resetSession()
20+
{
21+
self::$persistentSession = null;
22+
}
2723

28-
?>
24+
private static $persistentSession;
25+
}

lhc_web/lib/core/lhpermission/lhrole.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ public static function getSession()
8080
}
8181
return self::$persistentSession;
8282
}
83+
84+
public static function resetSession()
85+
{
86+
self::$persistentSession = null;
87+
}
8388

8489
/**
8590
* Returns something like that

lhc_web/lib/core/lhuser/lhuser.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ function logout()
294294

295295
erLhcoreClassUserDep::updateLastActivityByUser($this->userid, 0);
296296
}
297-
297+
298298
$this->session->destroy();
299-
299+
300300
@session_regenerate_id(true);
301301
@session_destroy();
302302
}
@@ -313,6 +313,11 @@ public static function getSession()
313313
return self::$persistentSession;
314314
}
315315

316+
public static function resetSession()
317+
{
318+
self::$persistentSession = null;
319+
}
320+
316321
function getUserData($useCache = false)
317322
{
318323
if ($useCache == true && isset($GLOBALS['UserModelCache_'.$this->userid])) return $GLOBALS['UserModelCache_'.$this->userid];

0 commit comments

Comments
 (0)