Retrieving Web Users Preferences

Retrieving Web Users Preferences

Use the get operation to retrieve preferences common for all users of a certain site. These settings automatically will be applied to a new user added to the site. Web users preferences are of more priority than web user settings. For more information on the settings, refer to the Retrieving Web Users Settings and Web User Settings and Preferences sections.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet retrieving preferences of web users includes the get-prefs operation node:

<packet version="1.4.2.0">
<webuser >
   <get-prefs>
   ...
   </get-prefs>
</webuser>
</packet>

 

The get-prefs node is presented by type WebUserGetPrefInputType (webuser.xsd), and its graphical representation is as follows:

  • The filter node is required. It specifies the filtering rule. For more information, refer to the Available Filters section. Data type: WebUserOwnFilter (webuser.xsd)

Remarks

You can retrieve preferences of web users using different filtering rules in a single packet. Add as many get-prefs operations as the number of different filtering rules to be used.

<packet version="1.4.2.0">
<get-prefs>
...
</get-prefs>
...
<get-prefs>
...
</get-prefs>
</packet>

 

 

Response Packet Structure

The get-prefs node of the output XML packet is presented by type WebUserGetPrefOutputType (webuser.xsd) and structured as follows:

  • The result node is required. It wraps the response retrieved from the server. Data type: resultFilterType (common.xsd).
  • The status node is required. It specifies the execution status of the get-prefs operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. It returns the error code if the get-prefs operation fails. Data type: unsignedInt.
  • The errtext node is optional. It returns the error message if the get-prefs operation fails. Data type: string.
  • The filter-id node is required. It returns the filtering rule parameter. For more information, refer to the Available Filters section. Data type: anySimple.
  • The id node is optional. If the set operation succeeds it holds the ID of the updated web user. Data type: integer.
  • The wuscripts node is optional. It is required if the get-prefs operation succeeds. It indicates if web users are able to use web scripts. Data type: boolean.

 

 

Samples

Retrieving preferences a web user

This packet retrieves preferences of all web users of the site with ID 5. The packet can look as follows:

<packet>
<webuser>
<get-prefs>
   <filter>
      <site-id>5</site-id>
   </filter>
</get-prefs>
</webuser>

Response:

<packet>
<webuser>
<get-prefs>
   <result>
      <status>ok</status>
      <filter-id>5</filter-id>
      <id>5</id>
      <wuscripts>true</wuscripts>
   </result>
</get-prefs>
</webuser> 
Retrieving preferences of multiple sites

This packet retrieves preferences of all web users of sites example.com and example2.com. The request packet looks as follows:

<packet>
<webuser>
<get-prefs>
   <filter>
      <site-name>example.com</site-name>
      <site-name>example2.com</site-name>
   </filter>
</get-prefs>
</webuser>

Response:

<packet>
<webuser>
<get-prefs>

   <result>
      <status>error</status>
      <errcode>1015</errcode>
      <errtext>Domain does not exist</errtext>
      <filter-id>example.com</filter-id>
   </result>

   <result>
      <status>ok</status>
      <filter-id>example2.com</filter-id>
      <id>6</id>
      <wuscripts>true</wuscripts>
   </result>

</get-prefs>
</webuser>

 

 

Leave your comments on this page

Leave your feedback or question on this documentation topic below. For technical assistance, contact your hosting service provider or submit a request to Plesk support. Suggest new features for Plesk here. Discuss general questions on the Plesk forum. All offtopic comments will be removed.