Fix all internal apis

This commit is contained in:
Cassowary Rusnov 2023-09-27 12:03:58 -07:00
parent 872ebbd129
commit 34d45c6338

View File

@ -99,8 +99,8 @@ class UserHooks {
return false;
}
private function deleteEmailAccount($user_data) {
$ch = curl_init($this->config->getMailUAPI() . 'user/' . urlencode($user_data->email));
private function deleteEmailAccount($user) {
$ch = curl_init($this->config->getMailUAPI() . 'user/' . urlencode($user));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . $this->config->getMailUKeys()));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
@ -124,9 +124,9 @@ class UserHooks {
return false;
}
private function updateEmailPassword($user_data) {
private function updateEmailPassword($user, $password) {
$ch = curl_init($this->config->getMailUAPI() . 'user/' . urlencode($user_data->email));
$payload = json_encode(array("raw_password" => $user_data['password']));
$payload = json_encode(array("raw_password" => $password));
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload );
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json',
'Authorization:' . $this->config->getMailUKeys()));