Is there any way that i can Restrict Check In & CheckOut Based on IP Address?
I am using Cloudflare - and i want to whitelist only my office and some more ip to check-in and checkout.
Is there any way?
Thanks
Is there any way that i can Restrict Check In & CheckOut Based on IP Address?
I am using Cloudflare - and i want to whitelist only my office and some more ip to check-in and checkout.
Is there any way?
Thanks
Can you tell me from where i can add this?
in details - that would be very helpful .
Thanks
after update that go to server script by searching
after create server script and add the code in script and then save that and also set the allowed_checkin_ip for employee
Hi @ShaonPro
Try to refresh browser. If don’t works, open browser console and check if any error is shown. Share screenshot here
I have Updated the Script
And Added these - also added IPs
But still user can check in from other ips
Please Help
Hi @ShaonPro:
Allowed IP address should be informed on each employee document, not in “design”. Anyway, this method just works with one IP. It can be tuned to allow ip ranges, or a list of ips …
Or … try this
if frappe.request.headers.get('X-Forwarded-For'):
ip_address = frappe.request.headers.get('X-Forwarded-For').split(',')[0]
else:
ip_address = frappe.request.remote_addr
allowed_ips = ["103.72.212.29", "103.49.170.164"] # write here all your ips
if ip_address not in allowed_ips:
frappe.throw("IP address not allowed")
i did these but still no luck.
Hi @ShaonPro:
There are a lot of things that could be failing … show how your script is written now.
Share too how your doctype is customized, showing fieldname too.
Can’t you restrict the user login from unknown IPs?
Hi @Varun:
Since “unknown” is a valid identifier for “X-Forwarded-For”, it should works … the value is not on on the allowed ip addresses.
Hope this helps.