Added algo in activation link URL

This commit is contained in:
Sylvain Berfini 2019-09-02 11:57:46 +02:00
parent eae267e264
commit 4b91231b7a
3 changed files with 5 additions and 4 deletions

View file

@ -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
*/

View file

@ -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);

View file

@ -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) {