16.10.2017, 17:56
(This post was last modified: 17.10.2017, 14:59 by Erwin van der Zwart.)
Hi,
Only solution i know is by using a .lp file (in sample i named it user.lp) with this content:
Create a text object with custom class 'username' , enter a random text to position the element and add it to your visu.
Add this to custom css:
Enable password for user folder if you add the .lp file to the user folder (otherwise it shows 'anonymous') and put this into your custom javaScript:
BR,
Erwin
Only solution i know is by using a .lp file (in sample i named it user.lp) with this content:
Code:
<?
require('apps')
clientuser = request.username or 'anonymous'
print(clientuser)
?>
Add this to custom css:
Code:
.username {
display: none;
}
Enable password for user folder if you add the .lp file to the user folder (otherwise it shows 'anonymous') and put this into your custom javaScript:
Code:
$(function(){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
var res = xhttp.responseText;
if (typeof(res) !== "undefined" && res !== null){
var UpperCaseRes = res.charAt(0).toUpperCase() + res.slice(1);
$(".username").html(UpperCaseRes);
$(".username").css("display","initial");
}
}
};
xhttp.open("GET", "/user/user.lp", true);
xhttp.send();
});
Erwin