bacon / baconuser Goto Github PK
View Code? Open in Web Editor NEWBaconUser provides simple user management
License: BSD 2-Clause "Simplified" License
BaconUser provides simple user management
License: BSD 2-Clause "Simplified" License
Hi,
I can see the use of the username property (even if it's not used, it's often useful it tons of projects). However, I'd be for removing the displayName property. Most of the time, people use "firstName" and "lastName" (I already had a display name in some clients websites that ended being simply a free input where people would enter first name and last name, but it's just a hell to normalize then). I think most of the time this property will be disabled in favor of first name and last name, so I'd say maybe we could remove it (so less nullable inputs).
I was looking over the code and noticed that the registration form factory is defined in the form element manager configuration:
https://github.com/Bacon/BaconUser/blob/master/config/module.config.php#L40
However, the form registration service attempts to get the form from the service manager: https://github.com/Bacon/BaconUser/blob/master/src/BaconUser/Service/Factory/RegistrationServiceFactory.php#L31
There is no 'BaconUser\Form\RegistrationForm' key in the service manager configuration. I'm sure the form should be instantiated by the form element manager:
Like so:
$serviceLocator->get('FormElementManager')->get('BaconUser\Form\RegistrationForm')
I could be wrong and haven't tested anything, merely an observation.
Here : https://github.com/Bacon/BaconUser/blob/master/config/doctrine/BaconUser.Entity.User.dcm.xml#L9
You are changing the column name of the primary key (from id to user_id). I'd suggest NOT to change the default name for identifier because Doctrine make assumptions about this name when using those entities in associations (and User one is often used !). As a consequence, we need to add a @joincolumn and change the referencedColumn attribute whenever we have an association to a user, which is not intuitive and very annoying.
I had this problem in ZfcUserDoctrine too, and I'd like not to have it here. We should favor the default usage here.
Currently, tests is mostly done with mocks. This is good, but as a consequence there were plenty of issues that could have been detected by testing directly the code instead of mocking everything.
For example, we should reuse the default config provided by the module, and use it to test them.
Currently BaconUser uses form. However, forms are not reusable while fieldset are. This means that if someone want to have another form with a user, he has to duplicate all the fields.
We need to change that so we have a UserFieldset instead, and multiple forms (RegistrationForm, LoginForm…) that reuse the fieldset, and set the validation group accordingly.
Here: https://github.com/Bacon/BaconUser/blob/master/src/BaconUser/Service/RegistrationService.php#L27
The registration service is tied to a form. I think it's not responsability of the service to do that. The RegistrationService should only receive data considered as valid. When using REST we mostly don't use form but only input filter.
Furthermore, because the form is in the registration form itself, there is no way to retrieve it to show errors.
What do oyu think @Ocramius?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.