Author Topic: Choose UserGroup on Registration  (Read 6365 times)

0 Members and 1 Guest are viewing this topic.

Offline ClickyMouse

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Choose UserGroup on Registration
« on: December 05, 2007, 11:08:39 AM »
Hi!
Is there any way to make that the user can chose on his registration, the User Group that he wants to integrate?

Thanks!

Offline ClickyMouse

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: Choose UserGroup on Registration
« Reply #1 on: December 06, 2007, 12:19:53 AM »
 :?

Offline live@ct

  • Sr. Member
  • ****
  • Posts: 348
    • View Profile
Re: Choose UserGroup on Registration
« Reply #2 on: December 25, 2007, 06:06:57 AM »
hi! im looking for this also, Im thinking in a solution maybe someone can help me... here are some steps

1. We need to add the code for add a user in the table of usergroups the function is in: admin/usergroups.php but is it in a "admin" folder it will be a risk to call this or I need to recreate??
2. Put the code in the registration form and the edit form, this will be simple but I like to know if there are no risk of someone inject a specified usegroup that can make changes in the gallery

thanks and clickymouse if I found a fix to this Ill post it or someone can find this steps useful please hep us :P
Existen 10 tipos de personas, los que entienden el codigo binario y los que no.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Choose UserGroup on Registration
« Reply #3 on: December 25, 2007, 09:47:05 PM »
If use amember script (integrate with 4images) - is possible. ;)

http://www.amember.com - try demo. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Choose UserGroup on Registration
« Reply #4 on: December 25, 2007, 10:01:12 PM »
http://www.4homepages.de/forum/index.php?topic=6945.0

with a little modification it will work... (o:

make a Dropdown (for the registration template) with the Usergroups and the value must be the group_id and name it group_id

for example:
<select name="group_id" id="group_id">
  <option value="11">Group where id is 11</option>
  <option value="12">Group where id is 12</option>
</select>

replace:
$group_id = [group_id];

with:
if(isset($_REQUEST['group_id']) && is_numeric(isset($_REQUEST['group_id']) && ($_REQUEST['group_id'] != 1 || $_REQUEST['group_id'] != 2)){
//the red part is only to exclude some groups and make it "save"
     $group_id = $_REQUEST['group_id'];
}
Hope it will work... (o:
« Last Edit: December 26, 2007, 09:57:10 PM by Acidgod »

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Choose UserGroup on Registration
« Reply #5 on: December 26, 2007, 09:23:37 PM »
Global.php use $HTTP_GET_VARS and $HTTP_POST_VARS with 4images. Use this :

Code: [Select]
if (isset($HTTP_GET_VARS['group_id']) || isset($HTTP_POST_VARS['group_id'])) {
   $group_id = (isset($HTTP_POST_VARS['group_id'])) ? intval(trim($HTTP_POST_VARS['group_id'])) : intval(trim($HTTP_GET_VARS['group_id']));
   $group_id = preg_replace("/[^0-9]+/i", "", $group_id);
} else {
   $group_id = 0;
}

if (isset($group_id) && $group_id != 1 || $group_id != 2) {
   //...
}

Replace //... with code of use. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?