entrance: fixed autologin
This commit is contained in:
parent
9ce973d6f7
commit
ac231982aa
|
@ -12,7 +12,7 @@ struct tm *local_time;
|
|||
char entrance_time_d[4096];
|
||||
|
||||
static Eina_Bool _open_log();
|
||||
static Eina_Bool _entrance_main(const char *dname);
|
||||
static Eina_Bool _entrance_display_ready(const char *dname);
|
||||
static void _remove_lock();
|
||||
static void _signal_cb(int sig);
|
||||
static void _signal_log(int sig);
|
||||
|
@ -172,7 +172,7 @@ _entrance_client_data(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Exe_Event_Da
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
_entrance_main(const char *dname)
|
||||
_entrance_display_ready(const char *dname)
|
||||
{
|
||||
PT("starting...\n");
|
||||
if (!entrance_config->autologin)
|
||||
|
@ -197,7 +197,18 @@ _entrance_main(const char *dname)
|
|||
}
|
||||
}
|
||||
else
|
||||
ecore_main_loop_quit();
|
||||
{
|
||||
//TODO test if there is allready a user loggind in
|
||||
PT("auth user\n");
|
||||
entrance_pam_init("entrance", dname, NULL);
|
||||
#ifdef HAVE_PAM
|
||||
entrance_pam_item_set(ENTRANCE_PAM_ITEM_USER, entrance_config->userlogin);
|
||||
#endif
|
||||
PT("login user\n");
|
||||
entrance_session_login(NULL, EINA_FALSE);
|
||||
//we have a loged user begin entrance shutdown
|
||||
ecore_main_loop_quit();
|
||||
}
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
||||
|
@ -388,37 +399,24 @@ main (int argc, char ** argv)
|
|||
if (!_xephyr)
|
||||
{
|
||||
PT("xserver init\n");
|
||||
pid = entrance_xserver_init(_entrance_main, dname);
|
||||
pid = entrance_xserver_init(_entrance_display_ready, dname);
|
||||
}
|
||||
else
|
||||
_entrance_main(dname);
|
||||
_entrance_display_ready(dname);
|
||||
PT("history init\n");
|
||||
entrance_history_init();
|
||||
if (entrance_config->autologin && !entrance_user)
|
||||
{
|
||||
PT("autologin init\n");
|
||||
xcb_connection_t *disp = NULL;
|
||||
disp = xcb_connect(dname, NULL);
|
||||
PT("main loop begin\n");
|
||||
ecore_main_loop_begin();
|
||||
PT("auth user\n");
|
||||
#ifdef HAVE_PAM
|
||||
entrance_pam_item_set(ENTRANCE_PAM_ITEM_USER, entrance_config->userlogin);
|
||||
#endif
|
||||
PT("login user\n");
|
||||
entrance_session_login(NULL, EINA_FALSE);
|
||||
sleep(30);
|
||||
xcb_disconnect(disp);
|
||||
}
|
||||
else
|
||||
if (!entrance_config->autologin)
|
||||
{
|
||||
PT("action init\n");
|
||||
entrance_action_init();
|
||||
PT("server init\n");
|
||||
entrance_server_init();
|
||||
PT("starting main loop\n");
|
||||
ecore_main_loop_begin();
|
||||
PT("main loop end\n");
|
||||
}
|
||||
PT("starting main loop\n");
|
||||
ecore_main_loop_begin();
|
||||
PT("main loop end\n");
|
||||
if (!entrance_config->autologin)
|
||||
{
|
||||
entrance_server_shutdown();
|
||||
PT("server shutdown\n");
|
||||
entrance_action_shutdown();
|
||||
|
|
Loading…
Reference in New Issue