Fixed account activated flag upon recovery & fixed is_account_used method to check aliases

This commit is contained in:
Sylvain Berfini 2019-11-28 16:49:48 +01:00
parent 16b82b88bc
commit 6abd99e397
2 changed files with 15 additions and 2 deletions

View file

@ -8,7 +8,7 @@
#%define _datadir %{_datarootdir}
#%define _docdir %{_datadir}/doc
%define build_number 13
%define build_number 14
#%if %{build_number}
#%define build_number_ext -%{build_number}
#%endif

View file

@ -48,11 +48,19 @@ function xmlrpc_is_account_used($method, $args) {
$account = new Account($db);
$account->username = $user;
$account->domain = $domain;
if ($account->getOne()) {
return OK;
}
$alias = new Alias($db);
$alias->alias = $user;
$alias->domain = $domain;
if ($alias->getOne()) {
return OK;
}
return NOK;
}
@ -119,6 +127,11 @@ function xmlrpc_recover_account_from_confirmation_key($method, $args) {
return KEY_DOESNT_MATCH;
}
if (!is_activated($account)) {
$account->activated = "1";
$account->update();
}
$password = new Password($db);
$password->account_id = $account->id;
$password->algorithm = $algo;