/*
- * $Id$
+ * Copyright (c) 1996-2011 by the citadel.org team
+ *
+ * This program is open source software. You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "webcit.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");
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;
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("000");
}
else
- lprintf(1, "Error while creating user vcard: %s\n", ChrPtr(Buf));
+ 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);
}
+