Compare commits

...

11 Commits

Author SHA1 Message Date
Petter Joelson 74af0aace4 Update Nextcloud version and remove from main menu 2021-06-10 10:31:25 +00:00
Alexander Vassilevski d326b84408 revert changeUser hook 2021-02-21 19:36:54 -08:00
Alexander Vassilevski 646ff2a029 experimenting with changeUser hook 2021-02-21 19:29:12 -08:00
Alexander Vassilevski f9e9ba3eb8 Merge branch 'master' of gitlab.com:collective.tools/ctautomailhooks 2021-02-21 19:07:23 -08:00
Alexander Vassilevski fe013d6eea added password update hook 2021-02-21 19:06:57 -08:00
Alexander Vassilevski a7b542ead0 fixing error msgs and ensuring return status; 2021-02-21 18:58:13 -08:00
Alexander Vassilevski 14a6f49d58 removing third param; 2021-02-21 18:55:23 -08:00
Alexander Vassilevski e098b4e7a3 fixing variable rename error 2021-02-21 18:51:52 -08:00
Alexander Vassilevski 2766f1e18b fix typo 2021-02-21 18:49:07 -08:00
Alexander Vassilevski 2e8a3cf88d added hook for password update 2021-02-21 18:41:27 -08:00
Petter b99446dff1 Don't print array with user info 2021-02-02 21:47:46 +01:00
2 changed files with 10 additions and 11 deletions

View File

@ -12,12 +12,8 @@
<category>tools</category>
<bugs>https://github.com/sashetov/ctautomailhooks</bugs>
<dependencies>
<nextcloud min-version="15" max-version="15"/>
<nextcloud min-version="15" max-version="25"/>
</dependencies>
<navigations>
<navigation>
<name>C T Auto Mail Hooks</name>
<route>ctautomailhooks.page.index</route>
</navigation>
</navigations>
</info>

View File

@ -62,8 +62,7 @@ class UserHooks {
};
}
private function updateEmailPasswordCB() {
return function (
\OC\User\User $user, string $password, string $recoverPassword) {
return function (\OC\User\User $user, string $password) {
$uid = $user->getUID();
$email_suffix = $this->config->getEmailAddressSuffix();
$email = $uid . $email_suffix;
@ -75,7 +74,8 @@ class UserHooks {
$this->logger->warning(
"Updated glesys password for account: " . $email,
$this->logContext);
else $this->logger->error("Error deleting mail account" . $uid);
else $this->logger->error(
"Error updating mail password for account" . $uid);
};
}
private function createImapFolders($user_data) {
@ -105,7 +105,7 @@ class UserHooks {
$keys = $this->config->getGlesysKeys();
$fields = array(
'emailaccount' => $user_data['email'],
'password' => $user_dat['password'],
'password' => $user_data['password'],
'quota' => $user_data['quota']
);
$query = http_build_query($fields);
@ -125,7 +125,7 @@ class UserHooks {
curl_close($ch);
$xml = simplexml_load_string($result);
$code = $xml->status->code;
if ($code == 200) return $this->createImapFolders($newuser);
if ($code == 200) return $this->createImapFolders($user_data);
else $this->logger->warning(
"Error: non-200 status: " . $xml->status->text);
return false;
@ -170,8 +170,11 @@ class UserHooks {
curl_close($ch);
$xml = simplexml_load_string($result);
$code = $xml->status->code;
if ($code != 200)
if ($code != 200){
$this->logger->warning(
"Error: non-200 status: " . $xml->status->text);
return false;
}
return true;
}
}