Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
760 views
in Q2A Core by

hi what must i edit in the qa-db-users.php file for give user automatic Expert level on register the process ?

qa_db_query_sub(
'INSERT INTO ^users (created, createip, email, passsalt, passcheck, level, handle, loggedin, loginip) '.
'VALUES (NOW(), COALESCE(INET_ATON($), 0), $, $, UNHEX($), #, $, NOW(), COALESCE(INET_ATON($), 0))',
$ip, $email, $salt, isset($password) ? qa_db_calc_passcheck($password, $salt) : null, (int)$level, $handle, $ip
);
 
return qa_db_last_insert_id();
}
 
Q2A version: 1.5.2

1 Answer

0 votes
by

Why don't you use event module and update the level column value in qa_users table???

I would suggest you to not to update level on regsitration but only when user confirm email. That's how you can prevent spam.

You can achieve this by using u_confirmed even and need to update only level value to 20 for Expert and they will get all expert permission.

 

by
Why don't you use event module and update the level column value in qa_users table???


ok thanks, and how do I do that ? because I can not write event modules.
by
You need to register even module in plugin and check if u_confirmed event occurred than run query to update user level value
...