|
|
|
@ -66,7 +66,7 @@ class UserHooks {
|
|
|
|
|
return function (\OC\User\User $user, string $password) {
|
|
|
|
|
$email = $user->getUID() . $this->config->getEmailAddressSuffix();
|
|
|
|
|
if($this->updateEmailPassword($email, $password)) {
|
|
|
|
|
$this->logger->warning("Updated glesys password for account: " . $email, $this->logContext);
|
|
|
|
|
$this->logger->warning("updated email password for account" . $email, $this->logContext);
|
|
|
|
|
} else {
|
|
|
|
|
$this->logger->error("Error updating mail password for account" . $email);
|
|
|
|
|
}
|
|
|
|
@ -74,7 +74,7 @@ class UserHooks {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function createEmailAccount($user_data) {
|
|
|
|
|
$ch = curl_init($this.config->getMailUAPI . 'user');
|
|
|
|
|
$ch = curl_init($this->config->getMailUAPI() . 'user');
|
|
|
|
|
$payload = json_encode($user_data);
|
|
|
|
|
curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload );
|
|
|
|
@ -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) {
|
|
|
|
|
$ch = curl_init($this.config->getMailUAPI . 'user/' . urlencode($user_data->email));
|
|
|
|
|
$payload = json_encode(array("raw_password" => $user_data['password']));
|
|
|
|
|
private function updateEmailPassword($user, $password) {
|
|
|
|
|
$ch = curl_init($this->config->getMailUAPI() . 'user/' . urlencode($user));
|
|
|
|
|
$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()));
|
|
|
|
|