Updating Web Users Preferences

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

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet updating preferences of web users includes the set-prefs operation node:

<packet>
<webuser >
   <set-prefs>
   ...
   </set-prefs>
</webuser>
</packet>

 

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

Remarks

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

<packet>
<set-prefs>
...
</set-prefs>
...
<set-prefs>
...
</set-prefs>
</packet>

Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.

 

Response Packet Structure

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

 

 

Samples

Updating preferences of a single site

The request packet disables scripts execution for all web users of the site with ID 4.

<packet>
<webuser>
<set-prefs>
   <filter>
      <site-id>4</site-id>
   </filter>
   <values>
      <wuscripts>0</wuscripts>
   </values>
</set-prefs>
</webuser>
</packet>

Response:

<packet>
<webuser>
<set-prefs>
   <result>
      <status>ok</status>
      <filter-id>4</filter-id>
      <id>4</id>      
   </result>
</set-prefs>
</webuser>
</packet>
 
Updating preferences of multiple sites

This request packet disables scripts execution, and sites like username@<site> for all web users of the example.com and example2.com sites.

<packet>
<webuser>
<set-prefs>
   <filter>
      <site-id>example.com</site-id>
      <site-id>example2.com</site-id>
   </filter>
   <values>
      <wuscripts>0</wuscripts>
   </values>
</set-prefs>
</webuser>
</packet>

Response (if example2.com wasn't found on the server):

<packet>
<webuser>
<set-prefs>

   <result>
      <status>ok</status>
      <filter-id>Domain1.com</filter-id>
      <id>4</id>      
   </result>

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

</set-prefs>
</webuser>
</packet>