mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
move check if all passwords allow direct into pwdValidation so it will work with every code which ask for password
This commit is contained in:
parent
e7856ca7f9
commit
e2c38c1a0f
@ -51,7 +51,7 @@ Poco::JSON::Object* JsonCreateUser::handle(Poco::Dynamic::Var params)
|
|||||||
|
|
||||||
if (password.size()) {
|
if (password.size()) {
|
||||||
ErrorList errors;
|
ErrorList errors;
|
||||||
if (!(ServerConfig::g_AllowUnsecureFlags & ServerConfig::UNSECURE_ALLOW_ALL_PASSWORDS) && !sm->checkPwdValidation(password, &errors)) {
|
if (!sm->checkPwdValidation(password, &errors)) {
|
||||||
Poco::JSON::Object* result = new Poco::JSON::Object;
|
Poco::JSON::Object* result = new Poco::JSON::Object;
|
||||||
result->set("state", "error");
|
result->set("state", "error");
|
||||||
result->set("msg", errors.getLastError()->getString(false));
|
result->set("msg", errors.getLastError()->getString(false));
|
||||||
|
|||||||
@ -589,6 +589,10 @@ void SessionManager::deleteLoginCookies(Poco::Net::HTTPServerRequest& request, P
|
|||||||
|
|
||||||
bool SessionManager::checkPwdValidation(const std::string& pwd, ErrorList* errorReciver)
|
bool SessionManager::checkPwdValidation(const std::string& pwd, ErrorList* errorReciver)
|
||||||
{
|
{
|
||||||
|
if ((ServerConfig::g_AllowUnsecureFlags & ServerConfig::UNSECURE_ALLOW_ALL_PASSWORDS) == ServerConfig::UNSECURE_ALLOW_ALL_PASSWORDS) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isValid(pwd, VALIDATE_PASSWORD)) {
|
if (!isValid(pwd, VALIDATE_PASSWORD)) {
|
||||||
errorReciver->addError(new Error("Passwort", "Bitte gebe ein gültiges Password ein mit mindestens 8 Zeichen, Groß- und Kleinbuchstaben, mindestens einer Zahl und einem Sonderzeichen (@$!%*?&+-_) ein!"));
|
errorReciver->addError(new Error("Passwort", "Bitte gebe ein gültiges Password ein mit mindestens 8 Zeichen, Groß- und Kleinbuchstaben, mindestens einer Zahl und einem Sonderzeichen (@$!%*?&+-_) ein!"));
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user