2 * Copyright (c) 1996-2012 by the citadel.org team
4 * This program is open source software. You can redistribute it and/or
5 * modify it under the terms of the GNU General Public License, version 3.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
14 #include "webserver.h"
18 * show a list of available users to edit them
19 * message the header message???
20 * preselect = which user should be selected in the browser
22 void select_user_to_edit(const char *preselect)
24 output_headers(1, 0, 0, 0, 1, 0);
25 do_template("aide_edituser_select");
30 typedef struct _UserListEntry {
39 /* Just available for Single users to view: */
46 UserListEntry* NewUserListOneEntry(StrBuf *SerializedUser, const char *Pos)
50 if (StrLength(SerializedUser) < 8)
53 ul = (UserListEntry*) malloc(sizeof(UserListEntry));
54 ul->UserName = NewStrBuf();
55 ul->Passvoid = NewStrBuf();
57 StrBufExtract_NextToken(ul->UserName, SerializedUser, &Pos, '|');
58 StrBufExtract_NextToken(ul->Passvoid, SerializedUser, &Pos, '|');
59 ul->Flags = StrBufExtractNext_unsigned_long(SerializedUser, &Pos, '|');
60 ul->nLogons = StrBufExtractNext_int( SerializedUser, &Pos, '|');
61 ul->nPosts = StrBufExtractNext_int( SerializedUser, &Pos, '|');
62 ul->AccessLevel = StrBufExtractNext_int( SerializedUser, &Pos, '|');
63 ul->UID = StrBufExtractNext_int( SerializedUser, &Pos, '|');
64 ul->LastLogonT = StrBufExtractNext_long( SerializedUser, &Pos, '|');
65 ul->DaysTillPurge = StrBufExtractNext_int( SerializedUser, &Pos, '|');
69 void DeleteUserListEntry(void *vUserList)
71 UserListEntry *ul = (UserListEntry*) vUserList;
73 FreeStrBuf(&ul->UserName);
74 FreeStrBuf(&ul->Passvoid);
78 UserListEntry* NewUserListEntry(StrBuf *SerializedUserList)
80 const char *Pos = NULL;
83 if (StrLength(SerializedUserList) < 8)
86 ul = (UserListEntry*) malloc(sizeof(UserListEntry));
87 ul->UserName = NewStrBuf();
88 ul->Passvoid = NewStrBuf();
90 StrBufExtract_NextToken(ul->UserName, SerializedUserList, &Pos, '|');
91 ul->AccessLevel = StrBufExtractNext_int( SerializedUserList, &Pos, '|');
92 ul->UID = StrBufExtractNext_int( SerializedUserList, &Pos, '|');
93 ul->LastLogonT = StrBufExtractNext_long(SerializedUserList, &Pos, '|');
94 ul->nLogons = StrBufExtractNext_int( SerializedUserList, &Pos, '|');
95 ul->nPosts = StrBufExtractNext_int( SerializedUserList, &Pos, '|');
96 StrBufExtract_NextToken(ul->Passvoid, SerializedUserList, &Pos, '|');
99 ul->DaysTillPurge = -1;
106 int CompareUserListName(const void *vUser1, const void *vUser2)
108 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
109 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
111 return strcmp(ChrPtr(u1->UserName), ChrPtr(u2->UserName));
114 int CompareUserListNameRev(const void *vUser1, const void *vUser2)
116 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
117 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
118 return strcmp(ChrPtr(u2->UserName), ChrPtr(u1->UserName));
121 int GroupchangeUserListName(const void *vUser1, const void *vUser2)
123 UserListEntry *u1 = (UserListEntry*) vUser1;
124 UserListEntry *u2 = (UserListEntry*) vUser2;
125 return ChrPtr(u2->UserName)[0] != ChrPtr(u1->UserName)[0];
129 * Sort by access level
131 int CompareAccessLevel(const void *vUser1, const void *vUser2)
133 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
134 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
136 return (u1->AccessLevel > u2->AccessLevel);
139 int CompareAccessLevelRev(const void *vUser1, const void *vUser2)
141 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
142 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
144 return (u2->AccessLevel > u1->AccessLevel);
147 int GroupchangeAccessLevel(const void *vUser1, const void *vUser2)
149 UserListEntry *u1 = (UserListEntry*) vUser1;
150 UserListEntry *u2 = (UserListEntry*) vUser2;
152 return u2->AccessLevel != u1->AccessLevel;
158 int CompareUID(const void *vUser1, const void *vUser2)
160 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
161 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
163 return (u1->UID > u2->UID);
166 int CompareUIDRev(const void *vUser1, const void *vUser2)
168 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
169 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
171 return (u2->UID > u1->UID);
174 int GroupchangeUID(const void *vUser1, const void *vUser2)
176 UserListEntry *u1 = (UserListEntry*) vUser1;
177 UserListEntry *u2 = (UserListEntry*) vUser2;
179 return (u2->UID / 10) != (u1->UID / 10);
183 * Sort By Date /// TODO!
185 int CompareLastLogon(const void *vUser1, const void *vUser2)
187 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
188 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
190 return (u1->LastLogonT > u2->LastLogonT);
193 int CompareLastLogonRev(const void *vUser1, const void *vUser2)
195 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
196 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
198 return (u2->LastLogonT > u1->LastLogonT);
201 int GroupchangeLastLogon(const void *vUser1, const void *vUser2)
203 UserListEntry *u1 = (UserListEntry*) vUser1;
204 UserListEntry *u2 = (UserListEntry*) vUser2;
206 return (u2->LastLogonT != u1->LastLogonT);
210 * Sort By Number of Logons
212 int ComparenLogons(const void *vUser1, const void *vUser2)
214 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
215 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
217 return (u1->nLogons > u2->nLogons);
220 int ComparenLogonsRev(const void *vUser1, const void *vUser2)
222 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
223 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
225 return (u2->nLogons > u1->nLogons);
228 int GroupchangenLogons(const void *vUser1, const void *vUser2)
230 UserListEntry *u1 = (UserListEntry*) vUser1;
231 UserListEntry *u2 = (UserListEntry*) vUser2;
233 return (u2->nLogons / 100) != (u1->nLogons / 100);
237 * Sort By Number of Posts
239 int ComparenPosts(const void *vUser1, const void *vUser2)
241 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
242 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
244 return (u1->nPosts > u2->nPosts);
247 int ComparenPostsRev(const void *vUser1, const void *vUser2)
249 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
250 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
252 return (u2->nPosts > u1->nPosts);
255 int GroupchangenPosts(const void *vUser1, const void *vUser2)
257 UserListEntry *u1 = (UserListEntry*) vUser1;
258 UserListEntry *u2 = (UserListEntry*) vUser2;
260 return (u2->nPosts / 100) != (u1->nPosts / 100);
264 HashList *iterate_load_userlist(StrBuf *Target, WCTemplputParams *TP)
268 HashList *Hash = NULL;
274 WCTemplputParams SubTP;
276 memset(&SubTP, 0, sizeof(WCTemplputParams));
279 StrBuf_ServGetln(Buf);
280 if (GetServerStatus(Buf, NULL) == 1) {
281 Hash = NewHash(1, Flathash);
284 len = StrBuf_ServGetln(Buf);
287 !strcmp(ChrPtr(Buf), "000")))
292 ul = NewUserListEntry(Buf);
296 Put(Hash, IKEY(ul->UID), ul, DeleteUserListEntry);
300 StrBuf_ServGetln(Buf);
301 if (GetServerStatus(Buf, NULL) == 1)
304 len = StrBuf_ServGetln(Buf);
307 !strcmp(ChrPtr(Buf), "000")))
312 UID = atoi(ChrPtr(Buf));
313 if (GetHash(Hash, IKEY(UID), &vData) && vData != 0)
315 ul = (UserListEntry*)vData;
319 SubTP.Filter.ContextType = CTX_USERLIST;
320 SortIt = RetrieveSort(&SubTP, HKEY("USER"), HKEY("user:uid"), 0);
322 SortByPayload(Hash, SortIt);
324 SortByPayload(Hash, CompareUID);
331 void tmplput_USERLIST_UserName(StrBuf *Target, WCTemplputParams *TP)
333 UserListEntry *ul = (UserListEntry*) CTX;
334 StrBufAppendTemplate(Target, TP, ul->UserName, 0);
337 void tmplput_USERLIST_Password(StrBuf *Target, WCTemplputParams *TP)
339 UserListEntry *ul = (UserListEntry*) CTX;
340 StrBufAppendTemplate(Target, TP, ul->Passvoid, 0);
343 void tmplput_USERLIST_AccessLevelNo(StrBuf *Target, WCTemplputParams *TP)
345 UserListEntry *ul = (UserListEntry*) CTX;
347 StrBufAppendPrintf(Target, "%d", ul->AccessLevel, 0);
350 void tmplput_USERLIST_AccessLevelStr(StrBuf *Target, WCTemplputParams *TP)
352 UserListEntry *ul = (UserListEntry*) CTX;
354 StrBufAppendBufPlain(Target, _(axdefs[ul->AccessLevel]), -1, 0);
357 void tmplput_USERLIST_UID(StrBuf *Target, WCTemplputParams *TP)
359 UserListEntry *ul = (UserListEntry*) CTX;
361 StrBufAppendPrintf(Target, "%d", ul->UID, 0);
364 void tmplput_USERLIST_LastLogonNo(StrBuf *Target, WCTemplputParams *TP)
366 UserListEntry *ul = (UserListEntry*) CTX;
368 StrBufAppendPrintf(Target,"%ld", ul->LastLogonT, 0);
370 void tmplput_USERLIST_LastLogonStr(StrBuf *Target, WCTemplputParams *TP)
372 UserListEntry *ul = (UserListEntry*) CTX;
373 StrEscAppend(Target, NULL, asctime(localtime(&ul->LastLogonT)), 0, 0);
376 void tmplput_USERLIST_nLogons(StrBuf *Target, WCTemplputParams *TP)
378 UserListEntry *ul = (UserListEntry*) CTX;
380 StrBufAppendPrintf(Target, "%d", ul->nLogons, 0);
383 void tmplput_USERLIST_nPosts(StrBuf *Target, WCTemplputParams *TP)
385 UserListEntry *ul = (UserListEntry*) CTX;
387 StrBufAppendPrintf(Target, "%d", ul->nPosts, 0);
390 void tmplput_USERLIST_Flags(StrBuf *Target, WCTemplputParams *TP)
392 UserListEntry *ul = (UserListEntry*) CTX;
394 StrBufAppendPrintf(Target, "%d", ul->Flags, 0);
397 void tmplput_USERLIST_DaysTillPurge(StrBuf *Target, WCTemplputParams *TP)
399 UserListEntry *ul = (UserListEntry*) CTX;
401 StrBufAppendPrintf(Target, "%d", ul->DaysTillPurge, 0);
404 int ConditionalUser(StrBuf *Target, WCTemplputParams *TP)
406 UserListEntry *ul = (UserListEntry*) CTX;
407 if (havebstr("usernum")) {
408 return ibstr("usernum") == ul->UID;
410 else if (havebstr("username")) {
411 return strcmp(bstr("username"), ChrPtr(ul->UserName)) == 0;
417 int ConditionalFlagINetEmail(StrBuf *Target, WCTemplputParams *TP)
419 UserListEntry *ul = (UserListEntry*) CTX;
420 return (ul->Flags & US_INTERNET) != 0;
423 int ConditionalUserAccess(StrBuf *Target, WCTemplputParams *TP)
425 UserListEntry *ul = (UserListEntry*) CTX;
430 return GetTemplateTokenNumber(Target,
437 int ConditionalHaveBIO(StrBuf *Target, WCTemplputParams *TP)
439 UserListEntry *ul = (UserListEntry*) CTX;
446 void tmplput_USER_BIO(StrBuf *Target, WCTemplputParams *TP)
453 GetTemplateTokenString(Target, TP, 0, &who, &len);
456 serv_printf("RBIO %s", who);
457 StrBuf_ServGetln(Buf);
458 if (GetServerStatus(Buf, NULL) == 1) {
459 StrBuf *BioBuf = NewStrBufPlain(NULL, SIZ);
460 while (!Done && StrBuf_ServGetln(Buf)>=0) {
461 if ( (StrLength(Buf)==3) &&
462 !strcmp(ChrPtr(Buf), "000"))
465 StrBufAppendBuf(BioBuf, Buf, 0);
467 StrBufAppendTemplate(Target, TP, BioBuf, 1);
473 int Conditional_USER_HAS_PIC(StrBuf *Target, WCTemplputParams *TP)
480 GetTemplateTokenString(Target, TP, 2, &who, &len);
483 serv_printf("OIMG _userpic_|%s", who);
484 StrBuf_ServGetln(Buf);
485 if (GetServerStatus(Buf, NULL) != 2) {
492 StrBuf_ServGetln(Buf);
493 GetServerStatus(Buf, NULL);
500 * Locate the message number of a user's vCard in the current room
501 * Returns the message id of his vcard
503 long locate_user_vcard_in_this_room(message_summary **VCMsg, wc_mime_attachment **VCAtt)
511 message_summary *Msg;
512 wc_mime_attachment *Att;
514 long vcard_msgnum = (-1L);
515 int already_tried_creating_one = 0;
516 StrBuf *FoundCharset = NewStrBuf();
517 StrBuf *Error = NULL;
518 SharedMessageStatus Stat;
523 memset(&Stat, 0, sizeof(SharedMessageStatus));
524 Stat.maxload = 10000;
525 Stat.lowest_found = (-1);
526 Stat.highest_found = (-1);
527 /* Search for the user's vCard */
528 if (load_msg_ptrs("MSGS ALL||||1", NULL, &Stat, NULL) > 0) {
529 at = GetNewHashPos(WCC->summ, 0);
530 while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) {
531 Msg = (message_summary*) vMsg;
532 Msg->MsgBody = (wc_mime_attachment*) malloc(sizeof(wc_mime_attachment));
533 memset(Msg->MsgBody, 0, sizeof(wc_mime_attachment));
534 Msg->MsgBody->msgnum = Msg->msgnum;
536 load_message(Msg, FoundCharset, &Error);
538 if (Msg->AllAttach != NULL) {
539 att = GetNewHashPos(Msg->AllAttach, 0);
540 while (GetNextHashPos(Msg->AllAttach, att, &HKLen, &HashKey, &vMsg) &&
541 (vcard_msgnum == -1)) {
542 Att = (wc_mime_attachment*) vMsg;
544 (strcasecmp(ChrPtr(Att->ContentType), "text/x-vcard") == 0)
545 || (strcasecmp(ChrPtr(Att->ContentType), "text/vcard") == 0)
549 vcard_msgnum = Msg->msgnum;
550 if (Att->Data == NULL) {
557 FreeStrBuf(&Error); /* don't care... */
563 /* If there's no vcard, create one */
564 if ((*VCMsg == NULL) && (already_tried_creating_one == 0)) {
566 already_tried_creating_one = 1;
567 serv_puts("ENT0 1|||4");
568 StrBuf_ServGetln(Buf);
569 if (GetServerStatus(Buf, NULL) == 4) {
570 serv_puts("Content-type: text/x-vcard");
572 serv_puts("begin:vcard");
573 serv_puts("end:vcard");
577 syslog(1, "Error while creating user vcard: %s\n", ChrPtr(Buf));
581 FreeStrBuf(&FoundCharset);
583 return(vcard_msgnum);
588 * Display the form for editing a user's address book entry
589 * username the name of the user
590 * usernum the citadel-uid of the user
592 void display_edit_address_book_entry(const char *username, long usernum) {
593 message_summary *VCMsg = NULL;
594 wc_mime_attachment *VCAtt = NULL;
597 long vcard_msgnum = (-1L);
599 /* Locate the user's config room, creating it if necessary */
601 roomname = NewStrBuf();
602 StrBufPrintf(roomname, "%010ld.%s", usernum, USERCONFIGROOM);
603 serv_printf("GOTO %s||1", ChrPtr(roomname));
604 StrBuf_ServGetln(Buf);
605 if (GetServerStatus(Buf, NULL) != 2) {
606 serv_printf("CRE8 1|%s|5|||1|", ChrPtr(roomname));
607 StrBuf_ServGetln(Buf);
608 GetServerStatus(Buf, NULL);
609 serv_printf("GOTO %s||1", ChrPtr(roomname));
610 StrBuf_ServGetln(Buf);
611 if (GetServerStatusMsg(Buf, NULL, 1, 2) != 2) {
612 select_user_to_edit(username);
614 FreeStrBuf(&roomname);
620 locate_user_vcard_in_this_room(&VCMsg, &VCAtt);
623 AppendImportantMessage(_("An error occurred while trying to create or edit this address book entry."), -1);
624 select_user_to_edit(username);
625 FreeStrBuf(&roomname);
629 do_edit_vcard(vcard_msgnum, "1",
632 "select_user_to_edit",
634 FreeStrBuf(&roomname);
639 * username the name of the user to remove
641 void delete_user(char *username) {
645 serv_printf("ASUP %s|0|0|0|0|0|", username);
646 StrBuf_ServGetln(Buf);
647 GetServerStatusMsg(Buf, NULL, 1, 2);
649 select_user_to_edit( bstr("username"));
654 void display_edituser(const char *supplied_username, int is_new) {
660 if (supplied_username != NULL) {
661 safestrncpy(username, supplied_username, sizeof username);
664 safestrncpy(username, bstr("username"), sizeof username);
668 serv_printf("AGUP %s", username);
669 StrBuf_ServGetln(Buf);
670 if (GetServerStatusMsg(Buf, NULL, 1, 2) != 2) {
671 select_user_to_edit(username);
676 Pos = ChrPtr(Buf) + 4;
677 UL = NewUserListOneEntry(Buf, Pos);
678 if ((UL != NULL) && havebstr("edit_abe_button")) {
679 display_edit_address_book_entry(username, UL->UID);
681 else if ((UL != NULL) && havebstr("delete_button")) {
682 delete_user(username);
684 else if (UL != NULL) {
685 WCTemplputParams SubTP;
686 memset(&SubTP, 0, sizeof(WCTemplputParams));
687 SubTP.Filter.ContextType = CTX_USERLIST;
689 output_headers(1, 0, 0, 0, 1, 0);
690 DoTemplate(HKEY("aide_edituser_detailview"), NULL, &SubTP);
693 DeleteUserListEntry(UL);
700 * do the backend operation of the user edit on the server
702 void edituser(void) {
704 unsigned int flags = 0;
705 const char *username;
707 is_new = ibstr("is_new");
708 username = bstr("username");
710 if (!havebstr("ok_button")) {
711 AppendImportantMessage(_("Changes were not saved."), -1);
714 StrBuf *Buf = NewStrBuf();
716 flags = ibstr("flags");
717 if (yesbstr("inetmail")) {
718 flags |= US_INTERNET;
721 flags &= ~US_INTERNET ;
724 if ((havebstr("newname")) && (strcasecmp(bstr("username"), bstr("newname")))) {
725 serv_printf("RENU %s|%s", bstr("username"), bstr("newname"));
726 StrBuf_ServGetln(Buf);
727 if (GetServerStatusMsg(Buf, NULL, 1, 2) != 2) {
728 username = bstr("newname");
732 serv_printf("ASUP %s|%s|%d|%s|%s|%s|%s|%s|%s|",
743 StrBuf_ServGetln(Buf);
744 GetServerStatusMsg(Buf, NULL, 1, 2);
749 * If we are in the middle of creating a new user, move on to
750 * the vCard edit screen.
753 display_edit_address_book_entry(username, lbstr("usernum") );
756 select_user_to_edit(username);
764 * take the web environment username and create it on the citadel server
766 void create_user(void) {
769 const char *username;
772 username = bstr("username");
773 serv_printf("CREU %s", username);
774 StrBuf_ServGetln(Buf);
775 if (GetServerStatus(Buf, &FullState) == 2) {
776 AppendImportantMessage(_("A new user has been created."), -1);
777 display_edituser(username, 1);
779 else if (FullState == 570) {
780 AppendImportantMessage(_("You are attempting to create a new user from within Citadel "
781 "while running in host based authentication mode. In this mode, "
782 "you must create new users on the host system, not within Citadel."),
784 select_user_to_edit(NULL);
787 AppendImportantMessage(ChrPtr(Buf) + 4, StrLength(Buf) - 4);
788 select_user_to_edit(NULL);
794 void _select_user_to_edit(void) {
795 select_user_to_edit(NULL);
799 void _display_edituser(void) {
800 display_edituser(NULL, 0);
805 output_headers(1, 0, 0, 0, 1, 0);
806 do_template("user_show");
815 WebcitAddUrlHandler(HKEY("showuser"), "", 0, showuser, 0);
816 WebcitAddUrlHandler(HKEY("select_user_to_edit"), "", 0, _select_user_to_edit, 0);
817 WebcitAddUrlHandler(HKEY("display_edituser"), "", 0, _display_edituser, 0);
818 WebcitAddUrlHandler(HKEY("edituser"), "", 0, edituser, 0);
819 WebcitAddUrlHandler(HKEY("create_user"), "", 0, create_user, 0);
821 RegisterNamespace("USERLIST:USERNAME", 0, 1, tmplput_USERLIST_UserName, NULL, CTX_USERLIST);
822 RegisterNamespace("USERLIST:PASSWD", 0, 1, tmplput_USERLIST_Password, NULL, CTX_USERLIST);
823 RegisterNamespace("USERLIST:ACCLVLNO", 0, 0, tmplput_USERLIST_AccessLevelNo, NULL, CTX_USERLIST);
824 RegisterNamespace("USERLIST:ACCLVLSTR", 0, 0, tmplput_USERLIST_AccessLevelStr, NULL, CTX_USERLIST);
825 RegisterNamespace("USERLIST:UID", 0, 0, tmplput_USERLIST_UID, NULL, CTX_USERLIST);
826 RegisterNamespace("USERLIST:LASTLOGON:STR", 0, 0, tmplput_USERLIST_LastLogonStr, NULL, CTX_USERLIST);
827 RegisterNamespace("USERLIST:LASTLOGON:NO", 0, 0, tmplput_USERLIST_LastLogonNo, NULL, CTX_USERLIST);
828 RegisterNamespace("USERLIST:NLOGONS", 0, 0, tmplput_USERLIST_nLogons, NULL, CTX_USERLIST);
829 RegisterNamespace("USERLIST:NPOSTS", 0, 0, tmplput_USERLIST_nPosts, NULL, CTX_USERLIST);
831 RegisterNamespace("USERLIST:FLAGS", 0, 0, tmplput_USERLIST_Flags, NULL, CTX_USERLIST);
832 RegisterNamespace("USERLIST:DAYSTILLPURGE", 0, 0, tmplput_USERLIST_DaysTillPurge, NULL, CTX_USERLIST);
834 RegisterNamespace("USER:BIO", 1, 2, tmplput_USER_BIO, NULL, CTX_NONE);
836 RegisterConditional(HKEY("COND:USERNAME"), 0, ConditionalUser, CTX_USERLIST);
837 RegisterConditional(HKEY("COND:USERACCESS"), 0, ConditionalUserAccess, CTX_USERLIST);
838 RegisterConditional(HKEY("COND:USERLIST:FLAG:USE_INTERNET"), 0, ConditionalFlagINetEmail, CTX_USERLIST);
839 RegisterConditional(HKEY("COND:USERLIST:HAVEBIO"), 0, ConditionalHaveBIO, CTX_USERLIST);
841 RegisterConditional(HKEY("COND:USER:PIC"), 1, Conditional_USER_HAS_PIC, CTX_NONE);
843 RegisterIterator("USERLIST", 0, NULL, iterate_load_userlist, NULL, DeleteHash, CTX_USERLIST, CTX_NONE, IT_FLAG_DETECT_GROUPCHANGE);
847 RegisterSortFunc(HKEY("user:name"),
850 CompareUserListNameRev,
851 GroupchangeUserListName,
853 RegisterSortFunc(HKEY("user:accslvl"),
856 CompareAccessLevelRev,
857 GroupchangeAccessLevel,
860 RegisterSortFunc(HKEY("user:nlogons"),
867 RegisterSortFunc(HKEY("user:uid"),
874 RegisterSortFunc(HKEY("user:lastlogon"),
878 GroupchangeLastLogon,
881 RegisterSortFunc(HKEY("user:nmsgposts"),
888 REGISTERTokenParamDefine(AxDeleted);
889 REGISTERTokenParamDefine(AxNewU);
890 REGISTERTokenParamDefine(AxProbU);
891 REGISTERTokenParamDefine(AxLocU);
892 REGISTERTokenParamDefine(AxNetU);
893 REGISTERTokenParamDefine(AxPrefU);
894 REGISTERTokenParamDefine(AxAideU);