× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
which file can been used after email verification
#1
Hi,

I want to know which file i can change for creating some database changes after a user is validated bij email.

I use beta 3 of 4.4 and love all the work what is already done.

Grtz Ruud
  Reply
#2
(01-02-2019, 02:12 AM)Ruud Wrote: Hi,

I want to know which file i can change for creating some database changes after a user is validated bij email.

I use beta 3 of 4.4 and love all the work what is already done.

Grtz Ruud

Thanks for the compliments. Let me think through this.  So you could make the changes during user creation in the script usersc/scripts/during_user_creation.php (I think that's the name), but only consider them active if $user->data()->email_verified == 1;

I'm not sure what types of data you're trying to enter, so I'm not sure the absolute best way to do it.

The problem is that with social logins and things like that, "email verified" can happen at several places.  

A bit of a hack could be to add a column in the users table like ver_script tinyint(1) which defaults to zero.  Then in usersc/includes/head_tags you could do

if(isset $user && $user->isLoggedin() && $user->data()->email_verified == 1 && $user->data()->ver_script == 0){
//run script here
//the last thing you do is to set the ver_script to 1 and it will forever skip that block.  The bonus is that if you ever need to get more info or run something on other users, you could just flip ver_script back to 0.

If that doesn't work, let me know, and we can figure something else out.
  Reply
#3
(01-02-2019, 10:18 AM)mudmin Wrote:
(01-02-2019, 02:12 AM)Ruud Wrote: Hi,

I want to know which file i can change for creating some database changes after a user is validated bij email.

I use beta 3 of 4.4 and love all the work what is already done.

Grtz Ruud

Thanks for the compliments. Let me think through this.  So you could make the changes during user creation in the script usersc/scripts/during_user_creation.php (I think that's the name), but only consider them active if $user->data()->email_verified == 1;

I'm not sure what types of data you're trying to enter, so I'm not sure the absolute best way to do it.

The problem is that with social logins and things like that, "email verified" can happen at several places.  

A bit of a hack could be to add a column in the users table like ver_script tinyint(1) which defaults to zero.  Then in usersc/includes/head_tags you could do

if(isset $user && $user->isLoggedin() && $user->data()->email_verified == 1 && $user->data()->ver_script == 0){
//run script here
//the last thing you do is to set the ver_script to 1 and it will forever skip that block.  The bonus is that if you ever need to get more info or run something on other users, you could just flip ver_script back to 0.

If that doesn't work, let me know, and we can figure something else out.

Okay, you give me a good thought.

First, some more context, because you trigger me with the social oauth stuff. What I will implement later.

The script I use will assign the US accountId with my own customerId after a successful registration, where I'm sure that I've got a verified email address.
Bij US or given by Social IDP, like facebook (is email address passing through by facebook reliable?).
That's my basic reason.

I develop an App and want to use group assignments for given separate information (a ABAC way of thinking).
First, I thought to use US permission levels, but that's not doable. I don't want administration handling, it's already there in my CRM tables.

So based on the information given in the database (CRM tables), I will assign by script (autorize_groups.php):
a) First time when user ended a successful registration;
b) Every day at 6 o'clock automatically

I hope you can help me with doing the right changes.

Thanks Mud.

For example, there's already a customer administration and a customer can be assigned to several groups.
With US I will map the account based on email address with the email address in the customer administration.
  Reply
#4
Ok. So, I think the most flexible way to do this where it will work regardless of how a person signs up/logs in is definitely the method I outlined above with adding a column to the users table.

Social logins use oAuth which is a very mature technology. UserSpice specifically merges your accounts so if your email address is the same, it doesn't matter if you login with facebook, username, email, or google, they are all going to only create 1 account with one set of permissions. It also doesn't matter which one you sign up with.

So, yeah. If you want to run a script on confirmation (or at least first login after confirmation) then that would definitely work.

I also would equate facebook/google login with an email address being verified. If you managed to take over one of those 2 accounts, you most certainly have what it takes to validate an email anyway, so there isn't much difference...I hope that statement made sense Smile
  Reply
#5
okay, if I understand it right, the property email_verified == 1 will also be used when using facebook authentication.

thanks
  Reply
#6
Yes. And google.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)