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
LDAP auth: get user information to fill full name and/or address #973
Comments
Great, idea, you would need to extend this to the user_auth_domains table too. We would welcome a pull request from you of course. |
I see you are working on a pull. That's great. If you need assistance figuring anything out, just comment here. |
You lost me! And I need a little help, with my modification on global_setting, the 2 new fields are displayed all the time, but it should be only when you select ldap as authentication method, can you give me some hint how the optional display is done ? |
My bad. It's 'user_domains_ldap'. That table replicates the settings in the settings table as columns. So, if I read your thread correctly, you will need two new columns, one for the email CN, and the other for the full name CN. I would call the columns just as you see them: cn_email Make them a varchar(20) or so, with a default of ''. You will need an update script in the install/updates directory. That's pretty strait forward, and you will also need to update cacti.sql. In user_domains.php, you will need to add the two columns as 'textbox' form elements, and finally, modify the sql_save() to include them. In the lib/ldap. There is a function (for legacy), and the class. You will have to update both. It's a great little project to kind of familiarize yourself with the user interface. Lastly, please create your pull request against feature-1.2 branch and not the develop branch. Thanks! |
The rest of the plan looks pretty good. I will review you work. So, no worries. |
So I finish to write the code, but still one minor problem, on the authentication page, I'm unable to display my 2 new fileds only when selecting LDAP as authentication method, it's always there. |
Post a screen shot of what you see now, and then if you would mock it up using paint, then I'll explain what to do. |
authentication with CN fields.docx The 3 last fields |
So, the display is all done using jQuery. Why don't you create the pull request against feature-1.2 branch, and then I'll do the visibility settings. |
It's pretty simple though. Say you have a text field called "cn_email", you can do |
Ok I find it, I new it was simple, but where unable to find where. I did the pull request, have fun ! |
I just had a few comments as did Kevin. Keep up the good work. There are just a few updates for you. |
Resolved. Will be a part of the 1.2 release. |
I did some whitespace cleanup. You should setup your vim sessions to use a tab stop of 4 characters:
|
I suggest to enhanced the LDAP authentication to be able to have 2 fields that allow to fill the full username and the email address, based on LDAP fields.
I have the code to change that, it touch:
include/global_settings.php (2 mores files when selecting LDAP auth, to have the CN for full username and email)
lib/auth.php (change the user copy function to add the email address update)
lib/ldap.php (add a function ldap_search_fileds to find the 2 news fields)
auth_login.php (add the rule to ask the fileds whend auto create a new user)
The text was updated successfully, but these errors were encountered: