static void start_authentication (struct AuthHandler *handler) { gchar *username = g_strdup (handler->username); g_warning ("start authentication:%s\n", username); if (g_strcmp0 (username, "guest") == 0) { lightdm_greeter_authenticate_as_guest (greeter); g_warning ("start authentication for guest\n"); } else { lightdm_greeter_authenticate (greeter, username); } g_free (username); }
static JSValueRef authenticate_cb(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception) { gchar *name = NULL; if (argumentCount > 0) { name = arg_to_string(context, arguments[0], exception); } lightdm_greeter_authenticate(GREETER, name); g_free(name); return JSValueMakeNull(context); }