We have already wrote about user interfaces in chapter about AddUser-NG cabilities. Now, that you have knowledge about configuration, we will summarize.
User Interface in AddUser-NG, is designed to comunicate with user. It is executed when any option from any plugin needs to be configurated, its value is not set in group file or commented out. In this case, user is being informed: what option, from which plugin, some help for the option is displyed, and the default value (if the option has one). User will be asked then to enter value for this option. If user stops program execution at this moment, no changes will be made, and program will quit.
Additonaly, User Interface is called by program if errors occure, in order to make user aware of them. If -V | --verbose option is used, verbose mode is on, and program informs user about what it is doing.
As there are different User Interfaces, the way they get data and present it is also different for each one.
UI: readline
This is the default interface, it gets data from user like system shell. It displays help message concerning specific option, and prompt, which is option's name. Additionally, if an option has default value, it will be automaticly set as the answer value, so that user can simply affirm it by pressing “ENTER”.
This interface has values history, just press “up arrow” and previously entered values will appear.
UI: cdk
This UI looks simmilar to dialog program, and it also acts alike. In this UI dialog windows are displayed, each has title (plugin/option name) and help concerning the option. Additionally, if option has a default value, it will be also displayed, and affirmed with “ENTER”.
UI: batch
It is special UI that gets data from program parameters, it does not display anything. It is usefull for writing scripts with AddUser-NG program. Syntax is as follows:
bash# adduser-ng Plugin_name.Option=value Other_plugin_name.This_plugins_option=other_value group username
Is it clear? If it isn't take a look at an example.
Example 4.2. Example of batch UI usage
bash# adduser-ng UserAdd.comment="Added by bath UI" PasswdUser.passwd=qwerty123456 customers alice
In this UI, if you give no value for an option, and it has a default one, the default one will be automaticaly used.