25.4. Creating a New File Editor

To add a new button to the module's main page for editing a file, follow these steps:

1.
Click on the Create a new file editor link above or below the existing buttons. This will bring up the editor creation form shown in Figure 25.3.

Figure 25.3. Creating a new file editor.


2.
Enter a short description for the file to be edited into the Description field. Whatever text you enter will appear on the editor's button on the main page. You can also enter additional text (including HTML tags) into the larger text box below it, to be displayed underneath the button.

3.
Enter the full path of the file to be edited into the File to edit field. The file does not necessarily have to exist yet.

4.
To have the file's owner changed when it is saved, set the File ownership field to User and enter a UNIX username and group name into the fields next to it. This is especially useful when editing a file that does not yet exist, so the ownership of the newly created file is set properly.

If you leave the field set to Leave as is, the file's ownership will not be changed when it is saved. Newly created files will be owned by root.

5.
To have the file's access permissions changed when it is saved, set the File permissions field to Set to octal and enter the permissions (like 700 or 664) into the field next to it. If you select Leave as is, the file's permissions will not be changed when it is saved. The permissions on newly created files depend on the Webmin processes' umask.

6.
To have a command run just before the file is saved by the user, fill in the Command to run before saving field. This could be useful for making a backup copy, checking the file out of RCS, or anything else that you can come up with.

7.
Similarly, to have a command run just after the file is saved fill in the Command to run after saving field. This can be useful for validating the file's contents, copying it to another system, or checking it back into RCS.

8.
To control the placement of the new editor's button on the module's front page, enter a number for the Ordering on main page option. Commands and editors are ordered so that those with the highest number appear first. If Default is chosen, the ordering number is assumed to be zero.

If you do not set the ordering number for any of your file editors, they will be displayed in the order in which they were created.

9.
To have the editor appear in Usermin's Custom Commands module, change the Available in Usermin? field to Yes. See Chapter 47 for more information on how to install and configure Usermin.

10.
Finally, click the Save button. If there are no errors in the form, you will be returned to the module's main page which will include a button for the new editor.

Once an editor has been created, you can edit it by clicking on the Edit file editor link on the module's main page. Once you are done making changes, click the Save button at the bottom of the page. To get rid of the editor, click the Delete button in the bottom-right corner instead.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.197.212