Compare commits

...

11 Commits

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;
}
}