Read the statement by Michael Teeuw here.
Show calendar based on IP Address accessed
-
@MMRIZE that is why you need the express api call…
I would make a separate module that has ip in div, not shown, but w id
then call in calendar is document.get…
compare, your way or on cal entries
more synchronous… -
@sdetweil
Yes. I thought a small module with node_helper that could return clients’ ip as a result of REST api call from calendar module. -
@MMRIZE and that module calls its own rest call publishes the address in its getDom() result, with id= on div
and then cal module can use synchronous document.getElementsById()
to get that value.
-
so the little module is
https://github.com/sdetweil/getip
and it does correctly return the ip address of the client… tested from 4 different systems to the same MM…
see later post for final solution
-
-
I tried your code, but find that once I include getip module in config.js, I am not seeing any output for calendar. Is this the expected output. Without getip module, I find that client_ip = document.getElementById("getip is returning null.Please advice
-
@Spinstersee later post
-
@Spinster
By the way, which client are you using? Electron? Or Browser? -
@MMRIZE Browser as of now.
I also tried using express ipfilter, but the problem is I don’t know how to use it in module.js, it is throwing error saying ipfilter not known etc
-
@Spinster well, here is a working example, in addition to the other code already
watch out if using address AND MM host system not included. as it won’t show either…
one could make the ipaddress in cal a list (of ip addresses) similar to what @MMRIZE does…
I don’t like adding the extra block,
just add the var to the thing that matters…see later post