Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search.php and stats.php stats epoch time #26

Open
ummeegge opened this issue Jun 10, 2019 · 0 comments
Open

search.php and stats.php stats epoch time #26

ummeegge opened this issue Jun 10, 2019 · 0 comments

Comments

@ummeegge
Copy link

Hi all,
i know that the Ossec WebUI project is currently dead, i would nevertheless post a solution for the above mentioned problem.
Since we tried the WebUI again out in the IPFire project --> https://forum.ipfire.org/viewtopic.php?f=50&p=125255#p125255 we discovered the problem that the stats.php and the search.php starts the time ranges at 1970 (epoch time) we find a work around with this diff:

--- /srv/web/ossec.orig/site/search.php	2019-06-10 12:58:12.516654796 +0200
+++ /srv/web/ossec/site/search.php	2019-06-10 12:48:30.129985517 +0200
@@ -28,7 +28,7 @@
 
 
 /* Initializing some variables */
-$u_final_time = time(0);
+$u_final_time = time();
 $u_init_time = $u_final_time - $ossec_search_time;
 $u_level = $ossec_search_level;
 $u_pattern = "";
diff -Nur /srv/web/ossec.orig/site/stats.php /srv/web/ossec/site/stats.php
--- /srv/web/ossec.orig/site/stats.php	2019-06-10 12:58:12.516654796 +0200
+++ /srv/web/ossec/site/stats.php	2019-06-10 12:48:30.106652183 +0200
@@ -29,7 +29,7 @@
 
 
 /* Current date values */
-$curr_time = time(0);
+$curr_time = time();
 $curr_day = date('d',$curr_time);
 $curr_month = date('m', $curr_time);
 $curr_year = date('Y', $curr_time);

We are using:
$ php -v PHP 7.3.6 (cli) (built: Jun 8 2019 13:33:53) ( ZTS DEBUG ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.6, Copyright (c) 1998-2018 Zend Technologies

Not sure if this might be a help for others. Would like to say a big thanks to the Ossec project and also to the done work for the WebUI .

Best regards,

Erik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant