|
|
@ -52,6 +52,37 @@ static JSClassRef |
|
|
|
lightdm_layout_class, |
|
|
|
lightdm_layout_class, |
|
|
|
lightdm_session_class; |
|
|
|
lightdm_session_class; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static char * |
|
|
|
|
|
|
|
escape (const gchar *text) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
size_t len; |
|
|
|
|
|
|
|
size_t i, j; |
|
|
|
|
|
|
|
int count = 0; |
|
|
|
|
|
|
|
gchar *escaped; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
len = strlen (text); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < len; i++) |
|
|
|
|
|
|
|
if (text[i] == '\'') |
|
|
|
|
|
|
|
count++; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (count == 0) |
|
|
|
|
|
|
|
return g_strdup (text); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
escaped = g_malloc (len + count + 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
j = 0; |
|
|
|
|
|
|
|
for (i = 0; i <= len; i++) { |
|
|
|
|
|
|
|
if (text[i] == '\'') { |
|
|
|
|
|
|
|
escaped[j] = '\\'; |
|
|
|
|
|
|
|
j++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
escaped[j] = text[i]; |
|
|
|
|
|
|
|
j++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return escaped; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static JSValueRef |
|
|
|
static JSValueRef |
|
|
|
get_user_name_cb(JSContextRef context, |
|
|
|
get_user_name_cb(JSContextRef context, |
|
|
@ -1059,6 +1090,7 @@ show_prompt_cb(LightDMGreeter *greeter, |
|
|
|
JSGlobalContextRef jsContext; |
|
|
|
JSGlobalContextRef jsContext; |
|
|
|
JSStringRef command; |
|
|
|
JSStringRef command; |
|
|
|
gchar *string; |
|
|
|
gchar *string; |
|
|
|
|
|
|
|
gchar *etext; |
|
|
|
const gchar *ct = ""; |
|
|
|
const gchar *ct = ""; |
|
|
|
|
|
|
|
|
|
|
|
g_debug("Show prompt %s", text); |
|
|
|
g_debug("Show prompt %s", text); |
|
|
@ -1079,12 +1111,14 @@ show_prompt_cb(LightDMGreeter *greeter, |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
string = g_strdup_printf ("show_prompt('%s', '%s')", text, ct); |
|
|
|
etext = escape (text); |
|
|
|
|
|
|
|
string = g_strdup_printf ("show_prompt('%s', '%s')", etext, ct); |
|
|
|
command = JSStringCreateWithUTF8CString(string); |
|
|
|
command = JSStringCreateWithUTF8CString(string); |
|
|
|
|
|
|
|
|
|
|
|
JSEvaluateScript(jsContext, command, NULL, NULL, 0, NULL); |
|
|
|
JSEvaluateScript(jsContext, command, NULL, NULL, 0, NULL); |
|
|
|
|
|
|
|
|
|
|
|
g_free(string); |
|
|
|
g_free(string); |
|
|
|
|
|
|
|
g_free(etext); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1099,6 +1133,7 @@ show_message_cb(LightDMGreeter *greeter, |
|
|
|
WebKitFrame *web_frame; |
|
|
|
WebKitFrame *web_frame; |
|
|
|
JSGlobalContextRef jsContext; |
|
|
|
JSGlobalContextRef jsContext; |
|
|
|
JSStringRef command; |
|
|
|
JSStringRef command; |
|
|
|
|
|
|
|
gchar *etext; |
|
|
|
gchar *string; |
|
|
|
gchar *string; |
|
|
|
const gchar *mt = ""; |
|
|
|
const gchar *mt = ""; |
|
|
|
|
|
|
|
|
|
|
@ -1117,12 +1152,14 @@ show_message_cb(LightDMGreeter *greeter, |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
string = g_strdup_printf ("show_prompt('%s', '%s')", text, mt); |
|
|
|
etext = escape (text); |
|
|
|
|
|
|
|
string = g_strdup_printf ("show_prompt('%s', '%s')", etext, mt); |
|
|
|
command = JSStringCreateWithUTF8CString(string); |
|
|
|
command = JSStringCreateWithUTF8CString(string); |
|
|
|
|
|
|
|
|
|
|
|
JSEvaluateScript(jsContext, command, NULL, NULL, 0, NULL); |
|
|
|
JSEvaluateScript(jsContext, command, NULL, NULL, 0, NULL); |
|
|
|
|
|
|
|
|
|
|
|
g_free(string); |
|
|
|
g_free(string); |
|
|
|
|
|
|
|
g_free(etext); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|