diff --git a/docu/login_server.api.md b/docu/login_server.api.md index 51e29db96..e244885ba 100644 --- a/docu/login_server.api.md +++ b/docu/login_server.api.md @@ -215,6 +215,7 @@ return ## Send Emails Let send Login-Server Password reset E-Mail to User Can be also used for admin interface to resend email verification code + POST http://localhost/login_api/sendEmail ```json {"email": "max.musterman@gmail.de", "email_text":7, "email_verification_code_type":"resetPassword" } @@ -236,7 +237,7 @@ or: - "email admin user verification code" (5): used if admin trigger sending the email with email verification code - "email admin user verification code resend" (6): used if admin trigger sending the email with email verification code again - "user reset Password" (7): used for reset password email text - - "email custom tex" (8): used if custom email text should be used (than email_custom_text must also be filled) + - "email custom tex" (8): used if custom email text should be used (than email_custom_text and email_custom_subject must also be filled) - email_verification_code_type - resetPassword: for password resets, will be deleted immediately, is a only one use code, can be used without session_id - registerDirect: code generated by register for check email, can only be used by admins for another user @@ -248,7 +249,7 @@ or: - [duration] time span since user has created account (ex.: 10 Days) with largest unit, day is last unit - [link] login-server checkEmail link with email verification code (ex.: http://localhost/account/checkEmail/382738273892983) - [code] email verification code if you like to use your one link -- emailCustomSubject: for custom email the subject +- email_custom_subject (optional): for custom email the subject return ```json diff --git a/login_server/src/cpp/JSONInterface/JsonSendEmail.cpp b/login_server/src/cpp/JSONInterface/JsonSendEmail.cpp index f4525b3d7..aff4b8c77 100644 --- a/login_server/src/cpp/JSONInterface/JsonSendEmail.cpp +++ b/login_server/src/cpp/JSONInterface/JsonSendEmail.cpp @@ -42,8 +42,8 @@ Poco::JSON::Object* JsonSendEmail::handle(Poco::Dynamic::Var params) if (paramJsonObject->has("email_custom_text")) { paramJsonObject->get("email_custom_text").convert(emailCustomText); } - if (paramJsonObject->has("emailCustomSubject")) { - paramJsonObject->get("emailCustomSubject").convert(emailCustomSubject); + if (paramJsonObject->has("email_custom_subject")) { + paramJsonObject->get("email_custom_subject").convert(emailCustomSubject); } if (paramJsonObject->has("language")) { paramJsonObject->get("language").convert(languageCode); diff --git a/login_server/src/cpp/JSONInterface/JsonUpdateUserInfos.cpp b/login_server/src/cpp/JSONInterface/JsonUpdateUserInfos.cpp index 874ed033d..7add880aa 100644 --- a/login_server/src/cpp/JSONInterface/JsonUpdateUserInfos.cpp +++ b/login_server/src/cpp/JSONInterface/JsonUpdateUserInfos.cpp @@ -68,7 +68,7 @@ Poco::JSON::Object* JsonUpdateUserInfos::handle(Poco::Dynamic::Var params) try { - if ( "User.first_name" == name) { + if ( "User.first_name" == name && value.size() > 0) { if (!value.isString()) { jsonErrorsArray.add("User.first_name isn't a string"); } @@ -77,7 +77,7 @@ Poco::JSON::Object* JsonUpdateUserInfos::handle(Poco::Dynamic::Var params) extractet_values++; } } - else if ("User.last_name" == name) { + else if ("User.last_name" == name && value.size() > 0) { if (!value.isString()) { jsonErrorsArray.add("User.last_name isn't a string"); } @@ -103,7 +103,7 @@ Poco::JSON::Object* JsonUpdateUserInfos::handle(Poco::Dynamic::Var params) jsonErrorsArray.add("User.disabled isn't a boolean or integer"); } } - else if ("User.language" == name) { + else if ("User.language" == name && value.size() > 0) { if (!value.isString()) { jsonErrorsArray.add("User.language isn't a string"); } @@ -118,7 +118,7 @@ Poco::JSON::Object* JsonUpdateUserInfos::handle(Poco::Dynamic::Var params) } } } - else if ("User.password" == name && (ServerConfig::g_AllowUnsecureFlags & ServerConfig::UNSECURE_PASSWORD_REQUESTS) == ServerConfig::UNSECURE_PASSWORD_REQUESTS) { + else if ("User.password" == name && value.size() > 0 && (ServerConfig::g_AllowUnsecureFlags & ServerConfig::UNSECURE_PASSWORD_REQUESTS) == ServerConfig::UNSECURE_PASSWORD_REQUESTS) { if (!value.isString()) { jsonErrorsArray.add("User.password isn't string"); }