Check Account disabled  

  RSS

Fury
 Fury
(@fury)
Active Member
Joined: 7 months ago
Posts: 4
10/04/2019 12:49 am  
Hi, first I want to thank you for your great work. Thank you.
I was wondering if it is possible to verify that the user account is enabled or disabled when signing in.

Sorry, I'm new to programming.
This topic was modified 7 months ago by jaimzj

Quote
Topic Tags
jaimzj
(@jaimzj)
Guru Admin
Joined: 1 year ago
Posts: 58
10/04/2019 1:24 am  

Hi,

When signing in if the user account is disabled, yes the response of the login function will return a message which you can use to identify or display errors to the user.

Markers & maps are magical !!!


Fury liked
ReplyQuote
Fury
 Fury
(@fury)
Active Member
Joined: 7 months ago
Posts: 4
10/04/2019 1:59 am  

I get incorrect user name / password when responseCode it is not 200, this will happen for users who do not exist and also for blocked clients.

I wonder if it's just to check blocked users.

example :

 

if($responseCode == '200'){

    echo ('true');

}else if (disabled){

   // User disabled

}else{

    echo 'Incorrect username/password';

}
This post was modified 7 months ago 2 times by jaimzj

ReplyQuote
jaimzj
(@jaimzj)
Guru Admin
Joined: 1 year ago
Posts: 58
10/04/2019 2:33 am  

I would always suggest to learn and invest time in learning about the programming language you work on, in this case PHP.

Then invest time in understanding how this particular set of PHP codes work.

Then identify what problem you are facing, and try to do some basic troubleshooting.

Finally to answer your question, what you shared above is the set of code that works based on the response from the function , that is not the response of the function.

Refer to the codes, samples and check out     the response and responseCode section this will be the right way forward.

Feel free to write questions and I would be more than happy to help, provided you have done some basic study and attempts yourself as well.

Markers & maps are magical !!!


ReplyQuote
Fury
 Fury
(@fury)
Active Member
Joined: 7 months ago
Posts: 4
10/04/2019 2:48 am  

Ok jaimzj

thank you very much.

This post was modified 7 months ago by jaimzj

ReplyQuote
Fury
 Fury
(@fury)
Active Member
Joined: 7 months ago
Posts: 4
11/04/2019 1:14 am  
Posted by: Fury
Hello jaimzj
I'm trying to do this, but I'm not understanding.

// Server

if($responseCode == '200'){

    echo $response;

}else{

   echo 'Incorrect username/password';
}

// Client
$.ajax({
   type:"POST",
url:'loginDo.php',
data: {
username:$("#username").val(),
password:$("#password").val()
},

success:function(data)
{
console.log(data);
}

});
 

But when the client is disabled I do not get the answer so I can check, this should only happen on clients that do not exist?
Sorry for the double post,
I ended up finding out that I have to perform the query out of the if condition, I will study more, thank you

This post was modified 7 months ago by jaimzj

ReplyQuote
jaimzj
(@jaimzj)
Guru Admin
Joined: 1 year ago
Posts: 58
11/04/2019 2:46 pm  

You are headed in the right direction, here is what I suggest.

Share your codes before this section below, from the time you call login(); onwards. once you share that part I will point out what you need to look for.

 

if($responseCode == '200'){

Markers & maps are magical !!!


ReplyQuote
Share:
  
Working

Please Login or Register