Created
July 26, 2018 12:40
-
-
Save brusch/dfc3f2b0be8d226bd68a1bdb74bc4e62 to your computer and use it in GitHub Desktop.
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 | |
$client = new \Zend\XmlRpc\Client('https://example.com/rpc/xmlrpc'); // INSERT your hostname | |
$token = $client->call('confluence2.login', ['USERNAME','PASSWORD']); // INSERT your user + pass | |
try { | |
$profilePictureData = file_get_contents('/path/to/your/image/file.jpg'); // INSERT path to the file | |
$profilePictureData = new \Zend\XmlRpc\Value\Base64($profilePictureData); | |
// REPLACE "confluence-username" with the username of the user to update | |
$result = $client->call('confluence2.addProfilePicture', [$token, 'confluence-username', 'file.jpg', 'image/jpg', $profilePictureData]); | |
} catch (\Exception $e) { | |
echo $e->getMessage() . "\n"; | |
} |
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
composer require zendframework/zend-xmlrpc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment