From 6abd99e3975bc2d4e4f50258b01428d914f941cb Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 28 Nov 2019 16:49:48 +0100 Subject: [PATCH] Fixed account activated flag upon recovery & fixed is_account_used method to check aliases --- flexisip-account-manager.spec | 2 +- src/xmlrpc/accounts.php | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/flexisip-account-manager.spec b/flexisip-account-manager.spec index 2e338be..c8395a2 100644 --- a/flexisip-account-manager.spec +++ b/flexisip-account-manager.spec @@ -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 diff --git a/src/xmlrpc/accounts.php b/src/xmlrpc/accounts.php index 39c0cab..75961d8 100644 --- a/src/xmlrpc/accounts.php +++ b/src/xmlrpc/accounts.php @@ -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;