@@ -107,18 +107,12 @@ function _dosomething_northstar_build_http_client() {
107107function dosomething_northstar_update_user($form_state) {
108108 $user = $form_state['user'];
109109 $id = $user->uid;
110-
111110 $ns_user = dosomething_northstar_build_ns_user($user, $form_state);
112111
113112 $northstar = new Northstar();
114113 $client = _dosomething_northstar_build_http_client();
115114
116- // $northstar_user_info = dosomething_northstar_get_northstar_user($id);
117- // $northstar_user_info = json_decode($northstar_user_info->data, TRUE);
118- // $northstar_user_info = (object) $northstar_user_info['data'][0];
119- // $ns_id = $northstar_user_info->_id;
120-
121- $response = drupal_http_request($client['base_url'] . '/users/drupal_id' . $id, array(
115+ $response = drupal_http_request($client['base_url'] . '/users/drupal_id/' . $id, array(
122116 'headers' => $client['headers'],
123117 'method' => 'PUT',
124118 'data' => json_encode($ns_user),
@@ -133,26 +127,6 @@ function dosomething_northstar_update_user($form_state) {
133127
134128}
135129
136- function dosomething_northstar_update_user($form_state) {
137- $user = $form_state['user'];
138- $ns_user = dosomething_northstar_build_ns_user($user, $form_state);
139-
140- $northstar = new Northstar();
141- $client = _dosomething_northstar_build_http_client();
142- $response = drupal_http_request($client['base_url'] . '/users', array(
143- 'headers' => $client['headers'],
144- 'method' => 'POST',
145- 'data' => json_encode($ns_user),
146- ));
147- if ($response->code === '200' && module_exists('stathat')) {
148- stathat_send_ez_count('drupal - Northstar - user updated - count', 1);
149- }
150- elseif ($response->code !== '200') {
151- watchdog('dosomething_northstar', 'User not updated : ' . $response->code, NULL, WATCHDOG_ERROR);
152- }
153-
154- }
155-
156130/**
157131 *Get user data from northstar.
158132 */
0 commit comments