mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
merge again
This commit is contained in:
commit
a15c1ef168
@ -120,6 +120,14 @@ if(WIN32)
|
||||
|
||||
|
||||
else (WIN32)
|
||||
find_library(MYSQL_LIBRARIES libmariadb.so PATHS ${MARIADB_CONNECTOR_PATH} REQUIRED)
|
||||
find_library(CONAN_OPENSSL_SSL ssl PATHS ${CONAN_LIB_DIRS_OPENSSL} REQUIRED NO_DEFAULT_PATH )
|
||||
find_library(CONAN_OPENSSL_CRYPTO crypto PATHS ${CONAN_LIB_DIRS_OPENSSL} REQUIRED NO_DEFAULT_PATH )
|
||||
set(GRPC_PROTOBUF_DEBUG_PATH "${GRPC_PROTOBUF_PATH}")
|
||||
|
||||
list(REMOVE_ITEM CONAN_LIBS "ssl")
|
||||
list(REMOVE_ITEM CONAN_LIBS "crypto")
|
||||
list(REMOVE_ITEM CONAN_LIBS "dl")
|
||||
|
||||
find_library(MYSQL_LIBRARIES libmariadb.so PATHS ${MARIADB_CONNECTOR_PATH} REQUIRED)
|
||||
find_library(CONAN_OPENSSL_SSL ssl PATHS ${CONAN_LIB_DIRS_OPENSSL} REQUIRED NO_DEFAULT_PATH )
|
||||
@ -132,7 +140,6 @@ else (WIN32)
|
||||
|
||||
endif(WIN32)
|
||||
|
||||
|
||||
# load same ssl version like used from poco
|
||||
#find_package(OpenSSL PATHS . NO_DEFAULT_PATH)
|
||||
|
||||
@ -156,7 +163,6 @@ if(WIN32)
|
||||
|
||||
else(WIN32)
|
||||
|
||||
|
||||
set(INSTALL_BINDIR "bin")
|
||||
set(INSTALL_PLUGINDIR "bin")
|
||||
|
||||
@ -167,11 +173,9 @@ else(WIN32)
|
||||
|
||||
endif(WIN32)
|
||||
|
||||
|
||||
set(GRPC_LIBS libprotobuf grpc++_reflection grpc++)
|
||||
target_link_libraries(Gradido_LoginServer ${CONAN_LIBS})
|
||||
|
||||
|
||||
if(WIN32)
|
||||
TARGET_LINK_LIBRARIES(Gradido_LoginServer optimized ${MYSQL_LIBRARIES} Shlwapi)
|
||||
TARGET_LINK_LIBRARIES(Gradido_LoginServer debug ${COMPILED_MARIADB_CLIENT_DEBUG} Shlwapi)
|
||||
@ -211,4 +215,4 @@ else(WIN32)
|
||||
target_link_libraries(Gradido_LoginServer_Test ${MYSQL_LIBRARIES} ${CONAN_OPENSSL_CUSTOM_LIBS} ${GRPC_LIBS} ${CMAKE_DL_LIBS} ${PROTOBUF_LIBS})
|
||||
endif(WIN32)
|
||||
|
||||
add_test(NAME main COMMAND Gradido_LoginServer_Test)
|
||||
add_test(NAME main COMMAND Gradido_LoginServer_Test)
|
||||
|
||||
@ -8,8 +8,9 @@ fi
|
||||
|
||||
./protoc --cpp_out=./src/cpp/proto --proto_path=./src/proto ./src/proto/gradido/*.proto
|
||||
|
||||
#if [ ! -d "./src/cpp/proto/hedera" ] ; then
|
||||
# mkdir ./src/cpp/proto/hedera
|
||||
#fi
|
||||
if [ ! -d "./src/cpp/proto/hedera" ] ; then
|
||||
mkdir ./src/cpp/proto/hedera
|
||||
fi
|
||||
|
||||
|
||||
./protoc --plugin=protoc-gen-grpc=./grpc_cpp_plugin.exe --cpp_out=./src/cpp/proto/hedera --grpc_out=./src/cpp/proto/hedera --proto_path=./src/proto/hedera/hedera-protobuf/src/main/proto ./src/proto/hedera/hedera-protobuf/src/main/proto/*.proto
|
||||
|
||||
@ -319,12 +319,15 @@ void LoginPage::handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::
|
||||
responseStream << " <div class=\"center-form-bottom\">\n";
|
||||
responseStream << " <div class=\"signup-link\">\n";
|
||||
responseStream << "\t <p>";
|
||||
#line 183 "D:\\code\\gradido\\gradido_login_server_grpc\\src\\cpsp\\login.cpsp"
|
||||
#line 176 "F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp"
|
||||
responseStream << ( langCatalog->gettext("You haven't any account yet? Please follow the link to create one.") );
|
||||
responseStream << "</p>\n";
|
||||
responseStream << "\t <a href=\"https://elopage.com/s/gradido/registration-de/payment?locale=de\">\n";
|
||||
responseStream << "\t <a href=\"";
|
||||
#line 177 "F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp"
|
||||
responseStream << ( ServerConfig::g_serverPath );
|
||||
responseStream << "/registerDirect\">\n";
|
||||
responseStream << "\t\t\t";
|
||||
#line 185 "D:\\code\\gradido\\gradido_login_server_grpc\\src\\cpsp\\login.cpsp"
|
||||
#line 178 "F:\\Gradido\\gradido_login_server\\src\\cpsp\\login.cpsp"
|
||||
responseStream << ( langCatalog->gettext("Create New Account") );
|
||||
responseStream << "\n";
|
||||
responseStream << "\t\t </a>\n";
|
||||
|
||||
@ -35,7 +35,6 @@ Poco::JSON::Object* JsonCreateUser::handle(Poco::Dynamic::Var params)
|
||||
paramJsonObject->get("last_name").convert(last_name);
|
||||
paramJsonObject->get("emailType").convert(emailType);
|
||||
paramJsonObject->get("group_id").convert(group_id);
|
||||
|
||||
if ((ServerConfig::g_AllowUnsecureFlags & ServerConfig::UNSECURE_PASSWORD_REQUESTS)) {
|
||||
paramJsonObject->get("password").convert(password);
|
||||
}
|
||||
|
||||
@ -35,10 +35,6 @@ Poco::JSON::Object* JsonTransaction::handle(Poco::Dynamic::Var params)
|
||||
if (!paramJsonObject->isNull("balance")) {
|
||||
paramJsonObject->get("balance").convert(balance);
|
||||
if (balance) {
|
||||
auto u = session->getUser();
|
||||
if (u) {
|
||||
u->setBalance(balance);
|
||||
}
|
||||
auto nu = session->getNewUser();
|
||||
if (!nu.isNull()) {
|
||||
nu->setBalance(balance);
|
||||
|
||||
@ -74,7 +74,6 @@ Poco::Data::Session ConnectionManager::getConnection(ConnectionType type)
|
||||
}
|
||||
auto session = mSessionPools.getPool(mSessionPoolNames[type]).get();
|
||||
|
||||
|
||||
//return mSessionPoolNames[type];
|
||||
/*if (!session.isConnected()) {
|
||||
printf("reconnect called\n");
|
||||
|
||||
@ -445,7 +445,6 @@ namespace controller {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int User::addMissingEmailHashes()
|
||||
{
|
||||
auto cm = ConnectionManager::getInstance();
|
||||
@ -499,6 +498,4 @@ namespace controller {
|
||||
}
|
||||
return updated_count;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -29,8 +29,7 @@ public:
|
||||
virtual bool isError() { return true; }
|
||||
|
||||
protected:
|
||||
std::string mFunctionName;
|
||||
std::string mMessage;
|
||||
|
||||
};
|
||||
|
||||
class ParamError : public Error
|
||||
|
||||
@ -190,5 +190,95 @@ JsonRequestReturn JsonRequest::requestGRPCRelay(const Poco::Net::NameValueCollec
|
||||
|
||||
|
||||
|
||||
return JSON_REQUEST_RETURN_OK;
|
||||
}
|
||||
#include "Poco/JSON/Stringifier.h"
|
||||
JsonRequestReturn JsonRequest::requestGRPCRelay(const Poco::Net::NameValueCollection& payload)
|
||||
{
|
||||
static const char* functionName = "JsonRequest::requestGRPCRelay";
|
||||
Poco::JSON::Object requestJson;
|
||||
|
||||
for (auto it = payload.begin(); it != payload.end(); it++) {
|
||||
requestJson.set(it->first, it->second);
|
||||
}
|
||||
|
||||
// send post request via https
|
||||
// 443 = HTTPS Default
|
||||
// TODO: adding port into ServerConfig
|
||||
try {
|
||||
Profiler phpRequestTime;
|
||||
Poco::Net::HTTPClientSession httpClientSession(mServerHost, mServerPort);
|
||||
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/hedera_rpc_relay/gRPCProxy.php");
|
||||
|
||||
request.setChunkedTransferEncoding(false);
|
||||
std::ostream& requestStream = httpClientSession.sendRequest(request);
|
||||
requestJson.stringify(requestStream);
|
||||
|
||||
std::stringstream ss;
|
||||
requestJson.stringify(ss);
|
||||
auto f = fopen("grpc.txt", "wt");
|
||||
std::string grpc = ss.str();
|
||||
fwrite(grpc.data(), grpc.size(), 1, f);
|
||||
fclose(f);
|
||||
|
||||
Poco::Net::HTTPResponse response;
|
||||
std::istream& request_stream = httpClientSession.receiveResponse(response);
|
||||
|
||||
// debugging answer
|
||||
|
||||
std::stringstream responseStringStream;
|
||||
for (std::string line; std::getline(request_stream, line); ) {
|
||||
responseStringStream << line << std::endl;
|
||||
}
|
||||
Poco::Logger& speedLog = Poco::Logger::get("SpeedLog");
|
||||
speedLog.information("[gRPC relay] php server time: %s", phpRequestTime.string());
|
||||
|
||||
// extract parameter from request
|
||||
Poco::JSON::Parser jsonParser;
|
||||
Poco::Dynamic::Var parsedJson;
|
||||
try {
|
||||
parsedJson = jsonParser.parse(responseStringStream.str());
|
||||
}
|
||||
catch (Poco::Exception& ex) {
|
||||
addError(new ParamError(functionName, "error parsing request answer grpc relay", ex.displayText().data()));
|
||||
|
||||
std::string fileName = "response_grpc_";
|
||||
fileName += ".html";
|
||||
|
||||
FILE* f = fopen(fileName.data(), "wt");
|
||||
std::string responseString = responseStringStream.str();
|
||||
fwrite(responseString.data(), 1, responseString.size(), f);
|
||||
fclose(f);
|
||||
// */
|
||||
sendErrorsAsEmail(responseStringStream.str());
|
||||
return JSON_REQUEST_RETURN_PARSE_ERROR;
|
||||
}
|
||||
|
||||
Poco::JSON::Object object = *parsedJson.extract<Poco::JSON::Object::Ptr>();
|
||||
auto state = object.get("state");
|
||||
std::string stateString = state.convert<std::string>();
|
||||
if (stateString == "error") {
|
||||
addError(new Error(functionName, "php server return error"));
|
||||
if (!object.isNull("msg")) {
|
||||
addError(new ParamError(functionName, "msg:", object.get("msg").convert<std::string>().data()));
|
||||
}
|
||||
if (!object.isNull("details")) {
|
||||
addError(new ParamError(functionName, "details:", object.get("details").convert<std::string>().data()));
|
||||
}
|
||||
sendErrorsAsEmail();
|
||||
return JSON_REQUEST_RETURN_ERROR;
|
||||
}
|
||||
ss.clear();
|
||||
Poco::JSON::Stringifier::stringify(object, ss);
|
||||
printf("json request result: %s\n", ss.str().data());
|
||||
}
|
||||
catch (Poco::Exception& e) {
|
||||
addError(new ParamError(functionName, "connect error to php server", e.displayText().data()));
|
||||
sendErrorsAsEmail();
|
||||
return JSON_REQUEST_CONNECT_ERROR;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return JSON_REQUEST_RETURN_OK;
|
||||
}
|
||||
@ -34,59 +34,12 @@
|
||||
|
||||
using namespace Poco::Data::Keywords;
|
||||
|
||||
int WriteEmailVerification::run()
|
||||
{
|
||||
auto em = ErrorManager::getInstance();
|
||||
|
||||
mEmailVerificationCode->getModel()->setUserId(mUser->getDBId());
|
||||
auto emailVerificationModel = mEmailVerificationCode->getModel();
|
||||
emailVerificationModel->setUserId(mUser->getDBId());
|
||||
if (!emailVerificationModel->insertIntoDB(true) || emailVerificationModel->errorCount() > 0) {
|
||||
emailVerificationModel->sendErrorsAsEmail();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------
|
||||
|
||||
int WritePassphraseIntoDB::run()
|
||||
{
|
||||
Profiler timeUsed;
|
||||
|
||||
// TODO: encrypt passphrase, need server admin crypto box pubkey
|
||||
//int crypto_box_seal(unsigned char *c, const unsigned char *m,
|
||||
//unsigned long long mlen, const unsigned char *pk);
|
||||
size_t mlen = mPassphrase.size();
|
||||
size_t crypto_size = crypto_box_SEALBYTES + mlen;
|
||||
|
||||
auto em = ErrorManager::getInstance();
|
||||
|
||||
auto dbSession = ConnectionManager::getInstance()->getConnection(CONNECTION_MYSQL_LOGIN_SERVER);
|
||||
Poco::Data::Statement insert(dbSession);
|
||||
insert << "INSERT INTO user_backups (user_id, passphrase) VALUES(?,?)",
|
||||
use(mUserId), use(mPassphrase);
|
||||
try {
|
||||
if (insert.execute() != 1) {
|
||||
em->addError(new ParamError("WritePassphraseIntoDB::run", "inserting passphrase for user failed", std::to_string(mUserId)));
|
||||
em->sendErrorsAsEmail();
|
||||
}
|
||||
}
|
||||
catch (Poco::Exception& ex) {
|
||||
em->addError(new ParamError("WritePassphraseIntoDB::run", "insert passphrase mysql error", ex.displayText().data()));
|
||||
em->sendErrorsAsEmail();
|
||||
}
|
||||
|
||||
//printf("[WritePassphraseIntoDB] timeUsed: %s\n", timeUsed.string().data());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Session::Session(int handle)
|
||||
: mHandleId(handle), mSessionUser(nullptr), mState(SESSION_STATE_EMPTY), mActive(false)
|
||||
: mHandleId(handle), mState(SESSION_STATE_EMPTY), mActive(false)
|
||||
{
|
||||
|
||||
}
|
||||
@ -109,7 +62,6 @@ void Session::reset()
|
||||
//printf("[Session::reset]\n");
|
||||
lock("Session::reset");
|
||||
std::unique_lock<std::shared_mutex> _lock(mSharedMutex);
|
||||
mSessionUser.assign(nullptr);
|
||||
mNewUser.assign(nullptr);
|
||||
mEmailVerificationCodeObject.assign(nullptr);
|
||||
|
||||
@ -471,16 +423,8 @@ int Session::updateEmailVerification(Poco::UInt64 emailVerificationCode)
|
||||
}
|
||||
auto email_verification_code_model = mEmailVerificationCodeObject->getModel();
|
||||
assert(email_verification_code_model);
|
||||
if(email_verification_code_model->getCode() == emailVerificationCode) {
|
||||
if (mSessionUser && mSessionUser->getDBId() == 0) {
|
||||
//addError(new Error("E-Mail Verification", "Benutzer wurde nicht richtig gespeichert, bitte wende dich an den Server-Admin"));
|
||||
em->addError(new Error(funcName, "user exist with 0 as id"));
|
||||
em->sendErrorsAsEmail();
|
||||
|
||||
//return false;
|
||||
return -2;
|
||||
}
|
||||
|
||||
if(email_verification_code_model->getCode() == emailVerificationCode)
|
||||
{
|
||||
// load correct user from db
|
||||
if (mNewUser.isNull() || !mNewUser->getModel() || mNewUser->getModel()->getID() != email_verification_code_model->getUserId()) {
|
||||
mNewUser = controller::User::create();
|
||||
@ -502,7 +446,6 @@ int Session::updateEmailVerification(Poco::UInt64 emailVerificationCode)
|
||||
first_email_activation = true;
|
||||
}
|
||||
if (first_email_activation && user_model->isEmailChecked()) {
|
||||
mSessionUser = new User(mNewUser);
|
||||
addError(new Error(gettext("E-Mail Verification"), gettext("Du hast dein Konto bereits aktiviert!")), false);
|
||||
|
||||
return 1;
|
||||
@ -541,28 +484,6 @@ int Session::updateEmailVerification(Poco::UInt64 emailVerificationCode)
|
||||
|
||||
return -2;
|
||||
|
||||
/*if (updated_rows == 1) {
|
||||
Poco::Data::Statement delete_row(dbConnection);
|
||||
delete_row << "DELETE FROM email_opt_in where verification_code = ?", use(emailVerificationCode);
|
||||
if (delete_row.execute() != 1) {
|
||||
em->addError(new Error(funcName, "delete from email_opt_in entry didn't work as expected, please check db"));
|
||||
em->sendErrorsAsEmail();
|
||||
}
|
||||
if (mSessionUser) {
|
||||
mSessionUser->setEmailChecked();
|
||||
mSessionUser->setLanguage(getLanguage());
|
||||
}
|
||||
updateState(SESSION_STATE_EMAIL_VERIFICATION_CODE_CHECKED);
|
||||
//printf("[%s] time: %s\n", funcName, usedTime.string().data());
|
||||
unlock();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
em->addError(new ParamError(funcName, "update user work not like expected, updated row count", updated_rows));
|
||||
em->sendErrorsAsEmail();
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
addError(new Error(gettext("E-Mail Verification"), gettext("Falscher Code für aktiven Login")));
|
||||
@ -579,7 +500,6 @@ int Session::updateEmailVerification(Poco::UInt64 emailVerificationCode)
|
||||
int Session::sendResetPasswordEmail(Poco::AutoPtr<controller::User> user, bool passphraseMemorized)
|
||||
{
|
||||
mNewUser = user;
|
||||
mSessionUser = new User(user);
|
||||
auto em = EmailManager::getInstance();
|
||||
|
||||
std::unique_lock<std::shared_mutex> _lock(mSharedMutex);
|
||||
@ -623,7 +543,7 @@ int Session::sendResetPasswordEmail(Poco::AutoPtr<controller::User> user, bool p
|
||||
|
||||
int Session::comparePassphraseWithSavedKeys(const std::string& inputPassphrase, const Mnemonic* wordSource)
|
||||
{
|
||||
KeyPair keys;
|
||||
|
||||
static const char* functionName = "Session::comparePassphraseWithSavedKeys";
|
||||
if (!wordSource) {
|
||||
addError(new Error(functionName, "wordSource is empty"));
|
||||
@ -831,9 +751,7 @@ UserState Session::loadUser(const std::string& email, const std::string& passwor
|
||||
if (user_model && user_model->isDisabled()) {
|
||||
return USER_DISABLED;
|
||||
}
|
||||
|
||||
if (mNewUser->getUserState() >= USER_LOADED_FROM_DB) {
|
||||
|
||||
int loginResult = mNewUser->login(password);
|
||||
int exitCount = 0;
|
||||
if (loginResult == -3)
|
||||
@ -908,6 +826,7 @@ UserState Session::loadUser(const std::string& email, const std::string& passwor
|
||||
}
|
||||
|
||||
detectSessionState();
|
||||
unlock();
|
||||
if (0 == mNewUser->getModel()->getGroupId()) {
|
||||
return USER_NO_GROUP;
|
||||
}
|
||||
@ -985,7 +904,6 @@ SESSION_STATE_COUNT
|
||||
*/
|
||||
void Session::detectSessionState()
|
||||
{
|
||||
|
||||
if (mNewUser.isNull() || !mNewUser->getModel() || mNewUser->getPassword().isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -17,11 +17,11 @@ TransactionCreation::~TransactionCreation()
|
||||
int TransactionCreation::prepare()
|
||||
{
|
||||
const static char functionName[] = { "TransactionCreation::prepare" };
|
||||
if (!mProtoCreation.has_receiveramount()) {
|
||||
if (!mProtoCreation.has_receiver()) {
|
||||
addError(new Error(functionName, "hasn't receiver amount"));
|
||||
return -1;
|
||||
}
|
||||
auto receiverAmount = mProtoCreation.receiveramount();
|
||||
auto receiver_amount = mProtoCreation.receiver();
|
||||
|
||||
if (receiverAmount.amount() <= 0) {
|
||||
addError(new Error(functionName, "amount must be > 0"));
|
||||
@ -43,8 +43,7 @@ int TransactionCreation::prepare()
|
||||
getErrors(mReceiverUser->getModel());
|
||||
if (mReceiverUser->getUserState() == USER_EMPTY) {
|
||||
sodium_bin2hex(mReceiverPublicHex, 65, (const unsigned char*)receiverPublic.data(), receiverPublic.size());
|
||||
delete mReceiverUser;
|
||||
mReceiverUser = nullptr;
|
||||
mReceiverUser.assign(nullptr);
|
||||
}
|
||||
else {
|
||||
memcpy(mReceiverPublicHex, mReceiverUser->getModel()->getPublicKeyHex().data(), 64);
|
||||
|
||||
@ -62,22 +62,11 @@ int TransactionTransfer::prepare()
|
||||
{
|
||||
lock();
|
||||
const static char functionName[] = { "TransactionTransfer::prepare" };
|
||||
if (mProtoTransfer.senderamounts_size() == 0) {
|
||||
addError(new Error(functionName, "hasn't sender amount(s)"));
|
||||
unlock();
|
||||
return -1;
|
||||
}
|
||||
if (mProtoTransfer.receiveramounts_size() == 0) {
|
||||
addError(new Error(functionName, "hasn't receiver amount(s)"));
|
||||
unlock();
|
||||
return -2;
|
||||
}
|
||||
mKontoTable.reserve(mProtoTransfer.senderamounts_size() + mProtoTransfer.receiveramounts_size());
|
||||
|
||||
mKontoTable.reserve(2);
|
||||
|
||||
//auto receiverAmount = mProtoTransfer.receiveramount();
|
||||
//auto senderAmount
|
||||
int senderSum = 0;
|
||||
int receiverSum = 0;
|
||||
|
||||
char pubkeyHexTemp[65];
|
||||
|
||||
@ -125,25 +114,15 @@ int TransactionTransfer::prepare()
|
||||
mKontoTable.push_back(KontoTableEntry(pubkeyHexTemp, senderAmount.amount(), true));
|
||||
}
|
||||
else {
|
||||
mKontoTable.push_back(KontoTableEntry(user->getModel(), senderAmount.amount(), true));
|
||||
mKontoTable.push_back(KontoTableEntry(sender_user->getModel(), -amount, true));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < mProtoTransfer.receiveramounts_size(); i++) {
|
||||
auto receiverAmount = mProtoTransfer.receiveramounts(i);
|
||||
auto pubkey = receiverAmount.ed25519_receiver_pubkey();
|
||||
receiverSum += receiverAmount.amount();
|
||||
if (receiverAmount.ed25519_receiver_pubkey().size() != 32) {
|
||||
addError(new ParamError(functionName, "invalid public key for receiver ", i));
|
||||
unlock();
|
||||
return -4;
|
||||
}
|
||||
auto user = controller::User::create();
|
||||
if (!user->load((const unsigned char*)pubkey.data())) {
|
||||
sodium_bin2hex(pubkeyHexTemp, 65, (const unsigned char*)pubkey.data(), pubkey.size());
|
||||
mKontoTable.push_back(KontoTableEntry(pubkeyHexTemp, receiverAmount.amount(), false));
|
||||
|
||||
if (!receiver_user->load((const unsigned char*)receiver_pubkey.data())) {
|
||||
sodium_bin2hex(pubkeyHexTemp, 65, (const unsigned char*)receiver_pubkey.data(), receiver_pubkey.size());
|
||||
mKontoTable.push_back(KontoTableEntry(pubkeyHexTemp, amount, true));
|
||||
}
|
||||
else {
|
||||
mKontoTable.push_back(KontoTableEntry(user->getModel(), receiverAmount.amount(), false));
|
||||
mKontoTable.push_back(KontoTableEntry(sender_user->getModel(), amount, true));
|
||||
}
|
||||
}
|
||||
if (senderSum != receiverSum) {
|
||||
@ -199,5 +178,3 @@ const std::string& TransactionTransfer::getAmountCell(int index)
|
||||
|
||||
return mKontoTable[index].amountCell;
|
||||
}
|
||||
|
||||
>>>>>>> 1e4ae4a (update proto files matching with pauls proto version, update code which use them)
|
||||
|
||||
@ -56,7 +56,6 @@ namespace model {
|
||||
size_t updateFieldsFromCommunityServer();
|
||||
|
||||
// default getter unlocked
|
||||
|
||||
inline const std::string getEmail() const { SHARED_LOCK; return mEmail; }
|
||||
inline const std::string getFirstName() const { SHARED_LOCK; return mFirstName; }
|
||||
inline const std::string getLastName() const { SHARED_LOCK; return mLastName; }
|
||||
|
||||
@ -101,7 +101,6 @@
|
||||
|
||||
<% } else if(transactionBody.has_creation()) {
|
||||
auto creation = transactionBody.creation();
|
||||
|
||||
TransactionCreation creationObject("", creation);
|
||||
auto receiver = creation.receiver();
|
||||
char hex[65]; memset(hex, 0, 65);
|
||||
|
||||
@ -26,8 +26,8 @@
|
||||
auto langCatalog = lm->getFreeCatalog(lang);
|
||||
|
||||
std::string presetEmail("");
|
||||
if(mSession && mSession->getUser()) {
|
||||
presetEmail = mSession->getUser()->getEmail();
|
||||
if(mSession && mSession->getNewUser()) {
|
||||
presetEmail = mSession->getNewUser()->getModel()->getEmail();
|
||||
}
|
||||
|
||||
if(!form.empty()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user