Enlightenment CVS committal
Author : atmosphere
Project : e17
Module : apps/entrance
Dir : e17/apps/entrance/src/client
Modified Files:
entrance_auth.c entrance_config.c entrance_config.h
entrance_session.c
Log Message:
entrance supports an autologin now, you can configure it to boot immediately into your
xsession, or have it start your theme edje and do the post auth animation(if one
exists), next up allow certain users to login without passwords
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_auth.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- entrance_auth.c 3 Mar 2004 18:16:15 -0000 1.13
+++ entrance_auth.c 10 Apr 2004 22:20:24 -0000 1.14
@@ -313,6 +313,8 @@
int size;
char *mail;
+ if (!e || !e->pw)
+ return;
e->env = environ;
setenv("TERM", "vt100", 0); // TERM=linux?
setenv("HOME", e->pw->pw_dir, 1);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_config.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- entrance_config.c 10 Mar 2004 22:53:51 -0000 1.23
+++ entrance_config.c 10 Apr 2004 22:20:24 -0000 1.24
@@ -76,6 +76,11 @@
e->time.string = str;
else
e->time.string = strdup("%l:%M:%S %p");
+ if (e_db_int_get(db, "/entrance/autologin/mode", &e->autologin.mode))
+ {
+ if (e->autologin.mode > 0)
+ e->autologin.username = e_db_str_get(db, "/entrance/autologin/user");
+ }
/* ints */
if (!e_db_int_get(db, "/entrance/user/remember", &e->users.remember))
e->users.remember = 1;
@@ -404,6 +409,8 @@
free(e->before.string);
if (e->after.string)
free(e->after.string);
+ if (e->autologin.username)
+ free(e->autologin.username);
free(e);
}
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_config.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- entrance_config.h 10 Mar 2004 22:53:51 -0000 1.14
+++ entrance_config.h 10 Apr 2004 22:20:24 -0000 1.15
@@ -18,6 +18,10 @@
#define ENTRANCE_USE_PAM 1
#define ENTRANCE_USE_SHADOW 2
+#define ENTRANCE_AUTOLOGIN_NONE 0
+#define ENTRANCE_AUTOLOGIN_DEFAULT 1
+#define ENTRANCE_AUTOLOGIN_THEME 2
+
/**
* This contains all of the configuration options that the system can set
*/
@@ -101,6 +105,19 @@
Evas_Hash *hash;
Evas_List *keys;
} sessions;
+
+ struct
+ {
+ /**
+ * uid we can find in the users hash
+ */
+ char *username;
+ /**
+ * 0 = off, 1 = immediate exec, 2 = show theme & post auth
+ */
+ int mode;
+ } autologin;
+
};
typedef struct _Entrance_Config Entrance_Config;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_session.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -3 -r1.48 -r1.49
--- entrance_session.c 5 Apr 2004 21:17:47 -0000 1.48
+++ entrance_session.c 10 Apr 2004 22:20:24 -0000 1.49
@@ -131,8 +131,40 @@
void
entrance_session_run(Entrance_Session * e)
{
- ecore_evas_show(e->ee);
- ecore_main_loop_begin();
+ int ok = 0;
+ Entrance_User *eu = NULL;
+
+ switch (e->config->autologin.mode)
+ {
+ case ENTRANCE_AUTOLOGIN_NONE:
+ ecore_evas_show(e->ee);
+ break;
+ case ENTRANCE_AUTOLOGIN_DEFAULT:
+ if ((eu =
+ evas_hash_find(e->config->users.hash,
+ e->config->autologin.username)))
+ {
+ ok = 1;
+ e->authed = 1;
+ entrance_session_user_set(e, eu);
+ }
+ break;
+ case ENTRANCE_AUTOLOGIN_THEME:
+ ecore_evas_show(e->ee);
+ if ((eu =
+ evas_hash_find(e->config->users.hash,
+ e->config->autologin.username)))
+ {
+ e->authed = 1;
+ entrance_session_user_set(e, eu);
+ edje_object_signal_emit(e->edje, "EntranceUserAuthSuccess", "");
+ }
+ break;
+ }
+ if (!ok)
+ {
+ ecore_main_loop_begin();
+ }
}
/**
@@ -350,8 +382,11 @@
/* Tell PAM that session has begun */
if (pam_open_session(e->auth->pam.handle, 0) != PAM_SUCCESS)
{
- syslog(LOG_CRIT, "Unable to open PAM session. Aborting.");
- return;
+ if (!e->config->autologin.mode)
+ {
+ syslog(LOG_CRIT, "Unable to open PAM session. Aborting.");
+ return;
+ }
}
}
#endif
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs