From 6a00bf4517a2f9df9f606bfba07becc191166ccc Mon Sep 17 00:00:00 2001 From: MaxKey Date: Fri, 14 Jan 2022 12:33:46 +0800 Subject: [PATCH] Email and LDAP store to database --- .../java/org/maxkey/entity/EmailSenders.java | 251 ++++++++++++++++++ .../repository/PasswordPolicyRepository.java | 34 +-- .../mapper/EmailSendersMapper.java | 24 ++ .../persistence/mapper/LdapContextMapper.java | 24 ++ .../service/EmailSendersService.java | 42 +++ .../service/LdapContextService.java | 42 +++ .../java/org/maxkey/MaxKeyMgtMvcConfig.java | 2 + .../contorller/EmailSendersController.java | 92 +++++++ .../web/contorller/LdapContextController.java | 87 ++++++ .../resources/messages/message.properties | 24 +- .../resources/messages/message_en.properties | 24 +- .../messages/message_zh_CN.properties | 24 +- .../views/emailsenders/updateEmailSenders.ftl | 187 +++++++++++++ .../templates/views/layout/sidenav.ftl | 13 + .../views/ldapcontext/updateLdapContext.ftl | 193 ++++++++++++++ 15 files changed, 1043 insertions(+), 20 deletions(-) create mode 100644 maxkey-core/src/main/java/org/maxkey/entity/EmailSenders.java create mode 100644 maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/EmailSendersMapper.java create mode 100644 maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/LdapContextMapper.java create mode 100644 maxkey-persistence/src/main/java/org/maxkey/persistence/service/EmailSendersService.java create mode 100644 maxkey-persistence/src/main/java/org/maxkey/persistence/service/LdapContextService.java create mode 100644 maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/EmailSendersController.java create mode 100644 maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/LdapContextController.java create mode 100644 maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/emailsenders/updateEmailSenders.ftl create mode 100644 maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/ldapcontext/updateLdapContext.ftl diff --git a/maxkey-core/src/main/java/org/maxkey/entity/EmailSenders.java b/maxkey-core/src/main/java/org/maxkey/entity/EmailSenders.java new file mode 100644 index 000000000..ca1420ec6 --- /dev/null +++ b/maxkey-core/src/main/java/org/maxkey/entity/EmailSenders.java @@ -0,0 +1,251 @@ +package org.maxkey.entity; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +import org.apache.mybatis.jpa.persistence.JpaBaseEntity; + +@Entity +@Table(name = "MXK_EMAIL_SENDERS") +public class EmailSenders extends JpaBaseEntity{ + + /** + * + */ + private static final long serialVersionUID = 3689854324601731505L; + + @Id + @Column + @GeneratedValue(strategy = GenerationType.AUTO, generator = "snowflakeid") + private String id; + + @Column + private String account; + + @Column + private String credentials; + + @Column + private String smtpHost; + + @Column + private Integer port; + + @Column + private int sslSwitch; + + @Column + private String sender; + + @Column + private String encoding; + + @Column + private String protocol; + + @Column + private int status; + + @Column + private String instId; + + private String instName; + + @Column + private String description; + + @Column + private String createdBy; + + @Column + private String createdDate; + + @Column + private String modifiedBy; + + @Column + private String modifiedDate; + + public EmailSenders() { + super(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getAccount() { + return account; + } + + public void setAccount(String account) { + this.account = account; + } + + public String getCredentials() { + return credentials; + } + + public void setCredentials(String credentials) { + this.credentials = credentials; + } + + public String getSmtpHost() { + return smtpHost; + } + + public void setSmtpHost(String smtpHost) { + this.smtpHost = smtpHost; + } + + public Integer getPort() { + return port; + } + + public void setPort(Integer port) { + this.port = port; + } + + + public int getSslSwitch() { + return sslSwitch; + } + + public void setSslSwitch(int sslSwitch) { + this.sslSwitch = sslSwitch; + } + + public String getEncoding() { + return encoding; + } + + public void setEncoding(String encoding) { + this.encoding = encoding; + } + + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public String getSender() { + return sender; + } + + public void setSender(String sender) { + this.sender = sender; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getInstId() { + return instId; + } + + public void setInstId(String instId) { + this.instId = instId; + } + + public String getInstName() { + return instName; + } + + public void setInstName(String instName) { + this.instName = instName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public String getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(String createdDate) { + this.createdDate = createdDate; + } + + public String getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(String modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public String getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(String modifiedDate) { + this.modifiedDate = modifiedDate; + } + + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("EmailSenders [id="); + builder.append(id); + builder.append(", account="); + builder.append(account); + builder.append(", credentials="); + builder.append(credentials); + builder.append(", smtpHost="); + builder.append(smtpHost); + builder.append(", port="); + builder.append(port); + builder.append(", sslSwitch="); + builder.append(sslSwitch); + builder.append(", sender="); + builder.append(sender); + builder.append(", status="); + builder.append(status); + builder.append(", instId="); + builder.append(instId); + builder.append(", instName="); + builder.append(instName); + builder.append(", description="); + builder.append(description); + builder.append(", createdBy="); + builder.append(createdBy); + builder.append(", createdDate="); + builder.append(createdDate); + builder.append(", modifiedBy="); + builder.append(modifiedBy); + builder.append(", modifiedDate="); + builder.append(modifiedDate); + builder.append("]"); + return builder.toString(); + } + +} diff --git a/maxkey-core/src/main/java/org/maxkey/persistence/repository/PasswordPolicyRepository.java b/maxkey-core/src/main/java/org/maxkey/persistence/repository/PasswordPolicyRepository.java index 4e00afaa0..4a5e895c1 100644 --- a/maxkey-core/src/main/java/org/maxkey/persistence/repository/PasswordPolicyRepository.java +++ b/maxkey-core/src/main/java/org/maxkey/persistence/repository/PasswordPolicyRepository.java @@ -161,23 +161,23 @@ public class PasswordPolicyRowMapper implements RowMapper { @Override public PasswordPolicy mapRow(ResultSet rs, int rowNum) throws SQLException { PasswordPolicy passwordPolicy = new PasswordPolicy(); - passwordPolicy.setId(rs.getString("ID")); - passwordPolicy.setMinLength(rs.getInt("MINLENGTH")); - passwordPolicy.setMaxLength(rs.getInt("MAXLENGTH")); - passwordPolicy.setLowerCase(rs.getInt("LOWERCASE")); - passwordPolicy.setUpperCase(rs.getInt("UPPERCASE")); - passwordPolicy.setDigits(rs.getInt("DIGITS")); - passwordPolicy.setSpecialChar(rs.getInt("SPECIALCHAR")); - passwordPolicy.setAttempts(rs.getInt("ATTEMPTS")); - passwordPolicy.setDuration(rs.getInt("DURATION")); - passwordPolicy.setExpiration(rs.getInt("EXPIRATION")); - passwordPolicy.setUsername(rs.getInt("USERNAME")); - passwordPolicy.setHistory(rs.getInt("HISTORY")); - passwordPolicy.setDictionary(rs.getInt("DICTIONARY")); - passwordPolicy.setAlphabetical(rs.getInt("ALPHABETICAL")); - passwordPolicy.setNumerical(rs.getInt("NUMERICAL")); - passwordPolicy.setQwerty(rs.getInt("QWERTY")); - passwordPolicy.setOccurances(rs.getInt("OCCURANCES")); + passwordPolicy.setId(rs.getString("id")); + passwordPolicy.setMinLength(rs.getInt("minlength")); + passwordPolicy.setMaxLength(rs.getInt("maxlength")); + passwordPolicy.setLowerCase(rs.getInt("lowercase")); + passwordPolicy.setUpperCase(rs.getInt("uppercase")); + passwordPolicy.setDigits(rs.getInt("digits")); + passwordPolicy.setSpecialChar(rs.getInt("specialchar")); + passwordPolicy.setAttempts(rs.getInt("attempts")); + passwordPolicy.setDuration(rs.getInt("duration")); + passwordPolicy.setExpiration(rs.getInt("expiration")); + passwordPolicy.setUsername(rs.getInt("username")); + passwordPolicy.setHistory(rs.getInt("history")); + passwordPolicy.setDictionary(rs.getInt("dictionary")); + passwordPolicy.setAlphabetical(rs.getInt("alphabetical")); + passwordPolicy.setNumerical(rs.getInt("numerical")); + passwordPolicy.setQwerty(rs.getInt("qwerty")); + passwordPolicy.setOccurances(rs.getInt("occurances")); return passwordPolicy; } diff --git a/maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/EmailSendersMapper.java b/maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/EmailSendersMapper.java new file mode 100644 index 000000000..230dc7d0a --- /dev/null +++ b/maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/EmailSendersMapper.java @@ -0,0 +1,24 @@ +/* + * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.maxkey.persistence.mapper; +import org.apache.mybatis.jpa.persistence.IJpaBaseMapper; +import org.maxkey.entity.EmailSenders; + +public interface EmailSendersMapper extends IJpaBaseMapper { + +} diff --git a/maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/LdapContextMapper.java b/maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/LdapContextMapper.java new file mode 100644 index 000000000..5023090a0 --- /dev/null +++ b/maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/LdapContextMapper.java @@ -0,0 +1,24 @@ +/* + * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.maxkey.persistence.mapper; +import org.apache.mybatis.jpa.persistence.IJpaBaseMapper; +import org.maxkey.entity.LdapContext; + +public interface LdapContextMapper extends IJpaBaseMapper { + +} diff --git a/maxkey-persistence/src/main/java/org/maxkey/persistence/service/EmailSendersService.java b/maxkey-persistence/src/main/java/org/maxkey/persistence/service/EmailSendersService.java new file mode 100644 index 000000000..d38a20562 --- /dev/null +++ b/maxkey-persistence/src/main/java/org/maxkey/persistence/service/EmailSendersService.java @@ -0,0 +1,42 @@ +/* + * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.maxkey.persistence.service; + +import org.apache.mybatis.jpa.persistence.JpaBaseService; +import org.maxkey.entity.EmailSenders; +import org.maxkey.persistence.mapper.EmailSendersMapper; +import org.springframework.stereotype.Repository; + + +@Repository +public class EmailSendersService extends JpaBaseService{ + + public EmailSendersService() { + super(EmailSendersMapper.class); + } + + /* (non-Javadoc) + * @see com.connsec.db.service.BaseService#getMapper() + */ + @Override + public EmailSendersMapper getMapper() { + return (EmailSendersMapper)super.getMapper(); + } + + +} diff --git a/maxkey-persistence/src/main/java/org/maxkey/persistence/service/LdapContextService.java b/maxkey-persistence/src/main/java/org/maxkey/persistence/service/LdapContextService.java new file mode 100644 index 000000000..2d813b1c7 --- /dev/null +++ b/maxkey-persistence/src/main/java/org/maxkey/persistence/service/LdapContextService.java @@ -0,0 +1,42 @@ +/* + * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.maxkey.persistence.service; + +import org.apache.mybatis.jpa.persistence.JpaBaseService; +import org.maxkey.entity.LdapContext; +import org.maxkey.persistence.mapper.LdapContextMapper; +import org.springframework.stereotype.Repository; + + +@Repository +public class LdapContextService extends JpaBaseService{ + + public LdapContextService() { + super(LdapContextMapper.class); + } + + /* (non-Javadoc) + * @see com.connsec.db.service.BaseService#getMapper() + */ + @Override + public LdapContextMapper getMapper() { + return (LdapContextMapper)super.getMapper(); + } + + +} diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/MaxKeyMgtMvcConfig.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/MaxKeyMgtMvcConfig.java index 089bd980d..c92771909 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/MaxKeyMgtMvcConfig.java +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/MaxKeyMgtMvcConfig.java @@ -131,6 +131,8 @@ public class MaxKeyMgtMvcConfig implements WebMvcConfigurer { .addPathPatterns("/accountsstrategy/**") .addPathPatterns("/institutions/**") .addPathPatterns("/localization/**") + .addPathPatterns("/ldapcontext/**") + .addPathPatterns("/emailsenders/**") ; diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/EmailSendersController.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/EmailSendersController.java new file mode 100644 index 000000000..e3506fad8 --- /dev/null +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/EmailSendersController.java @@ -0,0 +1,92 @@ +/* + * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.maxkey.web.contorller; + +import org.apache.commons.lang3.StringUtils; +import org.maxkey.constants.ConstantsOperateMessage; +import org.maxkey.crypto.password.PasswordReciprocal; +import org.maxkey.entity.EmailSenders; +import org.maxkey.persistence.service.EmailSendersService; +import org.maxkey.web.WebContext; +import org.maxkey.web.message.Message; +import org.maxkey.web.message.MessageType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; + +@Controller +@RequestMapping(value={"/emailsenders"}) +public class EmailSendersController { + + + final static Logger _logger = LoggerFactory.getLogger(EmailSendersController.class); + + @Autowired + private EmailSendersService emailSendersService; + + /** + * 读取 + * @return + */ + @RequestMapping(value={"/forward"}) + public ModelAndView forward(){ + EmailSenders emailSenders = emailSendersService.get(WebContext.getUserInfo().getInstId()); + if(emailSenders != null && StringUtils.isNotBlank(emailSenders.getCredentials())) { + emailSenders.setCredentials(PasswordReciprocal.getInstance().decoder(emailSenders.getCredentials())); + }else { + emailSenders =new EmailSenders(); + emailSenders.setProtocol("smtp"); + emailSenders.setEncoding("utf-8"); + } + return new ModelAndView("emailsenders/updateEmailSenders","model",emailSenders); + } + + /** + * 更新 + * @param emailSenders + * @return + */ + @RequestMapping(value={"/update"}) + @ResponseBody + public Message update(@ModelAttribute("emailSenders") EmailSenders emailSenders,BindingResult result) { + _logger.debug("update emailSenders : "+emailSenders); + emailSenders.setInstId(WebContext.getUserInfo().getInstId()); + emailSenders.setCredentials(PasswordReciprocal.getInstance().encode(emailSenders.getCredentials())); + boolean updateResult = false; + if(StringUtils.isBlank(emailSenders.getId())) { + emailSenders.setId(emailSenders.getInstId()); + updateResult = emailSendersService.insert(emailSenders); + }else { + updateResult = emailSendersService.update(emailSenders); + } + + if(updateResult) { + return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success); + } else { + return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error); + } + } + + +} diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/LdapContextController.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/LdapContextController.java new file mode 100644 index 000000000..3205c9174 --- /dev/null +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/LdapContextController.java @@ -0,0 +1,87 @@ +/* + * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.maxkey.web.contorller; + +import org.apache.commons.lang3.StringUtils; +import org.maxkey.constants.ConstantsOperateMessage; +import org.maxkey.crypto.password.PasswordReciprocal; +import org.maxkey.entity.LdapContext; +import org.maxkey.persistence.service.LdapContextService; +import org.maxkey.web.WebContext; +import org.maxkey.web.message.Message; +import org.maxkey.web.message.MessageType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; + +@Controller +@RequestMapping(value={"/ldapcontext"}) +public class LdapContextController { + + + final static Logger _logger = LoggerFactory.getLogger(LdapContextController.class); + + @Autowired + private LdapContextService ldapContextService; + + /** + * 读取 + * @return + */ + @RequestMapping(value={"/forward"}) + public ModelAndView forward(){ + LdapContext ldapContext = ldapContextService.get(WebContext.getUserInfo().getInstId()); + if(ldapContext != null && StringUtils.isNoneBlank(ldapContext.getCredentials())) { + ldapContext.setCredentials(PasswordReciprocal.getInstance().decoder(ldapContext.getCredentials())); + } + return new ModelAndView("ldapcontext/updateLdapContext","model",ldapContext); + } + + /** + * 更新 + * @param sysConfig + * @return + */ + @RequestMapping(value={"/update"}) + @ResponseBody + public Message update(@ModelAttribute("ldapContext") LdapContext ldapContext,BindingResult result) { + _logger.debug("update ldapContext : "+ldapContext); + ldapContext.setCredentials(PasswordReciprocal.getInstance().encode(ldapContext.getCredentials())); + ldapContext.setInstId(WebContext.getUserInfo().getInstId()); + boolean updateResult = false; + if(StringUtils.isBlank(ldapContext.getId())) { + ldapContext.setId(ldapContext.getInstId()); + updateResult = ldapContextService.insert(ldapContext); + }else { + updateResult = ldapContextService.update(ldapContext); + } + if(updateResult) { + return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success); + } else { + return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error); + } + } + + +} diff --git a/maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message.properties b/maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message.properties index b93509520..f98df5eb9 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message.properties +++ b/maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message.properties @@ -513,6 +513,26 @@ institutions.postalcode=\u90AE\u7F16 localization.property=\u5C5E\u6027 localization.langZh=\u4E2D\u6587 localization.langEn=\u82F1\u6587 + +ldapcontext.product=\u4EA7\u54C1 +ldapcontext.providerUrl=\u5730\u5740 +ldapcontext.principal=\u8D26\u53F7 +ldapcontext.credentials=\u51ED\u8BC1 +ldapcontext.filters=\u8FC7\u6EE4\u5668 +ldapcontext.basedn=\u57FA\u672CDN +ldapcontext.msadDomain=Active Directory\u57DF +ldapcontext.sslSwitch=SSL +ldapcontext.trustStore=\u8BC1\u4E66 +ldapcontext.trustStorePassword=\u8BC1\u4E66\u5BC6\u94A5 +#emailsenders +emailsenders.account=\u8D26\u53F7 +emailsenders.credentials=\u51ED\u8BC1 +emailsenders.smtpHost=SMTP\u5730\u5740 +emailsenders.port=\u7AEF\u53E3 +emailsenders.sslSwitch=SSL +emailsenders.sender=\u53D1\u9001\u4EBA +emailsenders.encoding=\u9ED8\u8BA4\u7F16\u7801 +emailsenders.protocol=\u534F\u8BAE #button button.text.action=\u8BBF\u95EE button.text.visit=\u8BBF\u95EE @@ -636,4 +656,6 @@ navs.adapters=\u9002\u914D\u5668\u6CE8\u518C navs.notices=\u901A\u77E5\u516C\u544A navs.institutions=\u673A\u6784\u914D\u7F6E navs.socials.provider=\u793E\u4EA4\u670D\u52A1 -navs.synchronizers=\u540C\u6B65\u5668\u7BA1\u7406 \ No newline at end of file +navs.synchronizers=\u540C\u6B65\u5668\u7BA1\u7406 +navs.ldapcontext=LDAP\u914D\u7F6E +navs.emailsenders=\u7535\u5B50\u90AE\u7BB1 \ No newline at end of file diff --git a/maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_en.properties b/maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_en.properties index 06cd275ae..4de874d5c 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_en.properties +++ b/maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_en.properties @@ -522,6 +522,26 @@ institutions.postalcode=postalcode localization.property=Property localization.langZh=Chinese localization.langEn=English + +ldapcontext.product=Product +ldapcontext.providerUrl=ProviderUrl +ldapcontext.principal=Principal +ldapcontext.credentials=Credentials +ldapcontext.filters=Filters +ldapcontext.basedn=Base DN +ldapcontext.msadDomain=Active Directory Domain +ldapcontext.sslSwitch=SSL +ldapcontext.trustStore=TrustStore +ldapcontext.trustStorePassword=TrustStorePassword + +emailsenders.account=Account +emailsenders.credentials=Credentials +emailsenders.smtpHost=SMTPHost +emailsenders.port=Port +emailsenders.sslSwitch=SSL +emailsenders.sender=Sender +emailsenders.encoding=Encoding +emailsenders.protocol=Protocol button.text.action=Action button.text.visit=Visit @@ -645,4 +665,6 @@ navs.adapters=Adapters navs.notices=Notices navs.institutions=Institutions navs.socials.provider=SocialsProvider -navs.synchronizers=Synchronizers \ No newline at end of file +navs.synchronizers=Synchronizers +navs.ldapcontext=LdapContext +navs.emailsenders=Email \ No newline at end of file diff --git a/maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_zh_CN.properties b/maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_zh_CN.properties index a4cc1d581..beb92e2de 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_zh_CN.properties +++ b/maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_zh_CN.properties @@ -513,6 +513,26 @@ institutions.postalcode=\u90AE\u7F16 localization.property=\u5C5E\u6027 localization.langZh=\u4E2D\u6587 localization.langEn=\u82F1\u6587 + +ldapcontext.product=\u4EA7\u54C1 +ldapcontext.providerUrl=\u5730\u5740 +ldapcontext.principal=\u8D26\u53F7 +ldapcontext.credentials=\u51ED\u8BC1 +ldapcontext.filters=\u8FC7\u6EE4\u5668 +ldapcontext.basedn=\u57FA\u672CDN +ldapcontext.msadDomain=Active Directory\u57DF +ldapcontext.sslSwitch=SSL +ldapcontext.trustStore=\u8BC1\u4E66 +ldapcontext.trustStorePassword=\u8BC1\u4E66\u5BC6\u94A5 +#emailsenders +emailsenders.account=\u8D26\u53F7 +emailsenders.credentials=\u51ED\u8BC1 +emailsenders.smtpHost=SMTP\u5730\u5740 +emailsenders.port=\u7AEF\u53E3 +emailsenders.sslSwitch=SSL +emailsenders.sender=\u53D1\u9001\u4EBA +emailsenders.encoding=\u9ED8\u8BA4\u7F16\u7801 +emailsenders.protocol=\u534F\u8BAE #button button.text.action=\u8BBF\u95EE button.text.visit=\u8BBF\u95EE @@ -636,4 +656,6 @@ navs.adapters=\u9002\u914D\u5668\u6CE8\u518C navs.notices=\u901A\u77E5\u516C\u544A navs.institutions=\u673A\u6784\u914D\u7F6E navs.socials.provider=\u793E\u4EA4\u670D\u52A1 -navs.synchronizers=\u540C\u6B65\u5668\u7BA1\u7406 \ No newline at end of file +navs.synchronizers=\u540C\u6B65\u5668\u7BA1\u7406 +navs.ldapcontext=LDAP\u914D\u7F6E +navs.emailsenders=\u7535\u5B50\u90AE\u7BB1 \ No newline at end of file diff --git a/maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/emailsenders/updateEmailSenders.ftl b/maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/emailsenders/updateEmailSenders.ftl new file mode 100644 index 000000000..7bebd2dab --- /dev/null +++ b/maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/emailsenders/updateEmailSenders.ftl @@ -0,0 +1,187 @@ + + + + <#include "../layout/header.ftl"/> + <#include "../layout/common.cssjs.ftl"/> + + +
+
+ + + +
+ +
+
+ +
+
+
+
+
+
+

<@locale code="navs.emailsenders"/>

+
+
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ + +
+ +
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ + +
+ +
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ + +
+ +
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+ + +
+
+
+ +
+
+
+
+
+
+ <#include "../layout/footer.ftl"/> +
+ +
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/layout/sidenav.ftl b/maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/layout/sidenav.ftl index c6ec94958..31fcf6d09 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/layout/sidenav.ftl +++ b/maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/layout/sidenav.ftl @@ -141,6 +141,19 @@ +
  • + + <@locale code="navs.ldapcontext"/> + + +
  • +
  • + + <@locale code="navs.emailsenders"/> + + +
  • +
  • <@locale code="navs.conf.passwordpolicy"/> diff --git a/maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/ldapcontext/updateLdapContext.ftl b/maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/ldapcontext/updateLdapContext.ftl new file mode 100644 index 000000000..1703045e7 --- /dev/null +++ b/maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/ldapcontext/updateLdapContext.ftl @@ -0,0 +1,193 @@ + + + + <#include "../layout/header.ftl"/> + <#include "../layout/common.cssjs.ftl"/> + + +
    +
    + + + + + +
    +
    +
    + + + \ No newline at end of file