Post by nobodyinteresting » Thu Jan 23, 2020 3:05 am

Hey all!

I have a quick question. I need to set the minimum password for the accounts that people register to be at 7, instead of the default one. Preferably 8 symbols.

Which files should I edit?
I am using the 3.0.3.2 version, as well as quickcheckout extension, if that matters.

Thank you very much!
Last edited by nobodyinteresting on Thu Jan 23, 2020 8:05 am, edited 2 times in total.

New member

Posts

Joined
Fri Nov 08, 2019 7:53 am

Post by sw!tch » Thu Jan 23, 2020 4:16 am

You may want to post in the commercial section if plan on messing with the authentication. Otherwise if you understand the risk, you can search in the validate methods to increase the length. Keep in mind that there are a quite a few areas in OC where this is used, password reset, affiliate, account password, etc... best know what you are doing. Further you also have to update the appropriate language error message for the new length.

You can reference here for register.php, but again there are many other areas..:.
https://github.com/opencart/opencart/bl ... r.php#L263

Maybe look for something on the marketplace first.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by by mona » Thu Jan 23, 2020 4:28 am

ditto above ..
there is also appears to be an issue with some characters in the password database I can’t find the thread right now but you can search .. maybe someone else will post but the result would be .. maybe not the best idea.

this will explain both how to do it yourself and why its not a good idea to do so ..
viewtopic.php?t=205460

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by sw!tch » Thu Jan 23, 2020 4:44 am

by mona wrote:
Thu Jan 23, 2020 4:28 am
this will explain both how to do it yourself and why its not a good idea to do so ..
viewtopic.php?t=205460
I also wouldn't advise using anything from that forum post, what they are doing there is only client side, which is useless. Validation checks need to be handled server side.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by nobodyinteresting » Thu Jan 23, 2020 4:48 am

So there is no way to accomplish that? I went through the marketplace, but unfortunately there is nothing regarding password length.
I provide a service, which has hard requirement of the password being at least 7, preferably 8+ symbols. So not being able to set that as a requirement within opencart will make my life a living nightmare, as people will register accounts and use 6symbol passwords, and that will kill my automation.

New member

Posts

Joined
Fri Nov 08, 2019 7:53 am

Post by sw!tch » Thu Jan 23, 2020 4:53 am

nobodyinteresting wrote:
Thu Jan 23, 2020 4:48 am
So there is no way to accomplish that?
Sure there is a way, its actually simple if you know what you are doing and know OC well.

You may want to head over to the commercial section someone should be able to help you out. It's really not all that involved.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by nobodyinteresting » Thu Jan 23, 2020 5:03 am

sw!tch wrote:
Thu Jan 23, 2020 4:53 am
nobodyinteresting wrote:
Thu Jan 23, 2020 4:48 am
So there is no way to accomplish that?
Sure there is a way, its actually simple if you know what you are doing and know OC well.

You may want to head over to the commercial section someone should be able to help you out. It's really not all that involved.
Ah, I see what you mean. Gotcha, posted there.

Thanks for your help!

New member

Posts

Joined
Fri Nov 08, 2019 7:53 am

Post by straightlight » Thu Jan 23, 2020 5:03 am

Aside from the Commercial Support section of the forum, you could also look on the Marketplace for an extension that could provide what you need.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nobodyinteresting » Thu Jan 23, 2020 5:05 am

straightlight wrote:
Thu Jan 23, 2020 5:03 am
Aside from the Commercial Support section of the forum, you could also look on the Marketplace for an extension that could provide what you need.
I did look for it, however I can't seem to find one that would help out with the actual length of the pass.

Thanks!

New member

Posts

Joined
Fri Nov 08, 2019 7:53 am

Post by straightlight » Thu Jan 23, 2020 5:11 am

nobodyinteresting wrote:
Thu Jan 23, 2020 5:05 am
straightlight wrote:
Thu Jan 23, 2020 5:03 am
Aside from the Commercial Support section of the forum, you could also look on the Marketplace for an extension that could provide what you need.
I did look for it, however I can't seem to find one that would help out with the actual length of the pass.

Thanks!
In this case, posting in the Commercial Support section of the forum to get this done as a custom job might be the right course of action.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nobodyinteresting » Thu Jan 23, 2020 8:03 am

Just a quick update on this - I got it resolved. For anyone looking to do that in the future, here is what needs to be done:

You need to edit:
catalog/controller/account/register.php
catalog/controller/account/password.php
catalog/controller/account/reset.php
catalog/controller/checkout/register.php
catalog/controller/affiliate/register.php


When you do - look for code:

Code: Select all

if ((utf8_strlen(html_entity_decode($this->request->post['password'], ENT_QUOTES, 'UTF-8')) < 4) || (utf8_strlen(html_entity_decode($this->request->post['password'], ENT_QUOTES, 'UTF-8')) > 40)) {
and replace it with:

Code: Select all

if ((utf8_strlen(html_entity_decode($this->request->post['password'], ENT_QUOTES, 'UTF-8')) < 8) || (utf8_strlen(html_entity_decode($this->request->post['password'], ENT_QUOTES, 'UTF-8')) > 40)) {
Basically replace the < 4 with < 8 or whatever length you desire.

After you do that - refresh OCMod (Extensions->Modifications and hit Refresh) and then from Dashboard, gears from right top (under Logout), clear Theme cache, Sass cache.

Thank you to user @xxvirusxx for pointing me in the right direction.

Thanks to everyone that tried to help me out :-)

New member

Posts

Joined
Fri Nov 08, 2019 7:53 am

Post by sw!tch » Thu Jan 23, 2020 8:20 am

I believe you also need. admin/controller/customer/customer.php

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm
Who is online

Users browsing this forum: nonnedelectari and 412 guests