Skip to content

Commit 7583672

Browse files
Merge pull request #4393 from corentin-soriano/fix_settings_last_modification
Fix settings last modification.
2 parents 04f4e4b + e663d52 commit 7583672

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

includes/libraries/teampassclasses/configmanager/src/ConfigManager.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
use TeampassClasses\SessionManager\SessionManager;
3232
use DB;
33+
3334
class ConfigManager
3435
{
3536
private $settings;
@@ -131,7 +132,7 @@ public function getLastModificationTimestamp(): string|null
131132
require_once __DIR__.'/../../../sergeytsalkov/meekrodb/db.class.php';
132133

133134
$maxTimestamp = DB::queryFirstField(
134-
'SELECT MAX(GREATEST(created_at, updated_at)) AS timestamp
135+
'SELECT GREATEST(MAX(created_at), MAX(updated_at)) AS timestamp
135136
FROM ' . prefixTable('misc') . '
136137
WHERE type = %s',
137138
'admin'

sources/admin.queries.php

-4
Original file line numberDiff line numberDiff line change
@@ -2125,10 +2125,6 @@
21252125
$post_field
21262126
);
21272127

2128-
// Update session settings
2129-
$SETTINGS[$post_field] = $post_value;
2130-
$session->set('teampass-settings', $SETTINGS);
2131-
21322128
// in case of stats enabled, update the actual time
21332129
if ($post_field === 'send_stats') {
21342130
// Check if previous time exists, if not them insert this value in DB

vendor/teampassclasses/configmanager/src/ConfigManager.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function getLastModificationTimestamp(): string|null
132132
require_once __DIR__.'/../../../sergeytsalkov/meekrodb/db.class.php';
133133

134134
$maxTimestamp = DB::queryFirstField(
135-
'SELECT MAX(GREATEST(created_at, updated_at)) AS timestamp
135+
'SELECT GREATEST(MAX(created_at), MAX(updated_at)) AS timestamp
136136
FROM ' . prefixTable('misc') . '
137137
WHERE type = %s',
138138
'admin'

0 commit comments

Comments
 (0)