forked from enlightenment/enlightenment
send signal to indicate that password is currently being checked
send signal in the event that an invalid password has been entered update text to indicate current state don't accept text input while authenticating (as the text gets whiped out if it was wrong once pam returns) SVN revision: 29593
This commit is contained in:
parent
3fa775d6d3
commit
b2d64063f6
|
@ -4,6 +4,7 @@ images {
|
|||
image: "e17_entry_cursor.png" COMP;
|
||||
image: "e17_logo.png" COMP;
|
||||
image: "e17_gadman_overlay.png" COMP;
|
||||
image: "e17_desklock_error.png" COMP;
|
||||
}
|
||||
|
||||
group {
|
||||
|
@ -37,7 +38,7 @@ group {
|
|||
}
|
||||
group
|
||||
{
|
||||
name, "e/desklock/login_box";
|
||||
name: "e/desklock/login_box";
|
||||
parts
|
||||
{
|
||||
part
|
||||
|
@ -87,11 +88,54 @@ group
|
|||
}
|
||||
}
|
||||
}
|
||||
part
|
||||
{
|
||||
name: "pulse_clip";
|
||||
type: RECT;
|
||||
mouse_events: 0;
|
||||
description
|
||||
{
|
||||
state: "default" 0.0;
|
||||
rel1.to: "passwd_border";
|
||||
rel2.to: "passwd_border";
|
||||
}
|
||||
description
|
||||
{
|
||||
state: "pulse" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 128;
|
||||
}
|
||||
}
|
||||
part
|
||||
{
|
||||
name: "error";
|
||||
mouse_events: 0;
|
||||
clip_to: "pulse_clip";
|
||||
description
|
||||
{
|
||||
state: "default" 0.0;
|
||||
color: 255 255 255 0;
|
||||
rel1.to: "passwd_border";
|
||||
rel2.to: "passwd_border";
|
||||
image
|
||||
{
|
||||
normal: "e17_desklock_error.png";
|
||||
border: 15 15 15 15;
|
||||
}
|
||||
}
|
||||
description
|
||||
{
|
||||
state: "invalid" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
part
|
||||
{
|
||||
name: "passwd_entry_clip";
|
||||
type: RECT;
|
||||
mouse_events: 0;
|
||||
clip_to: "pulse_clip";
|
||||
description
|
||||
{
|
||||
state: "default" 0.0;
|
||||
|
@ -177,6 +221,7 @@ group
|
|||
{
|
||||
name: "passwd_border";
|
||||
mouse_events: 0;
|
||||
clip_to: "pulse_clip";
|
||||
description
|
||||
{
|
||||
state: "default" 0.0;
|
||||
|
@ -198,7 +243,67 @@ group
|
|||
border: 15 15 15 15;
|
||||
}
|
||||
}
|
||||
description
|
||||
{
|
||||
state: "checking" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 128;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs
|
||||
{
|
||||
program
|
||||
{
|
||||
name: "pulse.1";
|
||||
signal: "e,state,checking";
|
||||
source: "e.desklock";
|
||||
action: STATE_SET "pulse" 0.0;
|
||||
target: "pulse_clip";
|
||||
transition: SINUSOIDAL 0.5;
|
||||
after: "pulse.2";
|
||||
}
|
||||
program
|
||||
{
|
||||
name: "pulse.2";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "pulse_clip";
|
||||
transition: SINUSOIDAL 0.5;
|
||||
after: "pulse.1";
|
||||
}
|
||||
program
|
||||
{
|
||||
name: "pulse.stop";
|
||||
signal: "e,state,invalid";
|
||||
source: "e.desklock";
|
||||
action: ACTION_STOP;
|
||||
target: "pulse.1";
|
||||
target: "pulse.2";
|
||||
after: "pulse.reset";
|
||||
}
|
||||
program
|
||||
{
|
||||
name: "pulse.reset";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "pulse_clip";
|
||||
transition: SINUSOIDAL 0.5;
|
||||
}
|
||||
program
|
||||
{
|
||||
name: "go_invalid";
|
||||
signal: "e,state,invalid";
|
||||
source: "e.desklock";
|
||||
action: STATE_SET "invalid" 0.0;
|
||||
target: "error";
|
||||
transition: DECELERATE 0.5;
|
||||
}
|
||||
program
|
||||
{
|
||||
name: "stop_invalid";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "error";
|
||||
transition: DECELERATE 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -280,6 +280,7 @@ e17_cpufreq_freq09.png \
|
|||
e17_cpufreq_freq10.png \
|
||||
e17_cpufreq_increase1.png \
|
||||
e17_cpufreq_increase2.png \
|
||||
e17_desklock_error.png \
|
||||
e17_dialog_watermark.png \
|
||||
e17_entry_cursor.png \
|
||||
e17_fileman_bg.png \
|
||||
|
|
Binary file not shown.
|
@ -8,6 +8,10 @@
|
|||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
#define E_DESKLOCK_STATE_DEFAULT 0
|
||||
#define E_DESKLOCK_STATE_CHECKING 1
|
||||
#define E_DESKLOCK_STATE_INVALID 2
|
||||
|
||||
#define ELOCK_POPUP_LAYER 10000
|
||||
#define PASSWD_LEN 256
|
||||
|
||||
|
@ -32,6 +36,7 @@ struct _E_Desklock_Data
|
|||
Evas_List *handlers;
|
||||
Ecore_X_Window elock_grab_break_wnd;
|
||||
char passwd[PASSWD_LEN];
|
||||
int state;
|
||||
};
|
||||
#ifdef HAVE_PAM
|
||||
struct _E_Desklock_Auth
|
||||
|
@ -72,6 +77,7 @@ static void _e_desklock_backspace();
|
|||
static void _e_desklock_delete();
|
||||
static int _e_desklock_zone_num_get();
|
||||
static int _e_desklock_check_auth();
|
||||
static void _e_desklock_state_set(int state);
|
||||
|
||||
#ifdef HAVE_PAM
|
||||
static int _e_desklock_cb_exit(void *data, int type, void *event);
|
||||
|
@ -395,7 +401,7 @@ _e_desklock_cb_key_down(void *data, int type, void *event)
|
|||
Ecore_X_Event_Key_Down *ev;
|
||||
|
||||
ev = event;
|
||||
if (ev->win != edd->elock_wnd) return 1;
|
||||
if (ev->win != edd->elock_wnd || edd->state == E_DESKLOCK_STATE_CHECKING) return 1;
|
||||
|
||||
if (!strcmp(ev->keysymbol, "Escape"))
|
||||
;
|
||||
|
@ -560,12 +566,43 @@ _e_desklock_check_auth()
|
|||
#ifdef HAVE_PAM
|
||||
}
|
||||
#endif
|
||||
/* passowrd is definitely wrong */
|
||||
/* password is definitely wrong */
|
||||
_e_desklock_state_set(E_DESKLOCK_STATE_INVALID);
|
||||
memset(edd->passwd, 0, sizeof(char) * PASSWD_LEN);
|
||||
_e_desklock_passwd_update();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_desklock_state_set(int state)
|
||||
{
|
||||
Evas_List *l;
|
||||
const char *signal, *text;
|
||||
if (!edd) return;
|
||||
|
||||
edd->state = state;
|
||||
if (state == E_DESKLOCK_STATE_CHECKING)
|
||||
{
|
||||
signal = "e,state,checking";
|
||||
text = "Authenticating...";
|
||||
}
|
||||
else if (state == E_DESKLOCK_STATE_INVALID)
|
||||
{
|
||||
signal = "e,state,invalid";
|
||||
text = "The password you entered is invalid. Try again.";
|
||||
}
|
||||
|
||||
for (l = edd->elock_wnd_list; l; l = l->next)
|
||||
{
|
||||
E_Desklock_Popup_Data *edp;
|
||||
edp = l->data;
|
||||
edje_object_signal_emit(edp->login_box, signal, "e.desklock");
|
||||
edje_object_signal_emit(edp->bg_object, signal, "e.desklock");
|
||||
edje_object_part_text_set(edp->login_box, "e.text.title", text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_PAM
|
||||
static int
|
||||
_e_desklock_cb_exit(void *data, int type, void *event)
|
||||
|
@ -598,6 +635,7 @@ _e_desklock_cb_exit(void *data, int type, void *event)
|
|||
/* failed auth */
|
||||
else
|
||||
{
|
||||
_e_desklock_state_set(E_DESKLOCK_STATE_INVALID);
|
||||
/* security - null out passwd string once we are done with it */
|
||||
memset(edd->passwd, 0, sizeof(char) * PASSWD_LEN);
|
||||
_e_desklock_passwd_update();
|
||||
|
@ -611,6 +649,7 @@ _e_desklock_cb_exit(void *data, int type, void *event)
|
|||
static int
|
||||
_desklock_auth(char *passwd)
|
||||
{
|
||||
_e_desklock_state_set(E_DESKLOCK_STATE_CHECKING);
|
||||
if ((_e_desklock_child_pid = fork()))
|
||||
{
|
||||
/* parent */
|
||||
|
|
Loading…
Reference in New Issue