Skip to content

When using User Domains, global template user is used instead of the configured domain template user #3240

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

Closed
arno-st opened this issue Feb 6, 2020 · 5 comments
Assignees
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@arno-st
Copy link
Contributor

arno-st commented Feb 6, 2020

when multiple LDAP authentication are created, and group is mandatory, the code copy the default user template, not the one define into the 'User Domain' settings.

on Cacti 1.2.8
Looking into the code I think the error is on auth_login.php, line 505 and following:
If it's the first time the user login in, we go enter the IF function
on Line 500 we where able to qet the right 'template_user' from the 'User Domain' definition.
But on line 509 it make a query on the DB using the get_template_account() function (taken from functions.php line 2358) and this one look into the setting, so the simple LDAP auth. This record is not even visible on Cacti GUI when selecting multip LDAP auth.

Changing the line 512: array(get_template_account()));
to : array($template_user));

I think It will fix the problem!

@arno-st
Copy link
Contributor Author

arno-st commented Feb 6, 2020

On cacti 1.3-dev it's on line 411

@netniV
Copy link
Member

netniV commented Feb 6, 2020

I think 1.3 did get a bit of a rejig on the auth code to make it more streamlined/efficient. However, I would need to examine that properly before I decide to make modifications again because of its compound effect.

@netniV netniV self-assigned this Feb 6, 2020
@netniV
Copy link
Member

netniV commented Feb 6, 2020

@netniV
Copy link
Member

netniV commented Feb 22, 2020

So I've reviewed what you have stated and I do agree with you. If you have used multi domain auth, the template user isn't being picked from the domain record but from the settings table which really only appears to simple auth or cacti auth.

There also isn't an option on the domain record to say, use the global setting so you have it only set in one place but that would be an enhancement and no ones actually asked for that yet.

@netniV netniV changed the title Wrong user template on multiple LDAP login access When using User Domains, global template user is used instead of the configured domain template user Feb 22, 2020
netniV added a commit that referenced this issue Feb 22, 2020
@netniV netniV added auth bug Undesired behaviour resolved A fixed issue labels Feb 22, 2020
@netniV netniV added this to the 1.2.10 milestone Feb 22, 2020
@netniV
Copy link
Member

netniV commented Feb 22, 2020

I have made that change and pushed it up so it should be resolved now.

@netniV netniV closed this as completed Feb 22, 2020
netniV added a commit that referenced this issue Feb 22, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

2 participants