Commit 4b91231b authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added algo in activation link URL

parent eae267e2
Pipeline #7616 passed with stage
in 14 seconds
......@@ -19,7 +19,7 @@ define("EMAIL_SITE", "https://linphone.org");
/*
* The link to open when click on activation
* It can have a %link% and an %username% parameter
* It can have a %link%, %username% and %algo% parameter
*
* Default value: www.linphone.org
*/
......
......@@ -64,7 +64,7 @@ function send_email($email, $subject, $text, $html) {
}
}
function send_email_with_activation_link($email, $key, $username) {
function send_email_with_activation_link($email, $key, $username, $algo) {
if( !EMAIL_ENABLED ){
Logger::getInstance()->warning("[EMAIL] Emails are disabled");
return "WARNING_EMAILS_DISABLED";
......@@ -77,6 +77,7 @@ function send_email_with_activation_link($email, $key, $username) {
$link = $pageURL . EMAIL_ACTIVATION_LINK;
$link = str_replace("%key%", $key, $link);
$link = str_replace("%username%", $username, $link);
$link = str_replace("%algo%", $algo, $link);
Logger::getInstance()->debug("[EMAIL] Activation link is " . $link);
$body = str_replace("%link%", $link, EMAIL_ACTIVATION_BODY);
......
......@@ -88,7 +88,7 @@ function xmlrpc_create_email_account($method, $args) {
}
if (SEND_ACTIVATION_EMAIL && EMAIL_ENABLED) {
send_email_with_activation_link($email, $account->confirmation_key, $account->username);
send_email_with_activation_link($email, $account->confirmation_key, $account->username, $algo);
} else if (AUTO_ACTIVATE_ACCOUNT) {
//TODO
/*if (USE_IN_APP_PURCHASES) {
......@@ -165,7 +165,7 @@ function xmlrpc_create_email_md5_sha256_account($method, $args) {
}
if (SEND_ACTIVATION_EMAIL && EMAIL_ENABLED) {
send_email_with_activation_link($email, $account->confirmation_key, $account->username);
send_email_with_activation_link($email, $account->confirmation_key, $account->username, SHA256);
} else if (AUTO_ACTIVATE_ACCOUNT) {
//TODO
/*if (USE_IN_APP_PURCHASES) {
......
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