As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
hi ,
i need to get last logged date of current user. is there any service to access this?
regards
janaka
You have to enable the auditing engine of Alfresco to trace the login event:
Content Auditing
I think that you can follow these steps:
1. Enabled auditing by adding the following in alfresco-global.propertiesaudit.enabled=trueaudit.alfresco-access.enabled=true2. Start the server3. Verify auditing is enabled with
curl -u admin:admin http://localhost:9080/alfresco/service/api/audit/contol
Below output is shown, as expected
{"enabled" : true,"applications": [{ "name": "Alfresco Tagging Service", "path" : "/tagging", "enabled" : true },{ "name": "alfresco-access", "path" : "/alfresco-access", "enabled" : true }]}
{"enabled" : true,"applications": [
{ "name": "Alfresco Tagging Service", "path" : "/tagging", "enabled" : true }
,
{ "name": "alfresco-access", "path" : "/alfresco-access", "enabled" : true }
]}
4. List the audit entries using the following command
curl -u admin:admin http://localhost:8080/alfresco/service/api/audit/query/alfresco-access?verbose=true
Hope this helps
hi
thanks for your reply.
after enable audit as you said, i could get result as follow. problem is when i refresh alfresco page, that entries are filled manytimes. this does not return correct last logged date of user.
{
"count":21,
"entries":
[
"id":5,
"application":"alfresco-access",
"user":"admin",
"time":"2016-10-21T13:39:25.573+05:30",
"values":
"\/alfresco-access\/login\/user":"admin"
}
},
"id":6,
"time":"2016-10-21T13:39:26.684+05:30",
"\/alfresco-access\/transaction\/sub-actions":"readContent"
,"\/alfresco-access\/transaction\/action":"READ"
,"\/alfresco-access\/transaction\/type":"cmerson"
,"\/alfresco-access\/transaction\/path":"\/sys:system\/syseople\/cm:admin"
,"\/alfresco-access\/transaction\/user":"admin"
Hi:
As an additional comment, you can use audit-dashlet instead of curl command.
GitHub - share-extras/audit-dashlet: Display audit events for any given audit application
Regards.
--C.