entrance: autologin use the session saved in your profil

devs/bu5hm4n/session_bug
Michael Bouchaud 8 years ago
parent 1872433afa
commit 46c7cc4214
  1. 9
      src/daemon/entrance.c
  2. 14
      src/daemon/entrance_history.c
  3. 1
      src/daemon/entrance_history.h

@ -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);
}

@ -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)
{

@ -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;

Loading…
Cancel
Save