Compare commits
11 Commits
0fc202ac85
...
74af0aace4
Author | SHA1 | Date | |
---|---|---|---|
|
74af0aace4 | ||
|
d326b84408 | ||
|
646ff2a029 | ||
|
f9e9ba3eb8 | ||
|
fe013d6eea | ||
|
a7b542ead0 | ||
|
14a6f49d58 | ||
|
e098b4e7a3 | ||
|
2766f1e18b | ||
|
2e8a3cf88d | ||
|
b99446dff1 |
@ -12,12 +12,8 @@
|
|||||||
<category>tools</category>
|
<category>tools</category>
|
||||||
<bugs>https://github.com/sashetov/ctautomailhooks</bugs>
|
<bugs>https://github.com/sashetov/ctautomailhooks</bugs>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<nextcloud min-version="15" max-version="15"/>
|
<nextcloud min-version="15" max-version="25"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<navigations>
|
<navigations>
|
||||||
<navigation>
|
|
||||||
<name>C T Auto Mail Hooks</name>
|
|
||||||
<route>ctautomailhooks.page.index</route>
|
|
||||||
</navigation>
|
|
||||||
</navigations>
|
</navigations>
|
||||||
</info>
|
</info>
|
||||||
|
@ -62,8 +62,7 @@ class UserHooks {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
private function updateEmailPasswordCB() {
|
private function updateEmailPasswordCB() {
|
||||||
return function (
|
return function (\OC\User\User $user, string $password) {
|
||||||
\OC\User\User $user, string $password, string $recoverPassword) {
|
|
||||||
$uid = $user->getUID();
|
$uid = $user->getUID();
|
||||||
$email_suffix = $this->config->getEmailAddressSuffix();
|
$email_suffix = $this->config->getEmailAddressSuffix();
|
||||||
$email = $uid . $email_suffix;
|
$email = $uid . $email_suffix;
|
||||||
@ -75,7 +74,8 @@ class UserHooks {
|
|||||||
$this->logger->warning(
|
$this->logger->warning(
|
||||||
"Updated glesys password for account: " . $email,
|
"Updated glesys password for account: " . $email,
|
||||||
$this->logContext);
|
$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) {
|
private function createImapFolders($user_data) {
|
||||||
@ -105,7 +105,7 @@ class UserHooks {
|
|||||||
$keys = $this->config->getGlesysKeys();
|
$keys = $this->config->getGlesysKeys();
|
||||||
$fields = array(
|
$fields = array(
|
||||||
'emailaccount' => $user_data['email'],
|
'emailaccount' => $user_data['email'],
|
||||||
'password' => $user_dat['password'],
|
'password' => $user_data['password'],
|
||||||
'quota' => $user_data['quota']
|
'quota' => $user_data['quota']
|
||||||
);
|
);
|
||||||
$query = http_build_query($fields);
|
$query = http_build_query($fields);
|
||||||
@ -125,7 +125,7 @@ class UserHooks {
|
|||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
$xml = simplexml_load_string($result);
|
$xml = simplexml_load_string($result);
|
||||||
$code = $xml->status->code;
|
$code = $xml->status->code;
|
||||||
if ($code == 200) return $this->createImapFolders($newuser);
|
if ($code == 200) return $this->createImapFolders($user_data);
|
||||||
else $this->logger->warning(
|
else $this->logger->warning(
|
||||||
"Error: non-200 status: " . $xml->status->text);
|
"Error: non-200 status: " . $xml->status->text);
|
||||||
return false;
|
return false;
|
||||||
@ -170,8 +170,11 @@ class UserHooks {
|
|||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
$xml = simplexml_load_string($result);
|
$xml = simplexml_load_string($result);
|
||||||
$code = $xml->status->code;
|
$code = $xml->status->code;
|
||||||
if ($code != 200)
|
if ($code != 200){
|
||||||
$this->logger->warning(
|
$this->logger->warning(
|
||||||
"Error: non-200 status: " . $xml->status->text);
|
"Error: non-200 status: " . $xml->status->text);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user