diff --git a/plugins/platform/linux/LinuxPlatformConfiguration.h b/plugins/platform/linux/LinuxPlatformConfiguration.h index e1457525c..c3cc3f9af 100644 --- a/plugins/platform/linux/LinuxPlatformConfiguration.h +++ b/plugins/platform/linux/LinuxPlatformConfiguration.h @@ -29,7 +29,7 @@ #define FOREACH_LINUX_PLATFORM_CONFIG_PROPERTY(OP) \ OP( LinuxPlatformConfiguration, m_configuration, QString, pamServiceName, setPamServiceName, "PamServiceName", "Linux", QString(), Configuration::Property::Flag::Advanced ) \ OP( LinuxPlatformConfiguration, m_configuration, int, minimumUserSessionLifetime, setMinimumUserSessionLifetime, "MinimumUserSessionLifetime", "Linux", 3, Configuration::Property::Flag::Advanced ) \ - OP( LinuxPlatformConfiguration, m_configuration, QString, userLoginKeySequence, setUserLoginKeySequence, "UserLoginKeySequence", "Linux", QStringLiteral("%username%%password%"), Configuration::Property::Flag::Advanced ) \ + OP( LinuxPlatformConfiguration, m_configuration, QString, userLoginKeySequence, setUserLoginKeySequence, "UserLoginKeySequence", "Linux", QStringLiteral("%username%%password%"), Configuration::Property::Flag::Advanced ) \ DECLARE_CONFIG_PROXY(LinuxPlatformConfiguration, FOREACH_LINUX_PLATFORM_CONFIG_PROPERTY) diff --git a/plugins/platform/linux/LinuxUserFunctions.cpp b/plugins/platform/linux/LinuxUserFunctions.cpp index 289007fff..a75c89cc5 100644 --- a/plugins/platform/linux/LinuxUserFunctions.cpp +++ b/plugins/platform/linux/LinuxUserFunctions.cpp @@ -266,6 +266,16 @@ bool LinuxUserFunctions::prepareLogon( const QString& username, const Password& { if( m_logonHelper.prepare( username, password ) ) { + if( QFile::exists( QStringLiteral("/usr/share/veyon/veyon-config-dm-login.sh") ) ) + { + QProcess process; + process.start( QStringLiteral("bash"), QStringList( { + QStringLiteral("/usr/share/veyon/veyon-config-dm-login.sh"), + QStringLiteral("enable") } ) ); + + process.waitForFinished(); + } + LinuxCoreFunctions::restartDisplayManagers(); return true; } @@ -277,13 +287,23 @@ bool LinuxUserFunctions::prepareLogon( const QString& username, const Password& bool LinuxUserFunctions::performLogon( const QString& username, const Password& password ) { + if( QFile::exists( QStringLiteral("/usr/share/veyon/veyon-config-dm-login.sh") ) ) + { + QProcess process; + process.start( QStringLiteral("bash"), QStringList( { + QStringLiteral("/usr/share/veyon/veyon-config-dm-login.sh"), + QStringLiteral("disable") } ) ); + + process.waitForFinished(); + } + LinuxKeyboardInput input; auto sequence = LinuxPlatformConfiguration( &VeyonCore::config() ).userLoginKeySequence(); if( sequence.isEmpty() == true ) { - sequence = QStringLiteral("%username%%password%"); + sequence = QStringLiteral("%username%%password%"); } auto matchIterator = QRegularExpression( QStringLiteral("(<[\\w\\d_]+>|%username%|%password%|[\\w\\d]+)") ) @@ -303,6 +323,7 @@ bool LinuxUserFunctions::performLogon( const QString& username, const Password& } else if( token == QStringLiteral("%password%") ) { + QThread::msleep(10); input.sendString( QString::fromUtf8( password.toByteArray() ) ); } else if( token.startsWith( QLatin1Char('<') ) && token.endsWith( QLatin1Char('>') ) )