1

Topic: "Password last change" time not match my Timezone

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version: Centos 6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): Mysql
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? iRedAdmin-Pro 3.6(MySQL) 
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hi,

i have an issue, i check that the "Password last change" time not match my Timezone.

i checked that the mail log's time is correct only this not match. Where can i fix this?

Thanks so much.
Roy

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: "Password last change" time not match my Timezone

- How and where did you check this "Password last change" time?
- most timestamps are stored in UTC, not local time zone. iRedAdmin-Pro converts them to local time zone if you have a global or per-account time zone set in iRedAdmin-Pro.

3

Re: "Password last change" time not match my Timezone

Domain Time Zone Set to GMT +8 already.
Try User Time Zone to GMT +8 still no use.

The attached sample should be in the morning @ 09:35:47.

And in this version of iRedAdmin=Pro, i cannot ADD the user to "Member of Mail Aliases" with check the aliases checkbox in user profile page but remove is success.

Post's attachments

GMT +8.jpg
GMT +8.jpg 103.04 kb, file has never been downloaded. 

lastPassword.jpg
lastPassword.jpg 85.89 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

4

Re: "Password last change" time not match my Timezone

Confirmed it's a bug of iRedAdmin-Pro, here's patch to fix it:

diff -r d749d491d588 templates/default/macros/general.html
--- a/templates/default/macros/general.html    Thu Jul 18 13:23:14 2019 +0800
+++ b/templates/default/macros/general.html    Sat Jul 27 11:46:05 2019 +0800
@@ -1927,7 +1927,7 @@
 
         {% if password_last_change_date %}
             <h4>{{ _('Password last change:') }}</h4>
-            <p class="clean-padding clean-padding bt-space10">{{ password_last_change_date }}</p>
+            <p class="clean-padding clean-padding bt-space10">{{ password_last_change_date | utc_to_timezone(timezone=session.get('timezone')) }}</p>
         {% endif %}
 
     </div>
diff -r d749d491d588 templates/default/sql/user/profile.html
--- a/templates/default/sql/user/profile.html    Thu Jul 18 13:23:14 2019 +0800
+++ b/templates/default/sql/user/profile.html    Sat Jul 27 11:46:05 2019 +0800
@@ -515,7 +515,6 @@
                                                       store_password_in_plain_text=store_password_in_plain_text) }}
                         </div>
                         <div class="col1-4 lastcol">
-                            {{ profile.passwordlastchange }}
                             {{ display_random_password(password_length=min_passwd_length,
                                                        password_policies=password_policies,
                                                        password_last_change_date=profile.passwordlastchange) }}

5

Re: "Password last change" time not match my Timezone

Fixed and Thanks.

But please note the display of the "gear" under "Users under domain" page still wrong smile

Thanks!

6

Re: "Password last change" time not match my Timezone

Please apply extra patch to fix it under the "Users under domain" page:

diff -r a54d665912f1 templates/default/sql/user/list.html
--- a/templates/default/sql/user/list.html      Sat Jul 27 15:54:53 2019 +0800
+++ b/templates/default/sql/user/list.html      Mon Jul 29 21:01:35 2019 +0800
@@ -154,7 +154,7 @@
                     </td>
                     <td class="vcenter">
                         <a href="{{ctx.homepath}}/profile/user/general/{{mail}}">
-                            <i class="fa fa-cog fa-lg fr-space" title="{{ _('Edit account profile') }}{% if r.passwordlastchange %} ({{ _('Password last change:') }} {{ r.passwordlastchange }}){% endif %}"></i>
+                            <i class="fa fa-cog fa-lg fr-space" title="{{ _('Edit account profile') }}{% if r.passwordlastchange %} ({{ _('Password last change:') }} {{ r.passwordlastchange | utc_to_timezone(timezone=session.get('timezone')) }}){% endif %}"></i>
                         </a>
                         {{ set_account_activity_img('sent', 'user', mail) }}
                         {{ set_account_status_img(r.active) }}