mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fix bugs which came with merging into master
This commit is contained in:
parent
910e33deff
commit
fa48de44af
@ -19,7 +19,7 @@ Poco::UInt64 JsonGetUserInfos::readOrCreateEmailVerificationCode(int user_id, mo
|
||||
return emailVerificationCode->getModel()->getCode();
|
||||
}
|
||||
catch (Poco::Exception& ex) {
|
||||
ErrorList errors;
|
||||
NotificationList errors;
|
||||
//printf("exception: %s\n", ex.displayText().data());
|
||||
errors.addError(new ParamError("JsonGetUserInfos::readOrCreateEmailVerificationCode", "exception: ", ex.displayText()));
|
||||
errors.sendErrorsAsEmail();
|
||||
|
||||
@ -110,7 +110,7 @@ Poco::JSON::Object* JsonSendEmail::handle(Poco::Dynamic::Var params)
|
||||
{
|
||||
session = sm->getNewSession();
|
||||
if (emailType == model::EMAIL_USER_RESET_PASSWORD) {
|
||||
auto r = session->sendResetPasswordEmail(receiver_user, false);
|
||||
auto r = session->sendResetPasswordEmail(receiver_user, false, receiver_user->getGroupBaseUrl());
|
||||
if (1 == r) {
|
||||
return stateWarning("email already sended");
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ Poco::JSON::Object* JsonUpdateUserInfos::handle(Poco::Dynamic::Var params)
|
||||
jsonErrorsArray.add("User.password isn't string");
|
||||
}
|
||||
else {
|
||||
ErrorList errors;
|
||||
NotificationList errors;
|
||||
if (!sm->checkPwdValidation(value.toString(), &errors)) {
|
||||
jsonErrorsArray.add("User.password isn't valid");
|
||||
jsonErrorsArray.add(errors.getErrorsArray());
|
||||
|
||||
@ -95,7 +95,7 @@ int EmailManager::ThreadFunction()
|
||||
if (mPendingEmails.empty()) return 0;
|
||||
|
||||
auto lm = LanguageManager::getInstance();
|
||||
ErrorList errors;
|
||||
NotificationList errors;
|
||||
static const char* function_name = "PrepareEmailTask";
|
||||
|
||||
Poco::Net::SecureSMTPClientSession mailClientSession(mEmailAccount.url, mEmailAccount.port);
|
||||
|
||||
@ -121,11 +121,16 @@ namespace controller {
|
||||
|
||||
std::string EmailVerificationCode::getLink()
|
||||
{
|
||||
std::string link = ServerConfig::g_frontend_checkEmailPath;
|
||||
std::string link = mBaseUrl;
|
||||
if (ServerConfig::g_frontend_checkEmailPath.size() > 1 && ServerConfig::g_frontend_checkEmailPath.data()[0] != '/') {
|
||||
link += '/';
|
||||
}
|
||||
link += ServerConfig::g_frontend_checkEmailPath;
|
||||
if (link.data()[link.size() - 1] != '/') {
|
||||
link += '/';
|
||||
}
|
||||
link += std::to_string(getModel()->getCode());
|
||||
|
||||
return link;
|
||||
}
|
||||
|
||||
|
||||
@ -81,7 +81,7 @@ namespace controller {
|
||||
select.execute();
|
||||
}
|
||||
catch (Poco::Exception& ex) {
|
||||
ErrorList errors;
|
||||
NotificationList errors;
|
||||
errors.addError(new ParamError(functionName, "mysql error ", ex.displayText()));
|
||||
errors.addError(new ParamError(functionName, "search string", searchString));
|
||||
errors.addError(new ParamError(functionName, "account state", accountState));
|
||||
|
||||
@ -410,6 +410,9 @@ int Session::sendResetPasswordEmail(Poco::AutoPtr<controller::User> user, bool p
|
||||
else {
|
||||
email_already_send = true;
|
||||
}
|
||||
if (baseUrl.size() > 0) {
|
||||
mEmailVerificationCodeObject->setBaseUrl(baseUrl);
|
||||
}
|
||||
auto email_verification_model = mEmailVerificationCodeObject->getModel();
|
||||
if (email_already_send) {
|
||||
auto time_elapsed = Poco::DateTime() - email_verification_model->getUpdated();
|
||||
@ -420,7 +423,6 @@ int Session::sendResetPasswordEmail(Poco::AutoPtr<controller::User> user, bool p
|
||||
|
||||
if (!frequent_resend) {
|
||||
if (passphraseMemorized) {
|
||||
mEmailVerificationCodeObject->setBaseUrl(baseUrl);
|
||||
em->addEmail(new model::Email(mEmailVerificationCodeObject, mNewUser, model::EMAIL_USER_RESET_PASSWORD));
|
||||
}
|
||||
else {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
//#include "lib/Thread.h"
|
||||
//#include "UniversumLib.h"
|
||||
#include "Thread.h"
|
||||
#include "../lib/ErrorList.h"
|
||||
#include "../lib/NotificationList.h"
|
||||
|
||||
namespace UniLib {
|
||||
namespace lib {
|
||||
@ -57,7 +57,7 @@ namespace UniLib {
|
||||
void Thread::run()
|
||||
{
|
||||
static const char* function_name = "Thread::run";
|
||||
ErrorList errors;
|
||||
NotificationList errors;
|
||||
//Thread* t = this;
|
||||
while (true) {
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user