FEU - convert password after input

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
chips
Forum Members
Forum Members
Posts: 12
Joined: Mon Feb 20, 2017 11:58 pm

FEU - convert password after input

Post by chips »

Hi. I'm running CMS Made Simple 2.1.6. PHP version is 5.5.38 I am running FrontEndUsers 2.3.2 / CGExtension v1.53.18 / CGSimpleSmarty v2.1.6

In FEU, using FEU Standard Authentication, is it possible to convert the password that is entered by a user during login to all lower case for example after the form is submitted and before it is checked against the database? We need to do this for one particular generic user account. Is it possible to add this code within the "FrontEndUser::Login Form" template?

Also in FEU, where do we see all possible values of $error? We want to change the message that is being displayed by evaluating the value of $error.

Thanks for any input.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: FEU - convert password after input

Post by velden »

I think the way to go would be a javascript solution which, onSubmit, changes the password. This shouldn't be to hard but it exposes your method to the www
chips
Forum Members
Forum Members
Posts: 12
Joined: Mon Feb 20, 2017 11:58 pm

Re: FEU - convert password after input

Post by chips »

Hi velden,

Thanks for the reply. I have tried as you suggested and have been consuming the past couple of days in searching for answers and sample code. When I place an Onclick on the button and point it to a javascript that will process the value of {$fldname_password}.value as needed, nothing happens.

Code: Select all

      
<button class="btn btn-active" name="{$actionid}feu_submit"  onClick="convString()">{$FrontEndUsers->Lang('login')}</button>
the function is this:

Code: Select all

<__script__ language="JavaScript">

function convString()
{
       {$fldname_password}.value = .... do conversion here ....
       return true;
}
I am already at a lost on what to do next. Appreciate any help as I am not a developer. Thanks.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: FEU - convert password after input

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: FEU - convert password after input

Post by velden »

Try (assumig 'feu_password' is the ID of the field):

Code: Select all

function convString()
{
       p = document.getElementById('feu_password');
       p.value = p.value.toLowerCase();
       return true;
}
chips
Forum Members
Forum Members
Posts: 12
Joined: Mon Feb 20, 2017 11:58 pm

Re: FEU - convert password after input

Post by chips »

Rolf, thanks very much for the link. The use of onkeyup as well as 'this' is a new learning for me and could be used in future for other forms that I create. Aside from converting to lowercase, I need to make some further processing of the password and the solution by Velden did it. I will make sure to study the getElementById.

Velden, thanks very much for the solution.
Locked

Return to “Modules/Add-Ons”