Log in

View Full Version : Is This Possible?....


groovesalad
10-11-2002, 08:43 PM
I created a User Group named "DVD". Each one of the subscribers has a different Username but all of them have the same password. Is there a way that when they sign up with different usernames, but use a specific password, it'll register them under the DVD user group name?

Xenon
10-12-2002, 09:04 AM
you know it's dangerous to give all the same password?
they can easily log in as someone else...

my tip: create a new customfield DVD-Password

then edit register.php and compare DVD-Passwordfield with the password you want for that group.
if they match, they'll be registred in this custom group

groovesalad
10-12-2002, 01:43 PM
I have no idea how to do that.

Xenon
10-12-2002, 06:52 PM
well create the new field in your AdminCP
Editable by user, but not viewable in profile

then open register.php find
$DB_site->query("INSERT INTO user (userid,username,password,email,".$newstylefield."parentemail,coppauser,homepage,icq,aim,yahoo,signa ture,adminemail,showemail,invisible,usertitle,join date,cookieuser,daysprune,lastvisit,lastactivity,u sergroupid,timezoneoffset,emailnotification,receiv epm,emailonpm,options,birthday,maxposts,startofwee k,ipaddress,pmpopup,referrerid,nosessionhash,avata rid) VALUES (NULL,'".addslashes(htmlspecialchars($username))."','".addslashes(md5($password))."','".addslashes(htmlspecialchars($email))."',".$newstyleval."'".addslashes(htmlspecialchars($parentemail))."','$coppauser','".addslashes(htmlspecialchars($homepage))."','".addslashes(htmlspecialchars($icq))."','".addslashes(htmlspecialchars($aim))."','".addslashes(htmlspecialchars($yahoo))."','".addslashes($signature)."','$adminemail','$showemail','$invisible','".addslashes($usertitle)."','".time()."','$cookieuser','".addslashes($prunedays)."','".time()."','".time()."','$newusergroupid','".addslashes($timezoneoffset)."','$emailnotification','$receivepm','$emailonpm',' $options','".addslashes($birthday)."','".addslashes($umaxposts)."','".addslashes($startofweek)."','".addslashes($ipaddress)."','$pmpopup','".addslashes($testreferrerid['userid'])."','$nosessionhash','$avatarid')");


before this add:
if($fieldX=="password") $newusergroupid=xy;

replace the X with the new fieldid and the xy with the usergroupid of your DVD group

not tested but should work

groovesalad
10-12-2002, 07:12 PM
I know how to find out the usergroupid, but how do I figure out the fieldID number?

groovesalad
10-12-2002, 07:16 PM
nevermind, I think I got it...testing now

groovesalad
10-12-2002, 07:27 PM
Doesn't work unfortunately. It just registers them under "Registered" instead of "DVD"

Xenon
10-12-2002, 10:11 PM
hmm, had a second look at the code and it should work perfectly...

Is your typing correct, the password is cassensitiv.

you can add an echo $fieldX;
exit;
after if($fieldX=="password") $newusergroupid=xy;

to see if the content of the var is correct

groovesalad
10-12-2002, 10:28 PM
when I put in the echo code, when I try to register and give the correct password, the page refreshes to just a blank page. I took out that code and tried again and it still just registers the user as "Registered" and not under "DVD". Weird. Maybe I have my numbers wrong, but I have the Field ID set to the DVD group when I added that group, and I have the New User Group ID set to the Forum number. Is this correct?

groovesalad
10-12-2002, 10:51 PM
I even switched the numbers around and it still doesn't work.

Xenon
10-13-2002, 09:29 AM
the fieldid you'll get when you highlight the edit profilefield link and look into the status bar.

you must use the right numbers or it cannot work

groovesalad
10-13-2002, 10:20 AM
Yeah, used the correct numbers. Have you tried it on your site? Maybe I have a conflicting hack interfering with it? .....don't know. Either way, thanks for your help :)

Xenon
10-13-2002, 10:43 AM
yes i've tried it on my testboard now and it works perfectly.

you must have made a small mistake while hacking...

an normally there shouldn't be a conflicting hack, because it just uses a form value if the hack doesn't empty this val it should work...

groovesalad
10-13-2002, 11:40 PM
Ok, let's see if I did this wrong. Here's the steps I did.

1. Went to ACP and went to ACP > User Groups > Add ( under Title, I gave it DVD ), then clicked Save

2. I placed my cursor over the EDIT link for the newly created DVD group. It showed a number of 13

3. Went to Forums & Moderators > Add. I created a private group (maybe this is the problem - it being private?) called DVD. Then clicked on Save Forum.

4. Ran my cursor over the newly created Forum and got a number of 35.

For the code, I put this:

if($field13=="test") $newusergroupid=35;

Then I went to my board as an unregistered user. I registered with a random username and put the password as "test" (w/o quotes). Then I replied to the user authentication email.

However, now when I go into my ACP and look at the newly created user, they are placed in the "Registered" category instead of the "DVD" category.

Was this correct? Thanks again for your help.

Xenon
10-14-2002, 04:17 PM
ahh no i see what you've made wrong, you've missmatched some general vb terms.

step 1 and 2 are ok, usergroupid=13
step 3 and 4 are completly wrong for the instructions i meant:
section User Profile Fields > Add
add a new field lenght what you want, editable by user yes, hidden for other users in profile
after creating this field get the id and then chage the ifclause to:
if($fieldX=="test") $newusergroupid=13;
Replace the x with profilefield id

groovesalad
10-15-2002, 12:11 PM
Works perfectly! Thank you :)

Do you know if there is a way to send the DVD subscribers a different User Confirmation Email once they subscribe? Something that is different than the normal "Registered" users?

If that's not possible, then maybe this:

I signed up on a board once, replied to the user confirmation email, and once I signed into the board, I got a pop up box saying I had a private message. The message was just greeting me to the board. I noticed that the PM Popup button is always set to NO when my subscribers sign up. Is there any way to get it to default to YES?

Xenon
10-15-2002, 04:16 PM
you have to edit the registeroption templates to set defaults from YES to NO or the other way ;)

yes, as i say most of the time: Nearly everything is possible, but a secound email isnt as easy as this hack here, because you have to edit more than just one file ;)

groovesalad
10-15-2002, 04:29 PM
Great. Well, i really appreciate your help. :)