mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-1479: Merge change to styling of disabled users/groups.
This commit is contained in:
@@ -63,12 +63,6 @@ public class ModeledUser extends ModeledPermissions<UserModel> implements User {
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(ModeledUser.class);
|
||||
|
||||
/**
|
||||
* The name of the attribute which controls whether a user account is
|
||||
* disabled.
|
||||
*/
|
||||
public static final String DISABLED_ATTRIBUTE_NAME = "disabled";
|
||||
|
||||
/**
|
||||
* The name of the attribute which controls whether a user's password is
|
||||
* expired and must be reset upon login.
|
||||
@@ -121,7 +115,6 @@ public class ModeledUser extends ModeledPermissions<UserModel> implements User {
|
||||
* form.
|
||||
*/
|
||||
public static final Form ACCOUNT_RESTRICTIONS = new Form("restrictions", Arrays.<Field>asList(
|
||||
new BooleanField(DISABLED_ATTRIBUTE_NAME, "true"),
|
||||
new BooleanField(EXPIRED_ATTRIBUTE_NAME, "true"),
|
||||
new TimeField(ACCESS_WINDOW_START_ATTRIBUTE_NAME),
|
||||
new TimeField(ACCESS_WINDOW_END_ATTRIBUTE_NAME),
|
||||
@@ -149,7 +142,6 @@ public class ModeledUser extends ModeledPermissions<UserModel> implements User {
|
||||
User.Attribute.EMAIL_ADDRESS,
|
||||
User.Attribute.ORGANIZATION,
|
||||
User.Attribute.ORGANIZATIONAL_ROLE,
|
||||
DISABLED_ATTRIBUTE_NAME,
|
||||
EXPIRED_ATTRIBUTE_NAME,
|
||||
ACCESS_WINDOW_START_ATTRIBUTE_NAME,
|
||||
ACCESS_WINDOW_END_ATTRIBUTE_NAME,
|
||||
@@ -281,6 +273,16 @@ public class ModeledUser extends ModeledPermissions<UserModel> implements User {
|
||||
userModel.setPasswordDate(new Timestamp(System.currentTimeMillis()));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDisabled() {
|
||||
return getModel().isDisabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDisabled(boolean disabled) {
|
||||
getModel().setDisabled(disabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the this user's current password record. If the user is new, this
|
||||
@@ -309,9 +311,6 @@ public class ModeledUser extends ModeledPermissions<UserModel> implements User {
|
||||
*/
|
||||
private void putRestrictedAttributes(Map<String, String> attributes) {
|
||||
|
||||
// Set disabled attribute
|
||||
attributes.put(DISABLED_ATTRIBUTE_NAME, getModel().isDisabled() ? "true" : null);
|
||||
|
||||
// Set password expired attribute
|
||||
attributes.put(EXPIRED_ATTRIBUTE_NAME, getModel().isExpired() ? "true" : null);
|
||||
|
||||
@@ -424,10 +423,6 @@ public class ModeledUser extends ModeledPermissions<UserModel> implements User {
|
||||
*/
|
||||
private void setRestrictedAttributes(Map<String, String> attributes) {
|
||||
|
||||
// Translate disabled attribute
|
||||
if (attributes.containsKey(DISABLED_ATTRIBUTE_NAME))
|
||||
getModel().setDisabled("true".equals(attributes.get(DISABLED_ATTRIBUTE_NAME)));
|
||||
|
||||
// Translate password expired attribute
|
||||
if (attributes.containsKey(EXPIRED_ATTRIBUTE_NAME))
|
||||
getModel().setExpired("true".equals(attributes.get(EXPIRED_ATTRIBUTE_NAME)));
|
||||
@@ -737,19 +732,6 @@ public class ModeledUser extends ModeledPermissions<UserModel> implements User {
|
||||
return isActive(getAccessWindowStart(), getAccessWindowEnd());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this user account has been disabled. The credentials of
|
||||
* disabled user accounts are treated as invalid, effectively disabling
|
||||
* that user's access to data for which they would otherwise have
|
||||
* permission.
|
||||
*
|
||||
* @return
|
||||
* true if this user account has been disabled, false otherwise.
|
||||
*/
|
||||
public boolean isDisabled() {
|
||||
return getModel().isDisabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this user's password has expired. If a user's password
|
||||
* is expired, it must be immediately changed upon login. A user account
|
||||
|
@@ -42,36 +42,17 @@ import org.apache.guacamole.net.auth.UserGroup;
|
||||
public class ModeledUserGroup extends ModeledPermissions<UserGroupModel>
|
||||
implements UserGroup {
|
||||
|
||||
/**
|
||||
* The name of the attribute which controls whether a user group is
|
||||
* disabled.
|
||||
*/
|
||||
public static final String DISABLED_ATTRIBUTE_NAME = "disabled";
|
||||
|
||||
/**
|
||||
* All attributes related to restricting user groups, within a logical
|
||||
* form.
|
||||
*/
|
||||
public static final Form ACCOUNT_RESTRICTIONS = new Form("restrictions", Arrays.<Field>asList(
|
||||
new BooleanField(DISABLED_ATTRIBUTE_NAME, "true")
|
||||
));
|
||||
|
||||
/**
|
||||
* All possible attributes of user groups organized as individual,
|
||||
* logical forms.
|
||||
*/
|
||||
public static final Collection<Form> ATTRIBUTES = Collections.unmodifiableCollection(Arrays.asList(
|
||||
ACCOUNT_RESTRICTIONS
|
||||
));
|
||||
|
||||
public static final Collection<Form> ATTRIBUTES = Collections.emptyList();
|
||||
|
||||
/**
|
||||
* The names of all attributes which are explicitly supported by this
|
||||
* extension's UserGroup objects.
|
||||
*/
|
||||
public static final Set<String> ATTRIBUTE_NAMES =
|
||||
Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(
|
||||
DISABLED_ATTRIBUTE_NAME
|
||||
)));
|
||||
public static final Set<String> ATTRIBUTE_NAMES = Collections.emptySet();
|
||||
|
||||
/**
|
||||
* Provider for RelatedObjectSets containing the user groups of which this
|
||||
@@ -121,6 +102,16 @@ public class ModeledUserGroup extends ModeledPermissions<UserGroupModel>
|
||||
super.init(currentUser, model);
|
||||
this.exposeRestrictedAttributes = exposeRestrictedAttributes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDisabled() {
|
||||
return getModel().isDisabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDisabled(boolean disabled) {
|
||||
getModel().setDisabled(disabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores all restricted (privileged) attributes within the given Map,
|
||||
@@ -133,9 +124,6 @@ public class ModeledUserGroup extends ModeledPermissions<UserGroupModel>
|
||||
*/
|
||||
private void putRestrictedAttributes(Map<String, String> attributes) {
|
||||
|
||||
// Set disabled attribute
|
||||
attributes.put(DISABLED_ATTRIBUTE_NAME, getModel().isDisabled() ? "true" : null);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,9 +135,6 @@ public class ModeledUserGroup extends ModeledPermissions<UserGroupModel>
|
||||
*/
|
||||
private void setRestrictedAttributes(Map<String, String> attributes) {
|
||||
|
||||
// Translate disabled attribute
|
||||
getModel().setDisabled("true".equals(attributes.get(DISABLED_ATTRIBUTE_NAME)));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -89,7 +89,6 @@
|
||||
|
||||
"USER_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Inici de sessió desactivat:",
|
||||
"FIELD_HEADER_EXPIRED" : "Contrasenya caducada:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_END" : "No permetre l'accés després:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_START" : "Permet l'accés després:",
|
||||
@@ -104,8 +103,6 @@
|
||||
|
||||
"USER_GROUP_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Desactivat:",
|
||||
|
||||
"SECTION_HEADER_RESTRICTIONS" : "Restriccions de grup"
|
||||
|
||||
}
|
||||
|
@@ -88,7 +88,6 @@
|
||||
|
||||
"USER_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Login deaktiviert:",
|
||||
"FIELD_HEADER_EXPIRED" : "Passwort abgelaufen:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_END" : "Zugriff nach dieser Uhrzeit nicht mehr erlauben:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_START" : "Zugriff erst nach dieser Uhrzeit erlauben:",
|
||||
@@ -102,9 +101,7 @@
|
||||
},
|
||||
|
||||
"USER_GROUP_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Deaktiviert:",
|
||||
|
||||
|
||||
"SECTION_HEADER_RESTRICTIONS" : "Gruppeneinschränkung"
|
||||
|
||||
}
|
||||
|
@@ -89,7 +89,6 @@
|
||||
|
||||
"USER_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Login disabled:",
|
||||
"FIELD_HEADER_EXPIRED" : "Password expired:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_END" : "Do not allow access after:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_START" : "Allow access after:",
|
||||
@@ -104,8 +103,6 @@
|
||||
|
||||
"USER_GROUP_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Disabled:",
|
||||
|
||||
"SECTION_HEADER_RESTRICTIONS" : "Group Restrictions"
|
||||
|
||||
},
|
||||
|
@@ -89,7 +89,6 @@
|
||||
|
||||
"USER_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Inicio de sesión deshabilitado:",
|
||||
"FIELD_HEADER_EXPIRED" : "Contraseña expirada:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_END" : "No permitir acceso despues de:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_START" : "Permitir acceso despues de:",
|
||||
@@ -104,8 +103,6 @@
|
||||
|
||||
"USER_GROUP_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Deshabilitado:",
|
||||
|
||||
"SECTION_HEADER_RESTRICTIONS" : "Restricciones de grupo"
|
||||
|
||||
}
|
||||
|
@@ -89,7 +89,6 @@
|
||||
|
||||
"USER_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Connexion désactivée:",
|
||||
"FIELD_HEADER_EXPIRED" : "Mot de passe expiré:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_END" : "Ne pas autoriser l'accès après:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_START" : "Autoriser l'accès après:",
|
||||
@@ -104,8 +103,6 @@
|
||||
|
||||
"USER_GROUP_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Désactivé:",
|
||||
|
||||
"SECTION_HEADER_RESTRICTIONS" : "Restrictions de groupe"
|
||||
|
||||
}
|
||||
|
@@ -75,7 +75,7 @@
|
||||
|
||||
"USER_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "ログインの無効化:",
|
||||
|
||||
"FIELD_HEADER_EXPIRED" : "パスワード変更の強制:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_END" : "指定した時刻からアクセスを禁止する:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_START" : "指定した時刻からアクセスを許可する:",
|
||||
@@ -90,8 +90,6 @@
|
||||
|
||||
"USER_GROUP_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "グループの無効化:",
|
||||
|
||||
"SECTION_HEADER_RESTRICTIONS" : "グループ制限"
|
||||
|
||||
}
|
||||
|
@@ -88,7 +88,6 @@
|
||||
|
||||
"USER_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "로그인 비활성화:",
|
||||
"FIELD_HEADER_EXPIRED" : "비밀번호 만료됨:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_END" : "다음 이후에 액세스 허용 안함 :",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_START" : "다음 이후에 엑세스 허용:",
|
||||
@@ -103,8 +102,6 @@
|
||||
|
||||
"USER_GROUP_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "비활성화:",
|
||||
|
||||
"SECTION_HEADER_RESTRICTIONS" : "그룹 제한"
|
||||
|
||||
}
|
||||
|
@@ -89,7 +89,6 @@
|
||||
|
||||
"USER_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Logowanie zablokowane:",
|
||||
"FIELD_HEADER_EXPIRED" : "Hasło wygasło:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_END" : "Nie zezwalaj na dostęp po:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_START" : "Zezwalaj na dostęp od:",
|
||||
@@ -104,8 +103,6 @@
|
||||
|
||||
"USER_GROUP_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Wyłączona:",
|
||||
|
||||
"SECTION_HEADER_RESTRICTIONS" : "Ograniczenia Grupy"
|
||||
|
||||
}
|
||||
|
@@ -90,7 +90,6 @@
|
||||
|
||||
"USER_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Login desativado:",
|
||||
"FIELD_HEADER_EXPIRED" : "Senha expirada:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_END" : "Não permitir acesso após:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_START" : "Permitir acesso após:",
|
||||
@@ -105,8 +104,6 @@
|
||||
|
||||
"USER_GROUP_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Desativado:",
|
||||
|
||||
"SECTION_HEADER_RESTRICTIONS" : "Restrições de Grupo"
|
||||
|
||||
}
|
||||
|
@@ -88,7 +88,6 @@
|
||||
|
||||
"USER_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Аккаунт отключен:",
|
||||
"FIELD_HEADER_EXPIRED" : "Пароль просрочен:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_END" : "Запретить доступ после:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_START" : "Разрешить доступ после:",
|
||||
@@ -103,8 +102,6 @@
|
||||
|
||||
"USER_GROUP_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "Группа отключена:",
|
||||
|
||||
"SECTION_HEADER_RESTRICTIONS" : "Ограничения"
|
||||
|
||||
}
|
||||
|
@@ -89,7 +89,6 @@
|
||||
|
||||
"USER_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "已禁用登录:",
|
||||
"FIELD_HEADER_EXPIRED" : "密码已过期:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_END" : "之后不允许访问:",
|
||||
"FIELD_HEADER_ACCESS_WINDOW_START" : "之后允许访问:",
|
||||
@@ -104,8 +103,6 @@
|
||||
|
||||
"USER_GROUP_ATTRIBUTES" : {
|
||||
|
||||
"FIELD_HEADER_DISABLED" : "禁用:",
|
||||
|
||||
"SECTION_HEADER_RESTRICTIONS" : "组限制"
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user