Beispiel #1
0
    //create an array of fields to update, NOTE: id is required
    $last_name = $user->last_name;
    $updates = array('id' => USER_ID, 'last_name' => $last_name . ' updated');
    //update the user
    $updated = GoCoin::updateUser($token, $updates);
    //show the updates
    echo '<h3 style="color:blue">Updated User</h3>';
    showObject($updated);
    //reset the last name
    $updates['last_name'] = $last_name;
    GoCoin::updateUser($token, $updates);
}
//show the applications
echo '<h3 style="color:blue">Applications</h3>';
//get the user applications
$apps = GoCoin::getUserApplications($token, USER_ID);
foreach ($apps as $app) {
    showObject($app);
}
//update password tests
$PASSWORD = FALSE;
if ($PASSWORD) {
    echo '<h3 style="color:blue">Password Update Test</h3>';
    //an array to update the password
    $pw_array = array("current_password" => "passw0rd", "password" => "newpassw0rd", "password_confirmation" => "newpassw0rd");
    //update the password
    $pw_update = GoCoin::updatePassword($token, USER_ID, $pw_array);
    if ($pw_update->code == '204') {
        echo '<div>Password successfully updated!</div>';
    } else {
        echo '<div>Password update failure:</div>';