diff --git a/src/main/scala/app/IndexController.scala b/src/main/scala/app/IndexController.scala index 54d5b93..591270d 100644 --- a/src/main/scala/app/IndexController.scala +++ b/src/main/scala/app/IndexController.scala @@ -59,7 +59,7 @@ session.setAttribute(Keys.Session.LoginAccount, account) updateLastLoginDate(account.userName) - if(LDAPUtil.hasLdapDummyMailAddress(account)) { + if(LDAPUtil.isDummyMailAddress(account)) { redirect("/" + account.userName + "/_edit") } diff --git a/src/main/scala/util/LDAPUtil.scala b/src/main/scala/util/LDAPUtil.scala index 00dd50b..ae578bd 100644 --- a/src/main/scala/util/LDAPUtil.scala +++ b/src/main/scala/util/LDAPUtil.scala @@ -22,7 +22,7 @@ /** * Returns true if mail address ends with "@ldap-devnull" */ - def hasLdapDummyMailAddress(account: Account): Boolean = { + def isDummyMailAddress(account: Account): Boolean = { account.mailAddress.endsWith(LDAP_DUMMY_MAL) } @@ -33,7 +33,7 @@ * GitBucket does not send any mails to this dummy address. And these users must input their mail address * at the first step after LDAP authentication. */ - def getLdapDummyMailAddress(userName: String): String = { + def createDummyMailAddress(userName: String): String = { userName + LDAP_DUMMY_MAL } @@ -74,7 +74,7 @@ fullName = ldapSettings.fullNameAttribute.flatMap { fullNameAttribute => findFullName(conn, userDN, ldapSettings.userNameAttribute, userName, fullNameAttribute) }.getOrElse(userName), - mailAddress = getLdapDummyMailAddress(userName))) + mailAddress = createDummyMailAddress(userName))) } else { findMailAddress(conn, userDN, ldapSettings.userNameAttribute, userName, ldapSettings.mailAttribute.get) match { case Some(mailAddress) => Right(LDAPUserInfo( diff --git a/src/main/scala/util/Notifier.scala b/src/main/scala/util/Notifier.scala index 6ecc3f6..39b906a 100644 --- a/src/main/scala/util/Notifier.scala +++ b/src/main/scala/util/Notifier.scala @@ -28,7 +28,7 @@ ) .distinct .withFilter ( _ != context.loginAccount.get.userName ) // the operation in person is excluded - .foreach ( getAccountByUserName(_) filterNot (_.isGroupAccount) filterNot (LDAPUtil.hasLdapDummyMailAddress(_)) foreach (x => notify(x.mailAddress)) ) + .foreach ( getAccountByUserName(_) filterNot (_.isGroupAccount) filterNot (LDAPUtil.isDummyMailAddress(_)) foreach (x => notify(x.mailAddress)) ) } diff --git a/src/main/twirl/account/edit.scala.html b/src/main/twirl/account/edit.scala.html index 599c453..32055ab 100644 --- a/src/main/twirl/account/edit.scala.html +++ b/src/main/twirl/account/edit.scala.html @@ -10,7 +10,7 @@