[SOLVED] SelfRegistration: Field must have a certain value

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
opawaldburger
Forum Members
Forum Members
Posts: 94
Joined: Tue Nov 04, 2008 2:10 pm

[SOLVED] SelfRegistration: Field must have a certain value

Post by opawaldburger »

Hi there!

I'm currently building a website for a small community with about 50 members. Those members shall be able to register themselves for the restricted area, therefore I use FEU and SelfRegistration.

Of course I only want members of the community to be able to register. So I thought, the best idea would be to have a field, where a specific value has to be entered, to proceed the registration. For example a field called "Enter Code", and the value has to be "135join-in".

How can I do this?

Regards, opa
Last edited by opawaldburger on Fri Aug 05, 2011 4:03 pm, edited 1 time in total.
Duketown

Re: SelfRegistration: Field must have a certain value

Post by Duketown »

opa,

Maybe you can use some (or all of the following):
http://forum.cmsmadesimple.org/viewtopi ... 28&t=55014

Duketown
User avatar
opawaldburger
Forum Members
Forum Members
Posts: 94
Joined: Tue Nov 04, 2008 2:10 pm

Re: SelfRegistration: Field must have a certain value

Post by opawaldburger »

Hi Duketown!

Thanks a lot for your post, but I'm afraid this doesn't help me a lot. At least a have no idea how to implement this into SelfRegistration...

-opa
Duketown

Re: SelfRegistration: Field must have a certain value

Post by Duketown »

opa,

Once I had reread it, I can imagine it is not the easiest one to understand.
Please copy the following to your registration page:

Code: Select all

// Use {CodeProtectedSelfRegistration} in one of your pages
// UDT based upon idea from steelexus
// How to prepare UDT in UDT was taken from wiki documentation of CMSMS

$passprot = '135join-in'; // The code that should be entered
$pass = $_POST[pass];
if ($pass)
{
if ($pass==$passprot)
{
$_SESSION[passprot] = $passprot;
// Prepare tag to self registration
$gCms = cmsms(); //global $gCms;
  $smarty = &$gCms->GetSmarty();
 
    $smarty_data = "{cms_module module=SelfRegistration}";
  
   $smarty->_compile_source('temporary template',    
     $smarty_data, $_compiled );
     @ob_start();
     $smarty->_eval('?>' . $_compiled);
     $_contents = @ob_get_contents();
     @ob_end_clean();
     echo $_contents;
}
else
{
echo 'Wrong code.';
}
}
else
{
echo '
<form method=post>
Enter code: <INPUT TYPE="PASSWORD" NAME="pass" VALUE="'.$pass.'"> 
<INPUT TYPE="SUBMIT" VALUE="OK">
</FORM>
';
}
You will first only see the field where the code should be entered. Next you will see the registration form of SelfRegistration.

Duketown
User avatar
opawaldburger
Forum Members
Forum Members
Posts: 94
Joined: Tue Nov 04, 2008 2:10 pm

Re: SelfRegistration: Field must have a certain value

Post by opawaldburger »

This. is. great!!!

Thanks a lot, it's working fantastic!!! :D
Duketown

Re: SelfRegistration: Field must have a certain value

Post by Duketown »

Good to hear/read that it works in one go.
Please put [Solved] in the header of this post.

Duketown
allan1412
Forum Members
Forum Members
Posts: 24
Joined: Wed May 21, 2008 9:14 pm

Re: [SOLVED] SelfRegistration: Field must have a certain val

Post by allan1412 »

Hi Duketown

Thanks for providing this method of hiding the SelfRegistration form.
Does it need modification for 1.10?
The SelfReg form works as expected when not 'within' the hidden content - but although the form is shown as expected when using the udt/passcode form - completing the form does not submit its content.

Thanks

Allan
georgechr
Forum Members
Forum Members
Posts: 96
Joined: Tue Sep 13, 2011 6:02 am

Re: [SOLVED] SelfRegistration: Field must have a certain val

Post by georgechr »

that would be nice
Post Reply

Return to “Modules/Add-Ons”