This Theme was discussed before hack
Hi together Is it possible to define a default usergroup for new registered users? As soon as the new user has activated his account, he should be linked to the usergroup "new user". thanks for helping me.
Serge
from Jan:
Try this:
1.) Open register.php and search for Code:
$sql = "SELECT ".get_user_table_field("",
"user_name").get_user_table_field(", ",
"user_email").get_user_table_field(", ",
"user_activationkey")."
Replace it with Code:
$sql = "SELECT ".get_user_table_field("",
"user_id").get_user_table_field("",
"user_name").get_user_table_field(", ",
"user_email").get_user_table_field(", ",
"user_activationkey")."
2.) Then search for Code:
$msg = $lang['activation_success'];
Add the following code below Code:
$group_id = [group_id];
$sql = "INSERT INTO ".GROUP_MATCH_TABLE."
(group_id, user_id, groupmatch_startdate,
groupmatch_enddate)
VALUES
($group_id, ".$row[$user_table_fields['user_id']].",
".time().", 0)";
$site_db->query($sql);
Replace [group_id] with the id of the goup id you want the user link with. To find out the id, go to Control Panel -> Usergroups and point your cursor over the edit link of the usergroup. Then look at the status bar of the browser and check the group_id= parameter in the url. The value of the parameter is the group id.
Jan
Zuletzt bearbeitet von Jan am 10.01.2005, 13:21, insgesamt 2 Male bearbeitet
TIMT wrote:
Hi Jan Now I get the following error-message:
"DB Error: Bad SQL Query: SELECT user_iduser_name, user_email,
user_activationkey FROM 4images_users WHERE user_activationkey =
'0fa67cf43fd1dd0e1176a1d2ddedbc7b'
Unknown column 'user_iduser_name' in 'field list'"
v@no wrote:
@Jan: that what u get when u put things at the beginning of line, instead of end j/k
TIMT hat folgendes geschrieben::
"DB Error: Bad SQL Query: SELECT user_iduser_name, user_email, $
user_activationkey FROM 4images_users WHERE user_activationkey =
'0fa67cf43fd1dd0e1176a1d2ddedbc7b'
Unknown column 'user_iduser_name' in 'field list'"
@TIMT: First line u changed should looks like this:
Zitat:
$sql = "SELECT ".get_user_table_field("",
"user_id").get_user_table_field(", ", "user_name").get_user_table_field(",
", "user_email").get_user_table_field(", ", "user_activationkey")."
Jan wrote:
V@no is right. Forgive me, its monday
TIMT wrote:
Thank you Jan, Thank you V@no! Now it works perfect!