-/*
- * $Id$
- */
#include "webcit.h"
#include "webserver.h"
void select_user_to_edit(const char *preselect)
{
output_headers(1, 0, 0, 0, 1, 0);
- do_template("edituser_select", NULL);
+ do_template("aide_edituser_select", NULL);
end_burst();
}
{
int Done = 0;
CompareFunc SortIt;
- HashList *Hash;
+ HashList *Hash = NULL;
StrBuf *Buf;
UserListEntry* ul;
char nnn[64];
while (!Done) {
len = StrBuf_ServGetln(Buf);
- if ((len == 3) &&
- (strcmp(ChrPtr(Buf), "000")==0)) {
+ if ((len <0) ||
+ ((len == 3) &&
+ strcmp(ChrPtr(Buf), "000")))
+ {
Done = 1;
break;
}
SortByPayload(Hash, SortIt);
else
SortByPayload(Hash, CompareUID);
- return Hash;
}
FreeStrBuf(&Buf);
- return NULL;
+ return Hash;
}
int ConditionalUserAccess(StrBuf *Target, WCTemplputParams *TP)
{
UserListEntry *ul = (UserListEntry*) CTX;
-
- if (TP->Tokens->Params[3]->Type == TYPE_LONG)
- return (TP->Tokens->Params[3]->lvalue == ul->AccessLevel);
- else
+
+ if (ul == NULL)
return 0;
+
+ return GetTemplateTokenNumber(Target,
+ TP,
+ 3,
+ AxNewU)
+ ==
+ ul->AccessLevel;
}
/*
Stat.highest_found = (-1);
Done = 0;
/* Search for the user's vCard */
- if (load_msg_ptrs("MSGS ALL||||1", &Stat) > 0) {
+ if (load_msg_ptrs("MSGS ALL||||1", &Stat, NULL) > 0) {
at = GetNewHashPos(WCC->summ, 0);
while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) {
Msg = (message_summary*) vMsg;
if (Msg->AllAttach != NULL) {
att = GetNewHashPos(Msg->AllAttach, 0);
- while (GetNextHashPos(Msg->AllAttach, att, &HKLen, &HashKey, &vMsg)) {
+ while (GetNextHashPos(Msg->AllAttach, att, &HKLen, &HashKey, &vMsg) &&
+ (vcard_msgnum == -1)) {
Att = (wc_mime_attachment*) vMsg;
if (
(strcasecmp(ChrPtr(Att->ContentType), "text/x-vcard") == 0)
) {
*VCAtt = Att;
*VCMsg = Msg;
+ vcard_msgnum = Msg->msgnum;
if (Att->Data == NULL) {
MimeLoadData(Att);
- vcard_msgnum = Msg->msgnum;
}
}
}
/* If there's no vcard, create one */
if ((*VCMsg == NULL) && (already_tried_creating_one == 0)) {
+ FlushStrBuf(Buf);
already_tried_creating_one = 1;
serv_puts("ENT0 1|||4");
StrBuf_ServGetln(Buf);
- if (GetServerStatus(Buf, NULL) != 4) {
+ if (GetServerStatus(Buf, NULL) == 4) {
serv_puts("Content-type: text/x-vcard");
serv_puts("");
serv_puts("begin:vcard");
serv_puts("end:vcard");
serv_puts("000");
}
+ else
+ syslog(1, "Error while creating user vcard: %s\n", ChrPtr(Buf));
goto TRYAGAIN;
}
FreeStrBuf(&Buf);
SubTP.Filter.ContextType = CTX_USERLIST;
SubTP.Context = UL;
output_headers(1, 0, 0, 0, 1, 0);
- DoTemplate(HKEY("userlist_detailview"), NULL, &SubTP);
+ DoTemplate(HKEY("aide_edituser_detailview"), NULL, &SubTP);
end_burst();
}
DeleteUserListEntry(UL);
GroupchangenPosts,
CTX_USERLIST);
+ REGISTERTokenParamDefine(AxDeleted);
+ REGISTERTokenParamDefine(AxNewU);
+ REGISTERTokenParamDefine(AxProbU);
+ REGISTERTokenParamDefine(AxLocU);
+ REGISTERTokenParamDefine(AxNetU);
+ REGISTERTokenParamDefine(AxPrefU);
+ REGISTERTokenParamDefine(AxAideU);
}
+