Gossamer Forum
Quote Reply
User signup pre-sets?
Hi. I've been playing with the user signup...and I am wondering how you would go about setting other fields, other than the Username, Email and Password. I tried adding the following to the form code;

<input type="hidden" name="Free_Home_User" value="0">
<input type="hidden" name="isPro" value="0">

But that doesn't set it correctly. When defining this, would I need to use the data that is added to the database, or the name that is shown? (i.e Yes/No).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] User signup pre-sets? In reply to
What might be happening, is that '0' is a defined "False" value, and the tags are stripped.

I've found I had to use double negatives to make the forms work in cases like this, pass in a '1' or a '-1', or Yes/No (which might be why Alex took the steps to use Yes/No rather than 1/0).


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] User signup pre-sets? In reply to
I tried it with a -1, and also a 'No', but neither worked. Its really annoying. I may just have to go into the actual script itself, and manually edit the codes Frown I'll give it one more day...and then see if Alex, or anyone at GT can spread some light on the matter.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] User signup pre-sets? In reply to
Hey Andy,

Take a close look at admin/Links/Login.pm and "sub signup_user" for detailed information on implementation.

Aside from making sure that the fields you're trying to set are named exactly the same as in the database, I'm not sure what I can add.
Quote Reply
Re: [Aki] User signup pre-sets? In reply to
Hi..I had a look at Login.pm, but I can't seem to find the part that reference's the addition to the database? In the validation sub, I see the update code, but I can't find the 'insert' code for the actual use radditon Unsure I searched the whole file for 'insert', and no instances were found...

Any ideas? Unimpressed

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] User signup pre-sets? In reply to
add is similar to insert. Take a look at $db->add(); Maybe do a Data::Dumper of what goes into that method to see if everything is being set properly.

Code:
145 # Send validation email if needed.
146 if ($CFG->{user_validation}) {
147 my $code = (time) . ($$) . (int rand (1000));
148 $user->{Status} = "Not Validated";
149 $user->{Validation} = $code;
150 my $ret = $db->add ($user);
151 if (!$ret) {
152 print $IN->header();
153 print Links::SiteHTML::display ( 'signup_form', { error => $db->error } );
154 return;
155 }
156 }
157 else {
158 $user->{Status} = "Registered";
159 $user->{Validation} = 0;
160 my $ret = $db->add ($user);
Quote Reply
Re: [Aki] User signup pre-sets? In reply to
Ah, so I just need to push new variables into $user? Something like;

$user->{isPro} = "1";

Am I on the right track? Tongue

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] User signup pre-sets? In reply to
Yes you are. However, right above it, it seems like it does a

Code:
$user = $IN->get_hash();

That suggests that the form data may not be properly getting to that database insertion call :/
Quote Reply
Re: [Aki] User signup pre-sets? In reply to
Cheers...its working great now :)

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!