Commit ea1afa30 authored by johan's avatar johan

Add overload for recover_phone_account

parent 3d9d2521
<?php
/* ### Overloads configuration ### */
/*
* Set the following to TRUE to overload the xmlrpc_recover_phone_account function
*
* Default value: FALSE
*/
define('XMLRPC_RECOVER_PHONE_ACCOUNT_OVERLOAD', FALSE);
/** ### Overloads implementation */
// We may need to access some of the functions provided by the server (database access at least)
// so we need to know where to find them
define("PATH_TO_INSTALLATION", "/opt/belledonne-communications/share/flexisip-account-manager");
if (XMLRPC_RECOVER_PHONE_ACCOUNT_OVERLOAD === True) {
include_once PATH_TO_INSTALLATION . '/database/database.php';
}
// args = [phone, [domain], [lang]]
// is expected to return the recovered account username or ACCOUNT_NOT_FOUND
function xmlrpc_recover_phone_account_overload($method, $args) {
}
?>
......@@ -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';
?>
......@@ -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
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment