Skip to content

Commit

Permalink
Merge pull request #4393 from corentin-soriano/fix_settings_last_modi…
Browse files Browse the repository at this point in the history
…fication

Fix settings last modification.
  • Loading branch information
nilsteampassnet authored Oct 4, 2024
2 parents 04f4e4b + e663d52 commit 7583672
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

use TeampassClasses\SessionManager\SessionManager;
use DB;

class ConfigManager
{
private $settings;
Expand Down Expand Up @@ -131,7 +132,7 @@ public function getLastModificationTimestamp(): string|null
require_once __DIR__.'/../../../sergeytsalkov/meekrodb/db.class.php';

$maxTimestamp = DB::queryFirstField(
'SELECT MAX(GREATEST(created_at, updated_at)) AS timestamp
'SELECT GREATEST(MAX(created_at), MAX(updated_at)) AS timestamp
FROM ' . prefixTable('misc') . '
WHERE type = %s',
'admin'
Expand Down
4 changes: 0 additions & 4 deletions sources/admin.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -2125,10 +2125,6 @@
$post_field
);

// Update session settings
$SETTINGS[$post_field] = $post_value;
$session->set('teampass-settings', $SETTINGS);

// in case of stats enabled, update the actual time
if ($post_field === 'send_stats') {
// Check if previous time exists, if not them insert this value in DB
Expand Down
2 changes: 1 addition & 1 deletion vendor/teampassclasses/configmanager/src/ConfigManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function getLastModificationTimestamp(): string|null
require_once __DIR__.'/../../../sergeytsalkov/meekrodb/db.class.php';

$maxTimestamp = DB::queryFirstField(
'SELECT MAX(GREATEST(created_at, updated_at)) AS timestamp
'SELECT GREATEST(MAX(created_at), MAX(updated_at)) AS timestamp
FROM ' . prefixTable('misc') . '
WHERE type = %s',
'admin'
Expand Down

0 comments on commit 7583672

Please sign in to comment.