Finished the mini http fetcher
authorArt Cancro <ajc@citadel.org>
Thu, 15 May 2008 20:49:31 +0000 (20:49 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 15 May 2008 20:49:31 +0000 (20:49 +0000)
webcit/auth.c
webcit/webcit.h

index 5ebe8e48618d7a52fe99d2b20fdca9a812bccc8a..15c769d6110fcfcb4637e9af835a837505069fe1 100644 (file)
@@ -5,22 +5,22 @@
  */
 
 #include "webcit.h"
+#include "webserver.h"
 
 /*
- * user states
- * the plain text states of a user. filled in at \ function TODO initialize_ax_defs()
- * due to NLS
+ * Access level definitions.  This is initialized from a function rather than a
+ * static array so that the strings may be localized.
  */
 char *axdefs[7]; 
 
 void initialize_axdefs(void) {
-       axdefs[0] = _("Deleted");       /*!0: an erased user */
-       axdefs[1] = _("New User");      /*!1: a new user */
-       axdefs[2] = _("Problem User");  /*!2: a trouble maker */
-       axdefs[3] = _("Local User");    /*!3: user with normal privileges */
-       axdefs[4] = _("Network User");  /*!4: a user that may access network resources */
-       axdefs[5] = _("Preferred User");/*!5: a moderator */
-       axdefs[6] = _("Aide");          /*!6: chief */
+       axdefs[0] = _("Deleted");       /* an erased user */
+       axdefs[1] = _("New User");      /* a new user */
+       axdefs[2] = _("Problem User");  /* a trouble maker */
+       axdefs[3] = _("Local User");    /* user with normal privileges */
+       axdefs[4] = _("Network User");  /* a user that may access network resources */
+       axdefs[5] = _("Preferred User");/* a moderator */
+       axdefs[6] = _("Aide");          /* chief */
 }
 
 
@@ -266,6 +266,9 @@ void do_login(void)
  */
 void do_openid_login(void)
 {
+       int i;
+       char buf[4096];
+
        if (havebstr("language")) {
                set_selected_language(bstr("language"));
                go_selected_language();
@@ -277,7 +280,9 @@ void do_openid_login(void)
        }
        if (havebstr("login_action")) {
 
-               fetch_http(bstr("openid_url"));         // FIXME
+               i = fetch_http(bstr("openid_url"), buf, sizeof buf);
+               lprintf(9, "fetched %d bytes (FIXME do something with it)\n", i);
+
 
        }
        if (WC->logged_in) {
index 94c4832fae7f30ff26774812b2853f4f7e1efd9a..93b71c6258e68d3eac1fd2b13f1fa61a752c579c 100644 (file)
@@ -807,7 +807,7 @@ void display_wiki_page(void);
 int get_time_format_cached (void);
 int xtoi(char *in, size_t len);
 void webcit_fmt_date(char *buf, time_t thetime, int brief);
-void fetch_http(char *url);
+int fetch_http(char *url, char *target_buf, int maxbytes);
 
 
 #ifdef HAVE_ICONV