Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "vendor/autoload.php";
- # Create the Openfire Rest api object
- $api = new Gidkom\OpenFireRestApi\OpenFireRestApi;
- # Set the required config parameters
- $api->secret = "TWvMWE8QJCmOOPkE";
- $api->host = "139.60.161.225";
- $api->port = "9090"; # default 9090
- # Optional parameters (showing default values)
- $api->useSSL = false;
- $api->plugin = "/plugins/restapi/v1"; # plugin
- # Add a new user to OpenFire and add to a group
- $result = $api->addUser('hey', 'Passwor123d', 'Working', 'johndoe@domain.com', array('Group 1'));
- # Check result if command is succesful
- if($result['status']) {
- # Display result
- print_r($result['message']);
- } else {
- # Something went wrong
- echo 'Error: ';
- echo $result['message'];
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement