Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Request: Password Policy #763

Open
neanhunt opened this issue Apr 4, 2024 · 7 comments
Open

Port Request: Password Policy #763

neanhunt opened this issue Apr 4, 2024 · 7 comments

Comments

@neanhunt
Copy link

neanhunt commented Apr 4, 2024

Name of the module, theme, or layout
Password Policy

Link to the drupal.org module, theme, or layout
https://www.drupal.org/project/password_policy

I tried to port this module over using the upgrade module and it looked like it worked but when I tried to use it I received the following:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'role' doesn't exist: SELECT r.name AS name FROM {role} r INNER JOIN {password_policy_role} p ON p.rid = r.rid WHERE (p.pid = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 1 )

@neanhunt neanhunt changed the title Porting of Password Policy from D7 Port Request: Password Policy Apr 4, 2024
@oadaeh
Copy link

oadaeh commented Apr 4, 2024

Hello. Are you aware of this module?: https://github.com/backdrop-contrib/passphrase_policy
It is a port of the Password Policy by one of the D7 maintainers with some modifications. You might or might not care for the modifications. If you are fine with them, then the Passphrase Policy module might be all you need.

If not, maybe the code of the Passphrase Policy module might have clues on what needs to be done. If it doesn't, provide more information about the error, like the line number and filename that is causing it, and maybe someone can offer a suggestion.

@neanhunt
Copy link
Author

neanhunt commented Apr 4, 2024

The elements we used heavily with Password Policy was settings requirements for the password complexity and setting a requirement that users need to update their password every 90 days. This enforced passwords getting updated and blocked accounts for users that did not make the 90 day requirement. This helped with deactivating unused accounts.

@argiepiano
Copy link

@neanhunt, for many D7 modules, running them through the coder_upgrade module is not enough to obtain a working module. In the case you mention, D7 used a table called role to store the role definitions. In Backdrop, this was changed. Role definitions now are stored as a JSON configuration files in your active config folder (typically files/config_XXX/active), for example, user.role.administrator.json for the administrator, etc.

So, you will need to do some tweaking and changes to the module to adapt to those types of differences.

@argiepiano
Copy link

Further: I would suggest you put the semi-ported module in your github account. That may help people take a look and suggest changes.

@jenlampton
Copy link
Member

@neanhunt I'm also going to need this module for an upcoming project. I'd love to start from the work you've already done, and I have previously adapted modules to go from the D7 role table to the B config alternative. If that's all that's left to do, perhaps we can have this wrapped up quickly :)

@neanhunt
Copy link
Author

neanhunt commented Apr 22, 2024

Sorry @jenlampton for the response delay, I have been dealing with ill (elderly) parents since right after Backdrop Live so I have not been checking on much else. I ran the D7 Password Policy through the Backdrop code_upgrader module and loaded it on my site and saw the DB errors but haven't gone any further. I did load the converted module files here: https://github.com/neanhunt/Password-Policy

@jenlampton
Copy link
Member

Beautiful, thank you for sharing that. And no need to apologize, whatever time you have is always appreciated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants