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();
|
return emailVerificationCode->getModel()->getCode();
|
||||||
}
|
}
|
||||||
catch (Poco::Exception& ex) {
|
catch (Poco::Exception& ex) {
|
||||||
ErrorList errors;
|
NotificationList errors;
|
||||||
//printf("exception: %s\n", ex.displayText().data());
|
//printf("exception: %s\n", ex.displayText().data());
|
||||||
errors.addError(new ParamError("JsonGetUserInfos::readOrCreateEmailVerificationCode", "exception: ", ex.displayText()));
|
errors.addError(new ParamError("JsonGetUserInfos::readOrCreateEmailVerificationCode", "exception: ", ex.displayText()));
|
||||||
errors.sendErrorsAsEmail();
|
errors.sendErrorsAsEmail();
|
||||||
|
|||||||
@ -110,7 +110,7 @@ Poco::JSON::Object* JsonSendEmail::handle(Poco::Dynamic::Var params)
|
|||||||
{
|
{
|
||||||
session = sm->getNewSession();
|
session = sm->getNewSession();
|
||||||
if (emailType == model::EMAIL_USER_RESET_PASSWORD) {
|
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) {
|
if (1 == r) {
|
||||||
return stateWarning("email already sended");
|
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");
|
jsonErrorsArray.add("User.password isn't string");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ErrorList errors;
|
NotificationList errors;
|
||||||
if (!sm->checkPwdValidation(value.toString(), &errors)) {
|
if (!sm->checkPwdValidation(value.toString(), &errors)) {
|
||||||
jsonErrorsArray.add("User.password isn't valid");
|
jsonErrorsArray.add("User.password isn't valid");
|
||||||
jsonErrorsArray.add(errors.getErrorsArray());
|
jsonErrorsArray.add(errors.getErrorsArray());
|
||||||
|
|||||||
@ -95,7 +95,7 @@ int EmailManager::ThreadFunction()
|
|||||||
if (mPendingEmails.empty()) return 0;
|
if (mPendingEmails.empty()) return 0;
|
||||||
|
|
||||||
auto lm = LanguageManager::getInstance();
|
auto lm = LanguageManager::getInstance();
|
||||||
ErrorList errors;
|
NotificationList errors;
|
||||||
static const char* function_name = "PrepareEmailTask";
|
static const char* function_name = "PrepareEmailTask";
|
||||||
|
|
||||||
Poco::Net::SecureSMTPClientSession mailClientSession(mEmailAccount.url, mEmailAccount.port);
|
Poco::Net::SecureSMTPClientSession mailClientSession(mEmailAccount.url, mEmailAccount.port);
|
||||||
|
|||||||
@ -121,11 +121,16 @@ namespace controller {
|
|||||||
|
|
||||||
std::string EmailVerificationCode::getLink()
|
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] != '/') {
|
if (link.data()[link.size() - 1] != '/') {
|
||||||
link += '/';
|
link += '/';
|
||||||
}
|
}
|
||||||
link += std::to_string(getModel()->getCode());
|
link += std::to_string(getModel()->getCode());
|
||||||
|
|
||||||
return link;
|
return link;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ namespace controller {
|
|||||||
select.execute();
|
select.execute();
|
||||||
}
|
}
|
||||||
catch (Poco::Exception& ex) {
|
catch (Poco::Exception& ex) {
|
||||||
ErrorList errors;
|
NotificationList errors;
|
||||||
errors.addError(new ParamError(functionName, "mysql error ", ex.displayText()));
|
errors.addError(new ParamError(functionName, "mysql error ", ex.displayText()));
|
||||||
errors.addError(new ParamError(functionName, "search string", searchString));
|
errors.addError(new ParamError(functionName, "search string", searchString));
|
||||||
errors.addError(new ParamError(functionName, "account state", accountState));
|
errors.addError(new ParamError(functionName, "account state", accountState));
|
||||||
|
|||||||
@ -410,6 +410,9 @@ int Session::sendResetPasswordEmail(Poco::AutoPtr<controller::User> user, bool p
|
|||||||
else {
|
else {
|
||||||
email_already_send = true;
|
email_already_send = true;
|
||||||
}
|
}
|
||||||
|
if (baseUrl.size() > 0) {
|
||||||
|
mEmailVerificationCodeObject->setBaseUrl(baseUrl);
|
||||||
|
}
|
||||||
auto email_verification_model = mEmailVerificationCodeObject->getModel();
|
auto email_verification_model = mEmailVerificationCodeObject->getModel();
|
||||||
if (email_already_send) {
|
if (email_already_send) {
|
||||||
auto time_elapsed = Poco::DateTime() - email_verification_model->getUpdated();
|
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 (!frequent_resend) {
|
||||||
if (passphraseMemorized) {
|
if (passphraseMemorized) {
|
||||||
mEmailVerificationCodeObject->setBaseUrl(baseUrl);
|
|
||||||
em->addEmail(new model::Email(mEmailVerificationCodeObject, mNewUser, model::EMAIL_USER_RESET_PASSWORD));
|
em->addEmail(new model::Email(mEmailVerificationCodeObject, mNewUser, model::EMAIL_USER_RESET_PASSWORD));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
//#include "lib/Thread.h"
|
//#include "lib/Thread.h"
|
||||||
//#include "UniversumLib.h"
|
//#include "UniversumLib.h"
|
||||||
#include "Thread.h"
|
#include "Thread.h"
|
||||||
#include "../lib/ErrorList.h"
|
#include "../lib/NotificationList.h"
|
||||||
|
|
||||||
namespace UniLib {
|
namespace UniLib {
|
||||||
namespace lib {
|
namespace lib {
|
||||||
@ -57,7 +57,7 @@ namespace UniLib {
|
|||||||
void Thread::run()
|
void Thread::run()
|
||||||
{
|
{
|
||||||
static const char* function_name = "Thread::run";
|
static const char* function_name = "Thread::run";
|
||||||
ErrorList errors;
|
NotificationList errors;
|
||||||
//Thread* t = this;
|
//Thread* t = this;
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user