public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
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] Fix missing IP in autodiscover logs
4019dc54
data/web/autodiscover.php | 3 +++
data/web/js/site/debug.js | 1 +
2 files changed, 4 insertions(+)
Diff
diff --git a/data/web/autodiscover.php b/data/web/autodiscover.php
index c18edbfc..c2eb0ad5 100644
--- a/data/web/autodiscover.php
+++ b/data/web/autodiscover.php
@@ -58,6 +58,7 @@ if (empty($_SERVER['PHP_AUTH_USER']) || empty($_SERVER['PHP_AUTH_PW'])) {
"time" => time(),
"ua" => $_SERVER['HTTP_USER_AGENT'],
"user" => "none",
+ "ip" => $_SERVER['REMOTE_ADDR'],
"service" => "Error: must be authenticated"
)
);
@@ -82,6 +83,7 @@ if ($login_role === "user") {
"time" => time(),
"ua" => $_SERVER['HTTP_USER_AGENT'],
"user" => $_SERVER['PHP_AUTH_USER'],
+ "ip" => $_SERVER['REMOTE_ADDR'],
"service" => "Error: invalid or missing request data"
)
);
@@ -136,6 +138,7 @@ if ($login_role === "user") {
"time" => time(),
"ua" => $_SERVER['HTTP_USER_AGENT'],
"user" => $_SERVER['PHP_AUTH_USER'],
+ "ip" => $_SERVER['REMOTE_ADDR'],
"service" => $autodiscover_config['autodiscoverType']
)
);
diff --git a/data/web/js/site/debug.js b/data/web/js/site/debug.js
index 6b08113e..ba08248f 100644
--- a/data/web/js/site/debug.js
+++ b/data/web/js/site/debug.js
@@ -78,6 +78,7 @@ jQuery(function($){
{"name":"time","formatter":function unix_time_format(tm) { var date = new Date(tm ? tm * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"});},"title":lang.time,"style":{"width":"170px"}},
{"name":"ua","title":"User-Agent","style":{"min-width":"200px"}},
{"name":"user","title":"Username","style":{"min-width":"200px"}},
+ {"name":"ip","title":"IP","style":{"min-width":"200px"}},
{"name":"service","title":"Service"},
],
"rows": $.ajax({