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

net/freeradius: Add more attributes to users and remove radiusd.conf #313

Merged
merged 23 commits into from
Oct 11, 2017
Merged

net/freeradius: Add more attributes to users and remove radiusd.conf #313

merged 23 commits into from
Oct 11, 2017

Conversation

mimugmail
Copy link
Member

What I want to achieve is:

I asked fraenki but he didn't really remembers what all the JS magic is actually doing :)

If it's not possible or your time too limited I would pack everything too specific in <advanced> so the dialog is not overloaded with many input fields.

Thanks for any hints! :)

@mimugmail
Copy link
Member Author

@AdSchellevis Did you have the time to look at this? If not I'd like to move everything beside standard to <advanced> cause I don't like hacky solutions I dont understand myself :)

@AdSchellevis
Copy link
Member

@mimugmail I was some days away, haven't seen the question. The JS stuff should be quite simple, I can do it for you if the rest of the code is in the master branch and I know what to show/hide.

The "magic" in the JS code lies in hooking the "onShow" event from the dialog and handling the hidden fields from there. But if the rest of the code is finished and this can be pulled I don't mind adding it for you.

@mimugmail mimugmail changed the title net/freeradius: [WIP] Add more attributes to users and remove radiusd.conf net/freeradius: Add more attributes to users and remove radiusd.conf Oct 9, 2017
@mimugmail
Copy link
Member Author

@fichtner Please review
@AdSchellevis Thanks for your offer! I renamed some fields get a logic:

When field in general is enabled (e.g general.wispr) then show every field in user with _ (e.g. user.wispr_XXX).
I did this also with chillispot and it would pretty scale.

@AdSchellevis
Copy link
Member

@mimugmail ok, sounds good, can you open an issue when this code is in for me? (just to make sure I won't forget)

@fichtner
Copy link
Member

fichtner commented Oct 9, 2017

LGTM, but assigned to @AdSchellevis for follow-up core thingy

@mimugmail
Copy link
Member Author

@AdSchellevis please merge, very exited how you solve this one :)

@AdSchellevis AdSchellevis merged commit 3e062a6 into opnsense:master Oct 11, 2017
@AdSchellevis
Copy link
Member

@mimugmail this should do the trick 6105bf5

Since your form is bound to the general settings, we need to fetch them first, after which we can hide what isn't needed.

This could potentially mess up the zebra stripes, but should keep values of the fields when saving a user again. Another option is to drop the tr tags, keeps zebra intact, but trashes previously saved values if not enabled in the general section anymore.

@mimugmail
Copy link
Member Author

@AdSchellevis works great, thanks! Only problem is that disabling the section in general keeps the settings in users in DB. So this logic is only be allowed if the tick in general has no other meaning and does not en-/disable a feature the attributes in users rely on. Anyway, it keeps the view short and simple, I'll add a info to the help and hopefully all are happy.

Thank you! :)

@AdSchellevis
Copy link
Member

@mimugmail you're welcome :)

If you want to ignore old settings on save, you can remove the tr tag, which stops the save from sending the data to the controller.... but settings for other users will obviously remain in the file.

@mimugmail
Copy link
Member Author

@AdSchellevis I decided to keep the values and add a note. Otherwise a false tick disabling in general would squeeze a bigger user setup :)

@AdSchellevis
Copy link
Member

@mimugmail sounds good to me

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.

3 participants