Compare commits

..

8 Commits

Author SHA1 Message Date
3wc
b926207927 Mark as supported w/ NC 28 2023-12-29 14:22:42 -03:00
f312f174ce fix log messages 2023-09-27 12:11:09 -07:00
cc618ecfda Fix another internal api error 2023-09-27 12:08:43 -07:00
34d45c6338 Fix all internal apis 2023-09-27 12:03:58 -07:00
872ebbd129 Fix all the $this calls 2023-09-27 11:58:40 -07:00
aef194c55d Fix error in function call 2023-09-27 11:56:16 -07:00
3aea64056b Fix typo in function call 2023-09-27 11:54:00 -07:00
3wc
f39c5fcfe7 Bump NC version 2023-09-27 19:44:30 +01:00
2 changed files with 8 additions and 8 deletions

View File

@ -12,7 +12,7 @@
<category>tools</category>
<bugs>https://github.com/sashetov/ctautomailhooks</bugs>
<dependencies>
<nextcloud min-version="15" max-version="25"/>
<nextcloud min-version="15" max-version="28"/>
</dependencies>
<navigations>
</navigations>

View File

@ -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()));