Project

General

Profile

Bug #5418

Online user list is empty

Added by Hubert Borderiou about 7 years ago. Updated about 7 years ago.

Status:
Bug resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
05/09/2012
Due date:
% Done:

70%

Estimated time:
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

Hi,
since 1.9.2 update, the list of user connected to the platform is empty
I'm not sure that the number of user connected to the platform is right :s

In BDD table track_e_online, time is 2 hours below local time and it try to compare user with login date of the local time

In function who_is_online (file inline.inc.php) we have
valid_date_time DateTime Object ( [date] => 2012-09-05 14:25:53 [timezone_type] => 3 [timezone] => Europe/Berlin )
user_login_date DateTime Object ( [date] => 2012-09-05 12:50:54 [timezone_type] => 3 [timezone] => Europe/Berlin )

regards


Files

online.inc.php (16.9 KB) online.inc.php Yoselyn Castillo, 12/09/2012 23:49
online.inc.php (17 KB) online.inc.php Yoselyn Castillo, 18/09/2012 21:42

Associated revisions

Revision 46b1e711 (diff)
Added by Julio Montoya about 7 years ago

Should fix wrong date convertion see #5418

Revision afc2a57e (diff)
Added by Julio Montoya about 7 years ago

Using UTC date in login_date instead of the DB date see #5418

Revision 2f14cc84 (diff)
Added by Julio Montoya about 7 years ago

Undo previous changes see #5418

History

#1

Updated by Julio Montoya about 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Julio Montoya
#2

Updated by Julio Montoya about 7 years ago

  • Status changed from Assigned to Needs testing
  • Assignee changed from Julio Montoya to Yoselyn Castillo
  • % Done changed from 0 to 50

I sent a fix

#3

Updated by Hubert Borderiou about 7 years ago

Hi,
works fine for the list of user connected
The number of user connected is wrong :-( it seems to stay 1

#4

Updated by Yannick Warnier about 7 years ago

That would also explain why sometimes the number doesn't even appear (it doesn't if it's 0, apparently) and when it doesn't, the tabs bar moves up and gets too close from the logo.

#5

Updated by Yannick Warnier about 7 years ago

  • Status changed from Needs testing to Assigned
  • Assignee changed from Yoselyn Castillo to Julio Montoya
#6

Updated by Yannick Warnier about 7 years ago

  • Target version set to 1.9.2
#7

Updated by Julio Montoya about 7 years ago

  • Assignee changed from Julio Montoya to Yoselyn Castillo

needs testing

#8

Updated by Yoselyn Castillo about 7 years ago

It continues showing 1 in online user list . I am Working...

#9

Updated by Yoselyn Castillo about 7 years ago

Upload this file. It fixes the problem with the number of online users

#10

Updated by Julio Montoya about 7 years ago

This was the change you sent:

    $current_date    = api_get_utc_datetime();
    $current_date = api_strtotime($current_date, 'UTC');
    $current_date = date('Y-m-d h:i:s', $current_date);

api_get_utc_datetime() already has the UTC date so no need to transform it. The bug could be that login_date field in table TABLE_STATISTIC_TRACK_E_ONLINE is not saved using UTC checking ...

#11

Updated by Julio Montoya about 7 years ago

I sent a commit

#12

Updated by Yoselyn Castillo about 7 years ago

It continues showing bad number. it's strange because with the fix i sent it works fine. Anyway I am verifying..

#13

Updated by Yoselyn Castillo about 7 years ago

  • File online.inc.php added

Upload this fix. Now it should be work. I have used time()

#14

Updated by Julio Montoya about 7 years ago

  • Assignee changed from Julio Montoya to Yoselyn Castillo

Please check this change, your are multiplying the current timestamp by 60?


    $online_time         = time()*60;
    $current_date        = api_get_utc_datetime($online_time);

Check http://php.net/manual/en/function.time.php

time() — Return current Unix timestamp
Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).

#15

Updated by Yoselyn Castillo about 7 years ago

  • File deleted (online.inc.php)
#16

Updated by Yoselyn Castillo about 7 years ago

Sorry, it was a mistake.

#17

Updated by Yoselyn Castillo about 7 years ago

This is the file. I have used the same method that is being used to check who is online in function who_is_online and it wroks fine. test it!

#18

Updated by Julio Montoya about 7 years ago

  • Status changed from Assigned to Needs testing
  • Assignee deleted (Julio Montoya)

file was sent

#19

Updated by Eric Petitdemange about 7 years ago

Sorry to interfer,

Tested with the latest nightly (n19), it seems to work here (using only 1 student and admin though).

Environment:
- VM Xubuntu 12.04 LTS
- Chamilo 1.9.2 n19
- 1 student
- Administrator

Delay of update for the number of online people, around 5 seconds (acceptable on my understanding)...

#20

Updated by Yoselyn Castillo about 7 years ago

  • Status changed from Needs testing to Bug resolved

It works fine now. It is necessary to take in mind, number of people online depends on administration parameter

Also available in: Atom PDF