diff options
author | Andy Hertzfeld <andy@src.gnome.org> | 2000-04-12 01:33:34 +0000 |
---|---|---|
committer | Andy Hertzfeld <andy@src.gnome.org> | 2000-04-12 01:33:34 +0000 |
commit | 25c4634248f54c33655cea11412c16c7332fe065 (patch) | |
tree | b9f981eb6f4af87f50d761a2d1fdab9ed2793976 | |
parent | 08d18d6542781094de5dc2914fa292eea9bc1f4c (diff) | |
download | nautilus-25c4634248f54c33655cea11412c16c7332fe065.tar.gz |
tweaked configuration upload protocol to match Jonathan's changes
tweaked configuration upload protocol to match Jonathan's changes
-rw-r--r-- | ChangeLog-20000414 | 9 | ||||
-rw-r--r-- | components/services/startup/eazel-register.c | 4 | ||||
-rw-r--r-- | components/services/startup/nautilus-service-startup-view.c | 15 |
3 files changed, 23 insertions, 5 deletions
diff --git a/ChangeLog-20000414 b/ChangeLog-20000414 index ae864bf25..3fdc877eb 100644 --- a/ChangeLog-20000414 +++ b/ChangeLog-20000414 @@ -1,3 +1,12 @@ +2000-04-11 Andy Hertzfeld <andy@eazel.com> + + * components/services/startup/eazel-register.c: + added hostname to configuration node to distinguish machines when + the user has more than one + * components/services/startup/nautilus-service-startup-view.c: + changed protocol for configuration upload to match Jonathans's new + cgi; configuration upload is now working with Jonathan's stuff! + 2000-04-11 Darin Adler <darin@eazel.com> * libnautilus/nautilus-directory.c diff --git a/components/services/startup/eazel-register.c b/components/services/startup/eazel-register.c index e498491c0..c7ea7ae56 100644 --- a/components/services/startup/eazel-register.c +++ b/components/services/startup/eazel-register.c @@ -28,6 +28,7 @@ #include <stdio.h> #include <fcntl.h> #include <time.h> +#include <unistd.h> #include <rpm/rpmlib.h> #include <gnome.h> #include <gnome-xml/entities.h> @@ -242,15 +243,18 @@ xmlDoc* create_configuration_metafile() time_t current_time; xmlNode *container_node; gchar *time_string; + gchar host_name[512]; xmlDoc *configuration_metafile = xmlNewDoc((const CHAR*)"1.0"); + gethostname(&host_name[0], 511); container_node = xmlNewDocNode(configuration_metafile, NULL, (const CHAR*) "CONFIGURATION", NULL); configuration_metafile->root = container_node; time(¤t_time); time_string = strdup(ctime(¤t_time)); time_string[strlen(time_string) - 1] = '\0'; + xmlSetProp(container_node, "computer", host_name); xmlSetProp(container_node, "date", time_string); g_free(time_string); diff --git a/components/services/startup/nautilus-service-startup-view.c b/components/services/startup/nautilus-service-startup-view.c index 7e240729d..721538f05 100644 --- a/components/services/startup/nautilus-service-startup-view.c +++ b/components/services/startup/nautilus-service-startup-view.c @@ -31,6 +31,7 @@ #include "eazel-register.h" #include <ghttp.h> +#include <unistd.h> #include <gnome-xml/tree.h> #include <libnautilus/nautilus-background.h> #include <libnautilus/nautilus-gtk-macros.h> @@ -182,8 +183,8 @@ static void gather_config_button_cb (GtkWidget *button, NautilusServicesContentView *view) { FILE* config_file; - gchar buffer[256]; - gchar *config_file_name, *config_string, *uri, *response_str; + gchar buffer[256], host_name[512]; + gchar *config_file_name, *config_string, *uri, *response_str, *cookie_str; GString* config_data; xmlDocPtr config_doc; ghttp_request *request; @@ -223,9 +224,13 @@ gather_config_button_cb (GtkWidget *button, NautilusServicesContentView *view) /* send the config file to the server via HTTP */ /* FIXME: need to url-encode the arguments here */ - uri = g_strdup_printf("http://%s/set.pl", SERVICE_DOMAIN_NAME); + uri = g_strdup_printf("http://%s/profile/set.pl", SERVICE_DOMAIN_NAME); + + gethostname(&host_name[0], 511); + cookie_str = g_strdup_printf("token=%s; computer=%s", view->details->auth_token, host_name); + request = make_http_post_request(uri, config_string, cookie_str); + g_free(cookie_str); - request = make_http_post_request(uri, config_string, view->details->auth_token); response_str = ghttp_get_body(request); g_free(uri); ghttp_request_destroy(request); @@ -283,7 +288,7 @@ register_button_cb (GtkWidget *button, NautilusServicesContentView *view) body = g_strdup_printf("email=%s&pwd=%s", email, password); uri = g_strdup_printf("http://%s/member/new.pl", SERVICE_DOMAIN_NAME); - request = make_http_post_request(uri, body, view->details->auth_token); + request = make_http_post_request(uri, body, NULL); response_str = ghttp_get_body(request); /* handle the error response */ |