From ea1afa30bfab08b8a072d2e704c87f8927873cb8 Mon Sep 17 00:00:00 2001 From: Johan Pascal Date: Mon, 8 Jul 2019 05:49:16 +0700 Subject: [PATCH] Add overload for recover_phone_account --- conf/overloads.conf | 26 ++++++++++++++++++++++++++ src/config/config.php | 7 +++++-- src/xmlrpc/accounts.php | 8 +++++++- 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 conf/overloads.conf diff --git a/conf/overloads.conf b/conf/overloads.conf new file mode 100644 index 0000000..7f38b83 --- /dev/null +++ b/conf/overloads.conf @@ -0,0 +1,26 @@ + diff --git a/src/config/config.php b/src/config/config.php index df65788..c6fba9d 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -24,11 +24,14 @@ include_once PATH_TO_CONFIG . '/accounts.conf'; include_once PATH_TO_CONFIG . '/auth.conf'; include_once PATH_TO_CONFIG . '/db.conf'; include_once PATH_TO_CONFIG . '/emails.conf'; -include_once PATH_TO_CONFIG . '/hooks.conf'; include_once PATH_TO_CONFIG . '/inapp.conf'; include_once PATH_TO_CONFIG . '/logs.conf'; include_once PATH_TO_CONFIG . '/provisioning.conf'; include_once PATH_TO_CONFIG . '/sms.conf'; include_once PATH_TO_CONFIG . '/tests.conf'; -?> \ No newline at end of file +// these two might include some of the scripts from the installation, so keep them last +include_once PATH_TO_CONFIG . '/hooks.conf'; +include_once PATH_TO_CONFIG . '/overloads.conf'; + +?> diff --git a/src/xmlrpc/accounts.php b/src/xmlrpc/accounts.php index ff9917e..b3c9a78 100644 --- a/src/xmlrpc/accounts.php +++ b/src/xmlrpc/accounts.php @@ -587,6 +587,12 @@ function xmlrpc_get_phone_number_for_account($method, $args) { // args = [phone, [domain], [lang]] function xmlrpc_recover_phone_account($method, $args) { + + // Is this function overloaded + if (XMLRPC_RECOVER_PHONE_ACCOUNT_OVERLOAD === TRUE) { + return xmlrpc_recover_phone_account_overload($method, $args); + } + $phone = $args[0]; $domain = get_domain($args[1]); $lang = get_lang($args[2]); @@ -788,4 +794,4 @@ function xmlrpc_accounts_register_methods($server) { xmlrpc_server_register_method($server, 'update_email', 'xmlrpc_update_email');// args = [username, password, new email, [domain]], return OK } -?> \ No newline at end of file +?>