20.12.2017, 23:35
(This post was last modified: 21.12.2017, 00:00 by Erwin van der Zwart.)
Hi,
You can fetch his/her login username and showPlan(x) based on username with custom JavaScript.
Put this in a file called user.lp inside your ftp user folder:
Put this in your custom JS:
BR,
Erwin
You can fetch his/her login username and showPlan(x) based on username with custom JavaScript.
Put this in a file called user.lp inside your ftp user folder:
Code:
<?
require('apps')
clientuser = request.username or 'anonymous'
print(clientuser)
?>
Code:
$(function(){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
var res = xhttp.responseText;
res = res.trim();
if (typeof(res) !== "undefined" && res !== null){
if (res == 'erwin'){
showPlan(1);
}
if (res == 'admin'){
showPlan(2);
}
}
}
};
xhttp.open("GET", "/user/user.lp", true);
xhttp.send();
});
Erwin