예제 #1
0
PasswordDialog::PasswordDialog( QWidget *parent ) :
	QDialog( parent ),
	ui( new Ui::PasswordDialog )
{
	ui->setupUi( this );

	const LocalSystem::User loggedOnUser = LocalSystem::User::loggedOnUser();
	QString username = loggedOnUser.name();
#ifdef VEYON_BUILD_WIN32
	if( !username.isEmpty() && !loggedOnUser.domain().isEmpty() )
	{
		username = loggedOnUser.domain() + "\\" + username;
	}
#endif

	ui->username->setText( username );

	if( !username.isEmpty() )
	{
		ui->password->setFocus();
	}

	updateOkButton();

	VeyonCore::enforceBranding( this );
}
예제 #2
0
bool UserSessionControl::handleServiceFeatureMessage( const FeatureMessage& message,
													  FeatureWorkerManager& featureWorkerManager )
{
	Q_UNUSED(featureWorkerManager);

	if( m_userSessionInfoFeature.uid() == message.featureUid() )
	{
		LocalSystem::User user = LocalSystem::User::loggedOnUser();

		FeatureMessage reply( message.featureUid(), message.command() );
		reply.addArgument( UserName, QString( "%1 (%2)" ).arg( user.name() ).arg( user.fullName() ) );
		reply.addArgument( HomeDir, user.homePath() );

		uint8_t rfbMessageType = rfbItalcFeatureMessage;
		message.ioDevice()->write( (const char *) &rfbMessageType, sizeof(rfbMessageType) );

		reply.send( message.ioDevice() );

		return true;
	}
	else if( m_userLogoutFeature.uid() == message.featureUid() )
	{
		LocalSystem::logoutUser();
	}

	return false;
}