#461 : add mail attribute
This commit is contained in:
parent
9d955d17d9
commit
92bb7abbaf
7 changed files with 30 additions and 0 deletions
|
@ -19,6 +19,7 @@ import java.io.Serializable;
|
|||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.hibernate.validator.constraints.Email;
|
||||
import org.lastaflute.web.validation.Required;
|
||||
import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
|
||||
|
||||
|
@ -50,6 +51,10 @@ public class CreateForm implements Serializable {
|
|||
@Size(max = 1000)
|
||||
public String givenName;
|
||||
|
||||
@Email
|
||||
@Size(max = 1000)
|
||||
public String mail;
|
||||
|
||||
public String[] roles;
|
||||
|
||||
public String[] groups;
|
||||
|
|
|
@ -359,6 +359,11 @@ public class LdapManager {
|
|||
.ifPresent(s -> modifyReplaceEntry(modifyList, attrGivenName, s))
|
||||
.orElse(() -> getAttributeValueList(result, attrGivenName).stream().forEach(
|
||||
v -> modifyDeleteEntry(modifyList, attrGivenName, v)));
|
||||
final String attrMail = fessConfig.getLdapAttrMail();
|
||||
OptionalUtil.ofNullable(user.getMail()).filter(s -> StringUtil.isNotBlank(s))
|
||||
.ifPresent(s -> modifyReplaceEntry(modifyList, attrMail, s))
|
||||
.orElse(() -> getAttributeValueList(result, attrMail).stream().forEach(v -> modifyDeleteEntry(modifyList, attrMail, v)));
|
||||
|
||||
modify(userDN, modifyList, adminEnv);
|
||||
}
|
||||
|
||||
|
@ -370,6 +375,8 @@ public class LdapManager {
|
|||
.ifPresent(s -> entry.put(new BasicAttribute(fessConfig.getLdapAttrSurname(), s)));
|
||||
OptionalUtil.ofNullable(user.getGivenName()).filter(s -> StringUtil.isNotBlank(s))
|
||||
.ifPresent(s -> entry.put(new BasicAttribute(fessConfig.getLdapAttrGivenName(), s)));
|
||||
OptionalUtil.ofNullable(user.getMail()).filter(s -> StringUtil.isNotBlank(s))
|
||||
.ifPresent(s -> entry.put(new BasicAttribute(fessConfig.getLdapAttrMail(), s)));
|
||||
}
|
||||
|
||||
public void delete(final User user) {
|
||||
|
|
|
@ -684,3 +684,5 @@ labels.user_given_name=First Name
|
|||
labels.givenName=First Name
|
||||
labels.user_surname=Last Name
|
||||
labels.surame=Last Name
|
||||
labels.user_mail=E-Mail
|
||||
labels.mail=E-Mail
|
||||
|
|
|
@ -684,3 +684,5 @@ labels.user_given_name=First Name
|
|||
labels.givenName=First Name
|
||||
labels.user_surname=Last Name
|
||||
labels.surame=Last Name
|
||||
labels.user_mail=E-Mail
|
||||
labels.mail=E-Mail
|
||||
|
|
|
@ -684,3 +684,5 @@ labels.user_given_name=\u540d\u524d(\u540d)
|
|||
labels.givenName=\u540d\u524d(\u540d)
|
||||
labels.user_surname=\u540d\u524d(\u59d3)
|
||||
labels.surame=\u540d\u524d(\u59d3)
|
||||
labels.user_mail=\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9
|
||||
labels.mail=\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9
|
||||
|
|
|
@ -58,6 +58,10 @@
|
|||
<th class="col-xs-2"><la:message key="labels.user_given_name" /></th>
|
||||
<td>${f:h(givenName)}<la:hidden property="givenName" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="col-xs-2"><la:message key="labels.user_mail" /></th>
|
||||
<td>${f:h(mail)}<la:hidden property="mail" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><la:message key="labels.roles" /></th>
|
||||
<td><c:forEach var="rt" varStatus="s"
|
||||
|
|
|
@ -89,6 +89,14 @@
|
|||
<la:text property="givenName" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="mail" class="col-sm-3 control-label"><la:message
|
||||
key="labels.user_mail" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="mail" />
|
||||
<la:text property="mail" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="roles" class="col-sm-3 control-label"><la:message
|
||||
key="labels.roles" /></label>
|
||||
|
|
Loading…
Add table
Reference in a new issue