Created
April 16, 2013 14:06
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is not possible at the moment. But I would suggest you use our UserVoice system http://feedback.kerio.com/forums/141042-kerio-control