summaryrefslogtreecommitdiffstats
path: root/src/loginform.cpp
diff options
context:
space:
mode:
authorSimon Rettberg2018-02-08 12:02:00 +0100
committerSimon Rettberg2018-02-08 12:02:00 +0100
commit7688ba080c0c69508847fca9aa36dc392ddbb766 (patch)
treef39315ec70374d2cca6b0929049345c7b113d8d0 /src/loginform.cpp
parentUpdate readme (diff)
downloadslxgreeter-7688ba080c0c69508847fca9aa36dc392ddbb766.tar.gz
slxgreeter-7688ba080c0c69508847fca9aa36dc392ddbb766.tar.xz
slxgreeter-7688ba080c0c69508847fca9aa36dc392ddbb766.zip
Support regex mangling of username before passing to lightdm
Diffstat (limited to 'src/loginform.cpp')
-rw-r--r--src/loginform.cpp10
1 files changed, 9 insertions, 1 deletions
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)