[horde] Get a list of (active) Horde users

Jens Wahnes wahnes at uni-koeln.de
Mon Aug 24 17:54:44 UTC 2020


Olaf.Hopp at atis.uka.de wrote:
> I can write myself a script for that, but I do not want to reinvent the 
> wheel.
> Maybe anybody can share his script.

Since I seldomly need to look up these kind of figures, I usually end up 
doing something along the lines of

select count(*) from horde_prefs where pref_name='last_login' and 
pref_scope='horde' and substring_index(substring_index(pref_value, 
'time";i:', -1), ';', 1) >= unix_timestamp(date_sub(now(), interval 7 day));

Of course, this is neither very elegant nor is it fast. Plus,
it's assuming the simple case of a MySQL/MariaDB database for preference 
storage. But since I really only need to get a rough feeling for how 
many users have been logging in lately, this has been good enough for me.

Jens


More information about the horde mailing list