Skip to content

Instantly share code, notes, and snippets.

@ryanrhanson
Created August 23, 2014 04:13
Show Gist options
  • Save ryanrhanson/1e6414886d630bed0cb2 to your computer and use it in GitHub Desktop.
Save ryanrhanson/1e6414886d630bed0cb2 to your computer and use it in GitHub Desktop.
This corrects a deficiency in the SoftLayer portal, allowing you to update your forums.softlayer.com password so you can log into them directly, instead of going through the rest of the portal.
<?php
// apiconfig.php needs to have apiUsername, apiKey, and the path to the SLApi file that used to be in this script.
require_once('configuration/apiconfig.php');
$newPassword = readline("New password: ");
$client = SoftLayer_SoapClient::getClient('SoftLayer_Account', null, SLAPI_USER, SLAPI_KEY);
$user = $client->getCurrentUser();
$userClient = SoftLayer_SoapClient::getClient('SoftLayer_User_Customer', $user->id,SLAPI_USER, SLAPI_KEY);
try {
$userClient->updateForumPassword($newPassword);
echo "Forum password updated to " . $newPassword . " for user " . $user->username . "\n\r";
} catch (Exception $e) {
echo $e->getMessage() . "\n\r";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment