mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
merge with branch issue-153
This commit is contained in:
@@ -155,6 +155,12 @@ public class User extends BasicPropertiesAware implements Principal, ModelObject
|
||||
user.setAdmin(admin);
|
||||
}
|
||||
|
||||
if (user.isActive() != active)
|
||||
{
|
||||
result = true;
|
||||
user.setActive(active);
|
||||
}
|
||||
|
||||
if (Util.isNotEquals(user.getDisplayName(), displayName))
|
||||
{
|
||||
result = true;
|
||||
@@ -216,6 +222,7 @@ public class User extends BasicPropertiesAware implements Principal, ModelObject
|
||||
&& Objects.equal(mail, other.mail)
|
||||
&& Objects.equal(type, other.type)
|
||||
&& Objects.equal(admin, other.admin)
|
||||
&& Objects.equal(active, other.active)
|
||||
&& Objects.equal(password, other.password)
|
||||
&& Objects.equal(creationDate, other.creationDate)
|
||||
&& Objects.equal(lastModified, other.lastModified)
|
||||
@@ -232,7 +239,7 @@ public class User extends BasicPropertiesAware implements Principal, ModelObject
|
||||
public int hashCode()
|
||||
{
|
||||
return Objects.hashCode(name, displayName, mail, type, admin, password,
|
||||
creationDate, lastModified, properties);
|
||||
active, creationDate, lastModified, properties);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,6 +263,7 @@ public class User extends BasicPropertiesAware implements Principal, ModelObject
|
||||
.add("password", pwd)
|
||||
.add("admin", admin)
|
||||
.add("type", type)
|
||||
.add("active", active)
|
||||
.add("creationDate", creationDate)
|
||||
.add("lastModified", lastModified)
|
||||
.add("properties", properties)
|
||||
@@ -357,6 +365,18 @@ public class User extends BasicPropertiesAware implements Principal, ModelObject
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns false if the user is deactivated.
|
||||
*
|
||||
*
|
||||
* @return false if the user is deactivated
|
||||
* @since 1.16
|
||||
*/
|
||||
public boolean isActive()
|
||||
{
|
||||
return active;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -384,6 +404,18 @@ public class User extends BasicPropertiesAware implements Principal, ModelObject
|
||||
|
||||
//~--- set methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Activate or deactive this user.
|
||||
*
|
||||
*
|
||||
* @param active false to deactivate the user.
|
||||
* @since 1.6
|
||||
*/
|
||||
public void setActive(boolean active)
|
||||
{
|
||||
this.active = active;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -476,7 +508,10 @@ public class User extends BasicPropertiesAware implements Principal, ModelObject
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
private boolean admin;
|
||||
private boolean active = true;
|
||||
|
||||
/** Field description */
|
||||
private boolean admin = false;
|
||||
|
||||
/** Field description */
|
||||
private Long creationDate;
|
||||
|
||||
Reference in New Issue
Block a user