mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 23:15:49 +01:00
Add features (additional filter condition / disable mail resolve) to LDAP authentication.
This commit is contained in:
18
src/main/scala/util/AccountUtil.scala
Normal file
18
src/main/scala/util/AccountUtil.scala
Normal file
@@ -0,0 +1,18 @@
|
||||
package util
|
||||
|
||||
import model.Account
|
||||
|
||||
/**
|
||||
* Utility for account model.
|
||||
*/
|
||||
object AccountUtil {
|
||||
private val LDAP_DUMMY_MAL = "@ldap-devnull"
|
||||
|
||||
def hasLdapDummyMailAddress(account: Account): Boolean = {
|
||||
account.mailAddress.endsWith(LDAP_DUMMY_MAL)
|
||||
}
|
||||
|
||||
def getLdapDummyMailAddress(userName: String): String = {
|
||||
userName + LDAP_DUMMY_MAL
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user