Skip to content

Instantly share code, notes, and snippets.

@mosladil
Created April 16, 2013 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mosladil/5396164 to your computer and use it in GitHub Desktop.
Save mosladil/5396164 to your computer and use it in GitHub Desktop.
Kerio Control - Create a local user http://forums.kerio.com/m/101708/#msg_101708
<?php
require_once 'src/KerioControlApi.php';
$api = new KerioControlApi('Create user', 'Miroslav Osladil', '1.0');
try {
$session = $api->login('fw.company.local', 'username', 'password');
/* a new user */
$newUser = array(
'credentials' => array(
'userName' => 'jdoe1',
'password' => 'SecretPassword',
'passwordChanged' => true
),
'fullName' => 'John Done',
'description' => '',
'email' => '',
'authType' => 'Internal',
'useTemplate' => true,
'adEnabled' => true,
'localEnabled' => true,
'groups' => array(),
'autoLogin' => array(
'firewall' => false,
'addresses' => array(
'enabled' => false,
'value' => null
),
'addressGroup' => array(
'enabled' => false,
'id' => null
)
),
'vpnAddress' => array(
'enabled' => false,
'value' => null
),
'data' => array(
'rights' => array(
'readConfig' => false,
'writeConfig' => false,
'overrideWwwFilter' => false,
'unlockRule' => false,
'dialRasConnection' => false,
'connectVpn' => false,
'connectSslVpn' => false,
'useP2p' => false
),
'quota' => array(
'daily' => array(
'enabled' => false,
'type' => 'QuotaBoth',
'limit' => array(
'value' => 0,
'units' => 'GigaBytes'
)
),
'weekly' => array(
'enabled' => false,
'type' => 'QuotaBoth',
'limit' => array(
'value' => 0,
'units' => 'GigaBytes'
)
),
'monthly' => array(
'enabled' => false,
'type' => 'QuotaBoth',
'limit' => array(
'value' => 0,
'units' => 'GigaBytes'
)
),
'blockTraffic' => false,
'notifyUser' => false
),
'wwwFilter' => array(
'javaApplet' => false,
'embedObject' => false,
'script' => false,
'popup' => false,
'referer' => false
),
'language' => 'detect'
)
);
$userList[] = $newUser;
/* create user */
$params = array(
'domainId' => 'local',
'users' => $userList
);
$api->sendRequest('Users.create', $params);
}
catch (KerioApiException $e) {
print $e->getMessage();
}
if (isset($session)) $api->logout();
@mosladil
Copy link
Author

It is not possible at the moment. But I would suggest you use our UserVoice system http://feedback.kerio.com/forums/141042-kerio-control

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment