Jump to content

Only allow "activated" users to login


WatsonN

Recommended Posts

I am pretty sure just like an ordinary login script. All you need is an extra column in your table with approved and an extra if clause in your login script that checks if the value of approved is 1

 

right on the money.

 

if($approved==1){
// let me login
}
else{
// tell me why i can't
}

the value for the approved var is pulled from the Db when querying for the user info

Link to comment
Share on other sites

additionally you could leave this part out on there profile page, so people can edit there profile and already do something. Which is not visible unless they are approved You might not want to do this, but it can be something to keep in mind. for instance If you let them pay for something, but they first have to be checked out if they qualify or something like a chamber of commerce integrity check thing.

 

This is also a nice extra because this way you can only display content from users that are approved. (in case someone breaks the rules all his post will not show up)

Link to comment
Share on other sites

Thank ya fortnox007. After I read that i was like :facewall: here it is.

//gives error if not allowed	
	if ($info['Allowed'] != "1") {
		$error = 'You are not allowed to login. Please activate your account.';   setcookie("Errors", 0, time()-3600); setcookie(Errors, $error, time()+5); ?> <BODY onLoad=window.setTimeout("location.href='/'",0)> <?php 
	}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.