yoz pushed a commit to branch master.

http://git.enlightenment.org/misc/entrance.git/commit/?id=46c7cc4214ab10cf105c5e5f111e41e7998e0158

commit 46c7cc4214ab10cf105c5e5f111e41e7998e0158
Author: Michael Bouchaud <y...@efl.so>
Date:   Wed Sep 10 21:13:32 2014 +0000

    entrance: autologin use the session saved in your profil
---
 src/daemon/entrance.c         |  9 ++++++---
 src/daemon/entrance_history.c | 14 ++++++++++++++
 src/daemon/entrance_history.h |  1 +
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/daemon/entrance.c b/src/daemon/entrance.c
index 3250567..de43162 100644
--- a/src/daemon/entrance.c
+++ b/src/daemon/entrance.c
@@ -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);
      }
diff --git a/src/daemon/entrance_history.c b/src/daemon/entrance_history.c
index b958121..42770ba 100644
--- a/src/daemon/entrance_history.c
+++ b/src/daemon/entrance_history.c
@@ -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)
 {
diff --git a/src/daemon/entrance_history.h b/src/daemon/entrance_history.h
index 8ebbc62..90d4584 100644
--- a/src/daemon/entrance_history.h
+++ b/src/daemon/entrance_history.h
@@ -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;
 

-- 


Reply via email to