Jump to content


Photo

User Import Password Problem

API

  • Please log in to reply
1 reply to this topic

#1 jimf

jimf

    Advanced Member

  • Members
  • PipPipPip
  • 64 posts

Posted 04 October 2012 - 02:01 AM

I just used the API to import my database of users into Zurmo. I set the password in the API along with username, etc. the import is going fine and the user is put into zurmo, but I cannot log in with the new credentials. I logged in as super and did a password change and I noticed that the hash field is null on all the users I imported, but is set on the one I edited the pasword by hand.
I think there is a bug in the import. I am setting all of these fields so if I have to have another field to make this work, please let me know.

$data['username']  = strtolower($row->username);
  $data['password']  =  'somepass';
  $data['language']  =  'en';
  $data['firstName']  =  substr($row->firstname,0,25);
  $data['lastName']  = iif(strlen(trim($data['lastName']))<3,'NoLast',substr($row->lastname,0,25));
  $data['mobilePhone']  = clean_phone($row->cell_phone);
  $data['primaryEmail']['emailAddress'] = $row->notification_email;
 
  $response = createApiCall(variable_get('zurmourl'). '/users/user/api/create/'  , 'POST', $headers, array('data' => $data));
  $response = json_decode($response, true);

On another note, I've noticed that I can delete users with the API but not the Zurmo UI, is this by design? The delete user api works good. I've had to use it a lot today, and I think I'll have to use it again since none of my passwords got set. :)

Jim

#2 Ivica

Ivica

    Advanced Member

  • Moderators
  • 478 posts

Posted 05 October 2012 - 01:21 PM

Jim, I fixed this issue, but it is in bleeding stage, please wait few days, we will mark new stable version soon.





Also tagged with one or more of these keywords: API

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users