Skip to content

Commit

Permalink
Merge branch 'master' into locked-user
Browse files Browse the repository at this point in the history
  • Loading branch information
miloshIra authored Sep 1, 2023
2 parents 83de62f + 2138bb7 commit 25f1607
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 88 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[![Tests](https://github.com/Keitaro/ckanext-password-policy/workflows/Tests/badge.svg?branch=main)](https://github.com/Keitaro/ckanext-password-policy/actions)

# CKAN password policy

CKAN extension that adds password policy for all the users. With this extension You can set up minimum password length and password complexity (password must consist capital and small letters, number and special characters). A user lock on defined time period after x number of failed logins is also implemented
Expand Down Expand Up @@ -46,14 +44,26 @@ To install ckanext-password-policy:

## Config settings

1. The following setting needs to be done in who.ini

```
[plugin:friendlyform]
use = ckanext.password_policy.views:FriendlyFormPlugin_
```


2. These are the settings for production.ini

```
Minimum length of the user password. Default is 12
ckan.password_policy.password_length = 12

Number of failed logins before the user is locked. Default is 3
ckan.password_policy.failed_logins = 3
ckan.password_policy.failed_logins = 3

Time after the locked user is allowed to log in again in seconds. Default is 600
ckan.password_policy.user_locked_time = 600
```



Expand Down
2 changes: 2 additions & 0 deletions ckanext/password_policy/templates/user/locked.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
{% endblock %}

{% block primary_content %}

<br>
{{ h.lockout_time() }}

{% endblock %}

{% block secondary_content %}
Expand Down
54 changes: 0 additions & 54 deletions ckanext/password_policy/templates/user/login.html

This file was deleted.

30 changes: 0 additions & 30 deletions ckanext/password_policy/templates/user/snippets/login_form.html

This file was deleted.

2 changes: 1 addition & 1 deletion ckanext/password_policy/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def logged_in():
return me()
else:

err = _(u'Login failed. Bad username or password overwriten.')
err = _(u'Login failed. Bad username or password')
h.flash_error(err)
return custom_login()

Expand Down

0 comments on commit 25f1607

Please sign in to comment.