Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

How do you pass Username to signup page!!

Quote Reply
How do you pass Username to signup page!!
Greetings,

I need to pass <%Username%> to the signup form... How would I go about doing that?

Basically, what I am after, is to allow the user, when logged in, to register new users (short form) under his/her name. But I am not getting the <%Username%> tag passed to the signup form.

I placed: <%GT::Template::dump%> in the signup form, but I got the Username field empty!!!

My signup form looks like this:
======================
<%if Username%>
Load simple singup form to add new user to your user account
<%endif%>
<%ifnot Username%>
Load the whole signup form as this is a completely new user
<%endif%>

Thank you for your help
Mark
Quote Reply
Re: [Mark2] How do you pass Username to signup page!! In reply to
Hi,

That's because it's conflicting with the username field on the signup form. You could use a global:

current_user => sub { return $USER ? $USER->{Username} : '' }

which will return the current logged in user.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] How do you pass Username to signup page!! In reply to
Thank you Alex for your answer,

What I have done is, created a global called logged_user and has:

sub {
Links::init_user ('path to the admin directory');
}


Then I added the tag <%logged_user%> right after the body tag in the signup_form and it seems that it worked beautifully!! I hope this was correct!!

Now, it allows the user to add a subuser under his/her name. Of course after modifying user_form to have the <%if Username%> tag.

Thank you again
Mark