Skip to content
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

Sector Nord AG: Editing own extended agent preferences is not possible #580

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

jsinagowitz
Copy link
Contributor

Proposed change

Some agent preferences can only be edited by admins, e.g. PreferencesGroups###Comment.
To edit them you need to go to:
Admin -> Agents -> Choose an agent -> "Edit personal preferences for this agent" -> "Miscellaneous"

Since this commit there is a bug when editing the own "extended" preferences.

When clicking on "Edit personal preferences for this agent" the URL contains the UserID of the target user that should be edited: /znuny/index.pl?Action=AgentPreferences;EditUserID=1

If I am UserID 1 and want to edit UserID 1 the parameter is beeing removed after clicking on "Miscellaneous": /znuny/index.pl?Action=AgentPreferences;Subaction=Group;Group=Miscellaneous

If I edit another User, the URL contains the parameter correctly: /znuny/index.pl?Action=AgentPreferences;Subaction=Group;Group=Miscellaneous;EditUserID=2

If the parameter "EditUserID" is missing, not all agent preferences are shown, e.g. "Comment" is missing. So it is not possible to edit the comment preferences for the own user. You need to ask a different admin user or add the parameter "EditUserID" to the URL.

Type of change

  • '1 - 🐞 bug 🐞'

Additional information

I found out that the bug was built into Znuny 7 with this commit: a9dd66c

I have also tested changing the settings of another agent as an agent (not admin) by adding the parameter manually. However, this is correctly recognized and intercepted by Znuny, so that it is not possible to change other settings without permission.

Checklist

  • The code change is tested and works locally.(❗)
  • There is no commented out code in this PR.(❕)
  • You improved or added new unit tests.(❕)
  • Local ZnunyCodePolicy passed.(❕)
  • Local UnitTests / Selenium passed.(❕)
  • GitHub workflow CI (UnitTests / Selenium) passed.(❗)

Copy link
Contributor

@NiklasSchmitt NiklasSchmitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

removing the condition && $EditUserID != $Self->{UserID} would result in other issues while saving preferences for other agents and/or own preferences. This is not the right way to resolve the explained issue.

A better solution would be to have a deeper look into AgentPreferences and verify that GET-parameter EditUserID is always set to the following requests again when given.

Best regards,
Niklas

@NiklasSchmitt NiklasSchmitt added the 3 - wait for contributor Contributor, it's your turn. label Jul 11, 2024
@rkaldung
Copy link
Member

Is there a bug report for this?

@jsinagowitz
Copy link
Contributor Author

Hi,
I took another closer look at the problem and tested the functions thoroughly. I could not find any malfunction. The agent setting was always saved correctly. In addition, the agent settings already worked like this up to Znuny 6.4.

@jsinagowitz jsinagowitz changed the title Editing own extended agent preferences is not possible Sector Nord AG: Editing own extended agent preferences is not possible Jul 24, 2024
@dennykorsukewitz dennykorsukewitz removed the 3 - wait for contributor Contributor, it's your turn. label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants