Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
authorWilfried Goesgens <dothebart@citadel.org>
Mon, 18 Jul 2011 00:06:58 +0000 (00:06 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Mon, 18 Jul 2011 00:06:58 +0000 (00:06 +0000)
citadel/modules/bio/serv_bio.c
webcit/graphics.c
webcit/static/t/files/graphicsupload.html [new file with mode: 0644]
webcit/static/t/user/list_section.html
webcit/static/t/user/show.html
webcit/useredit.c
webcit/webcit.h

index e98131361f70598fd3c889dfc9c8051af62e0d3c..ac135cc2272c084baa4b6d2e2e42e53ac4227e14 100644 (file)
@@ -111,6 +111,7 @@ void cmd_lbio(char *cmdbuf)
                return;
        }
        dont_resolve_uids = *cmdbuf == '1';
+        cprintf("%d\n", LISTING_FOLLOWS);
        while ((readdir_r(filedir, d, &filedir_entry) == 0) &&
               (filedir_entry != NULL))
        {
@@ -119,6 +120,10 @@ void cmd_lbio(char *cmdbuf)
 #else
                d_namelen = strlen(filedir_entry->d_name);
 #endif
+               if (((d_namelen == 1) && (filedir_entry->d_name[0] == '.')) || 
+                   ((d_namelen == 2) && (filedir_entry->d_name[0] == '.') && (filedir_entry->d_name[1] == '.')))
+                       continue;
+                   
                if (dont_resolve_uids) {
                        filedir_entry->d_name[d_namelen++] = '\n';
                        filedir_entry->d_name[d_namelen] = '\0';
index ee7d6bd97ed8ed9e61df624026934cd6c5038f55..f798cc3e5bf1cb99e0eb70b7a499ebaa8cd2b78b 100644 (file)
 
 #include "webcit.h"
 
-void display_graphics_upload(char *description, char *filename, char *uplurl)
+void display_graphics_upload(char *filename)
 {
-       WCTemplputParams SubTP;
-       StrBuf *Buf;
        char buf[SIZ];
 
-
        snprintf(buf, SIZ, "UIMG 0||%s", filename);
        serv_puts(buf);
        serv_getln(buf, sizeof buf);
@@ -35,46 +32,9 @@ void display_graphics_upload(char *description, char *filename, char *uplurl)
                display_main_menu();
                return;
        }
-       /*output_headers(1, 1, 0, 0, 0, 0); */
-
-       output_headers(1, 1, 1, 0, 0, 0);
-
-       Buf = NewStrBufPlain(_("Image upload"), -1);
-       memset(&SubTP, 0, sizeof(WCTemplputParams));
-       SubTP.Filter.ContextType = CTX_STRBUF;
-       SubTP.Context = Buf;
-       DoTemplate(HKEY("box_begin"), NULL, &SubTP);
-
-       FreeStrBuf(&Buf);
-
-       wc_printf("<form enctype=\"multipart/form-data\" action=\"%s\" "
-               "method=\"post\" name=\"graphicsupload\">\n", uplurl);
-
-       wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
-       wc_printf("<input type=\"hidden\" name=\"which_room\" value=\"");
-       urlescputs(bstr("which_room"));
-       wc_printf("\">\n");
-
-       wc_printf(_("You can upload an image directly from your computer"));
-       wc_printf("<br><br>\n");
-
-       wc_printf(_("Please select a file to upload:"));
-       wc_printf("<input type=\"file\" name=\"filename\" size=\"35\">\n");
-
-       wc_printf("<div class=\"uploadpic\"><img src=\"image?name=%s\"></div>\n", filename);
-
-       wc_printf("<div class=\"buttons\">");
-       wc_printf("<input type=\"submit\" name=\"upload_button\" value=\"%s\">\n", _("Upload"));
-       wc_printf("&nbsp;");
-       wc_printf("<input type=\"reset\" value=\"%s\">\n", _("Reset form"));
-       wc_printf("&nbsp;");
-       wc_printf("<input type=\"submit\" name=\"cancel_button\" value=\"%s\">\n", _("Cancel"));
-       wc_printf("</div>\n");
-       wc_printf("</form>\n");
-
-       do_template("box_end");
-
-       wDumpContent(1);
+       output_headers(1, 0, 0, 0, 1, 0);
+       do_template("files_graphicsupload");
+       end_burst();
 }
 
 void do_graphics_upload(char *filename)
@@ -143,38 +103,44 @@ void editgoodbuyepic(void) { do_graphics_upload("UIMG 1|%s|goodbuye"); }
 
 /* The users photo display / upload facility */
 void display_editpic(void) {
-       display_graphics_upload(_("your photo"),
-                               "_userpic_",
-                               "editpic");
+       putbstr("__WHICHPIC", NewStrBufPlain(HKEY("_userpic_")));
+       putbstr("__PICDESC", NewStrBufPlain(_("your photo"), -1));
+       putbstr("__UPLURL", NewStrBufPlain(HKEY("editpic")));
+       display_graphics_upload("editpic");
 }
 /* room picture dispay / upload facility */
 void display_editroompic(void) {
-       display_graphics_upload(_("the icon for this room"),
-                               "_roompic_",
-                               "editroompic");
+       putbstr("__WHICHPIC", NewStrBufPlain(HKEY("_roompic_")));
+       putbstr("__PICDESC", NewStrBufPlain(_("the icon for this room"), -1));
+       putbstr("__UPLURL", NewStrBufPlain(HKEY("editroompic")));
+       display_graphics_upload("editroompic");
 }
 
 /* the greetingpage hello pic */
 void display_edithello(void) {
-       display_graphics_upload(_("the Greetingpicture for the login prompt"),
-                               "hello",
-                               "edithellopic");
+       putbstr("__WHICHPIC", NewStrBufPlain(HKEY("hello")));
+       putbstr("__PICDESC", NewStrBufPlain(_("the Greetingpicture for the login prompt"), -1));
+       putbstr("__UPLURL", NewStrBufPlain(HKEY("edithellopic")));
+       display_graphics_upload("edithellopic");
 }
 
 /* the logoff banner */
 void display_editgoodbyepic(void) {
-       display_graphics_upload(_("the Logoff banner picture"),
-                               "UIMG 0|%s|goodbuye",
-                               "editgoodbuyepic");
+       putbstr("__WHICHPIC", NewStrBufPlain(HKEY("UIMG 0|%s|goodbuye")));
+       putbstr("__PICDESC", NewStrBufPlain(_("the Logoff banner picture"), -1));
+       putbstr("__UPLURL", NewStrBufPlain(HKEY("editgoodbuyepic")));
+       display_graphics_upload("editgoodbuyepic");
 }
 
 void display_editfloorpic(void) {
-       char buf[SIZ];
-       snprintf(buf, SIZ, "_floorpic_|%s",
-                bstr("which_floor"));
-       display_graphics_upload(_("the icon for this floor"),
-                               buf,
-                               "editfloorpic");
+       StrBuf *PicAction;
+
+       PicAction = NewStrBuf();
+       StrBufPrintf(PicAction, "_floorpic_|%s", bstr("which_floor"));
+       putbstr("__WHICHPIC", PicAction);
+       putbstr("__PICDESC", NewStrBufPlain(_("the icon for this floor"), -1));
+       putbstr("__UPLURL", NewStrBufPlain(HKEY("editfloorpic")));
+       display_graphics_upload("editfloorpic");
 }
 
 void editroompic(void) {
diff --git a/webcit/static/t/files/graphicsupload.html b/webcit/static/t/files/graphicsupload.html
new file mode 100644 (file)
index 0000000..8caaef5
--- /dev/null
@@ -0,0 +1,22 @@
+<?=("head")>
+<?=("box_begin_1")><?_("Image upload")> <?BSTR("__PICDESC")><?=("box_begin_2")>
+<form enctype="multipart/form-data" action='<?BSTR("__UPLURL")>' method="post" name="graphicsupload">
+
+<input type="hidden" name="nonce" value="<?NONCE>">
+<input type="hidden" name="which_room" value="<?ROOMNAME("U")>"><?_("You can upload an image directly from your computer")>
+<br><br>
+<?_("Please select a file to upload:")>
+<input type="file" name="filename" size="35">
+
+<div class="uploadpic"><img src="image?name=<?BSTR("__WHICHPIC")>"></div>
+
+<div class="buttons">
+  <input type="submit" name="upload_button" value="<?_("Upload")>">
+  &nbsp;
+  <input type="reset" value="<?_("Reset form")>" >
+  &nbsp;
+  <input type="submit" name="cancel_button" value="<?_("Cancel")>">
+</div>
+</form>
+<?=("box_end")>
+<?=("trailing")>
index 1f456de7f826c62015841b5f67733895d14799e0..0c5f6823b05e14ec5e14714c02e470708417a7b8 100644 (file)
@@ -1,9 +1,8 @@
 <tr class="<?ITERATE:ODDEVEN>"><td>
-    <?!("COND:USERLIST:HAVEBIO", 1)><a href="showuser?who=<?USERLIST:USERNAME('U')>"><?USERLIST:USERNAME('X')></a><?!("X", 1)>
-    <??("COND:USERLIST:HAVEBIO", 2)><?USERLIST:USERNAME('X')><??("X", 2)>
+    <?!("COND:USERLIST:HAVEBIO", 1)><a href="showuser?who=<?USERLIST:USERNAME('U')>"><?USERLIST:USERNAME('X')></a><?!("X", 1)><??("COND:USERLIST:HAVEBIO", 2)><?USERLIST:USERNAME('X')><??("X", 2)>
   </td>
 <td><?USERLIST:UID></td>
-<td><?USERLIST:ACCLVLSTR)>(<?USERLIST:ACCLVLNO>)</td>
+<td><?USERLIST:ACCLVLSTR>(<?USERLIST:ACCLVLNO>)</td>
 <td><?USERLIST:LASTLOGON:STR></td>
 <td><?USERLIST:NLOGONS></td>
 <td><?USERLIST:NPOSTS></td>
index 5434dbc672cb9fa9e63041977287f1a6062b68da..f411034eda303bc618edaed3507933934f43931d 100644 (file)
@@ -1,4 +1,4 @@
-<?("=head")>
+<?=("head")>
 <div id="banner">
   <img src="static/webcit_icons/essen/32x32/account.png" alt="">
   <h1><?_("User profile")></h1>
@@ -24,4 +24,4 @@
        <?USER:BIO(B"who", "FJUSTIFY")>
   </td></tr>
   </table>
-<?=("trailing">
+<?=("trailing")>
index 81a5bd99545c9c5d7e2ca6f1fb4dbecf74637f6e..c6dee8107671907cacb7ffeca71c723b8a27326f 100644 (file)
@@ -101,6 +101,7 @@ UserListEntry* NewUserListEntry(StrBuf *SerializedUserList)
        ul->nPosts      = StrBufExtractNext_int( SerializedUserList, &Pos, '|');
        StrBufExtract_NextToken(ul->Passvoid,    SerializedUserList, &Pos, '|');
        ul->Flags = 0;
+       ul->HasBio = 0;
        ul->DaysTillPurge = -1;
        return ul;
 }
@@ -302,7 +303,9 @@ HashList *iterate_load_userlist(StrBuf *Target, WCTemplputParams *TP)
                }
 
                serv_puts("LBIO 1");
+               StrBuf_ServGetln(Buf);
                if (GetServerStatus(Buf, NULL) == 1)
+                       Done = 0;
                        while (!Done) {
                        len = StrBuf_ServGetln(Buf);
                        if ((len <0) || 
@@ -820,7 +823,12 @@ void _display_edituser(void) {
        display_edituser(NULL, 0);
 }
 
-void showuser(void) { do_template("user_show");}
+void showuser(void)
+{
+       output_headers(1, 0, 0, 0, 1, 0);
+       do_template("user_show");
+       end_burst();
+}
 
 
 void 
index 3e435f1e7434d57192f740c439ecf216ac069726..cb8128ac72234251c1475461cf7769d169ab9a1a 100644 (file)
@@ -803,8 +803,6 @@ int ical_ctdl_is_overlap(
 
 extern char *months[];
 extern char *days[];
-void display_graphics_upload(char *, char *, char *);
-void do_graphics_upload(char *upl_cmd);
 int serv_write(const char *buf, int nbytes);
 int serv_putbuf(const StrBuf *string);
 int serv_printf(const char *format,...)__attribute__((__format__(__printf__,1,2)));