Welcome Guest, Not a member yet? Register   Sign In
Community Auth Redirect
#6

(06-08-2016, 12:33 AM)skunkbad Wrote:
(06-07-2016, 11:10 PM)zenepay Wrote: Hi Skunkbad,
I wonder that the function $this->require_min_level(1) will just return true/false or it redirect to login page if false.
I am trying to initial create new user with auth_level =0, then after email verifying is confirmed, it will set auth_level =1.
But I found that just after register new account, it will redirect to page /login. I tried to look for where I could prevent this. So, I can return message telling new register to check email etc.
Please advise.

The redirect should only happen if you are not logged in. But there are some problems with what you are doing. I don't think you can create a user level 0, and a better solution would be to set `users`.`banned` to 1, then after they verify their account set it to 0.

In my own personal websites, and the websites I create for customers, users who are going through the verification process are stored in a different table than regular users. This table has a field for a registration code, and the code is a query string parameter that must be in the verification URL. If the user follows the link that is in their email, their temporary account is used to create a real user account, and then the temporary account is deleted.

Since you asked, the method verify_min_level is like require_min_level, except without the redirect.

Hi Skunkbad,
Thank you for your valuable response. Now, I could get it worked.
I have thought for a while if I should do register with users table using Communication Auth as a core controller.
Yes, I design to put it there, just to make it simple. So, creating account and login will do in Auth class.
I add email_verfication_code field to users table.
Then after email verification is done, it starts to create user Profile which is in different table eg. Members where more detail of members are saved to.

Thank you for your great support.
Reply


Messages In This Thread
Community Auth Redirect - by cytey - 04-16-2016, 04:37 AM
RE: Community Auth Redirect - by skunkbad - 04-16-2016, 07:59 AM
RE: Community Auth Redirect - by cytey - 06-01-2016, 09:30 PM
RE: Community Auth Redirect - by zenepay - 06-07-2016, 11:10 PM
RE: Community Auth Redirect - by skunkbad - 06-08-2016, 12:33 AM
RE: Community Auth Redirect - by zenepay - 06-08-2016, 12:57 AM
RE: Community Auth Redirect - by skunkbad - 06-08-2016, 01:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB