In our system we want to integrate moodle plugin(version 3.1) with amember.We have some users in moodle with passwords in encrypted format and we want to import those users to amember without changing users passwords using api.
Can anyone please suggest a way how can we handle this?
I am using following code to create users in amember.it successfully create users in amember but when i try to login it denied.
$url = 'http://YOURDOMAIN.COM/amember/api/users';
$fields = array(
'_key' => 'SECRETKEY',
'_format' => 'xml',
'login' => 'USERNAME',
'pass' => 'PASSWORD',
'email' => 'EMAIL',
'name_f' => 'FIRST NAME',
'name_l' => 'LAST NAME',
);
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields));
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: application/x- www-form-urlencoded"));
//execute post
$result = curl_exec($ch);
//close connection
curl_close($ch);
Thanks in advance.