mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUAC-1176: Generalize form fields by removing the value property. Add type-specific convenience classes for each field.
This commit is contained in:
@@ -37,6 +37,7 @@ import org.glyptodon.guacamole.auth.jdbc.activeconnection.ActiveConnectionPermis
|
||||
import org.glyptodon.guacamole.auth.jdbc.permission.ConnectionGroupPermissionService;
|
||||
import org.glyptodon.guacamole.auth.jdbc.permission.ConnectionPermissionService;
|
||||
import org.glyptodon.guacamole.auth.jdbc.permission.UserPermissionService;
|
||||
import org.glyptodon.guacamole.form.BooleanField;
|
||||
import org.glyptodon.guacamole.form.Field;
|
||||
import org.glyptodon.guacamole.form.Form;
|
||||
import org.glyptodon.guacamole.net.auth.User;
|
||||
@@ -68,9 +69,9 @@ public class ModeledUser extends ModeledDirectoryObject<UserModel> implements Us
|
||||
* All attributes related to restricting user accounts, within a logical
|
||||
* form.
|
||||
*/
|
||||
public static final Form ACCOUNT_RESTRICTIONS = new Form("restrictions", "Account Restrictions", Arrays.asList(
|
||||
new Field(DISABLED_ATTRIBUTE_NAME, "Disabled", "true"),
|
||||
new Field(EXPIRED_ATTRIBUTE_NAME, "Password expired", "true")
|
||||
public static final Form ACCOUNT_RESTRICTIONS = new Form("restrictions", "Account Restrictions", Arrays.<Field>asList(
|
||||
new BooleanField(DISABLED_ATTRIBUTE_NAME, "Disabled", "true"),
|
||||
new BooleanField(EXPIRED_ATTRIBUTE_NAME, "Password expired", "true")
|
||||
));
|
||||
|
||||
/**
|
||||
|
@@ -39,6 +39,7 @@ import org.glyptodon.guacamole.auth.jdbc.permission.ObjectPermissionModel;
|
||||
import org.glyptodon.guacamole.auth.jdbc.permission.UserPermissionMapper;
|
||||
import org.glyptodon.guacamole.auth.jdbc.security.PasswordEncryptionService;
|
||||
import org.glyptodon.guacamole.form.Field;
|
||||
import org.glyptodon.guacamole.form.PasswordField;
|
||||
import org.glyptodon.guacamole.net.auth.User;
|
||||
import org.glyptodon.guacamole.net.auth.credentials.CredentialsInfo;
|
||||
import org.glyptodon.guacamole.net.auth.credentials.GuacamoleInsufficientCredentialsException;
|
||||
@@ -81,7 +82,7 @@ public class UserService extends ModeledDirectoryObjectService<ModeledUser, User
|
||||
* The password field to provide the user when their password is expired
|
||||
* and must be changed.
|
||||
*/
|
||||
private static final Field NEW_PASSWORD = new Field(NEW_PASSWORD_PARAMETER, "New password", Field.Type.PASSWORD);
|
||||
private static final Field NEW_PASSWORD = new PasswordField(NEW_PASSWORD_PARAMETER, "New password");
|
||||
|
||||
/**
|
||||
* The name of the HTTP password confirmation parameter to expect if the
|
||||
@@ -93,7 +94,7 @@ public class UserService extends ModeledDirectoryObjectService<ModeledUser, User
|
||||
* The password confirmation field to provide the user when their password
|
||||
* is expired and must be changed.
|
||||
*/
|
||||
private static final Field CONFIRM_NEW_PASSWORD = new Field(CONFIRM_NEW_PASSWORD_PARAMETER, "Confirm new password", Field.Type.PASSWORD);
|
||||
private static final Field CONFIRM_NEW_PASSWORD = new PasswordField(CONFIRM_NEW_PASSWORD_PARAMETER, "Confirm new password");
|
||||
|
||||
/**
|
||||
* Information describing the expected credentials if a user's password is
|
||||
|
Reference in New Issue
Block a user