entrance: autologin use the session saved in your profil

This commit is contained in:
Michael Bouchaud 2014-09-10 21:13:32 +00:00
parent 1872433afa
commit 46c7cc4214
3 changed files with 21 additions and 3 deletions

View File

@ -394,7 +394,7 @@ main (int argc, char ** argv)
_entrance_main(dname);
PT("history init\n");
entrance_history_init();
if (entrance_config->autologin && !entrance_user)
if (entrance_config->autologin)
{
PT("autologin init\n");
xcb_connection_t *disp = NULL;
@ -404,10 +404,13 @@ main (int argc, char ** argv)
PT("auth user\n");
#ifdef HAVE_PAM
entrance_pam_init(PACKAGE, dname, NULL);
entrance_pam_item_set(ENTRANCE_PAM_ITEM_USER, entrance_config->userlogin);
entrance_pam_item_set(ENTRANCE_PAM_ITEM_USER,
entrance_config->userlogin);
#endif
PT("login user\n");
entrance_session_login(NULL, EINA_FALSE);
entrance_session_login(
entrance_history_user_session_get(entrance_config->userlogin),
EINA_FALSE);
sleep(30);
xcb_disconnect(disp);
}

View File

@ -98,6 +98,20 @@ _entrance_history_write(void)
}
}
const char *
entrance_history_user_session_get(const char *login)
{
Eina_List *l;
Entrance_Login *el;
EINA_LIST_FOREACH(_entrance_history->history, l, el)
{
if (!strcmp(login, el->login))
return el->lsess;
}
return NULL;
}
void
entrance_history_push(const char *login, const char *session)
{

View File

@ -6,6 +6,7 @@ void entrance_history_shutdown(void);
void entrance_history_push(const char *login, const char *session);
Eina_List *entrance_history_get(void);
void entrance_history_user_update(const Entrance_Login *el);
const char *entrance_history_user_session_get(const char *user);
typedef struct _Entrance_History Entrance_History;