Suspended date time on a suspended user is not properly displayed when he tries to login
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Low
|
Richard Mansfield |
Bug Description
Mahara master 1.5 dev from git, using MySQL on Linux
When an user is suspended, its suspended date time is stored in table usr as a formatted string yyyy-mm-dd : hh:nn like in most other places of Mahara.
But when the user tries to connect, the error message gives 'your account has been suspended on 1 january 1970 , 1:13 reason : ....'
this is due to the fact that the function ensure_
$suspendedctime = strftime(
where it should be :
$suspendedctime = strftime(
This is likely due to the fact that at that moment the global variable $USER
still contains all its date informations as formatted strings and not yet as time stamps (why ?) as shown by this output of a print_r($USER) at the beginning of function ensure_
[id] => 5835
[salt] => 8ef00c74
[staff] => 0
[admin] => 0
....
[quota] => 5242880
Attached a small patch against master ( 1.5dev) where I also changed get_string(
get_string(
according to a grep into all code , this should be fixed also in some other authentication plugins such as saml and xmlrpc
[root@vm107-04 mahara]# grep -Rin strftimedaydate * |grep suspendedctime
auth/lib.php:1417: $suspendedctime = strftime(
auth/saml/
auth/saml/
auth/xmlrpc/
Cheers
description: | updated |
Changed in mahara: | |
status: | New → Triaged |
importance: | Undecided → Low |
milestone: | none → 1.5.0 |
Changed in mahara: | |
status: | In Progress → Fix Released |
milestone: | 1.5.0 → none |
See https:/ /reviews. mahara. org/1038 - I think this was broken by me in commit 725ba92940, so I'll fix it there (in the commit function) rather than by reformatting the time again.