It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

User macro using LoginManager not working anymore in Confluence 7

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

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!

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.

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

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 Greg Bailey likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

Lessons and Learnings: Six Months of Working Remote [Discussion]

Hey there, folks! For most of us, the past six months- yes, you read that right- have been a journey. More people than ever before have pivoted to working remotely, and navigating being on-scre...

5,343 views 4 6
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you