The usercomp package



Since I have been working as a UNIX system administrator for some years I would like to have some components that may be used to simply set up system administration tasks. One first attempt to create a component for system administration is the package hbasic_usercomp which you can find in the packages folder of the HBasic distribution.

Currently this package contains two components which may be used to display or edit the list of users and groups on your computer. The components read the contents of the files /etc/passwd and /etc/group and display them in a listview in the component widget. If you start the program as root user you may also add, update and delete entries in this files with the component. The following image displays the useredit and groupedit component which have been inserted into a HBasic form window. The icons of the users are red for system users (user id < 500) and the group icons are red for group id's <100.


Currently this components only allows simple editing of the two files mentioned but they may be extended in oncoming versions. This components should be an example what you can do with more complex components. A component may not only be an instance of a Qt widget like a QPushButton but also a program that may export any functions to be used within HBasic.

Editing users and groups

To add a new user or new group entry click on the Add user or Add group button of the components. To edit an existing user or component double click on the listview line of the user or group within the component listview. TO delete an entry select it with a mouseclick in the listview and click on the Drop user or Drop group button.

If you add or update a user you will see the following user-editor dialog:

For a new or existing group you may set the following properties: