News:

Wondering if this will always be free?  See why free is better.

Main Menu

show password requirements

Started by brynn, June 26, 2016, 11:23:44 AM

Previous topic - Next topic

brynn

Hi Friends,
I want to have a strong password for my forum, but on the registration page, it doesn't give any hints for people, when they are registering.  I want to add some text to the registration page that says:

"The password must be at least eight characters long, and cannot be part of your username or email address.  It must contain a mixture of upper and lower case letters, and at least one number.  The red X will change to a green checkmark, when you have typed in a good password."

Or else, if there is some documentation about the password requirement somewhere, I would want to put a link on that page, to where they can find the info.

Unfortunately, I don't know much about PHP.  I found register.template.php and I think that might be what I need to edit.  But I'm not sure at all.  I've looked at the source code for the page, and if there were some html that I could edit, I could do that without any, or at least without very much help.

Could someone please tell me which file to edit, and the proper code to add and/or remove?

Also, shouldn't this be either a feature request or bug report?  It seems that the SMF project and I often differ about what should be a bug and what just needs a mod written.  But I hope it won't hurt to ask   :)

Thank you very much  :)

Siirist

Admin > Members > Registration > then click on Registration Agreement.

Put in the text you want and Don't forget to click on Save

Easy.

Be Well,
Siriist
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

brynn

Thanks Siirist  :)

Well, I guess that would be an option if there's no way to put that text on the registration page.  But as we all know, most people don't read that.  Plus, if they're on the registration page, trying to figure out the password, they aren't going to think of going back to the previous page to find instructions.

Siirist

Hey brynn,

You could go this way.

Password Strength Meter
http://custom.simplemachines.org/mods/index.php?mod=2910[no follow]

Siriist
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

brynn

Thanks again.

I saw that, but it doesn't tell the user what is needed to create the strong or weak password.  It's really just the same as the red X that changes to the green checkmark when you finally have guessed the needed combination, except that it has a different graphic display.

And yes, I know I can put the password strength down to medium, or even low.  But I'd rather use the strongest.

Sir Osis of Liver

You can add the text to the registration form in Register.template.php.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sir Osis of Liver

Something like this -



echo '
<dl class="register_form" id="password1_group">
<dt><strong><label for="smf_autov_pwmain">', $txt['choose_pass'], ':</label></strong></dt>
<dd>
<input type="password" name="passwrd1" id="smf_autov_pwmain" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
<span id="smf_autov_pwmain_div" style="display: none;">
<img id="smf_autov_pwmain_img" src="', $settings['images_url'], '/icons/field_invalid.gif" alt="*" />
</span>
</dd>
</dl>

<dl style="width: 70%; padding: 5px 0 0 10px; line-height: 130%; font-size: 10px; color: red;">The password must be at least eight characters long, and cannot be part of your username or email address.  It must contain a mixture of upper and lower case letters, and at least one number.  The red X will change to a green checkmark, when you have typed in a good password.</dl>

<dl class="register_form" id="password2_group">
<dt><strong><label for="smf_autov_pwverify">', $txt['verify_pass'], ':</label></strong></dt>
<dd>
<input type="password" name="passwrd2" id="smf_autov_pwverify" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
<span id="smf_autov_pwverify_div" style="display: none;">
<img id="smf_autov_pwverify_img" src="', $settings['images_url'], '/icons/field_valid.gif" alt="*" />
</span>
</dd>
</dl>';



You can tinker with the formatting.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

brynn

Oh, thank you so much!

Should I do it only for the default theme?  Or do I need to do it for whatever themes I want it to show?

Edit
Oh, I see that file doesn't show up in the other themes - only for default.  Ok, here goes....

brynn

Oh, that looks awesome!  Thank you so much Sir! 

I am kind of curious why it's not part of the software already.  Should I make a feature request or bug report?

Siirist

Brynn,

Was going to take you down that way, but a migraine took over.

Glad you were assisted and got it functioning as desired.   :D

Quote from: brynn on June 26, 2016, 05:15:12 PM
I am kind of curious why it's not part of the software already.  Should I make a feature request or bug report?

This is not something that is typically an issue for most SMF members. Because of that statement, I believe:

While feature requests can always be submitted, the SMF Team is going to decide if a sufficient number of SMF users would benefit from this "feature" to justify the added coding to either turn it "On and Off" or add it (by adding it, it now becomes a part of the overall program and some users may not care for it..

It is NOT a bug. I believe a bug is an occurrence that causes the interruption of a coded instruction within the software.

Be Well,
Siriist
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

brynn

Yeah, that was pretty much my thought too (about most users don't need the hint).  But some others on my staff wanted it, so I thought I'd give it a try.

And bonus -- now that I saw how that can work, I was able to add some text in another area, that I've been wanting for a while!  Even though I don't know php enough to write code, I can see certain patterns, and squeeze in a little bit of html for the text.

Anyway, thank you both!  I thought you might actually be the same person with 2 different accounts, because some similarity in the username.  But thanks both.  Feel better  :D

I'm happy camper   :laugh:

Sir Osis of Liver

Quote from: brynn on June 26, 2016, 05:15:12 PM
I am kind of curious why it's not part of the software already.

Actually, I had the same thought.  As there is an admin selection for password strength with specific character requirements, that information should be on the registration form, else users have to guess until they stumble onto an acceptable password.  I'll post this on dev board.


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Siirist

Quote from: Sir Osis of Liver on June 26, 2016, 04:10:20 PM
Something like this -



echo '
<dl class="register_form" id="password1_group">
<dt><strong><label for="smf_autov_pwmain">', $txt['choose_pass'], ':</label></strong></dt>
<dd>
<input type="password" name="passwrd1" id="smf_autov_pwmain" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
<span id="smf_autov_pwmain_div" style="display: none;">
<img id="smf_autov_pwmain_img" src="', $settings['images_url'], '/icons/field_invalid.gif" alt="*" />
</span>
</dd>
</dl>

<dl style="width: 70%; padding: 5px 0 0 10px; line-height: 130%; font-size: 10px; color: red;">The password must be at least eight characters long, and cannot be part of your username or email address.  It must contain a mixture of upper and lower case letters, and at least one number.  The red X will change to a green checkmark, when you have typed in a good password.</dl>

<dl class="register_form" id="password2_group">
<dt><strong><label for="smf_autov_pwverify">', $txt['verify_pass'], ':</label></strong></dt>
<dd>
<input type="password" name="passwrd2" id="smf_autov_pwverify" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
<span id="smf_autov_pwverify_div" style="display: none;">
<img id="smf_autov_pwverify_img" src="', $settings['images_url'], '/icons/field_valid.gif" alt="*" />
</span>
</dd>
</dl>';



You can tinker with the formatting.

Where in the Register.template.php?

It's a big file and I scanned it for a logical location, but didn't find one.

Thanks in advance,
Siirist
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Sir Osis of Liver

Only one line is added -



<dl style="width: 70%; padding: 5px 0 0 10px; line-height: 130%; font-size: 10px; color: red;">The password must be at least eight characters long, and cannot be part of your username or email address.  It must contain a mixture of upper and lower case letters, and at least one number.  The red X will change to a green checkmark, when you have typed in a good password.</dl>



the rest is unchanged.  Just search for any of the surrounding lines.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Siirist

Quote from: Sir Osis of Liver on June 29, 2016, 12:20:24 PM
Only one line is added -



<dl style="width: 70%; padding: 5px 0 0 10px; line-height: 130%; font-size: 10px; color: red;">The password must be at least eight characters long, and cannot be part of your username or email address.  It must contain a mixture of upper and lower case letters, and at least one number.  The red X will change to a green checkmark, when you have typed in a good password.</dl>



Perfect.  I added a couple < br > (without spaces to break it up and make it clearer)

Thanks again,
Siirist

the rest is unchanged.  Just search for any of the surrounding lines.
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Advertisement: