source: src-qt4/PCDM/src/pcdm-xprocess.h @ 90dc161

9.2-releasereleng/10.0releng/10.0.1
Last change on this file since 90dc161 was 90dc161, checked in by Ken Moore <ken@…>, 9 months ago

Completely revamp how PCDM uses the previous login information. Now you no longer need to specify which desktop to auto-login to if you have auto-login selected. It will first try to check for previous login information for that user, then fall back on the last login for the system in order to try and auto login. Also fix the PCDMd script a bit so that autologins work properly when triggered.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/* PCDM Login Manager:
2*  Written by Ken Moore (ken@pcbsd.org) 2012/2013
3*  Copyright(c) 2013 by the PC-BSD Project
4*  Available under the 3-clause BSD license
5*/
6
7/*
8 Sub-classed widget for starting an XSession process
9*/
10
11#ifndef PCDM_XPROCESS_H
12#define PCDM_XPROCESS_H
13
14#include <QFile>
15#include <QDebug>
16#include <QProcess>
17#include <QProcessEnvironment>
18
19#include <sys/types.h>
20#include <security/pam_appl.h>
21#include <security/openpam.h>
22
23#include "pcdm-backend.h"
24
25class XProcess : public QProcess
26{
27        Q_OBJECT
28
29  public:
30        XProcess();
31        ~XProcess();
32        bool isRunning();
33        void waitForSessionClosed();
34 
35  public slots:
36        void loginToXSession(QString, QString, QString, QString); //user, pwd, homedir, desktop
37       
38  private:
39        QString xuser, xcmd, xhome, xpwd, xde;
40        bool startXSession();
41       
42        // PAM stuff and simplification functions
43        pam_handle_t *pamh;  //handle for the PAM process structure
44        bool pam_started, pam_session_open;
45        bool pam_checkPW();
46        bool pam_startSession();
47        bool pam_stopSession();
48        void pam_logFailure(int);
49        void pam_shutdown(); //cleanly close all the PAM stuff
50       
51  private slots:
52        void slotCleanup(int, QProcess::ExitStatus);
53
54  signals:
55        void InvalidLogin();
56
57};
58#endif
Note: See TracBrowser for help on using the repository browser.