Front End Users one field login form

  Previous article Next article  

Front End Users one field login form

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.2.3.1
  Last updated: 09-09-2016
  Comments: 0

To enter a protected area at your website using the Front End Users module you need a login name and password. Sometimes it is more convenient to have just one field.

  How to use

I will describe two methods. Choose the one which suits you the most...
In both cases one of the form fields is pre filled in and is hidden so only one field is visible to the visitor.

A. Let all users log in with just one "password".

Create in the Front End Users Admin page a new user named i.e. "FEUser" and fill in the password you want to use.

Open in Design Manager the "FrontEndUsers::login form" and change this line:

<input type="{if $username_is_email}email{else}text{/if}" id="feu_username" name="{$fldname_username}" value="{$username}" size="{$username_size}" maxlength="{$username_maxlength}" {if !$username_is_email}autocorrect="off" autocapitalize="off"{/if} required/>

into:

<input type="hidden" id="feu_username" name="{$fldname_username}" value="FEUser" style="display: none" required />

What I do here is giving the username field a default value and afterwards hide it!
By changing the template and using CSS you can hide the fields and labels you don't want to show.

B. Give each user his/her own login name.

Create in the FEU Admin page a few users and use the same password each time, i.e. "DefaultPassword".

Open in Design Manager the "FrontEndUsers::login form" and change this line:

<input type="password" id="feu_password" name="{$fldname_password}" value="{$password}" size="{$password_size}" maxlength="{$password_maxlength}" required/>

into:

<input type="hidden" id="feu_password" name="{$fldname_password}" value="DefaultPassword" size="{$password_size}" maxlength="{$password_maxlength}" style="display: none" required />

What I do here is giving the password field a default value and afterwards hide it!
By changing the template and using CSS you can hide the fields and labels you don't want to show.



A2 Webhosting CMS Made Simple

  Comments

  Click here to leave a comment






This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)
  « Enter the CAPTCHA code (lower case)

Your IP address will be stored on submit. I reserve the right to change or delete your response without notice!
In case of abuse your IP address will be blocked!


Can I have your attention for a moment?

Did this tutorial help you solving a problem at your (clients) website and it saved you many hours of work? Great!!
Consider buying Rolf a cup of coffee in return! [ Click here ]


  0 Comments

No comments yet...

CMS Made Simple 2.2.3.1 - Tutorials, tips and tricks - CMSMS 2.2.3.1

Front End Users one field login form

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.2.3.1
  Last updated: 09-09-2016
  Comments: 0

A2 Webhosting CMS Made Simple