Jump to content

Security question input convert to text


Recommended Posts

Hello,

On our registration page, the input for security question input is in password format. When our users are registering, their keyboard is always switched to another language which is not English friendly.

We have this case almost everyday that someone cant get their security question right. Thanks to removing the ability to change security questions by admin, It is further complicated for us as it prolongs the support procedures.  I really hope that WHMCS can see reason into questioning the user via feedback before making decisions on how the system works. WHMCS is a vital tool to our business, you can't make decisions on that alone on your own.  When you do, provide an alternative as well. 

Anyways, what I need is to change the input for security question answer from password to text so user can see what they are typing. I know this can be done by modifying clientregister.tpl but this gets replaced every time we update the theme.  

Thank you

Edited by artaweb
Link to comment
Share on other sites

3 hours ago, artaweb said:

Anyways, what I need is to change the input for security question answer from password to text so user can see what they are typing. I know this can be done by modifying clientregister.tpl but this gets replaced every time we update the theme.  

I think i'd still be inclined to edit the template to avoid any potential JS/browser clashed (though I know what you mean about update issues)...

... but if you just want to change the input type(s) with a hook...

<?php

# Change Security Answer Field Type To Text Hook
# Written by brian!

add_hook('ClientAreaHeaderOutput', 1, function ($vars) {

	if (in_array($vars['templatefile'],array('clientregister','viewcart'))) {
		$changeInputType = '<script>$( document ).ready(function() {
			$("#inputSecurityQAns").prop({type:"text"});
			});</script>';
		return $changeInputType;
	}
	elseif (in_array($vars['templatefile'],array('user-security'))) {
		$changeInputType = '<script>$( document ).ready(function() {
			$("#inputSecurityAns1").prop({type:"text"});
			$("#inputSecurityAns2").prop({type:"text"});
			});</script>';
		return $changeInputType;
	}
});

top half changes type in register/checkout pages; bottom half for the two fields in user security.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated