Anonymous | Login | Signup for a new account | 2021-02-27 03:38 GMT | ![]() |
Main | My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0000395 | SiT! | other | public | 2009-01-11 16:38 | 2009-08-16 14:38 | ||||
Reporter | paulh | ||||||||
Assigned To | ivan | ||||||||
Priority | normal | Severity | feature | Reproducibility | N/A | ||||
Status | closed | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Product Version | |||||||||
Target Version | 3.50 | Fixed in Version | 3.50 | ||||||
Summary | 0000395: Variable for last seen | ||||||||
Description | We should have a global variable similar to $now for last seen calculation as its hard coded in a number of places and would be difficult to change if necessary (it also means there could be differences throughout SiT in its calculation) | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
![]() |
|
ivan (administrator) 2009-01-11 16:43 |
Theres the function user_online() Is this not good enough? |
paulh (administrator) 2009-01-11 18:03 |
Not really as a group_selector has a "All Online" option and this a number of places have SQL hardcoded for calculating last see e.g. users.php: if ($onlineonly === 'true' OR $filtergroup === 'allonline' ) { $sql .= "AND lastseen > NOW() - (60 * 30) "; } |
ivan (administrator) 2009-03-04 18:17 |
I think it's ok to have that in several places but the 30 shouldn't be hardcoded it should use the session length variable |
(0000969) DimKir (reporter) 2009-04-23 10:13 |
version 3.45. MySQL error (column 'lastseen'). I changed user_add.php (lines 237-243): $sql = "INSERT INTO `{$dbUsers}` (username, password, realname, roleid, groupid, title, email, phone, mobile, fax, status, var_style, holiday_entitlement, user_startdate, lastseen) "; $sql .= "VALUES ('$username', '$password', '$realname', '$roleid', '$groupid', '$jobtitle', '$email', '$phone', '$mobile', '$fax', 1, '{$CONFIG['default_interface_style']}', '$holiday_entitlement', '$startdate',NOW())"; |
ivan (administrator) 2009-04-23 10:20 |
Thanks DimKir, but is that what we want do you think? That will make it look as if newly added users are online right now? |
(0000971) DimKir (reporter) 2009-04-23 10:40 |
Sorry for wrong code, I had to quickly correct the problem with MySQL error :-) Now I change the code back and reproduced the problem: Application Error [256] MySQL Query Error Field 'lastseen' doesn't have a default value in user_add.php @ line 245 trigger_error() |
ivan (administrator) 2009-04-23 11:37 |
Ah I didn't see that error. I've gone with your suggestion and changed it to use NOW() it's better than an error message at least and it probably doesn't matter that the user shows online for a short time after user creation. |
ivan (administrator) 2009-04-23 12:11 |
Added a new variable $startofsession which is the current time less the length of user sessions. If lastseen is greater than this time we can assume the user is online. trunk svn r5346 |
ivan (administrator) 2009-08-16 14:38 |
Released in 3.50rc1 |
![]() |
|||
Date Modified | Username | Field | Change |
2009-01-11 16:38 | paulh | New Issue | |
2009-01-11 16:43 | ivan | Note Added: 0000473 | |
2009-01-11 16:43 | ivan | Status | new => feedback |
2009-01-11 18:03 | paulh | Note Added: 0000475 | |
2009-03-04 18:17 | ivan | Note Added: 0000707 | |
2009-03-04 18:17 | ivan | Assigned To | => ivan |
2009-03-04 18:17 | ivan | Status | feedback => assigned |
2009-03-04 18:17 | ivan | Target Version | => 3.50 |
2009-04-23 10:13 | DimKir | Note Added: 0000969 | |
2009-04-23 10:20 | ivan | Note Added: 0000970 | |
2009-04-23 10:40 | DimKir | Note Added: 0000971 | |
2009-04-23 11:37 | ivan | Note Added: 0000972 | |
2009-04-23 12:11 | ivan | Note Added: 0000973 | |
2009-04-23 12:11 | ivan | Status | assigned => resolved |
2009-04-23 12:11 | ivan | Resolution | open => fixed |
2009-04-23 12:11 | ivan | Fixed in Version | => Current SVN |
2009-08-16 13:17 | ivan | Fixed in Version | Current SVN => 3.50 |
2009-08-16 14:38 | ivan | Note Added: 0001610 | |
2009-08-16 14:38 | ivan | Status | resolved => closed |
Copyright © 2000 - 2021 MantisBT Team |