diff --git a/sddm-0.14.0/src/auth/AuthRequest.cpp b/sddm-0.14.0/src/auth/AuthRequest.cpp index 0d82503..abf6049 100644 --- a/sddm-0.14.0/src/auth/AuthRequest.cpp +++ b/sddm-0.14.0/src/auth/AuthRequest.cpp @@ -138,20 +138,24 @@ namespace SDDM { return NULL; } + void AuthRequest::setPrompts(AuthPrompt::Type type, const QString &data) const { + for (AuthPrompt* qap : d->prompts) { + if(qap->type()==type) { + qap->setResponse(qPrintable(data)); + } + } + } + void AuthRequest::setChangeResponse(const QString ¤tPwd, const QString &newPassword) { - AuthPrompt* prompt; if(!currentPwd.isNull()) { - prompt = findPrompt(AuthPrompt::CHANGE_CURRENT); - if(prompt) prompt->setResponse(qPrintable(currentPwd)); + setPrompts(AuthPrompt::CHANGE_CURRENT, currentPwd); } if(!newPassword.isNull()) { - prompt = findPrompt(AuthPrompt::CHANGE_NEW); - if(prompt) prompt->setResponse(qPrintable(newPassword)); + setPrompts(AuthPrompt::CHANGE_NEW, newPassword); - prompt = findPrompt(AuthPrompt::CHANGE_REPEAT); - if(prompt) prompt->setResponse(qPrintable(newPassword)); + setPrompts(AuthPrompt::CHANGE_REPEAT, newPassword); } } } diff --git a/sddm-0.14.0/src/auth/AuthRequest.h b/sddm-0.14.0/src/auth/AuthRequest.h index 15ebe0b..213a8d6 100644 --- a/sddm-0.14.0/src/auth/AuthRequest.h +++ b/sddm-0.14.0/src/auth/AuthRequest.h @@ -129,6 +129,8 @@ namespace SDDM { */ AuthPrompt *findPrompt(AuthPrompt::Type type) const; + void setPrompts(AuthPrompt::Type type, const QString &data) const; + public Q_SLOTS: /** * Call this slot when all prompts has been filled (with responses) to your satisfaction diff --git a/sddm-0.14.0/src/helper/backend/PamBackend.cpp b/sddm-0.14.0/src/helper/backend/PamBackend.cpp index f8bbcdc..87f2b64 100644 --- a/sddm-0.14.0/src/helper/backend/PamBackend.cpp +++ b/sddm-0.14.0/src/helper/backend/PamBackend.cpp @@ -32,26 +32,26 @@ namespace SDDM { static Request loginRequest { { { AuthPrompt::LOGIN_USER, QStringLiteral("login:"), false }, - { AuthPrompt::LOGIN_PASSWORD, QStringLiteral("Password: "), true }, { AuthPrompt::LOGIN_USER, QStringLiteral("учетная запись:"), false }, + { AuthPrompt::LOGIN_PASSWORD, QStringLiteral("Password: "), true }, { AuthPrompt::LOGIN_PASSWORD, QStringLiteral("Пароль: "), true } } }; static Request changePassRequest { { { AuthPrompt::CHANGE_CURRENT, QStringLiteral("(current) UNIX password: "), true }, - { AuthPrompt::CHANGE_NEW, QStringLiteral("New password: "), true }, - { AuthPrompt::CHANGE_REPEAT, QStringLiteral("Retype new password: "), true }, { AuthPrompt::CHANGE_CURRENT, QStringLiteral("(текущий) пароль UNIX: "), true }, + { AuthPrompt::CHANGE_NEW, QStringLiteral("New password: "), true }, { AuthPrompt::CHANGE_NEW, QStringLiteral("Новый пароль: "), true }, + { AuthPrompt::CHANGE_REPEAT, QStringLiteral("Retype new password: "), true }, { AuthPrompt::CHANGE_REPEAT, QStringLiteral("Повторите ввод пароля: "), true } } }; static Request changePassNoOldRequest { { { AuthPrompt::CHANGE_NEW, QStringLiteral("New password: "), true }, - { AuthPrompt::CHANGE_REPEAT, QStringLiteral("Retype new password: "), true }, { AuthPrompt::CHANGE_NEW, QStringLiteral("Новый пароль: "), true }, + { AuthPrompt::CHANGE_REPEAT, QStringLiteral("Retype new password: "), true }, { AuthPrompt::CHANGE_REPEAT, QStringLiteral("Повторите ввод пароля: "), true } } };