(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.