mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 22:15:51 +01:00
(refs #335)Revert account updating in LDAP authentication
This commit is contained in:
@@ -49,7 +49,7 @@ trait AccountService {
|
|||||||
}
|
}
|
||||||
case None => getAccountByMailAddress(ldapUserInfo.mailAddress, true) match {
|
case None => getAccountByMailAddress(ldapUserInfo.mailAddress, true) match {
|
||||||
case Some(x) if(!x.isRemoved) => {
|
case Some(x) if(!x.isRemoved) => {
|
||||||
updateAccountByMailAddress(x.copy(userName = ldapUserInfo.userName, fullName = ldapUserInfo.fullName))
|
updateAccount(x.copy(fullName = ldapUserInfo.fullName))
|
||||||
getAccountByUserName(ldapUserInfo.userName)
|
getAccountByUserName(ldapUserInfo.userName)
|
||||||
}
|
}
|
||||||
case Some(x) if(x.isRemoved) => {
|
case Some(x) if(x.isRemoved) => {
|
||||||
@@ -98,9 +98,6 @@ trait AccountService {
|
|||||||
isGroupAccount = false,
|
isGroupAccount = false,
|
||||||
isRemoved = false)
|
isRemoved = false)
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the account by user name.
|
|
||||||
*/
|
|
||||||
def updateAccount(account: Account): Unit =
|
def updateAccount(account: Account): Unit =
|
||||||
Accounts
|
Accounts
|
||||||
.filter { a => a.userName is account.userName.bind }
|
.filter { a => a.userName is account.userName.bind }
|
||||||
@@ -116,24 +113,6 @@ trait AccountService {
|
|||||||
account.lastLoginDate,
|
account.lastLoginDate,
|
||||||
account.isRemoved)
|
account.isRemoved)
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the account by mail address
|
|
||||||
*/
|
|
||||||
def updateAccountByMailAddress(account: Account): Unit =
|
|
||||||
Accounts
|
|
||||||
.filter { a => a.mailAddress is account.mailAddress.bind }
|
|
||||||
.map { a => a.userName ~ a.password ~ a.fullName ~ a.isAdmin ~ a.url.? ~ a.registeredDate ~ a.updatedDate ~ a.lastLoginDate.? ~ a.removed }
|
|
||||||
.update (
|
|
||||||
account.userName,
|
|
||||||
account.password,
|
|
||||||
account.fullName,
|
|
||||||
account.isAdmin,
|
|
||||||
account.url,
|
|
||||||
account.registeredDate,
|
|
||||||
currentDate,
|
|
||||||
account.lastLoginDate,
|
|
||||||
account.isRemoved)
|
|
||||||
|
|
||||||
def updateAvatarImage(userName: String, image: Option[String]): Unit =
|
def updateAvatarImage(userName: String, image: Option[String]): Unit =
|
||||||
Accounts.filter(_.userName is userName.bind).map(_.image.?).update(image)
|
Accounts.filter(_.userName is userName.bind).map(_.image.?).update(image)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user