-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] Feature: Adding User(s) Model + View to front-end #25030
Conversation
…dding-user-model-to-front-end
Thanks for your corrections @brianteeman |
I think the reason why this views are missing is security related. What is your use case? |
I understand your concerns. We have to double, triple, check that the views can only be used if they are made available on purpose, via a Menu Item. So you won't just make a list of users available on you sites front-end:
Use cases
|
for me allow user admin in front is realy great addition !!! |
JFYI to not repeat all arguments: #21441 |
@pe7er and I discussed that PR during jday nl and this is very different. It is not hardcoded to be connected to com_contacts. It doesn't duplicate existing functionality and it actually works and is testable |
@@ -0,0 +1,83 @@ | |||
<?xml version="1.0" encoding="utf-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use tabs and not spaces to indent in this file.
@@ -136,3 +136,9 @@ COM_USERS_USER_FIELD_HELPSITE_LABEL="Help Site" | |||
COM_USERS_USER_FIELD_TIMEZONE_LABEL="Time Zone" | |||
COM_USERS_USER_NOT_FOUND="User not found." | |||
COM_USERS_USER_SAVE_FAILED="Failed to save user: %s" | |||
COM_USERS_USERS_LASTVISIT="Last Vistited" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COM_USERS_USERS_LASTVISIT="Last Vistited" | |
COM_USERS_USERS_LASTVISIT="Last Visited" |
COM_USERS_USERS_VIEW_DEFAULT_DESC="Shows a List of Users" | ||
COM_USERS_USERS_VIEW_DEFAULT_TITLE="Users" | ||
COM_USERS_USERS_GROUP_VIEW_DEFAULT="List Users" | ||
COM_USERS_USERS_GROUP_VIEW_DEFAULT_DESC="Displays a list of Users of a Group." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COM_USERS_USERS_GROUP_VIEW_DEFAULT_DESC="Displays a list of Users of a Group." | |
COM_USERS_USERS_GROUP_VIEW_DEFAULT_DESC="Displays a list of Users from a Group." |
name="show_last_visited" | ||
type="list" | ||
label="COM_USERS_PARAMS_SHOW_LAST_VISITED" | ||
useglobal="true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cant see anywhere that you can set a global nor can I see a real need for one so just delete this line
Well right now it seems that this PR lacks the basic template functionallity that displays the user information. Profile fields and User custom fields. It's a bit barebones right now if clicking on an user shows nothing but just its name. |
Not true, you can use the username, the username is unique |
This hasn't been discussed either way as far as I know. It's something that came up in my London User Group like this but with custom fields etc. Tbh I wouldn't prioritise this right now. It's not something we are going to have in 4.0 at this stage as we're focussed on the beta blockers. Until a 4.1 branch is set up where this would probably be a viable feature there's not a huge amount of point in focussing on this. |
I have some GDPR concerns when a registered user can't block the display of its data in front-end. Whatever it is. |
Does this show user articles? |
Why? The user data is already available in the website and visible in the back-end. |
No, my previous PR did have that option: #24799 |
What is missing is a unique user alias (#__users change, router change, method to create unique alias based on username / name / ???) that needs to be added to the user table. the alias is needed for creating unique url's. Without this, this will technical work but not from a user / seo perspective. |
Maybe not for right now but that's the main thing I see missing from Joomla! if you want to create a blog. That's the main purpose I see for this pull request. And decoupling com_contact makes it more user friendly. |
Again, offering a PR that displays an empty profile unless people create a template override is not useful. At that point users would not creating a template Also again, this regarding the SEO usernames:
|
I do not agree with that. The purpose of this PR is to make the User Model available in the front-end. Currently you can only display a list of users or display a single user using a non-core component. When this PR is added to the Joomla core, the User Model can be used in the front-end and then other functionality can be added on top of that (e.g. a list of articles written by that user). First with using a template override. Or we can extend the functionality with a new PR later. |
until a user put's in an email address as username: get ready for the trolls :) so there should definitely be some conversions. Also all com_users back-end views should be adjusted to make the alias possible / editable |
For the username to be used as an alias it would need to be sanitised by using the same functionality we already have for this. |
@pe7er Any interest in fixing the conflicts and picking this up or should the PR be closed? |
@roland-d The branch is deleted so I assume he is no longer interested. |
That sucks. Can somebody else pick it up? |
@Quy Thanks for that, I missed the deleted branch. In that case I will close this pull request and if someone else is interested they can pick this up in a new pull request. |
Nobody will ever see or notice this again if the pull request gets closed. @roland-d |
@AndySDH We cannot keep PR's open forever. This PR being buried at page 1234 is not noticeable either. If we ever get to the point where we have a plan of what should be in which release, we could make a "job board" with features for people to work on. |
@roland-d @Quy @AndySDH I had git-out-of-sync issues with my local installation + my Joomla-CMS fork. I have not updated my PR because of all the discussions in this PR I have a feeling it is not wanted. If there's demand for my feature and there is more possibility that it will get merged, then I am willing to redo it. |
Well if it won't be merged in 4.0, it would definitely come in 4.1, it's a great feature for sure! |
I would love to see this in the core. |
Too bad about the energy, you are already a long way towards realization. |
Pull Request to add a new Model + View for Users/User to the front-end.
Note: this PR is an improved version of #24799
It has been decoupled from Articles (the previous version showed (the number) of articles that a User had created).
Summary of Changes
The front-end does not have a model + view to display a list of Users.
You cannot use the back-end model of com_users in the front-end because that model has some authentication so that you cannot get data from the Users table if you are not logged in.
This PR adds a Front-end View + Model for Users and User.
The view can be added to the Front-end by creating a new menu item type "Users > List Users".
The Users View supports Custom Fields.
Testing Instructions
Create some Users that you assign to some User Group (e.g. Author and Editor).
In Menus > Main Menu, create a New Menu Item of type "Users > List Users"
Under the "Users View" tab, configure what the new menu item should display:
Expected result
The Front-end should have a new View that displays a list of Users.
You should be able to navigate the list.
If you select a User, you should see the User page with currently only the name of the user:
The User View supports Custom Fields that have been added to the User.
For the moment you can display all other Fields (besides the Name it already displays) + Custom Fields them by creating a Template Override.