This topic is locked

Mobile security

11/11/2015 5:57:41 PM
PHPRunner General questions
crodrigof author

Hello,
I need to know if we can block access and how, cell phones or tablet users who are authorized to use the application on the PC desktop.
I have a mobile template.
Thank you,
Cristian

<============== ESPAÑOL ===============>
Hola,
Necesito saber si podemos bloquear el acceso y como, a teléfonos celulares o tabletas de usuarios que están autorizados a utilizar la aplicación en las PC de escritorio.
Tengo una plantilla mobile.
Gracias,
Cristian

Sergey Kornilov admin 11/11/2015

This question doesn't make sense in the way it asked. Do you want to only allow access to your application from the desktop?

crodrigof author 11/12/2015



This question doesn't make sense in the way it asked. Do you want to only allow access to your application from the desktop?


The point is:

  I have 10 users with authorized access, 5 have access by cell phone and desktop and 5 has only access desktop.
It is understood ?
Cristian

Sergey Kornilov admin 11/12/2015

I think I understand. You need certain users to be able to access website from mobile device only while others should be using desktop only.
While something like this is possible the solution won't be very reliable. It's very easy to trick website that you use a mobile device when using desktop browser and vice versa.
Anyway, you can use AfterSuccessfulLogin event and isMobile() function. Lets assume that you have the following Users table.

id username password device

----------------------------

1 test ***** desktop

2 admin ***** mobile

3 demo ***** desktop


Here is the sample code:

if (isMobile() && $data["device"]!="mobile") {

echo "You need to use mobile device to access this application";

session_unset();

exit();

}

if (!isMobile() && $data["device"]!="desktop") {

echo "You need to use desktop browser to access this application";

session_unset();

exit();

}


More info:

http://xlinesoft.com/phprunner/docs/after_successful_login.htm