Username come chiave

17 Sep '11, 03:45 PM
No Forum Badges

Ciao a tutti, ho cominciato a eseguire i tutorial presenti nella wiki di webratio, in particolare quelli relativi al sistema di login/moduli protetti. L'applicazione funziona alla perfezione ma mi rimane un grosso dubbio sul modello e-r, la chiave infatti è posta sull'id e non sull'username, come faccio quindi a impedire che due utenti si registrino con le stesse credenziali? posso modificare il modello o devo inserire un controllo successivo?

x 0
Answer Answer at this question and get points!
Forum Expert - Level 8

Ciao, il modello E-R relativo alle entità User, Group e Module può essere modificato aggiungendo attributi alle entità ma non cancellando o modificando quelli esistenti. La chiave dell'utente, quindi, non può essere modificata.

Per evitare che due utenti si registrino con lo stesso username devi inserire un controllo applicativo sulla form di registrazione. Puoi aggiungere una Validation Rule di tipo "Collection" al campo username e poi selezionare nel Properties View "User" come Entity e "username" come Attribute. A questo punto scegliendo come Predicate l'opzione "Not in Collection" e abilitando l'opzione Ignore Case l'utente non potrà registrarsi con uno username già esistente.

"Hi everybody, I just started to do the WebRatio tutorial written on the wiki. In particular I did the ones related to the login and protected modules. The Web application works properly but I have a doubt on the E-R model. The key of the User entity is placed on the ID attribute and not on the username one. How can I avoid that two users register using the same credentials? Can I change the E-R model or should I insert a check somewhere?"

Hi, the User, Group and Module E-R model can be modified adding new attributes on entities, but it's not possible to change or remove the existing ones. So, the User key can not be changed.

To avoid that two user register using the same username you must add a control on the registration form. You can add a "Collection" Validation Rule on the username field and then choose "User" as Entity and "username" as Attribute in the Properties View. Finally, you should choose "Not in Collection" as Predicate and you can enable the Ignore Case option. In this way you are sure that a user can not register using an existing username.

x 1
Answer at this question and get points!

Related questions

502 proxy error-generate and run Adding and deleting from the database Agregar boton de cambio de contraseña en el login Alimentar graficas con base de datos API documentation? Atributos Condicionales heredados Attribute comparison in a selector unit [beginner] - How to store and browse data collected with BPM app? Business object data Cancellare campi e tabelle dal database Cannot add a Database in the Domain Model Cannot connect to MySQL Cannot insert an entity in the database Cannot invoke method selectSingleNode() on null object Can't generate and run database or start tomcat server! Change uplod directory and protect anauthorized access to files Como mostrar una imagen en una lista o en la componente detalles? Como recuperar todos los atributos de una relacion N:N y insertar registros? Conexion a Oracle 12g Connection refused. connect to Cloud Convert data in a Calculated attribute Convert selector component result to single value Creación DB Apache Derby - Modelado BPMN Criptare dati sensibili nel database Database connection, Host and Port number Database password encrypting Database properties Database resource consumption Database Tables Creation After Remote Deploy DB in Data Service Project Deploy in Cloud Amazon Beanstalk with Postgres Description: Unknown tag 'wr:LinkResource' Dynamic data type Empty record mistakenly saved Error updating metadata process EverLasting error "The TCP/IP connection to the host has failed. Connection refused" Execute truncate sql query file analysis then update MySQL database Find Model Problemas Foriegn key relationship Generate and run locally on webratio professional edition. getting data from database Groovy and Database Guardar Saltos de LINEA Hide a form if condition if true How can I import a view in the Domain Model as an attribute of an Entity? How database or datamodel migration? How I can receive the primary key value after adding into database from OK Port. How to block empty string in Database How to disble derby database? How to fix Network error(status 0) How to show certain values derived from relations in the domain model? I can't run any application with WebRatio (Table/View 'APP.POST' does not exist) Image in List field Insert data into database Is it possible to create a derived relationship between databases? JDBC4 Postgresql Driver JDBC connection with mysql on mac Job not start correctly Mapping database of the entity '...' is unspecified [MOBILE] Can't synchronize domain model with beck end DB Mostrar datos de diferentes tablas/ show dates from diferentes entities MS SQL server jdbc file multi selections field problem MySQL Driver jdbc No Apache Derby driver found No Database on Cloud account No database on my cloud account Passing JSON Object to Model Personalizzare lo stile di un progetto PostgreSQL Predefined values in database Primefaces Problem accessing MySQL with WebRatio 6 Problema Grafo da una lista gerarchica Problema ¨HTTP Status 404" Problemas con el Operations View Delete Problemas desde que actualicé webratio Problem saving multi selection from input Problems to connect Sql Server DB from Webratio Problems with Database Metadata Problem with fields with accents used in attribute condition Problem with query unit! Problem with stored procedure Problem with the deletion of more than 50.000 records in a table publish web service for storing information in PostgreSQL DB following XSD Resource query a database Refresh and Synchronize DB Problems Relaciones Removing the User-Group-Module tagles Retrieve a value and add some value to it reverse engineering, problema con le relazioni di default Script Unit e Mysql Share database connection Solve "Generation Error" with Generate and Run option Statistics Component for WebRatio > 7.2.0 Status ProcessInstance and activityInstance in spanish Sybase JConnect 4 JAR replace Sync DataService Project with Mobile Project Table 'freeapp43.profesion' doesn't exist Tarea de servicio no me evalua el valor Trying to Synchronize Domain Model Unable to execute the script java.lang.NullPointerException Unknow property on Dynaclass after generation Unspecified BPM Engine Database Update mutiple records with the same value upload file and the move it to other location User Login Timestamp Using own User and Group tables Web ratio data model WebRatio - list results of joined tables Web Ratio Mobile and Foreign Key Web Ratio Mobile - Remote data mapping problem WebRatio no imports all attributes (fields) of a table Where is the ACME demo data stored?! which of these three models is closer to webratio/ifml way of creating web applications White report