diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUser.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUser.java index c10bd435ce..811ccaa311 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUser.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUser.java @@ -63,12 +63,6 @@ public class ModeledUser extends ModeledPermissions 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 implements User { * form. */ public static final Form ACCOUNT_RESTRICTIONS = new Form("restrictions", Arrays.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 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 void setPassword(String password) { 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 PasswordRecordModel getPasswordRecord() { */ private void putRestrictedAttributes(Map 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 @@ private Time parseTime(String timeString) */ private void setRestrictedAttributes(Map 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 boolean isAccountAccessible() { 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 diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/usergroup/ModeledUserGroup.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/usergroup/ModeledUserGroup.java index b31b61e1ee..8b30db4b31 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/usergroup/ModeledUserGroup.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/usergroup/ModeledUserGroup.java @@ -42,36 +42,17 @@ public class ModeledUserGroup extends ModeledPermissions 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.asList( - new BooleanField(DISABLED_ATTRIBUTE_NAME, "true") - )); - /** * All possible attributes of user groups organized as individual, * logical forms. */ - public static final Collection
ATTRIBUTES = Collections.unmodifiableCollection(Arrays.asList( - ACCOUNT_RESTRICTIONS - )); - + public static final Collection ATTRIBUTES = Collections.emptyList(); + /** * The names of all attributes which are explicitly supported by this * extension's UserGroup objects. */ - public static final Set ATTRIBUTE_NAMES = - Collections.unmodifiableSet(new HashSet(Arrays.asList( - DISABLED_ATTRIBUTE_NAME - ))); + public static final Set ATTRIBUTE_NAMES = Collections.emptySet(); /** * Provider for RelatedObjectSets containing the user groups of which this @@ -121,6 +102,16 @@ public void init(ModeledAuthenticatedUser currentUser, UserGroupModel model, 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 void init(ModeledAuthenticatedUser currentUser, UserGroupModel model, */ private void putRestrictedAttributes(Map attributes) { - // Set disabled attribute - attributes.put(DISABLED_ATTRIBUTE_NAME, getModel().isDisabled() ? "true" : null); - } /** @@ -147,9 +135,6 @@ private void putRestrictedAttributes(Map attributes) { */ private void setRestrictedAttributes(Map attributes) { - // Translate disabled attribute - getModel().setDisabled("true".equals(attributes.get(DISABLED_ATTRIBUTE_NAME))); - } @Override diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ca.json b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ca.json index 64b27238a2..c908548f1a 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ca.json +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ca.json @@ -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" } diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/de.json b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/de.json index 452d9ac041..20ffe0988e 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/de.json +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/de.json @@ -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" } diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/en.json b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/en.json index 68e96a83b3..cc9f6802b5 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/en.json +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/en.json @@ -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" }, diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/es.json b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/es.json index e6c06a8179..e3b1ef906c 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/es.json +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/es.json @@ -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" } diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/fr.json b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/fr.json index a85fad4410..63b27cdb97 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/fr.json +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/fr.json @@ -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" } diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ja.json b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ja.json index 2c94c4397e..18aaf59717 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ja.json +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ja.json @@ -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" : "グループ制限" } diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ko.json b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ko.json index 6c1a24da50..bfc124ab92 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ko.json +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ko.json @@ -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" : "그룹 제한" } diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/pl.json b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/pl.json index 8c31932aa9..a5b5fc11f1 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/pl.json +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/pl.json @@ -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" } diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/pt.json b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/pt.json index 928077038d..aafd4675c3 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/pt.json +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/pt.json @@ -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" } diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ru.json b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ru.json index 12e9c6f935..110a4bc5c1 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ru.json +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/ru.json @@ -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" : "Ограничения" } diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/zh.json b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/zh.json index 44b6bf2334..ff91c7e81c 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/zh.json +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/resources/translations/zh.json @@ -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" : "组限制" } diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/AbstractUserGroup.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/AbstractUserGroup.java index f63bfae7f0..2c89cb0506 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/AbstractUserGroup.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/AbstractUserGroup.java @@ -29,7 +29,7 @@ * Base implementation of UserGroup which provides default implementations of * most functions. */ -public class AbstractUserGroup extends AbstractIdentifiable implements UserGroup { +public abstract class AbstractUserGroup extends AbstractIdentifiable implements UserGroup { /** * {@inheritDoc} diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/DelegatingUser.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/DelegatingUser.java index 9da0fb561a..9f2d93b23d 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/DelegatingUser.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/DelegatingUser.java @@ -77,6 +77,16 @@ public String getPassword() { public void setPassword(String password) { user.setPassword(password); } + + @Override + public boolean isDisabled() { + return user.isDisabled(); + } + + @Override + public void setDisabled(boolean disabled) { + user.setDisabled(disabled); + } @Override public Map getAttributes() { diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/DelegatingUserGroup.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/DelegatingUserGroup.java index 22aa39a764..d52530748f 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/DelegatingUserGroup.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/DelegatingUserGroup.java @@ -65,6 +65,16 @@ public String getIdentifier() { public void setIdentifier(String identifier) { userGroup.setIdentifier(identifier); } + + @Override + public boolean isDisabled() { + return userGroup.isDisabled(); + } + + @Override + public void setDisabled(boolean disabled) { + userGroup.setDisabled(disabled); + } @Override public Map getAttributes() { diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Disableable.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Disableable.java new file mode 100644 index 0000000000..e515bc8ca0 --- /dev/null +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Disableable.java @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.guacamole.net.auth; + +/** + * An interface that defines items that can be enabled or disabled. + */ +public interface Disableable { + + /** + * Returns true if this object is disabled, otherwise false. + * + * @return + * True if this object is disabled, otherwise false. + */ + default public boolean isDisabled() { + return false; + } + + /** + * Set the disabled status of this object to the boolean value provided, + * true if the object should be disabled, otherwise false. + * + * @param disabled + * True if the object should be disabled, otherwise false. + */ + default public void setDisabled(boolean disabled) { + // Default implementation takes no action. + } + +} diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/User.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/User.java index 788e8d6746..d658bb08ca 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/User.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/User.java @@ -29,7 +29,7 @@ /** * A user of the Guacamole web application. */ -public interface User extends Identifiable, Attributes, Permissions { +public interface User extends Disableable, Identifiable, Attributes, Permissions { /** * All standard attribute names with semantics defined by the Guacamole web diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/UserGroup.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/UserGroup.java index 4dd167d13e..840c386f35 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/UserGroup.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/UserGroup.java @@ -26,7 +26,7 @@ * any number of Guacamole users and other user groups, and defines the * permissions implicitly granted to its members. */ -public interface UserGroup extends Identifiable, Attributes, Permissions { +public interface UserGroup extends Disableable, Identifiable, Attributes, Permissions { /** * Returns a set of all readable user groups of which this user group is a diff --git a/guacamole/src/main/frontend/src/app/manage/templates/manageUser.html b/guacamole/src/main/frontend/src/app/manage/templates/manageUser.html index 014c7659c1..d5896ecdd5 100644 --- a/guacamole/src/main/frontend/src/app/manage/templates/manageUser.html +++ b/guacamole/src/main/frontend/src/app/manage/templates/manageUser.html @@ -37,6 +37,10 @@

{{'MANAGE_USER.SECTION_HEADER_EDIT_USER' | translate}}

{{'MANAGE_USER.FIELD_HEADER_PASSWORD_AGAIN' | translate}} + + {{'MANAGE_USER.FIELD_HEADER_USER_DISABLED' | translate}} + + diff --git a/guacamole/src/main/frontend/src/app/manage/templates/manageUserGroup.html b/guacamole/src/main/frontend/src/app/manage/templates/manageUserGroup.html index 09fd3e68b1..c450baab98 100644 --- a/guacamole/src/main/frontend/src/app/manage/templates/manageUserGroup.html +++ b/guacamole/src/main/frontend/src/app/manage/templates/manageUserGroup.html @@ -28,6 +28,10 @@

{{'MANAGE_USER_GROUP.SECTION_HEADER_EDIT_USER_GROUP' | translate}}

{{userGroup.identifier}} + + {{'MANAGE_USER_GROUP.FIELD_HEADER_USER_GROUP_DISABLED' | translate}} + + diff --git a/guacamole/src/main/frontend/src/app/manage/types/ManageableUser.js b/guacamole/src/main/frontend/src/app/manage/types/ManageableUser.js index b67ddbdb7d..d6c987472d 100644 --- a/guacamole/src/main/frontend/src/app/manage/types/ManageableUser.js +++ b/guacamole/src/main/frontend/src/app/manage/types/ManageableUser.js @@ -45,6 +45,17 @@ angular.module('manage').factory('ManageableUser', [function defineManageableUse * @type User */ this.user = template.user; + + /** + * Return true if the underlying user account is disabled, otherwise + * return false. + * + * @returns + * True if the underlying user account is disabled, otherwise false. + */ + this.isDisabled = function isDisabled() { + return template.user.disabled; + }; }; diff --git a/guacamole/src/main/frontend/src/app/rest/types/User.js b/guacamole/src/main/frontend/src/app/rest/types/User.js index 3ca138d3b9..c74d1cd8a1 100644 --- a/guacamole/src/main/frontend/src/app/rest/types/User.js +++ b/guacamole/src/main/frontend/src/app/rest/types/User.js @@ -61,6 +61,13 @@ angular.module('rest').factory('User', [function defineUser() { * @type Number */ this.lastActive = template.lastActive; + + /** + * True if this user account is disabled, otherwise false. + * + * @type boolean + */ + this.disabled = template.disabled; /** * Arbitrary name/value pairs which further describe this user. The diff --git a/guacamole/src/main/frontend/src/app/rest/types/UserGroup.js b/guacamole/src/main/frontend/src/app/rest/types/UserGroup.js index f4bf26cfec..e3bc7eae23 100644 --- a/guacamole/src/main/frontend/src/app/rest/types/UserGroup.js +++ b/guacamole/src/main/frontend/src/app/rest/types/UserGroup.js @@ -42,6 +42,13 @@ angular.module('rest').factory('UserGroup', [function defineUserGroup() { * @type String */ this.identifier = template.identifier; + + /** + * True if this user group is disabled, otherwise false. + * + * @type boolean + */ + this.disabled = template.disabled; /** * Arbitrary name/value pairs which further describe this user group. diff --git a/guacamole/src/main/frontend/src/app/settings/styles/user-group-list.css b/guacamole/src/main/frontend/src/app/settings/styles/user-group-list.css index 2040eb440a..6f29de70fa 100644 --- a/guacamole/src/main/frontend/src/app/settings/styles/user-group-list.css +++ b/guacamole/src/main/frontend/src/app/settings/styles/user-group-list.css @@ -26,11 +26,17 @@ width: 100%; } -.settings.user-groups table.user-group-list tr.user td.user-group-name a[href] { +.settings.user-groups table.user-group-list tr.user-group td.user-group-name a[href] { display: block; padding: .5em 1em; } -.settings.user-groups table.user-group-list tr.user td.user-group-name { - padding: 0; +.settings.user-groups table.user-group-list tr.user-group.disabled, +.settings.user-groups table.user-group-list tr.user-group.disabled td.user-group-name a[href] { + color: gray; + font-style: italic; } + +.settings.user-groups table.user-group-list tr.user-group td.user-group-name { + padding: 0; +} \ No newline at end of file diff --git a/guacamole/src/main/frontend/src/app/settings/styles/user-list.css b/guacamole/src/main/frontend/src/app/settings/styles/user-list.css index e130d0da18..e9631a9509 100644 --- a/guacamole/src/main/frontend/src/app/settings/styles/user-list.css +++ b/guacamole/src/main/frontend/src/app/settings/styles/user-list.css @@ -36,6 +36,12 @@ padding: .5em 1em; } +.settings.users table.user-list tr.user.disabled, +.settings.users table.user-list tr.user.disabled td.username a[href] { + color: gray; + font-style: italic; +} + .settings.users table.user-list tr.user td.username { padding: 0; -} +} \ No newline at end of file diff --git a/guacamole/src/main/frontend/src/app/settings/templates/settingsUserGroups.html b/guacamole/src/main/frontend/src/app/settings/templates/settingsUserGroups.html index ccb534e65d..4e7cd4c5a9 100644 --- a/guacamole/src/main/frontend/src/app/settings/templates/settingsUserGroups.html +++ b/guacamole/src/main/frontend/src/app/settings/templates/settingsUserGroups.html @@ -30,7 +30,7 @@ - +
diff --git a/guacamole/src/main/frontend/src/app/settings/templates/settingsUsers.html b/guacamole/src/main/frontend/src/app/settings/templates/settingsUsers.html index 18a0437826..4a178fe491 100644 --- a/guacamole/src/main/frontend/src/app/settings/templates/settingsUsers.html +++ b/guacamole/src/main/frontend/src/app/settings/templates/settingsUsers.html @@ -39,7 +39,7 @@ - +
diff --git a/guacamole/src/main/frontend/src/translations/ca.json b/guacamole/src/main/frontend/src/translations/ca.json index 3ec74359db..658c9232f0 100644 --- a/guacamole/src/main/frontend/src/translations/ca.json +++ b/guacamole/src/main/frontend/src/translations/ca.json @@ -343,6 +343,7 @@ "FIELD_HEADER_CREATE_NEW_CONNECTIONS" : "Crear noves connexions:", "FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS" : "Crear grups de connexió nous:", "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "Crear nous perfils per compartir:", + "FIELD_HEADER_USER_DISABLED" : "Inici de sessió desactivat:", "FIELD_HEADER_USERNAME" : "Nom d'usuari:", "HELP_NO_USER_GROUPS" : "Actualment, aquest usuari no pertany a cap grup. Amplieu aquesta secció per afegir-lo a grups.", @@ -373,6 +374,7 @@ "FIELD_HEADER_CREATE_NEW_CONNECTIONS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTIONS", "FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS", "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_SHARING_PROFILES", + "FIELD_HEADER_USER_GROUP_DISABLED" : "Desactivat:", "FIELD_HEADER_USER_GROUP_NAME" : "Nom del grup:", "HELP_NO_USER_GROUPS" : "Actualment aquest grup no pertany a cap grup. Amplieu aquesta secció per afegir grups.", diff --git a/guacamole/src/main/frontend/src/translations/de.json b/guacamole/src/main/frontend/src/translations/de.json index 04059693d0..e9bcab55d9 100644 --- a/guacamole/src/main/frontend/src/translations/de.json +++ b/guacamole/src/main/frontend/src/translations/de.json @@ -411,6 +411,7 @@ "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "Neues Verteil-Profil erstellen:", "FIELD_HEADER_PASSWORD" : "@:APP.FIELD_HEADER_PASSWORD", "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", + "FIELD_HEADER_USER_DISABLED" : "Login deaktiviert:", "FIELD_HEADER_USERNAME" : "Benutzername:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", @@ -449,6 +450,7 @@ "FIELD_HEADER_CREATE_NEW_CONNECTIONS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTIONS", "FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS", "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_SHARING_PROFILES", + "FIELD_HEADER_USER_GROUP_DISABLED" : "Deaktiviert:", "FIELD_HEADER_USER_GROUP_NAME" : "Name der Benutzergruppe:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", diff --git a/guacamole/src/main/frontend/src/translations/en.json b/guacamole/src/main/frontend/src/translations/en.json index 39b19691c6..7b5e55c65b 100644 --- a/guacamole/src/main/frontend/src/translations/en.json +++ b/guacamole/src/main/frontend/src/translations/en.json @@ -416,6 +416,7 @@ "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "Create new sharing profiles:", "FIELD_HEADER_PASSWORD" : "@:APP.FIELD_HEADER_PASSWORD", "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", + "FIELD_HEADER_USER_DISABLED" : "Login disabled:", "FIELD_HEADER_USERNAME" : "Username:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", @@ -454,6 +455,7 @@ "FIELD_HEADER_CREATE_NEW_CONNECTIONS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTIONS", "FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS", "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_SHARING_PROFILES", + "FIELD_HEADER_USER_GROUP_DISABLED" : "Disabled:", "FIELD_HEADER_USER_GROUP_NAME" : "Group name:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", diff --git a/guacamole/src/main/frontend/src/translations/es.json b/guacamole/src/main/frontend/src/translations/es.json index dcacb70678..b607d0b605 100644 --- a/guacamole/src/main/frontend/src/translations/es.json +++ b/guacamole/src/main/frontend/src/translations/es.json @@ -317,6 +317,7 @@ "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "Crear nuevos perfiles de compartir:", "FIELD_HEADER_PASSWORD" : "@:APP.FIELD_HEADER_PASSWORD", "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", + "FIELD_HEADER_USER_DISABLED" : "Inicio de sesión deshabilitado:", "FIELD_HEADER_USERNAME" : "Nombre de usuario:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", @@ -355,6 +356,7 @@ "FIELD_HEADER_CREATE_NEW_CONNECTIONS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTIONS", "FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS", "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_SHARING_PROFILES", + "FIELD_HEADER_USER_GROUP_DISABLED" : "Deshabilitado:", "FIELD_HEADER_USER_GROUP_NAME" : "Nombre del grupo:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", diff --git a/guacamole/src/main/frontend/src/translations/fr.json b/guacamole/src/main/frontend/src/translations/fr.json index d61b041f9b..f6477400d3 100644 --- a/guacamole/src/main/frontend/src/translations/fr.json +++ b/guacamole/src/main/frontend/src/translations/fr.json @@ -413,6 +413,7 @@ "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "Créer de nouveaux profils de partage:", "FIELD_HEADER_PASSWORD" : "@:APP.FIELD_HEADER_PASSWORD", "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", + "FIELD_HEADER_USER_DISABLED" : "Connexion désactivée:", "FIELD_HEADER_USERNAME" : "Identifiant:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", @@ -451,6 +452,7 @@ "FIELD_HEADER_CREATE_NEW_CONNECTIONS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTIONS", "FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS", "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_SHARING_PROFILES", + "FIELD_HEADER_USER_GROUP_DISABLED" : "Désactivé:", "FIELD_HEADER_USER_GROUP_NAME" : "Nom Groupe:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", diff --git a/guacamole/src/main/frontend/src/translations/ja.json b/guacamole/src/main/frontend/src/translations/ja.json index e4c2ad0c4b..2750d38fd8 100644 --- a/guacamole/src/main/frontend/src/translations/ja.json +++ b/guacamole/src/main/frontend/src/translations/ja.json @@ -282,6 +282,7 @@ "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "共有プロファイルの作成:", "FIELD_HEADER_PASSWORD" : "@:APP.FIELD_HEADER_PASSWORD", "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", + "FIELD_HEADER_USER_DISABLED" : "ログインの無効化:", "FIELD_HEADER_USERNAME" : "ユーザ名:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", @@ -320,6 +321,7 @@ "FIELD_HEADER_CREATE_NEW_CONNECTIONS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTIONS", "FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS", "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_SHARING_PROFILES", + "FIELD_HEADER_USER_GROUP_DISABLED" : "グループの無効化:", "FIELD_HEADER_USER_GROUP_NAME" : "グループ名:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", diff --git a/guacamole/src/main/frontend/src/translations/ko.json b/guacamole/src/main/frontend/src/translations/ko.json index 8b01d8559a..ac135e4405 100644 --- a/guacamole/src/main/frontend/src/translations/ko.json +++ b/guacamole/src/main/frontend/src/translations/ko.json @@ -314,6 +314,7 @@ "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "새로운 공유 프로파일 생성", "FIELD_HEADER_PASSWORD" : "@:APP.FIELD_HEADER_PASSWORD", "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", + "FIELD_HEADER_USER_DISABLED" : "로그인 비활성화:", "FIELD_HEADER_USERNAME" : "사용자 이름:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", @@ -351,6 +352,7 @@ "FIELD_HEADER_CREATE_NEW_USER_GROUPS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_USER_GROUPS", "FIELD_HEADER_CREATE_NEW_CONNECTIONS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTIONS", "FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS", + "FIELD_HEADER_USER_GROUP_DISABLED" : "비활성화:", "FIELD_HEADER_USER_GROUP_NAME" : "그룹 이름:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", diff --git a/guacamole/src/main/frontend/src/translations/pl.json b/guacamole/src/main/frontend/src/translations/pl.json index 6f999697b4..bda29e05e1 100644 --- a/guacamole/src/main/frontend/src/translations/pl.json +++ b/guacamole/src/main/frontend/src/translations/pl.json @@ -326,6 +326,7 @@ "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "Tworzenie nowych profili udostępniania:", "FIELD_HEADER_PASSWORD" : "@:APP.FIELD_HEADER_PASSWORD", "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", + "FIELD_HEADER_USER_DISABLED" : "Logowanie zablokowane:", "FIELD_HEADER_USERNAME" : "Nazwa użytkownika:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", @@ -364,6 +365,7 @@ "FIELD_HEADER_CREATE_NEW_CONNECTIONS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTIONS", "FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS", "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_SHARING_PROFILES", + "FIELD_HEADER_USER_DISABLED" : "Wyłączona:", "FIELD_HEADER_USER_GROUP_NAME" : "Nazwa grupy:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", diff --git a/guacamole/src/main/frontend/src/translations/pt.json b/guacamole/src/main/frontend/src/translations/pt.json index 9cebddf262..2cf9b4f205 100644 --- a/guacamole/src/main/frontend/src/translations/pt.json +++ b/guacamole/src/main/frontend/src/translations/pt.json @@ -318,6 +318,7 @@ "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "Criar novos perfis de compartilhamento:", "FIELD_HEADER_PASSWORD" : "@:APP.FIELD_HEADER_PASSWORD", "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", + "FIELD_HEADER_USER_DISABLED" : "Login desativado:", "FIELD_HEADER_USERNAME" : "Usuário:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", @@ -356,6 +357,7 @@ "FIELD_HEADER_CREATE_NEW_CONNECTIONS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTIONS", "FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS", "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_SHARING_PROFILES", + "FIELD_HEADER_USER_GROUP_DISABLED" : "Desativado:", "FIELD_HEADER_USER_GROUP_NAME" : "Nome do grupo:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", diff --git a/guacamole/src/main/frontend/src/translations/ru.json b/guacamole/src/main/frontend/src/translations/ru.json index 7243e94972..a086f73390 100644 --- a/guacamole/src/main/frontend/src/translations/ru.json +++ b/guacamole/src/main/frontend/src/translations/ru.json @@ -309,6 +309,7 @@ "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "Создание нового профиля расшаривания:", "FIELD_HEADER_PASSWORD" : "@:APP.FIELD_HEADER_PASSWORD", "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", + "FIELD_HEADER_USER_DISABLED" : "Аккаунт отключен:", "FIELD_HEADER_USERNAME" : "Имя пользователя:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", @@ -347,6 +348,7 @@ "FIELD_HEADER_CREATE_NEW_CONNECTIONS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTIONS", "FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS", "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_SHARING_PROFILES", + "FIELD_HEADER_USER_GROUP_DISABLED" : "Группа отключена:", "FIELD_HEADER_USER_GROUP_NAME" : "Название:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", diff --git a/guacamole/src/main/frontend/src/translations/zh.json b/guacamole/src/main/frontend/src/translations/zh.json index 72b7cb3842..76e9a2a810 100644 --- a/guacamole/src/main/frontend/src/translations/zh.json +++ b/guacamole/src/main/frontend/src/translations/zh.json @@ -406,6 +406,7 @@ "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "新建共享设定:", "FIELD_HEADER_PASSWORD" : "@:APP.FIELD_HEADER_PASSWORD", "FIELD_HEADER_PASSWORD_AGAIN" : "@:APP.FIELD_HEADER_PASSWORD_AGAIN", + "FIELD_HEADER_USER_DISABLED" : "已禁用登录:", "FIELD_HEADER_USERNAME" : "用户名:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", @@ -444,7 +445,8 @@ "FIELD_HEADER_CREATE_NEW_CONNECTIONS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTIONS", "FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS", "FIELD_HEADER_CREATE_NEW_SHARING_PROFILES" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_SHARING_PROFILES", - "FIELD_HEADER_USER_GROUP_NAME" : "用户组名称:", + "FIELD_HEADER_USER_GROUP_DISABLED" : "禁用:", + "FIELD_HEADER_USER_GROUP_NAME" : "用户组名称:", "FIELD_PLACEHOLDER_FILTER" : "@:APP.FIELD_PLACEHOLDER_FILTER", @@ -1130,4 +1132,4 @@ } -} \ No newline at end of file +} diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/user/APIUser.java b/guacamole/src/main/java/org/apache/guacamole/rest/user/APIUser.java index f018074b63..06f1de1593 100644 --- a/guacamole/src/main/java/org/apache/guacamole/rest/user/APIUser.java +++ b/guacamole/src/main/java/org/apache/guacamole/rest/user/APIUser.java @@ -43,6 +43,11 @@ public class APIUser { */ private String password; + /** + * Boolean value indicating whether or not this user account is disabled. + */ + private boolean disabled; + /** * Map of all associated attributes by attribute identifier. */ @@ -61,7 +66,9 @@ public APIUser() {} /** * Construct a new APIUser from the provided User. - * @param user The User to construct the APIUser from. + * + * @param user + * The User to construct the APIUser from. */ public APIUser(User user) { @@ -69,6 +76,7 @@ public APIUser(User user) { this.username = user.getIdentifier(); this.password = user.getPassword(); this.lastActive = user.getLastActive(); + this.disabled = user.isDisabled(); // Associate any attributes this.attributes = user.getAttributes(); @@ -77,7 +85,9 @@ public APIUser(User user) { /** * Returns the username for this user. - * @return The username for this user. + * + * @return + * The username for this user. */ public String getUsername() { return username; @@ -85,7 +95,9 @@ public String getUsername() { /** * Set the username for this user. - * @param username The username for this user. + * + * @param username + * The username for this user. */ public void setUsername(String username) { this.username = username; @@ -93,7 +105,9 @@ public void setUsername(String username) { /** * Returns the password for this user. - * @return The password for this user. + * + * @return + * The password for this user. */ public String getPassword() { return password; @@ -101,11 +115,34 @@ public String getPassword() { /** * Set the password for this user. - * @param password The password for this user. + * + * @param password + * The password for this user. */ public void setPassword(String password) { this.password = password; } + + /** + * Returns true if this user account is disabled, otherwise false. + * + * @return + * True if this user account is disabled, otherwise false. + */ + public boolean isDisabled() { + return disabled; + } + + /** + * Sets the disabled status of this user account, disabling the account + * if set to true. + * + * @param disabled + * True if this user account should be disabled. + */ + public void setDisabled(boolean disabled) { + this.disabled = disabled; + } /** * Returns a map of all attributes associated with this user. Each entry diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/user/APIUserWrapper.java b/guacamole/src/main/java/org/apache/guacamole/rest/user/APIUserWrapper.java index b086314f63..f48a9cf461 100644 --- a/guacamole/src/main/java/org/apache/guacamole/rest/user/APIUserWrapper.java +++ b/guacamole/src/main/java/org/apache/guacamole/rest/user/APIUserWrapper.java @@ -69,6 +69,16 @@ public String getPassword() { public void setPassword(String password) { apiUser.setPassword(password); } + + @Override + public boolean isDisabled() { + return apiUser.isDisabled(); + } + + @Override + public void setDisabled(boolean disabled) { + apiUser.setDisabled(disabled); + } @Override public Map getAttributes() { diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/user/UserObjectTranslator.java b/guacamole/src/main/java/org/apache/guacamole/rest/user/UserObjectTranslator.java index 8c63d72180..f1a595bf72 100644 --- a/guacamole/src/main/java/org/apache/guacamole/rest/user/UserObjectTranslator.java +++ b/guacamole/src/main/java/org/apache/guacamole/rest/user/UserObjectTranslator.java @@ -49,6 +49,9 @@ public void applyExternalChanges(User existingObject, // Do not update the user password if no password was provided if (object.getPassword() != null) existingObject.setPassword(object.getPassword()); + + // Update disabled status + existingObject.setDisabled(object.isDisabled()); // Update user attributes existingObject.setAttributes(object.getAttributes()); diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/usergroup/APIUserGroup.java b/guacamole/src/main/java/org/apache/guacamole/rest/usergroup/APIUserGroup.java index df4847bc99..547fb1fca4 100644 --- a/guacamole/src/main/java/org/apache/guacamole/rest/usergroup/APIUserGroup.java +++ b/guacamole/src/main/java/org/apache/guacamole/rest/usergroup/APIUserGroup.java @@ -36,6 +36,11 @@ public class APIUserGroup { * The identifier of this user group. */ private String identifier; + + /** + * Boolean value indicating if this UserGroup is disabled. + */ + private boolean disabled; /** * Map of all associated attributes by attribute identifier. @@ -55,6 +60,7 @@ public APIUserGroup() {} */ public APIUserGroup(UserGroup group) { this.identifier = group.getIdentifier(); + this.disabled = group.isDisabled(); this.attributes = group.getAttributes(); } @@ -79,6 +85,27 @@ public String getIdentifier() { public void setIdentifier(String identifier) { this.identifier = identifier; } + + /** + * Return true if this user group is disabled, otherwise false. + * + * @return + * True if this user group is disabled, otherwise false. + */ + public boolean isDisabled() { + return disabled; + } + + /** + * Sets whether or not this user group is disabled to the parameter + * provided. + * + * @param disabled + * True if the user group should be disabled, otherwise false. + */ + public void setDisabled(boolean disabled) { + this.disabled = disabled; + } /** * Returns a map of all attributes associated with this user group. Each diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/usergroup/APIUserGroupWrapper.java b/guacamole/src/main/java/org/apache/guacamole/rest/usergroup/APIUserGroupWrapper.java index 5dc6d7b0a9..c195e87d08 100644 --- a/guacamole/src/main/java/org/apache/guacamole/rest/usergroup/APIUserGroupWrapper.java +++ b/guacamole/src/main/java/org/apache/guacamole/rest/usergroup/APIUserGroupWrapper.java @@ -61,6 +61,16 @@ public String getIdentifier() { public void setIdentifier(String identifier) { apiUserGroup.setIdentifier(identifier); } + + @Override + public boolean isDisabled() { + return apiUserGroup.isDisabled(); + } + + @Override + public void setDisabled(boolean disabled) { + apiUserGroup.setDisabled(disabled); + } @Override public Map getAttributes() { diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/usergroup/UserGroupObjectTranslator.java b/guacamole/src/main/java/org/apache/guacamole/rest/usergroup/UserGroupObjectTranslator.java index 88000b0104..a947b8fd4e 100644 --- a/guacamole/src/main/java/org/apache/guacamole/rest/usergroup/UserGroupObjectTranslator.java +++ b/guacamole/src/main/java/org/apache/guacamole/rest/usergroup/UserGroupObjectTranslator.java @@ -47,6 +47,9 @@ public UserGroup toInternalObject(APIUserGroup object) public void applyExternalChanges(UserGroup existingObject, APIUserGroup object) throws GuacamoleException { + // Update disabled status + existingObject.setDisabled(object.isDisabled()); + // Update user attributes existingObject.setAttributes(object.getAttributes());