OK managed to do it via ajs.params.remoteUser, but I get the ID of the user not the name...
OK solved, its ajs.params.userDisplayName
Here is a sample:
<body>
<script type="text/javascript">
AJS.toInit(function(){
alert("ID: " + AJS.params.remoteUser.toUpperCase() + " | UserName: " + AJS.params.userDisplayName + " | PageID: " + AJS.params.pageId);
});
</script>
</body>
Place this into an HTML macro...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So I was able to use that variable to get this:
var remoteUser = AuthenticatedUserThreadLocal.getUsername();
_paq.push(['setUserId', 'xxx']);
_paq.push(["setCustomVariable", 1, "username", remoteUser, "visit"]);
However, I am at a loss a since I need to acquire username in DN form for the UserID.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It looks like you are trying to write variables rather than read variables...that I haven't tried yet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That method only works in older versions since the newer versions disable AJS.
var user = AJS.Meta.get("remote-user");
var userdn = AJS.params.userDisplayName;
var userremote = AJS.Meta.get("remote-user");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is what I use:
var userFullname = $("#user-menu-link").attr("title");
Your mileage may vary depending on how your Confluence is configured.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.