Plugin copy

This commit is contained in:
2020-10-14 23:44:40 +03:00
parent 10ea221cc9
commit a9b6a253cc
7 changed files with 32 additions and 93 deletions
+1 -4
View File
@@ -1,5 +1,2 @@
FROM redmine:latest
#ARG REDMINE_DB_PASSWORD
#RUN echo "testarg=${REDMINE_DB_PASSWORD}"
#ENV REDMINE_DB_PASSWORD=${REDMINE_DB_PASSWORD}
ADD ./redmine_ldap_passwd/ /usr/share/redmine/plugins/
ADD --chown=999:999 ./redmine_ldap_passwd/ /usr/src/redmine/plugins/redmine_ldap_passwd/
+1 -4
View File
@@ -1,5 +1,2 @@
FROM redmine:latest
ARG REDMINE_DB_PASSWORD
RUN echo "testarg=${REDMINE_DB_PASSWORD}"
ENV REDMINE_DB_PASSWORD=${REDMINE_DB_PASSWORD}
ADD ./redmine_ldap_passwd/ /usr/share/redmine/plugins/
ADD ./redmine_ldap_passwd/ /usr/src/redmine/plugins/redmine_ldap_passwd/
@@ -8,8 +8,10 @@ class AuthSourceLdapPasswd < AuthSourceLdap
attrs = get_user_dn(user.login, password)
if attrs && attrs[:dn]
if self.account && self.account.include?("$login")
ldap_con = initialize_ldap_con(self.account.sub("$login", Net::LDAP::DN.escape(user.login)), password)
defaults = Redmine::Plugin::registered_plugins[:redmine_ldap_passwd].settings[:default]
suua = Setting.plugin_redmine_ldap_passwd[:use_user_account].nil? ? defaults[:use_user_account] : Setting.plugin_redmine_ldap_passwd[:use_user_account]
if suua || ( self.account && self.account.include?("$login") )
ldap_con = initialize_ldap_con(suua ? Net::LDAP::DN.escape(user.login) : self.account.sub("$login", Net::LDAP::DN.escape(user.login)), password)
else
ldap_con = initialize_ldap_con(self.account, self.account_password)
end
@@ -24,6 +26,7 @@ class AuthSourceLdapPasswd < AuthSourceLdap
return true
else
Rails.logger.info "Change password problem: #{result}."
return result
end
end
@@ -1,3 +1,8 @@
en:
notice_new_password_and_confirmation_different: The new password is different from the confirmation password
notice_new_password_format: "1. The password should be at least seven characters long. 2. The password should contain characters from at least three of the following four categories: (a) English uppercase characters (A - Z) (b) English lowercase characters (a - z) (c) Base 10 digits (0 - 9) (d) Non-alphanumeric (For example: !, $, or %). 3. The password shouldn't contain three or more characters from the user's account name."
notice_new_password_format: "1. The password should be at least seven characters long. 2. The password should contain characters from at least three of the following four categories: (a) English uppercase characters (A - Z) (b) English lowercase characters (a - z) (c) Base 10 digits (0 - 9) (d) Non-alphanumeric (For example: !, $, or %). 3. The password shouldn't contain three or more characters from the user's account name."
notice_can_t_change_password: "Can`t change password."
notice_account_wrong_password: "Wrong password or username"
notice_new_password_must_be_different: "New password must be different."
notice_account_password_updated: "Account pasword updated."
setting_use_user_account: "Use current user acoount for LDAP:"
+5
View File
@@ -11,6 +11,11 @@ Redmine::Plugin.register :redmine_ldap_passwd do
version '3.0.1'
url 'https://github.com/xeagle2/redmine_ldap_passwd'
author_url 'https://github.com/xeagle2'
settings :partial => 'settings/ldap_password',
:default => {
:use_user_account => true
}
end
require 'dispatcher' unless Rails::VERSION::MAJOR >= 3