mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Fix to disallow quotes in usernames (as per Group names)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2477 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -258,6 +258,7 @@ loggedout_details=You have been logged out of Alfresco.
|
|||||||
relogin=Re-login to Alfresco
|
relogin=Re-login to Alfresco
|
||||||
no_access=You have no access to Alfresco.
|
no_access=You have no access to Alfresco.
|
||||||
no_cookies=Cookies must be enabled in your browser for the Alfresco Web-Client to function correctly.
|
no_cookies=Cookies must be enabled in your browser for the Alfresco Web-Client to function correctly.
|
||||||
|
user_err_user_name=User ID cannot contain the characters: {0}
|
||||||
|
|
||||||
# Browse list messages
|
# Browse list messages
|
||||||
no_space_items=No items to display. Click the ''{0}'' action to create a space.
|
no_space_items=No items to display. Click the ''{0}'' action to create a space.
|
||||||
|
@@ -240,13 +240,19 @@ public class LoginBean
|
|||||||
public void validateUsername(FacesContext context, UIComponent component, Object value)
|
public void validateUsername(FacesContext context, UIComponent component, Object value)
|
||||||
throws ValidatorException
|
throws ValidatorException
|
||||||
{
|
{
|
||||||
String pass = (String) value;
|
String name = (String) value;
|
||||||
if (pass.length() < 3 || pass.length() > 32)
|
if (name.length() < 3 || name.length() > 32)
|
||||||
{
|
{
|
||||||
String err = MessageFormat.format(Application.getMessage(context, MSG_USERNAME_LENGTH),
|
String err = MessageFormat.format(Application.getMessage(context, MSG_USERNAME_LENGTH),
|
||||||
new Object[]{3, 32});
|
new Object[]{3, 32});
|
||||||
throw new ValidatorException(new FacesMessage(err));
|
throw new ValidatorException(new FacesMessage(err));
|
||||||
}
|
}
|
||||||
|
if (name.indexOf('\'') != -1 || name.indexOf('"') != -1 || name.indexOf('\\') != -1)
|
||||||
|
{
|
||||||
|
String err = MessageFormat.format(Application.getMessage(context, MSG_USER_ERR),
|
||||||
|
new Object[]{"', \", \\"});
|
||||||
|
throw new ValidatorException(new FacesMessage(err));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -397,6 +403,7 @@ public class LoginBean
|
|||||||
private static final String MSG_USERNAME_LENGTH = "login_err_username_length";
|
private static final String MSG_USERNAME_LENGTH = "login_err_username_length";
|
||||||
private static final String MSG_PASSWORD_CHARS = "login_err_password_chars";
|
private static final String MSG_PASSWORD_CHARS = "login_err_password_chars";
|
||||||
private static final String MSG_PASSWORD_LENGTH = "login_err_password_length";
|
private static final String MSG_PASSWORD_LENGTH = "login_err_password_length";
|
||||||
|
private static final String MSG_USER_ERR = "user_err_user_name";
|
||||||
|
|
||||||
public static final String LOGIN_REDIRECT_KEY = "_alfRedirect";
|
public static final String LOGIN_REDIRECT_KEY = "_alfRedirect";
|
||||||
public static final String LOGIN_EXTERNAL_AUTH= "_alfExternalAuth";
|
public static final String LOGIN_EXTERNAL_AUTH= "_alfExternalAuth";
|
||||||
|
@@ -186,7 +186,7 @@
|
|||||||
</a:panel>
|
</a:panel>
|
||||||
|
|
||||||
<td class="separator" width=1></td>
|
<td class="separator" width=1></td>
|
||||||
<td width=110 valign=middle>
|
<td width=118 valign=middle>
|
||||||
<%-- View mode settings --%>
|
<%-- View mode settings --%>
|
||||||
<a:modeList itemSpacing="4" iconColumnWidth="20" selectedStyleClass="statusListHighlight" disabledStyleClass="statusListDisabled" selectedImage="/images/icons/Details.gif"
|
<a:modeList itemSpacing="4" iconColumnWidth="20" selectedStyleClass="statusListHighlight" disabledStyleClass="statusListDisabled" selectedImage="/images/icons/Details.gif"
|
||||||
value="#{BrowseBean.browseViewMode}" actionListener="#{BrowseBean.viewModeChanged}" menu="true" menuImage="/images/icons/menu.gif" styleClass="moreActionsMenu">
|
value="#{BrowseBean.browseViewMode}" actionListener="#{BrowseBean.viewModeChanged}" menu="true" menuImage="/images/icons/menu.gif" styleClass="moreActionsMenu">
|
||||||
|
Reference in New Issue
Block a user