max username length is 32 everywhere
This commit is contained in:
parent
69c0882228
commit
4671cbc996
@ -43,7 +43,7 @@ public abstract class DatabaseUser extends AbstractEntity implements Serializabl
|
|||||||
@Column(name = "dbuser_id", columnDefinition = "integer", updatable=false, insertable=false)
|
@Column(name = "dbuser_id", columnDefinition = "integer", updatable=false, insertable=false)
|
||||||
private long id;
|
private long id;
|
||||||
|
|
||||||
@AnnFieldIO(validation="[a-z0-9]{5}_[a-z0-9_]{1,}", rw=ReadWriteAccess.WRITEONCE)
|
@AnnFieldIO(validation="[a-z0-9]{5}_[a-z0-9_]{1,26}", rw=ReadWriteAccess.WRITEONCE)
|
||||||
@Column(name = "name", columnDefinition = "character varying(64)", updatable=false)
|
@Column(name = "name", columnDefinition = "character varying(64)", updatable=false)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@ -26,9 +26,6 @@ public class MySqlUserModuleImpl extends AbstractModuleImpl {
|
|||||||
if (name.length() < 7 || name.charAt(5) != '_') {
|
if (name.length() < 7 || name.charAt(5) != '_') {
|
||||||
throw new AuthorisationException(loginUser, "add", newEntity);
|
throw new AuthorisationException(loginUser, "add", newEntity);
|
||||||
}
|
}
|
||||||
if (name.length() > 16) {
|
|
||||||
throw new HSAdminException("mysql database name max. length is 16 characters");
|
|
||||||
}
|
|
||||||
EntityManager em = getTransaction().getEntityManager();
|
EntityManager em = getTransaction().getEntityManager();
|
||||||
Query qPac = em.createQuery("SELECT obj FROM Pacs obj WHERE obj.name = :pacName");
|
Query qPac = em.createQuery("SELECT obj FROM Pacs obj WHERE obj.name = :pacName");
|
||||||
qPac.setParameter("pacName", name.substring(0, 5));
|
qPac.setParameter("pacName", name.substring(0, 5));
|
||||||
|
@ -40,7 +40,7 @@ public class UnixUser extends AbstractEntity implements Serializable {
|
|||||||
@Column(name="userid", columnDefinition="integer", nullable=false, updatable=false)
|
@Column(name="userid", columnDefinition="integer", nullable=false, updatable=false)
|
||||||
private long userId;
|
private long userId;
|
||||||
|
|
||||||
@AnnFieldIO(validation="[a-z0-9]{5}(-[a-z0-9\\.\\_]{1,})?", rw=ReadWriteAccess.WRITEONCE)
|
@AnnFieldIO(validation="[a-z0-9]{5}(-[a-z0-9\\.\\_]{1,26})?", rw=ReadWriteAccess.WRITEONCE)
|
||||||
@Column(name="name", columnDefinition = "character varying(64)", unique=true, updatable=false)
|
@Column(name="name", columnDefinition = "character varying(64)", unique=true, updatable=false)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user