User macro using LoginManager not working anymore in Confluence 7

JP _AC Bielefeld Leader_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 13, 2020

Hi,

after upgrading to Confluence 7 all user macros using something like:

$loginManager.getLoginInfo($user).getLastSuccessfulLoginDate()

don't seem to work anymore. The API clearly state that there is not change:

https://docs.atlassian.com/ConfluenceServer/javadoc/7.3.2/com/atlassian/confluence/security/login/LoginManager.html

Any known workaround or shall I file a bug with Atlassian?

Best

JP

1 answer

0 votes
Greg Bailey May 11, 2020

I am seeing this behavior as well.

I have a user macro that reports last login date of users which is also using 'loginManager.getLoginInfo' and when we upgraded to Confluence 7 it stopped working. 

Can someone please help to understand what has changed so I can fix our macro?  

Thanks!

JP _AC Bielefeld Leader_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 11, 2020

Atlassian beefed up the security by not allowing the use of sone java packages in velocity scripts. You can either write a macro using ScriptRunner which allows such things or switch off / allow the use of these packages in the velocity.properties configuration.

Greg Bailey May 11, 2020

aha!  thanks for the update!

Good to know it wasn't my macro itself that failed.  I will check out the other options.

Thanks again,

Greg

JP _AC Bielefeld Leader_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 11, 2020

I modified CONFLUENCE_INSTALL/confluence/WEB-INF/classes/velocity.properties and made two changes:

#introspector.restrict.packages = java.lang.reflect,\

introspector.restrict.packages = \

and

#introspector.restrict.classes = java.lang.Class,\

#java.lang.ClassLoader,\

introspector.restrict.classes = \

Like # people like this
Deanna Mosley August 25, 2022

I recently upgraded to 7.18.2 and this macro isn't working for me.  I tried the updates to velocity. properties too and that did not work.  Any other suggestions?

Charles Pikscher November 3, 2022
Deanna Mosley November 3, 2022

Thanks!  I just upgraded to 17.9.1.  

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events