Skip to content

SOAP API: client_update removes additional templates

Summary

In ISPConfig 3.2.9p1 (likely also in previous versions) a call to the client_update API causes the client to lose all it's assigned additional templates.

Steps to reproduce

  1. create aclient with a master template
  2. assign one or more additional templates
  3. call client_update on the client using the SOAP API

demo code causing the issue

$context = stream_context_create(array(
    'ssl' => array(
        'verify_peer'       => true,
        'verify_peer_name'  => true,
    )
));

$ispc = new SoapClient(null, array('location' => ISPC_API_LOCATION,
        'uri'      => ISPC_API_URI,
        'trace' => 1,
        'exceptions' => 1,
        'stream_context' => $context));

if($session_id = $ispc->login(ISPC_API_USER, ISPC_API_PWD)) {
    echo 'Login successful. Session ID:'.$session_id.'<br />';
}

$client = $ispc->client_get_by_customer_no($session_id, '12345');

if ($client) {
	$changes = array();
	$changes['contact_name'] = 'NewName';
	$result = $ispc->client_update($session_id, $client['client_id'], $client['parent_client_id'], $changes);
}

Correct behaviour

The templates should be kept

Environment

Server OS + version: Debian 11
ISPConfig version: 3.2.9p1

Edited by Alex von Firesplash