Ignore:
Timestamp:
Jul 11, 2013 2:28:19 PM (10 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1
Children:
ed51bc3
Parents:
8679296
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/PCDM/src/pcdm-xprocess.cpp

    r1add85d r90dc161  
    3030} 
    3131 
    32 void XProcess::loginToXSession(QString username, QString password, QString homedir, QString cmd){ 
     32void XProcess::loginToXSession(QString username, QString password, QString homedir, QString desktop){ 
    3333  //Setup the variables 
    3434  xuser = username; 
    3535  xpwd = password; 
    3636  xhome = homedir; 
    37   xcmd = cmd; 
     37  xcmd = Backend::getDesktopBinary(desktop); 
     38  xde = desktop; 
    3839  //Now start the login process 
    3940  startXSession(); 
     
    5960bool XProcess::startXSession(){ 
    6061  //Check that the necessary info to start the session is available 
    61   if( xuser.isEmpty() || xcmd.isEmpty() || xhome.isEmpty() ){ 
     62  if( xuser.isEmpty() || xcmd.isEmpty() || xhome.isEmpty() || xde.isEmpty() ){ 
    6263    emit InvalidLogin();  //Make sure the GUI knows that it was a failure 
    6364    return FALSE; 
     
    7071  if( !pam_startSession() ){ pam_shutdown(); return FALSE; } 
    7172  pam_session_open = TRUE; //flag that pam has an open session 
     73   
     74  //Save the current user/desktop as the last login 
     75  Backend::saveLoginInfo(Backend::getDisplayNameFromUsername(xuser),xde); 
    7276   
    7377  // Configure the DE startup command 
     
    100104  environ.insert("MAIL","/var/mail/"+xuser); //Set the mail variable 
    101105  environ.insert("GROUP",xuser); //Set the proper group id 
    102   environ.insert("SHLVL","1"); //Set the proper shell level 
     106  environ.insert("SHLVL","0"); //Set the proper shell level 
    103107  this->setProcessEnvironment(environ); 
    104108  this->setWorkingDirectory(xhome); //set the current directory to the user's home directory 
Note: See TracChangeset for help on using the changeset viewer.