Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <?php
  2.  
  3. include "vendor/autoload.php";
  4.  
  5. # Create the Openfire Rest api object
  6. $api = new Gidkom\OpenFireRestApi\OpenFireRestApi;
  7.  
  8. # Set the required config parameters
  9. $api->secret = "TWvMWE8QJCmOOPkE";
  10. $api->host = "139.60.161.225";
  11. $api->port = "9090"; # default 9090
  12.  
  13. # Optional parameters (showing default values)
  14. $api->useSSL = false;
  15. $api->plugin = "/plugins/restapi/v1"; # plugin
  16.  
  17. # Add a new user to OpenFire and add to a group
  18. $result = $api->addUser('hey', 'Passwor123d', 'Working', 'johndoe@domain.com', array('Group 1'));
  19.  
  20. # Check result if command is succesful
  21. if($result['status']) {
  22. # Display result
  23. print_r($result['message']);
  24. } else {
  25. # Something went wrong
  26. echo 'Error: ';
  27. echo $result['message'];
  28. }
  29.  
  30.  
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement