fixed: in notify/notify.cpp: a correct locale id should be taken
(we were not able to send: a mail with an activation link and a mail with the reset password link when we didn't have a locale with id 0 loaded) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@929 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
9ffda3e070
commit
083fa7857f
|
@ -434,7 +434,7 @@ cp_follow_symlinks = Podążaj za linkami symbolicznymi
|
||||||
|
|
||||||
slog_warning = Ostrzeżenie
|
slog_warning = Ostrzeżenie
|
||||||
slog_error = Błąd
|
slog_error = Błąd
|
||||||
slog_error = Informacja
|
slog_info = Informacja
|
||||||
unknown_filesystem = Nieznany system plików
|
unknown_filesystem = Nieznany system plików
|
||||||
no_such_dir = Nie ma takiego katalogu
|
no_such_dir = Nie ma takiego katalogu
|
||||||
unknown_mount_type = Nieprawidłowy rodzaj punktu montowania
|
unknown_mount_type = Nieprawidłowy rodzaj punktu montowania
|
||||||
|
|
|
@ -110,7 +110,7 @@ void Notify::ActivateAccount(const std::wstring & name, const std::wstring & ema
|
||||||
msg.code = WINIX_NOTIFY_CODE_CONFIRM_ACCOUNT;
|
msg.code = WINIX_NOTIFY_CODE_CONFIRM_ACCOUNT;
|
||||||
msg.name = name;
|
msg.name = name;
|
||||||
msg.email = email;
|
msg.email = email;
|
||||||
msg.lang = 0; // !! IMPROVE ME a better language can be chose
|
msg.lang = config->locale_default_id;
|
||||||
msg.activate_code = code;
|
msg.activate_code = code;
|
||||||
msg.template_index = notify_template_activate_account;
|
msg.template_index = notify_template_activate_account;
|
||||||
CreateActivateLink(name, code, msg.item_link);
|
CreateActivateLink(name, code, msg.item_link);
|
||||||
|
@ -126,7 +126,7 @@ void Notify::ResetPassword(const std::wstring & name, const std::wstring & email
|
||||||
msg.code = WINIX_NOTIFY_CODE_RESET_PASSWORD;
|
msg.code = WINIX_NOTIFY_CODE_RESET_PASSWORD;
|
||||||
msg.name = name;
|
msg.name = name;
|
||||||
msg.email = email;
|
msg.email = email;
|
||||||
msg.lang = 0; // !! IMPROVE ME a better language can be chose
|
msg.lang = config->locale_default_id; // !! IMPROVE ME a better language can be chose (the same as the user has)
|
||||||
msg.activate_code = code;
|
msg.activate_code = code;
|
||||||
msg.template_index = notify_template_reset_password;
|
msg.template_index = notify_template_reset_password;
|
||||||
CreateResetPasswordLink(name, code, msg.item_link);
|
CreateResetPasswordLink(name, code, msg.item_link);
|
||||||
|
|
|
@ -65,7 +65,7 @@ struct NotifyUserMsg
|
||||||
{
|
{
|
||||||
std::wstring name;
|
std::wstring name;
|
||||||
std::wstring email;
|
std::wstring email;
|
||||||
size_t lang;
|
size_t lang; // locale id (not an index)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -173,16 +173,17 @@ void NotifyThread::SendMail()
|
||||||
{
|
{
|
||||||
notify_stream.Clear();
|
notify_stream.Clear();
|
||||||
|
|
||||||
size_t lang_index = TemplatesNotifyFunctions::notify_user_msg.lang;
|
size_t lang_id = TemplatesNotifyFunctions::notify_user_msg.lang;
|
||||||
size_t template_index = TemplatesNotifyFunctions::notify_msg.template_index;
|
size_t template_index = TemplatesNotifyFunctions::notify_msg.template_index;
|
||||||
|
|
||||||
Lock();
|
Lock();
|
||||||
// 'patterns' object can use logger or other stuff so we use Lock() before
|
// 'patterns' object can use logger or other stuff so we use Lock() before
|
||||||
Ezc::Pattern * pat = patterns.Get(template_index, lang_index);
|
Ezc::Pattern * pat = patterns.Get(template_index, lang_id);
|
||||||
|
|
||||||
if( !pat )
|
if( !pat )
|
||||||
log << log1 << "NotifyThread: I don't have a template with index: " << template_index
|
log << log1 << "NotifyThread: I don't have a template with index: " << template_index
|
||||||
<< " and locale index: " << lang_index << logend;
|
<< " and locale id: " << lang_id << logend;
|
||||||
|
|
||||||
|
|
||||||
Unlock();
|
Unlock();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue