Skip to content

Commit 9110d52

Browse files
author
Pascal MARTINEZ
committed
CHANGE: the module's PHP constant MOD_Z4M_USERSESSIONS_APPLICATION_URI now accepts the 'ALL' value to display all existing user sessions in the session directory (see PHP 'session.save_path' configuration).
CHANGE: the value set for the module's PHP constant `MOD_Z4M_USERSESSIONS_APPLICATION_URI` is now displayed in the session configuration modal dialog. CHANGE: the application key is now displayed in the `z4m_usersessions` view (under the user name) when `MOD_Z4M_USERSESSIONS_APPLICATION_URI` is 'ALL'.
1 parent fc92fd1 commit 9110d52

5 files changed

Lines changed: 30 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGE LOG: User sessions (z4m_usersessions)
22

3+
## Version 1.2, 2025-06-15
4+
- CHANGE: the module's PHP constant `MOD_Z4M_USERSESSIONS_APPLICATION_URI` now accepts the 'ALL' value to display all existing user sessions in the session directory (see PHP 'session.save_path' configuration).
5+
- CHANGE: the value set for the module's PHP constant `MOD_Z4M_USERSESSIONS_APPLICATION_URI` is now displayed in the session configuration modal dialog.
6+
- CHANGE: the application key is now displayed in the `z4m_usersessions` view (under the user name) when `MOD_Z4M_USERSESSIONS_APPLICATION_URI` is 'ALL'.
7+
38
## Version 1.1, 2025-06-10
49
- CHANGE: code refactoring, new `UserSessionManager` class with `clean()` and `killAll()` public methods.
510

mod/Z4MUserSessionFile.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
* --------------------------------------------------------------------
2020
* ZnetDK 4 Mobile User sessions module PHP class
2121
*
22-
* File version: 1.0
23-
* Last update: 04/24/2025
22+
* File version: 1.1
23+
* Last update: 06/15/2025
2424
*/
2525

2626
namespace z4m_usersessions\mod;
@@ -67,7 +67,8 @@ public function convertSessionDataToDatalistRows($withFilePath = FALSE) {
6767
$thisAppURI = MOD_Z4M_USERSESSIONS_APPLICATION_URI === NULL
6868
? \General::getAbsoluteURI() : MOD_Z4M_USERSESSIONS_APPLICATION_URI;
6969
foreach ($decodedSessionData as $appKey => $sessionData) {
70-
if (!is_array($sessionData) || strpos($appKey, $thisAppURI) !== 0) {
70+
if (!is_array($sessionData) || ($thisAppURI !== 'ALL'
71+
&& strpos($appKey, $thisAppURI) !== 0)) {
7172
// This is not session data for this App
7273
continue;
7374
}

mod/config.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
* --------------------------------------------------------------------
1919
* Parameters of the ZnetDK 4 Mobile User sessions module
2020
*
21-
* File version: 1.1
22-
* Last update: 06/10/2025
21+
* File version: 1.2
22+
* Last update: 06/15/2025
2323
*/
2424

2525

@@ -28,6 +28,8 @@
2828
* @var string|NULL The application URI.
2929
* If NULL, the application URI is obtained calling the
3030
* \General::getAbsoluteURI() method.
31+
* If set to 'ALL', all existing sessions in the session directory (see PHP
32+
* 'session.save_path' option) are retrieved (no filter is applied).
3133
*/
3234
define('MOD_Z4M_USERSESSIONS_APPLICATION_URI', NULL);
3335

@@ -45,9 +47,9 @@
4547
* Module version number
4648
* @return string Version
4749
*/
48-
define('MOD_Z4M_USERSESSIONS_VERSION_NUMBER','1.1');
50+
define('MOD_Z4M_USERSESSIONS_VERSION_NUMBER','1.2');
4951
/**
5052
* Module version date
5153
* @return string Date in W3C format
5254
*/
53-
define('MOD_Z4M_USERSESSIONS_VERSION_DATE','2025-06-10');
55+
define('MOD_Z4M_USERSESSIONS_VERSION_DATE','2025-06-15');

mod/view/fragment/settings_modal.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
* --------------------------------------------------------------------
2020
* ZnetDK 4 Mobile User sessions module view fragment
2121
*
22-
* File version: 1.0
23-
* Last update: 04/24/2025
22+
* File version: 1.1
23+
* Last update: 06/15/2025
2424
*/
2525
?>
2626
<div id="z4m-user-sessions-settings-modal" class="w3-modal">
@@ -75,6 +75,11 @@
7575
<th class="w3-monospace"><?php echo is_bool(constant($zdkParamName)) ? (constant($zdkParamName) ? 'true' : 'false') : constant($zdkParamName); ?></th>
7676
</tr>
7777
<?php endforeach; ?>
78+
<tr>
79+
<td class="param">MOD_Z4M_USERSESSIONS_APPLICATION_URI</td>
80+
<td class="w3-monospace">-</td>
81+
<th class="w3-monospace"><?php echo MOD_Z4M_USERSESSIONS_APPLICATION_URI === NULL ? 'null' : "'" . MOD_Z4M_USERSESSIONS_APPLICATION_URI . "'"; ?></th>
82+
</tr>
7883
</tbody>
7984
</table>
8085
</div>

mod/view/z4m_usersessions.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
* --------------------------------------------------------------------
2020
* ZnetDK 4 Mobile User sessions module view
2121
*
22-
* File version: 1.0
23-
* Last update: 04/24/2025
22+
* File version: 1.1
23+
* Last update: 06/15/2025
2424
*/
2525
$color = defined('CFG_MOBILE_W3CSS_THEME_COLOR_SCHEME')
2626
? CFG_MOBILE_W3CSS_THEME_COLOR_SCHEME
@@ -66,10 +66,15 @@
6666
<div class="w3-row w3-stretch">
6767
<div class="w3-col s12 l3 m3 w3-padding-small w3-monospace"><b>{{start_date_time}}</b></div>
6868
<div class="w3-col s12 l3 m3 w3-padding-small">
69-
{{user_name}}
69+
<b>{{user_name}}</b>
7070
<a class="kill" href="#" data-login-name="{{login_name}}" data-appkey="{{application_key}}" title="<?php echo MOD_Z4M_USERSESSIONS_LIST_KILLSESSION_LINK; ?>">
7171
<i class="fa fa-times fa-fw w3-text-red"></i>
7272
</a>
73+
<?php if (MOD_Z4M_USERSESSIONS_APPLICATION_URI === 'ALL') : ?>
74+
<div class="w3-small">
75+
<i class="fa fa-at <?php echo $color['icon']; ?>"></i> {{application_key}}
76+
</div>
77+
<?php endif; ?>
7378
</div>
7479
<div class="w3-col s12 l3 m3 w3-padding-small">
7580
<div class="{{visibility}}">

0 commit comments

Comments
 (0)