coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: catfish on December 09, 2003, 01:16:02 PM

Title: how user can register in custom group
Post by: catfish on December 09, 2003, 01:16:02 PM
i created a custom group different rights than registered users
i would like certain people to register in the custom group (normal registration page with check box or different registration page doesn't matter much)
as you all guessed my knowledge of php allows only copy/paste/comment out
thanks for helping
Title: how user can register in custom group
Post by: Joachim Müller on December 09, 2003, 05:50:08 PM
That's the idea of custom groups: users can only register to become members in the group "registered" - you'll have to move them to any other group.
Surely the code could be modified to work as you want to, but I don't see the point...

GauGau
Title: how user can register in custom group
Post by: Oasis on December 09, 2003, 07:00:02 PM
try this:

make a copy of register.php and name it register2.php

find:
       $sql = "INSERT INTO {$CONFIG['TABLE_USERS']} ".
                   "(user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_location, user_interests, user_website, user_occupation) ".
                   "VALUES (NOW(), '$active', '$act_key', '".addslashes($user_name)."', '".addslashes($password)."', '".addslashes($email)."', '$location', '$interests', '$website', '$occupation' )";
        $result = db_query($sql);


replace it with:
       $sql = "INSERT INTO {$CONFIG['TABLE_USERS']} ".
                   "(user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_location, user_interests, user_website, user_occupation, user_group) ".
                   "VALUES (NOW(), '$active', '$act_key', '".addslashes($user_name)."', '".addslashes($password)."', '".addslashes($email)."', '$location', '$interests', '$website', '$occupation', '##' )";
        $result = db_query($sql);

where ## is the number of their group (registered is 2, for example).

Then, tell them to register at http://yoursite.com/gallery/register2.php
Title: thanks
Post by: catfish on December 10, 2003, 05:34:55 PM
it works thanks a lot for prompt answers