Created
August 23, 2014 04:13
-
-
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.
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 | |
// 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