#include "webserver.h"
-/**
+/*
* show a list of available users to edit them
* message the header message???
- * preselect which user should be selected in the browser
+ * preselect = which user should be selected in the browser
*/
void select_user_to_edit(const char *preselect)
{
return strcmp(ChrPtr(u1->UserName), ChrPtr(u2->UserName));
}
+
int CompareUserListNameRev(const void *vUser1, const void *vUser2)
{
UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
return strcmp(ChrPtr(u2->UserName), ChrPtr(u1->UserName));
}
+
int GroupchangeUserListName(const void *vUser1, const void *vUser2)
{
UserListEntry *u1 = (UserListEntry*) vUser1;
}
/*
- * Sort by AccessLevel
+ * Sort by access level
*/
int CompareAccessLevel(const void *vUser1, const void *vUser2)
{
return (u1->AccessLevel > u2->AccessLevel);
}
+
int CompareAccessLevelRev(const void *vUser1, const void *vUser2)
{
UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
return (u2->AccessLevel > u1->AccessLevel);
}
+
int GroupchangeAccessLevel(const void *vUser1, const void *vUser2)
{
UserListEntry *u1 = (UserListEntry*) vUser1;
return u2->AccessLevel != u1->AccessLevel;
}
-
/*
* Sort by UID
*/
return (u1->UID > u2->UID);
}
+
int CompareUIDRev(const void *vUser1, const void *vUser2)
{
UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
return (u2->UID > u1->UID);
}
+
int GroupchangeUID(const void *vUser1, const void *vUser2)
{
UserListEntry *u1 = (UserListEntry*) vUser1;
return (u1->LastLogonT > u2->LastLogonT);
}
+
int CompareLastLogonRev(const void *vUser1, const void *vUser2)
{
UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
return (u2->LastLogonT > u1->LastLogonT);
}
+
int GroupchangeLastLogon(const void *vUser1, const void *vUser2)
{
UserListEntry *u1 = (UserListEntry*) vUser1;
return (u1->nLogons > u2->nLogons);
}
+
int ComparenLogonsRev(const void *vUser1, const void *vUser2)
{
UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
return (u2->nLogons > u1->nLogons);
}
+
int GroupchangenLogons(const void *vUser1, const void *vUser2)
{
UserListEntry *u1 = (UserListEntry*) vUser1;
return (u1->nPosts > u2->nPosts);
}
+
int ComparenPostsRev(const void *vUser1, const void *vUser2)
{
UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
return (u2->nPosts > u1->nPosts);
}
+
int GroupchangenPosts(const void *vUser1, const void *vUser2)
{
UserListEntry *u1 = (UserListEntry*) vUser1;
* Locate the message number of a user's vCard in the current room
* Returns the message id of his vcard
*/
-long locate_user_vcard_in_this_room(message_summary **VCMsg,
- wc_mime_attachment **VCAtt)
+long locate_user_vcard_in_this_room(message_summary **VCMsg, wc_mime_attachment **VCAtt)
{
wcsession *WCC = WC;
HashPos *at;
void *vMsg;
message_summary *Msg;
wc_mime_attachment *Att;
-
-
int Done;
StrBuf *Buf;
long vcard_msgnum = (-1L);
StrBuf *FoundCharset = NewStrBuf();
StrBuf *Error = NULL;
-
Buf = NewStrBuf();
TRYAGAIN:
Done = 0;
- /** Search for the user's vCard */
- if (load_msg_ptrs("MSGS ALL||||1", 1) > 0) {
+ /* Search for the user's vCard */
+ if (load_msg_ptrs("MSGS ALL||||1", 1, NULL, NULL) > 0) {
at = GetNewHashPos(WCC->summ, 0);
while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) {
Msg = (message_summary*) vMsg;
memset(Msg->MsgBody, 0, sizeof(wc_mime_attachment));
Msg->MsgBody->msgnum = Msg->msgnum;
- load_message(Msg,
- FoundCharset,
- &Error);
+ load_message(Msg, FoundCharset, &Error);
if (Msg->AllAttach != NULL) {
att = GetNewHashPos(Msg->AllAttach, 0);
while (GetNextHashPos(Msg->AllAttach, att, &HKLen, &HashKey, &vMsg)) {
Att = (wc_mime_attachment*) vMsg;
- if ( (strcasecmp(ChrPtr(Att->ContentType), "text/x-vcard") == 0) ||
- (strcasecmp(ChrPtr(Att->ContentType), "text/vcard") == 0) ) {
+ if (
+ (strcasecmp(ChrPtr(Att->ContentType), "text/x-vcard") == 0)
+ || (strcasecmp(ChrPtr(Att->ContentType), "text/vcard") == 0)
+ ) {
*VCAtt = Att;
*VCMsg = Msg;
- if (Att->Data == NULL)
+ if (Att->Data == NULL) {
MimeLoadData(Att);
+ vcard_msgnum = Msg->msgnum;
+ }
}
}
+ DeleteHashPos(&att);
}
- FreeStrBuf(&Error); /*< don't care... */
+ FreeStrBuf(&Error); /* don't care... */
}
DeleteHashPos(&at);
}
- /** If there's no vcard, create one */
+
+ /* If there's no vcard, create one */
if ((*VCMsg == NULL) && (already_tried_creating_one == 0)) {
already_tried_creating_one = 1;
serv_puts("ENT0 1|||4");
}
-/**
+/*
* Display the form for editing a user's address book entry
* username the name of the user
* usernum the citadel-uid of the user
StrBuf *Buf;
long vcard_msgnum = (-1L);
- /** Locate the user's config room, creating it if necessary */
+ /* Locate the user's config room, creating it if necessary */
Buf = NewStrBuf();
roomname = NewStrBuf();
StrBufPrintf(roomname, "%010ld.%s", usernum, USERCONFIGROOM);
FreeStrBuf(&Buf);
}
-/**
+/*
* do the backend operation of the user edit on the server
*/
void edituser(void) {
FreeStrBuf(&Buf);
}
- /**
+ /*
* If we are in the middle of creating a new user, move on to
* the vCard edit screen.
*/
-/**
+/*
* create a new user
* take the web environment username and create it on the citadel server
*/
}
-void _select_user_to_edit(void){select_user_to_edit(NULL);}
-void _display_edituser(void) {display_edituser(NULL, 0);}
+void _select_user_to_edit(void) {
+ select_user_to_edit(NULL);
+}
+
+
+void _display_edituser(void) {
+ display_edituser(NULL, 0);
+}
+
void
InitModule_USEREDIT