• No se han encontrado resultados

Adding your own links to the VZCC or VZPP menus is performed by editing the C:\Program

Files\SWSoft\vzcp\etc\cc\menu.xml and C:\Program

Files\SWSoft\vzcp\etc\pp\menu.xml files inside the Service VPS, respectively. Let us assume that you wish to provide VZPP with a link to the page on the provider's website where the VPS administrator is able to buy additional resources for their VPS. Open the

C:\Program Files\SWSoft\vzcp\etc\pp\menu.xml file with the help of

Notepad or any other editor.

Note: To add a new link to the VZCC menu, you should open the C:\Program Files\SWSoft\vzcp\etc\cc\menu.xml file inside the Service VPS and edit it in the same way as is described below for VZPP.

As you see, there are four <submenu> elements in this file. Each <submenu> element is opened with the <submenu list_of_attributes> tag and closed with the

</submenu> tag. In the browser, each <submenu> element corresponds to one of the four groups of links on the VZPP menu. Let us add a link to the first group of links called VPS

Management:

1 In the C:\Program Files\SWSoft\vzcp\etc\pp\menu.xml file, locate the

<submenu> element having name="VPS Management" as one of its attributes. Between the <submenu> opening tag and the </submenu> closing tag, there are a number of <item> elements, also having their corresponding opening and closing tags. Each <item> element corresponds to a link on the VZPP menu.

2 Create a copy of one of the <item> elements (i.e. all the text between the <item>

opening tag and the </item> closing tag, including the tags proper) and place it just before the </submenu> closing tag. This will be a basis for your link.

3 Edit this <item> element in the following way:

ƒ Enter the path to the page where the VPS administrator can buy more resources for their VPS as the value of the href attribute.

ƒ Enter the ID of the icon file to be shown to the left of the link as the value of the icon

attribute. The file should be located in the C:\Program Files\SWSoft\vzcp\static\vz\skins\<skin_name>\icons directory inside the Service VPS and have the following name pattern: <id>_16.gif.

Note: There are a number of subdirectories in the C:\Program

Files\SWSoft\vzcp\static\vz\skins\ directory. One subdirectory corresponds to one VZPP skin defining such VZPP elements as its general layout, icons and images, the color palette, etc. Therefore, to allow your new icon to be displayed in VZPP when using any of the existing skins, you should add the icon file to each subdirectory.

ƒ Between the <title> and </title> tags, enter the text to be shown as the new link in the browser.

ƒ Remove the remaining attributes of the <item> element and the existing <screen>

elements.

In the end, your new <item> element may look like below:

<item href="http://www.domain.com/res.cfm" icon="res_16" target="_blank">

<title>Buy resources</title> </item>

Note: The target="_blank" attribute tells the browser to open the link in a new browser window. Omitting this attribute will open the link in the same browser window.

The newly created link will be available for all VPS administrators having access to the

<submenu> element where your new <item> element is included. However, you may wish to restrict access to the link. The cred attribute in the <item> element allows you to prevent the link from being displayed on the VZPP menu. To this effect, you should enter a random ID as the value of the cred attribute and make sure that this ID is not specified in the

C:\vz\private\1\root\Program Files\SWSoft\vzcp\etc\vzcpcon.conf

file on the Hardware Node as one of the existing XML elements included in the <access>

pattern element.

To make the link available on the VZPP menu again, you can choose one of the following ways: ƒ Remove the cred attribute from the <item> element in the C:\Program

Files\SWSoft\vzcp\etc\pp\menu.xml file inside the Service VPS;

ƒ Specify the cred attribute in the C:\vz\private\1\root\Program Files\SWSoft\vzcp\etc\vzcpcon.conf file inside the Service VPS as an XML element (for example, <buy_resources/>. The name of the element should coincide with the ID of the cred attribute in the C:\Program Files\SWSoft\vzcp\etc\pp\menu.xml file, and the element itself should be placed between the following pattern elements:

<auth> <type>VEUser</type> <user>root</user> <creds> <management> and </management> </creds> </auth>

In this case the root user will gain access to the created link, i.e. this link will be displayed on the VZPP menu under the VPS Management group when the root user is logged in to the Virtual Private Server.

Note: If you are creating a new VZCC link, you should look for the

<type>SVEUser</type> string instead of <type>VEUser</type> in the

C:\vz\private\1\root\Program Files\SWSoft\vzcp\etc\vzcpcon.conf

file and place the corresponding XML element between the subsequent <management>

opening tag and the </management> closing tag.

While working with the cred attribute, you should also keep in mind the following:

a After you have defined a new element in the C:\vz\private\1\root\Program Files\SWSoft\vzcp\etc\vzcpcon.conf file inside the Service VPS, you should restart the vzcp service by executing the vzctl exec 1 sc stop vzcpd

and vzctl exec 1 sc start vzcpd commands on the Hardware Node and log out of and log in to VZPP afresh for the new settings to take effect.

b Do not use spaces in the value of the cred attribute.

To learn more about the VZCC/VZPP menu customization, turn to the Customizing VZCC/VZPP

Menu subsection (on page 172).