gradido/login_server/src/cpp/JSONInterface/JsonUpdateUserInfos.h
einhornimmond 4df9ad380f make change password behave more like the other
- more tests
- make session_id optional, if not set take Login-Server Cookie
- check only for password_old if user was logged in with password, else reset password from email wouldn't work
- make successfull change password also add 1 to valid_values
- don't update other fields in db if only update password was called
2021-06-14 16:41:03 +02:00

28 lines
763 B
C++

#ifndef __JSON_INTERFACE_JSON_UPDATE_USER_INFOS_
#define __JSON_INTERFACE_JSON_UPDATE_USER_INFOS_
#include "JsonRequestHandler.h"
/*!
* @author Dario Rekowski
* @date 2020-07-30
* @brief to update non critical user data like first-name and last-name from community server with valid login-server session id
*
* works only for admins
*/
class JsonUpdateUserInfos : public JsonRequestHandler
{
public:
JsonUpdateUserInfos(Session* session);
Poco::JSON::Object* handle(Poco::Dynamic::Var params);
protected:
std::string validateString(Poco::Dynamic::Var value, const char* fieldName, Poco::JSON::Array& errorArray);
bool isOldPasswordValid(Poco::JSON::Object::Ptr updates, Poco::JSON::Array& errors);
};
#endif // __JSON_INTERFACE_JSON_UPDATE_USER_INFOS_