4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: ClickyMouse on December 05, 2007, 11:08:39 AM

Title: Choose UserGroup on Registration
Post by: ClickyMouse 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!
Title: Re: Choose UserGroup on Registration
Post by: ClickyMouse on December 06, 2007, 12:19:53 AM
 :?
Title: Re: Choose UserGroup on Registration
Post by: live@ct 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
Title: Re: Choose UserGroup on Registration
Post by: thunderstrike on December 25, 2007, 09:47:05 PM
If use amember script (integrate with 4images) - is possible. ;)

http://www.amember.com - try demo. ;)
Title: Re: Choose UserGroup on Registration
Post by: Acidgod 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:
Title: Re: Choose UserGroup on Registration
Post by: thunderstrike 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. ;)