This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Display Custom Home Screen for Different Users
#2
Create ip.lp file and upload to user directory using FTP with apps login:
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.
Reply


Messages In This Thread
RE: Display Custom Home Screen for Different Users - by admin - 03.08.2022, 07:36

Forum Jump: