From 7688ba080c0c69508847fca9aa36dc392ddbb766 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 8 Feb 2018 12:02:00 +0100 Subject: Support regex mangling of username before passing to lightdm --- src/loginform.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/loginform.cpp') diff --git a/src/loginform.cpp b/src/loginform.cpp index 823958d..a43e9a8 100644 --- a/src/loginform.cpp +++ b/src/loginform.cpp @@ -20,6 +20,7 @@ #include "ui_loginform.h" #include "settings.h" #include "global.h" +#include "namereplace.h" LoginForm::LoginForm(QWidget *parent) : QWidget(parent), @@ -73,12 +74,19 @@ void LoginForm::initialize() connect(Global::greeter(), SIGNAL(authenticationComplete()), this, SLOT(onAuthenticationComplete())); } + // Load regexp for name substitution + NameReplace::loadSubs(); + ui->leaveComboBox->setDisabled(ui->leaveComboBox->count() <= 1); ui->passwordInput->clear(); } void LoginForm::startAuthentication() { + QString username(ui->userInput->text()); + NameReplace::replace(username); + std::cerr << "Logging in as " << username.toStdString() << std::endl; + if (Global::testMode()) { return; } @@ -99,7 +107,7 @@ void LoginForm::startAuthentication() ui->userInput->setEnabled(false); ui->passwordInput->setEnabled(false); cancelLoginTimer.start(); - Global::greeter()->authenticate(ui->userInput->text()); + Global::greeter()->authenticate(username); } void LoginForm::onPrompt(QString prompt, QLightDM::Greeter::PromptType promptType) -- cgit v1.2.3-55-g7522