Self Registration No Password Required/Password Hardcoded

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
wazman21
Forum Members
Forum Members
Posts: 24
Joined: Wed Jul 07, 2010 1:52 pm

Self Registration No Password Required/Password Hardcoded

Post by wazman21 »

Hi all, long time solution-finder, first time help requester...

I have a Self Registration Form set up, but I do not want people to need to enter a password.  Basically, I am using this form in a way that enters a competition and enables the client to export all registrants to a CSV file - which is why I have not simply used a regular formbuilder form.  If anyone can help with the tags to hardcode a password for every user (such as xzy123 or similar), that would be amazing.

Appreciate any assistance!
vilkis

Re: Self Registration No Password Required/Password Hardcoded

Post by vilkis »

You can use jQuery to hide password fields and assign selected value to them.

vilkis
wazman21
Forum Members
Forum Members
Posts: 24
Joined: Wed Jul 07, 2010 1:52 pm

Re: Self Registration No Password Required/Password Hardcoded

Post by wazman21 »

Great idea!  Any pointers on how to implement?
vilkis

Re: Self Registration No Password Required/Password Hardcoded

Post by vilkis »

OK, post here Registration Template from "Registration Template 1" tab. I have idea how to do it without jQuery - just Smarty magic :)

vilkis
wazman21
Forum Members
Forum Members
Posts: 24
Joined: Wed Jul 07, 2010 1:52 pm

Re: Self Registration No Password Required/Password Hardcoded

Post by wazman21 »


Win an iPod Shuffle!
Simply enter your details in the form below, and you'll go into the draw to win a fantastic iPod Shuffle! We'll be in touch shortly to let you know if you've won!
{if isset($message) && $message != ''}
  {if isset($error) && $error != ''}
    {$message}
  {else}
    {$message}
  {/if}
{/if}


{$startform}

{if $controlcount > 0}
 
{foreach from=$controls item=control}
 
    {$control->hidden}
    {if $control->color != ''}
      color};">{$control->prompt}{$control->marker}
{elseif $control->hideme !=''}{$control->prompt}{$control->marker}
{else}
      {$control->prompt}{$control->marker}
    {/if}
   
    {$control->control}
 
{/foreach}
{if isset($captcha)}


Please enter the text from the image below:

{$input_captcha}


{$captcha}

{/if}


{$hidden}{if isset($hidden2)}{$hidden2}{/if}{$submit}


If you have already completed the entry form, but did not receive an email, you can re-send it {$link_sendanotheremail}

 
{/if}
{$endform}

vilkis

Re: Self Registration No Password Required/Password Hardcoded

Post by vilkis »

I have modified the template. Keep me informed if it works for you.

Code: Select all

<!-- Registration 1 template -->
<h2>Win an iPod Shuffle!</h2>
<p>Simply enter your details in the form below, and you'll go into the draw to win a fantastic iPod Shuffle! We'll be in touch shortly to let you know if you've won!</p>
{if isset($message) && $message != ''}
  {if isset($error) && $error != ''}
    <p><font color="red">{$message}</font></p>
  {else}
    <p>{$message}</p>
  {/if}
{/if}

<div class="contest">
{$startform}

{if $controlcount > 0}
  <table width="500px">
{foreach from=$controls item=control}
  <tr>
    <td width="300px"class="label">{$control->hidden}
{if $control->name eq 'password' OR $control->name eq 'repeatpassword'}
{capture assign=inputname}input_{$control->name}{/capture}
{$mod->CreateInputHidden($selfregactionid, $inputname, 'PASSWORD')}
{else}
    {if $control->color != ''}
      <span style="color:{$control->color};">{$control->prompt}{$control->marker}</span>
{elseif $control->hideme !=''}<span style="display:none;">{$control->prompt}{$control->marker}</span>
{else}
      {$control->prompt}{$control->marker}
    {/if}
    </td>
    <td class="showhide">{$control->control}</td>
  </tr>
{/if}
{/foreach}
{if isset($captcha)}
<tr>
<td style="text-align:right;">
Please enter the text from the image below:
</td>
<td>{$input_captcha}</td>
</tr>
<tr>
<td colspan="2" style="text-align:right;">{$captcha}</td>
</tr>
{/if}
<tr>
<td></td>
<td id="submit">{$hidden}{if isset($hidden2)}{$hidden2}{/if}{$submit}</td>
</tr>
<tr>
<td colspan="2"><p>If you have already completed the entry form, but did not receive an email, you can re-send it {$link_sendanotheremail}</p></td>
</tr>
  </table>
{/if}
{$endform}
</div>
<!-- Registration 1 template -->
wazman21
Forum Members
Forum Members
Posts: 24
Joined: Wed Jul 07, 2010 1:52 pm

Re: Self Registration No Password Required/Password Hardcoded

Post by wazman21 »

Thankyou!  I will try this as soon as possible...

At the moment I have found a messy solution by editing the source files to add a default value for the password fields and adding a 'hideme' attribute, then in the template and CSS I added an {if} statement to look for the extra attribute and the display:none if present.  Messy but effective - your solution is much more elegant and versatile!

I will keep you informed of how this goes when I restore the default files.
tiito78
New Member
New Member
Posts: 8
Joined: Wed Apr 30, 2008 8:16 pm

Re: Self Registration No Password Required/Password Hardcoded

Post by tiito78 »

How to do the same, but for the username also??? I need to hide both user and password???

Hope you can help me.
vilkis

Re: Self Registration No Password Required/Password Hardcoded

Post by vilkis »

Hi,
usernames should be unique. So such a solution will allow to register once :)
So you need UDT that generates new unique username for each registration event.
vilkis
tiito78
New Member
New Member
Posts: 8
Joined: Wed Apr 30, 2008 8:16 pm

Re: Self Registration No Password Required/Password Hardcoded

Post by tiito78 »

Oki thanks for your anwer. I notices that yersterday. But UDT, is it a settings in the module?
Post Reply

Return to “Modules/Add-Ons”