03.08.2022, 07:36
Create ip.lp file and upload to user directory using FTP with apps login:
Add to Custom JS and modify plans object as needed (Client IP -> Plan ID mapping).
For this to work correctly either set each client device to a static IP address or create static DHCP entries on your router.
Code:
<?=ngx.var.remote_addr?>
Add to Custom JS and modify plans object as needed (Client IP -> Plan ID mapping).
Code:
$(function() {
if ($('body').hasClass('usermode') || $('html').hasClass('touch')) {
var plans = {
'192.168.0.2': 10,
'192.168.0.3': 2,
};
$.get('/user/ip.lp', function(resp) {
var ip = $.trim(resp);
var plan = plans[ ip ];
if (plan) {
showPlan(plan);
}
});
}
});
For this to work correctly either set each client device to a static IP address or create static DHCP entries on your router.