Skip to content

Commit

Permalink
Issue #1162648 User Update issues by manatwo
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebrowning committed Jun 19, 2011
1 parent 5af558d commit 0670e41
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion resources/user_resource.inc
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ function _user_resource_create($account) {
*/
function _user_resource_update($uid, $account) {
$account['uid'] = $uid;
$user = user_load($uid);

// Load the required includes for saving profile information
// with drupal_execute().
Expand Down Expand Up @@ -287,8 +288,14 @@ function _user_resource_update($uid, $account) {
$form_state['values']['op'] = 'Save';
$form_state['values']['_category'] = $category;
$form_state['values']['_account'] = (object)$account;
if (isset($account['pass'])) {
$form_state['values']['pass'] = array(
'pass1' => $account['pass'],
'pass2' => $account['pass'],
);
}

$ret = drupal_execute('user_profile_form', $form_state, (object)$account, $category);
$ret = drupal_execute('user_profile_form', $form_state, $user, $category);

// Error if needed.
if ($errors = form_get_errors()) {
Expand Down

0 comments on commit 0670e41

Please sign in to comment.