Thanks for the response Jow, The problem with using the normal add/remove functionality is that the name of the section should be the name of the user being added, which when creating the user this value is obviously not present in the config, for editing purposes this works fine if the username as supplied as an argument when calling the model...
... url("admin/users/users", "foo")
then in the model
s = m:section(NamedSection, arg[1], "user")
I am thinking the only way to achieve this before the user/section is created is to add a text box to input the new username and use the "Add New User" button to submit the name as an argument to the model as shown above. I think this the cleanest method even though it a little unorthodox
the another method tough of is just add the user as a typed section first,resulting in a section like ..
config user
option name 'foo'
option shell '1'
...
then fire a function to rename the section to a
NamedSection with the desired format using the on_after_submit call to fire the function.
uci:rename("users.@user[0]=foo")
uci:commit("users")
resulting in the properly formated section
config user 'foo'
option name 'foo'
option shell '1'
...
(Last edited by hostle19 on 3 Feb 2016, 20:35)