]> code.citadel.org Git - citadel.git/blobdiff - webcit/useredit.c
* put filename reference into token, so we can put in errormessages where we wouldn...
[citadel.git] / webcit / useredit.c
index 2446b3c2e9153964b22bbaf06ec291eedd8d2ca1..97e59de1dd9dd67a4fe29d3020636c67623846ff 100644 (file)
@@ -273,7 +273,7 @@ int ComparenPostsRev(const void *vUser1, const void *vUser2)
 }
 
 
-HashList *iterate_load_userlist(WCTemplateToken *Token)
+HashList *iterate_load_userlist(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType)
 {
        HashList *Hash;
        char buf[SIZ];
@@ -496,7 +496,7 @@ TRYAGAIN:
        }
 
        /** If there's no vcard, create one */
-       if (vcard_msgnum < 0) if (already_tried_creating_one == 0) {
+       if ((vcard_msgnum < 0) && (already_tried_creating_one == 0)) {
                already_tried_creating_one = 1;
                serv_puts("ENT0 1|||4");
                serv_getln(buf, sizeof buf);
@@ -588,9 +588,18 @@ void display_edituser(char *supplied_username, int is_new) {
        }
        else {
                UL = NewUserListOneEntry(Buf);
-               output_headers(1, 0, 0, 0, 1, 0);
-               DoTemplate(HKEY("userlist_detailview"), NULL, (void*) UL, CTX_USERLIST);
-               end_burst();
+               if (havebstr("edit_abe_button")) {
+                       display_edit_address_book_entry(username, UL->UID);
+               }
+               else if (havebstr("delete_button")) {
+                       delete_user(username);
+               }
+               else {
+                       output_headers(1, 0, 0, 0, 1, 0);
+                       DoTemplate(HKEY("userlist_detailview"), NULL, (void*) UL, CTX_USERLIST);
+                       end_burst();
+               }
+               DeleteUserListEntry(UL);
                
        }
        FreeStrBuf(&Buf);
@@ -941,5 +950,5 @@ InitModule_USEREDIT
        RegisterConditional(HKEY("COND:USERACCESS"), 0,   ConditionalUserAccess, CTX_USERLIST);
        RegisterConditional(HKEY("COND:USERLIST:FLAG:USE_INTERNET"), 0, ConditionalFlagINetEmail, CTX_USERLIST);
 
-       RegisterIterator("USERLIST", 0, NULL, iterate_load_userlist, NULL, DeleteHash, CTX_USERLIST);
+       RegisterIterator("USERLIST", 0, NULL, iterate_load_userlist, NULL, DeleteHash, CTX_USERLIST, CTX_NONE);
 }