statistics about Authors logon activities.

Creating and modifying plugins.
mina
Regular
Posts: 7
Joined: Tue Mar 21, 2006 2:42 pm

statistics about Authors logon activities.

Post by mina »

Hi,

I would like know how i can collect information/statistics about Authors logon activities.
Who, when and last logon time, and total no of logons are of the interests.

The reason is we are running multi-user/authors blog for a group of students who are learning French.
We would like to know how many of them are actually using the blog as a medium of help.

thanks.

Mina.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: statistics about Authors logon activities.

Post by garvinhicking »

For that, a basic plugin would do fine.

I've patched up the "External Authentication" plugin to also do login logging. An updated file is here: http://nopaste.php-q.net/199981 and will be stored in Spartacus the next 48 hours.

It straightly logs to the database, there you can easily write up SQL queries that show you results with phpMyAdmin or tools like that.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mina
Regular
Posts: 7
Joined: Tue Mar 21, 2006 2:42 pm

Re: statistics about Authors logon activities.

Post by mina »

garvinhicking wrote:For that, a basic plugin would do fine.

I've patched up the "External Authentication" plugin to also do login logging. An updated file is here: http://nopaste.php-q.net/199981 and will be stored in Spartacus the next 48 hours.

It straightly logs to the database, there you can easily write up SQL queries that show you results with phpMyAdmin or tools like that.

Best regards,
Garvin

Thank you very much.

Mina
SHRIKEE
Regular
Posts: 128
Joined: Tue Feb 21, 2006 2:49 am
Location: Netherlands
Contact:

Post by SHRIKEE »

@garvin,

how is this logged, perhaps it can be shown in the statistics plugin... to add to the fun :)
My kingdom For i am king of my heap of trash

Developing code on:
Workstation: Windows 2000 sp4, TSW webcoder 2005
Server: fedora core 4 amd64, apache 2.0.54, php 5.0.4, mysql 4.1.11.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

In the current form it's logged to a plain "serendipity_loginlog" DB table, so yes - it could be integrated when the plugin is available :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mina
Regular
Posts: 7
Joined: Tue Mar 21, 2006 2:42 pm

Re: statistics about Authors logon activities.

Post by mina »

garvinhicking wrote:For that, a basic plugin would do fine.

I've patched up the "External Authentication" plugin to also do login logging. An updated file is here: http://nopaste.php-q.net/199981 and will be stored in Spartacus the next 48 hours.

It straightly logs to the database, there you can easily write up SQL queries that show you results with phpMyAdmin or tools like that.

Best regards,
Garvin
Hi,

I have updated the plugin (External user authentication (LDAP)/tracking) and then enabled option "Enable login logging?" but still i do not get any login details registered in the serendipity_loginlog DB table.
The loginlog table is completely empty, (0 raws)

I do not have/use any LDAP server for Authentication.

Any ideas?

thanks.

Mina.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: statistics about Authors logon activities.

Post by garvinhicking »

Hi Mina!

Thanks! It was a bug in the logger() function of the plugin. It specified the "ua" column name in the INSERT statement, where it should properly use "user_agent". I only added that later on, so I didn't catch that bug.

Just committed version 1.14 of the plugin.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
SHRIKEE
Regular
Posts: 128
Joined: Tue Feb 21, 2006 2:49 am
Location: Netherlands
Contact:

Post by SHRIKEE »

just a thought about error output,

aparantly there is no error output when a query fails. I noticed this earlier when i was working on the statistics en usergallery plugin.

maybe there is a way to create an area (above the site output for example) which shows when errors occur, be it accessrights or query or any error.
My kingdom For i am king of my heap of trash

Developing code on:
Workstation: Windows 2000 sp4, TSW webcoder 2005
Server: fedora core 4 amd64, apache 2.0.54, php 5.0.4, mysql 4.1.11.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Actually the error(s) from serendipity_db_query are returned as strings, it's just that plugins or function don't always evaluate the return.

It's a good idea to think about a central place where failed queries can be investigated! I'll think about how to actually implement that; it would be good to log errors to a file instead of the DB, and then have a small panel where one can read the error logfile?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
SHRIKEE
Regular
Posts: 128
Joined: Tue Feb 21, 2006 2:49 am
Location: Netherlands
Contact:

Post by SHRIKEE »

that might be an idea yes, but bear in mind this file or page should be accessable outside the admin area. otherwise if there are errors in the admin pages we still cannot see the errorlog
My kingdom For i am king of my heap of trash

Developing code on:
Workstation: Windows 2000 sp4, TSW webcoder 2005
Server: fedora core 4 amd64, apache 2.0.54, php 5.0.4, mysql 4.1.11.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

No way - error messages may contain very confidential information. It should never be disclosed without a login, or by downloading the file via FTP. :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
SHRIKEE
Regular
Posts: 128
Joined: Tue Feb 21, 2006 2:49 am
Location: Netherlands
Contact:

Post by SHRIKEE »

i didnt mean leaving it unprotected but if the admin area is screwed the log must be readable too.
My kingdom For i am king of my heap of trash

Developing code on:
Workstation: Windows 2000 sp4, TSW webcoder 2005
Server: fedora core 4 amd64, apache 2.0.54, php 5.0.4, mysql 4.1.11.
mina
Regular
Posts: 7
Joined: Tue Mar 21, 2006 2:42 pm

Re: statistics about Authors logon activities.

Post by mina »

garvinhicking wrote:Hi Mina!

Thanks! It was a bug in the logger() function of the plugin. It specified the "ua" column name in the INSERT statement, where it should properly use "user_agent". I only added that later on, so I didn't catch that bug.

Just committed version 1.14 of the plugin.

Regards,
Garvin

Hi Gavin,

Thank you very much. Now it is working :)

BTW, I am just wondering about couple of things.

Every login action creates 2 rows in the table, one for frontend_login
and one for backend_login. What these logins represents?

The timestamp is like this 1143192368
How can i get real date & time out of this?

thanks again for the greate help.

Mina.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: statistics about Authors logon activities.

Post by garvinhicking »

Hi mina!

This dual-login is actually how s9y works: If someone logs into the backend, he automatically logs into the frontend as well. But if someone logs into the frontend, he does not necessarily want to access the backend. So I think this is quite interesting information that is stored.

You can convert timestamps by using the MySQL "DATE_FORMAT" command: http://dev.mysql.com/doc/refman/4.0/de/ ... tions.html

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mina
Regular
Posts: 7
Joined: Tue Mar 21, 2006 2:42 pm

Re: statistics about Authors logon activities.

Post by mina »

garvinhicking wrote:Hi mina!

This dual-login is actually how s9y works: If someone logs into the backend, he automatically logs into the frontend as well. But if someone logs into the frontend, he does not necessarily want to access the backend. So I think this is quite interesting information that is stored.

You can convert timestamps by using the MySQL "DATE_FORMAT" command: http://dev.mysql.com/doc/refman/4.0/de/ ... tions.html

Best regards,
Garvin
Hi Garvin,

I am bit confussed about forntend & backend of the blog.
What is the differnce between frontend login and backeng login?

I know this is pretty boring question, but I am new to s9y.

best regards,

Mina.
Post Reply