summaryrefslogtreecommitdiffstats
path: root/src/loginrpc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/loginrpc.cpp')
-rw-r--r--src/loginrpc.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/loginrpc.cpp b/src/loginrpc.cpp
index a4e61fc..320cdfd 100644
--- a/src/loginrpc.cpp
+++ b/src/loginrpc.cpp
@@ -7,6 +7,11 @@
#include <QProcess>
#include <QRegularExpression>
+#include <QDir>
+#include <QFile>
+#include <QTextStream>
+#include <QIODevice>
+
LoginRpc::LoginRpc(int port, QObject *parent)
: QObject(parent)
{
@@ -41,7 +46,7 @@ void LoginRpc::handleIncoming(QTcpSocket *sock) {
void LoginRpc::handleCommandV1(const QString &command)
{
QStringList lines = command.split('\n');
- while (lines.count() < 3) {
+ while (lines.count() < 4) {
lines.append(QString());
}
QString res = lines[2];
@@ -129,5 +134,23 @@ void LoginRpc::handleCommandV1(const QString &command)
}
}
}
+
+ // If lectureId was sent, create a file that overrides the SLX_AUTOSTART_UUID
+ if (lines[3] != "") {
+ // File will be created at /var/lib/lightdm/config_overrides/SLX_AUTOSTART_UUID
+ QString path = "config_override/";
+ QFile file(path + "SLX_AUTOSTART_UUID");
+
+ QDir dir;
+ if (!dir.exists(path)) {
+ dir.mkdir(path);
+ }
+ if (file.open(QIODevice::ReadWrite)) {
+ QTextStream stream(&file);
+ stream << lines[3] << "\n";
+ file.close();
+ }
+ }
+
emit loginRequest(lines[0], lines[1], lines[2]);
}