You can provide your own implementation of the AuditActivity interface and plug
it into the Spring assembly configuration.
The component implementing this interface is called for many audit "events" from the Portal, including login/logout and
the corresponding methods on the interface are provided with the IP address of the user.
Look at the org.apache.jetspeed.audit.AuditActivity interface for more details.
The default provided org.apache.jetspeed.audit.impl.AuditActivityImpl (if enabled) already writes down all this info to
the AUDIT_ACTIVITY database table.
If however you need to write this out to another table and/or are not
interested in the other type of audit logs,
you can easily "wrap" this bean and only intercept the logUserActivity method or, probably even easier, just provide a
simple implementation yourself ignoring all the other "events".
Once you have that, provide an override definition for your bean in a separate Spring xml configuration file under the
WEB-INF/assembly/override folder. Your bean definition should have id="org.apache.jetspeed.audit.AuditActivity" matching
(and thereby overriding) the default bean definition provided in WEB-INF/assembly/statistics.xml
HTH,
Ate
Michael Binette wrote:
Is there a Jetspeed object to get at this information? I used the
GroupManager, UserManager, and RoleManager objects to get access to user
information for instance. I don't really want to connect directly to the
database.
--
Michael
On Thu, Jul 3, 2008 at 10:33 AM, Vivek Kumar <[EMAIL PROTECTED]> wrote:
Hi
Jetspeed have in-built STATISTICS features. Which capture IP address of
users, who ever access the portlet. Jetspeed store all these information in
PORTLET_STATISTICS table with in Jetspeed schema.
Regards
Vivek Kumar
On Thu, Jul 3, 2008 at 5:45 PM, Michael Binette <[EMAIL PROTECTED]>
wrote:
I have a requirement that I need to track what IP address the user logged
in
from. Is there any hooks to the login process that I can use to get and
record this information in my own database?
I was thinking if no hooks exists that I would create a portlet that went
on
the first page that would update this information. Setting it to only be
visible for logged in users should make it only get called after I know
who
the user is. Using the session Id and the username combination would
make
sure I only created the log entry once in my database.
How do I get the user's IP address and name from the portlets doView
method?
--
Michael
--
Regards & thanks
Vivek Kumar
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]