This topic is locked
[SOLVED]

 Search Script Block IP for X minutes

11/23/2020 1:48:12 AM
PHPRunner General questions
A
Andreas G. author

698/5000

Translated with Google

Hello

my name is Andreas and I come from Germany.

Can you ask questions in German here?
The following scenario:

I use custom views for different users.

But I need a Block IP script for an Android app.

That should be inserted at

Add page / Before process

This is to query an IP whether this IP has just been used.

If so, there should be a timeout for XX minutes and a redirection to another page.
It should work before filling out and submitting the form.

The user with a blocked IP should not come to the form first.
This example, with error message instead of redirection, does not work!
Code IP BLock

admin 11/23/2020
A
Andreas G. author 11/23/2020



You can find a few pointers here:

https://xlinesoft.com/phprunner/docs/restrict_access_by_ip_address.htm


I've already read that.

Do not block permanently!

I do not know the IP of the end device

Allow access with the IP again after xx minutes.

That was my question.
Login with Android app

Determine the IP of the phone, save the IP in the database or txt

Block this IP for xx minutes

Give access again after xx minutes

admin 11/23/2020

I guess you can use the same event to save the IP address in the database and apply some sort of logic when they try to logon the next time.
You just need to be careful with that as BeforeProcess event of the Add page will be called twice, once when that Add page is loaded initially and another one after the record was added. I would suggest only add their IP address to the database in the event like AfterAdd.

A
Andreas G. author 11/24/2020

after add is wrong

the query must come before it.
I will solve it with an external startpage.

IP not blocked >>>> my company.com/login.php

IP blocked >>>> external site with notice

admin 11/24/2020

I'm afraid that you misunderstood me. There are two actions here, "blocking" and "checking if block exists".
Blocking needs to be implemented in AfterAdd event while checking for the block can be placed to BeforeProcess event of the Add page.
With your suggested solution, they will be able to add as many records as they want once they got to the Add page.

A
Andreas G. author 11/24/2020

I do not know the IP!

Access works via an app from the Play Store.

Since every user, every device has a different IP, I cannot set an IP as a default.
The project is publicly visible and anyone who has the login data can register via the app and is then logged out.
These are all strangers and other devices and IPs.
Only a multiple entry should be prevented by the IP lock.
German to English translated is crap .....

admin 11/24/2020

Nobody is talking about setting "IP as a default". Of course, there are multiple IP addresses out there and you need to save them in the database to prevent multiple submissions.
I'm only talking about what PHPRunner events you should use.

HJB 11/25/2020

https://asprunner.com/forums/topic/15072-tip-how-to-autologin-rolling-login-license-solution/
The technical term for the described problem is called "avoidance of multiple logins" at the same time under only one existing registration. In other words, the goal here is that only a registered user can log in with his login data at the moment, while other users who want to log in either with or without the permission of the main user have to wait until the main user has logged out. FunkDaddy has a solution for this under the above URL.
Auf gut deutsch:
Der gesuchte Fachbegriff für das umschriebene Problem nennt sich "Vermeidung von Mehrfach-Logins" zur gleichen Zeit unter nur einer existierenden Registrierung. Anders ausgedrückt, Ziel hier ist, dass sich nur ein registrierter Nutzer zur Zeit mit seinen Anmeldedaten einloggen kann, während sich andere Nutzer, die sich entweder mit oder ohne Erlaubnis des Hauptnutzers einloggen wollen, warten müssen, bis sich der Hauptnutzer ausgeloggt hat. FunkDaddy hat hierfür unter obiger URL eine Lösung parat.

A
Andreas G. author 11/25/2020

OK