NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Commit

[Web] clear old app_passwd log entries

455ef084
FreddleSpl0it <[email protected]> 10 months ago
data/web/inc/init_db.inc.php | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Diff

diff --git a/data/web/inc/init_db.inc.php b/data/web/inc/init_db.inc.php
index 83b27fbe..b8ab8525 100644
--- a/data/web/inc/init_db.inc.php
+++ b/data/web/inc/init_db.inc.php
@@ -1338,12 +1338,12 @@ function init_db_schema()
     }
 
     // Clear old app_passwd log entries
-    if ($db_version == "07102025_1015") {
-      $pdo->query("DELETE FROM logs
-        WHERE JSON_EXTRACT(`call`, '$[0]') = 'app_passwd'
-          AND JSON_EXTRACT(`call`, '$[1]') = 'edit'
-          AND role != 'unauthenticated';");
-    }
+    $pdo->exec("DELETE FROM logs
+      WHERE role != 'unauthenticated'
+        AND JSON_EXTRACT(`call`, '$[0]') = 'app_passwd'
+        AND JSON_EXTRACT(`call`, '$[1]') = 'edit'
+        AND (JSON_CONTAINS_PATH(`call`, 'one', '$[2].password')
+          OR JSON_CONTAINS_PATH(`call`, 'one', '$[2].password2'));");
 
     // Mitigate imapsync argument injection issue
     $pdo->query("UPDATE `imapsync` SET `custom_params` = ''