Skip to content

Conversation

@tecpromotion
Copy link
Contributor

Summary of Changes

In the User Actions Log extension, the user is always used in the output. The exception is the log entries related to the cache. Here, the user name is always used instead of the user.

With the change now value username is used instead of value name.

Testing Instructions

Create a new user with
name = Super User
and
username = test

Expected result

User test deleted cache group all

Actual result

User Super User deleted cache group all

Documentation Changes Required

--

@brianteeman
Copy link
Contributor

Also see #24862

@degobbis
Copy link
Contributor

I have tested this item ✅ successfully on c3f1500

thx


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24992.

@alikon
Copy link
Contributor

alikon commented Jun 22, 2019

I have tested this item ✅ successfully on c3f1500


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24992.

@zero-24 zero-24 added this to the Joomla 3.9.9 milestone Jun 22, 2019
@zero-24 zero-24 merged commit 4127c01 into joomla:staging Jun 22, 2019
@zero-24
Copy link
Contributor

zero-24 commented Jun 22, 2019

Merging thanks.

@infograf768
Copy link
Member

The filter by user is still using name and not username
This PR implies changes to the logcreator field.

Without a modification here I get
Screen Shot 2019-06-22 at 09 16 48

Issue solved if modifying the query to use username and not name

// Construct the query
			$query = $db->getQuery(true)
				->select($db->quoteName('u.id', 'value'))
				->select($db->quoteName('u.username', 'text'))
				->from($db->quoteName('#__users', 'u'))
				->join('INNER', $db->quoteName('#__action_logs', 'c') . ' ON ' . $db->quoteName('c.user_id') . ' = ' . $db->quoteName('u.id'))
				->group($db->quoteName('u.id'))
				->group($db->quoteName('u.username'))
				->order($db->quoteName('u.username'));

@zero-24
Copy link
Contributor

zero-24 commented Jun 22, 2019

@infograf768 can you send the required changes as PR?

@infograf768
Copy link
Member

TBH, I am not sure about the whole thing
Yes, what is logged should be consistent BUT imho it should be the name and not the username displayed in the logs.
The reason is that the username is also the Login Name and this could be a security breach.
What do you think?

@infograf768
Copy link
Member

This means that we have to do the reverse of that PR, i.e. use ->name everywhere and keep the filter as is.

@degobbis
Copy link
Contributor

I do not see a security breach here. If you can see the action logs, then you can also access the users component and see the usernames. The improvement is that the username is unique and therefore faster to allocate.

@infograf768
Copy link
Member

You are right that the name is not unique indeed (which is weird btw...).

Note: it is always the Name which is displayed in the Managers and Created by field (and its modal), which imho demonstrates that we should make the Name unique too...

@degobbis
Copy link
Contributor

I don't think the name should be unique.
For a clear identification we already have 2 values, username and e-mail address. That's enough, or not?

But if it causes such far-reaching changes, is it perhaps sufficient to write the username in parentheses after the names in the output?
What do you all mean?

infograf768 added a commit to infograf768/joomla-cms that referenced this pull request Jun 22, 2019
@infograf768
Copy link
Member

Please test
#25291

Going further would need more important changes and should imho be reserved to J4.

@infograf768
Copy link
Member

BTW, why keep using ->name in onUserAfterRemind($user)
It is not consistent imho.

@HLeithner
Copy link
Member

username is unique, the name isn't. so imo it's better to use username

@brianteeman
Copy link
Contributor

we must not make "name" unique. That would be terribly restrictive. Even with my almost unique family name there are two "brian teeman"

@HLeithner
Copy link
Member

thats the reason that we stay with username instead using name.

@infograf768
Copy link
Member

Understood that. Tks.

@tecpromotion tecpromotion deleted the tecpromotion-correct-username_plg-actionlog branch December 29, 2019 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants