2 * Copyright (c) 1996-2011 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 as
6 * published by the Free Software Foundation; either version 3 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #include "webserver.h"
24 * show a list of available users to edit them
25 * message the header message???
26 * preselect = which user should be selected in the browser
28 void select_user_to_edit(const char *preselect)
30 output_headers(1, 0, 0, 0, 1, 0);
31 do_template("aide_edituser_select");
36 typedef struct _UserListEntry {
45 /* Just available for Single users to view: */
52 UserListEntry* NewUserListOneEntry(StrBuf *SerializedUser, const char *Pos)
56 if (StrLength(SerializedUser) < 8)
59 ul = (UserListEntry*) malloc(sizeof(UserListEntry));
60 ul->UserName = NewStrBuf();
61 ul->Passvoid = NewStrBuf();
63 StrBufExtract_NextToken(ul->UserName, SerializedUser, &Pos, '|');
64 StrBufExtract_NextToken(ul->Passvoid, SerializedUser, &Pos, '|');
65 ul->Flags = StrBufExtractNext_unsigned_long(SerializedUser, &Pos, '|');
66 ul->nLogons = StrBufExtractNext_int( SerializedUser, &Pos, '|');
67 ul->nPosts = StrBufExtractNext_int( SerializedUser, &Pos, '|');
68 ul->AccessLevel = StrBufExtractNext_int( SerializedUser, &Pos, '|');
69 ul->UID = StrBufExtractNext_int( SerializedUser, &Pos, '|');
70 ul->LastLogonT = StrBufExtractNext_long( SerializedUser, &Pos, '|');
71 ul->DaysTillPurge = StrBufExtractNext_int( SerializedUser, &Pos, '|');
75 void DeleteUserListEntry(void *vUserList)
77 UserListEntry *ul = (UserListEntry*) vUserList;
79 FreeStrBuf(&ul->UserName);
80 FreeStrBuf(&ul->Passvoid);
84 UserListEntry* NewUserListEntry(StrBuf *SerializedUserList)
86 const char *Pos = NULL;
89 if (StrLength(SerializedUserList) < 8)
92 ul = (UserListEntry*) malloc(sizeof(UserListEntry));
93 ul->UserName = NewStrBuf();
94 ul->Passvoid = NewStrBuf();
96 StrBufExtract_NextToken(ul->UserName, SerializedUserList, &Pos, '|');
97 ul->AccessLevel = StrBufExtractNext_int( SerializedUserList, &Pos, '|');
98 ul->UID = StrBufExtractNext_int( SerializedUserList, &Pos, '|');
99 ul->LastLogonT = StrBufExtractNext_long(SerializedUserList, &Pos, '|');
100 ul->nLogons = StrBufExtractNext_int( SerializedUserList, &Pos, '|');
101 ul->nPosts = StrBufExtractNext_int( SerializedUserList, &Pos, '|');
102 StrBufExtract_NextToken(ul->Passvoid, SerializedUserList, &Pos, '|');
105 ul->DaysTillPurge = -1;
112 int CompareUserListName(const void *vUser1, const void *vUser2)
114 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
115 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
117 return strcmp(ChrPtr(u1->UserName), ChrPtr(u2->UserName));
120 int CompareUserListNameRev(const void *vUser1, const void *vUser2)
122 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
123 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
124 return strcmp(ChrPtr(u2->UserName), ChrPtr(u1->UserName));
127 int GroupchangeUserListName(const void *vUser1, const void *vUser2)
129 UserListEntry *u1 = (UserListEntry*) vUser1;
130 UserListEntry *u2 = (UserListEntry*) vUser2;
131 return ChrPtr(u2->UserName)[0] != ChrPtr(u1->UserName)[0];
135 * Sort by access level
137 int CompareAccessLevel(const void *vUser1, const void *vUser2)
139 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
140 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
142 return (u1->AccessLevel > u2->AccessLevel);
145 int CompareAccessLevelRev(const void *vUser1, const void *vUser2)
147 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
148 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
150 return (u2->AccessLevel > u1->AccessLevel);
153 int GroupchangeAccessLevel(const void *vUser1, const void *vUser2)
155 UserListEntry *u1 = (UserListEntry*) vUser1;
156 UserListEntry *u2 = (UserListEntry*) vUser2;
158 return u2->AccessLevel != u1->AccessLevel;
164 int CompareUID(const void *vUser1, const void *vUser2)
166 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
167 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
169 return (u1->UID > u2->UID);
172 int CompareUIDRev(const void *vUser1, const void *vUser2)
174 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
175 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
177 return (u2->UID > u1->UID);
180 int GroupchangeUID(const void *vUser1, const void *vUser2)
182 UserListEntry *u1 = (UserListEntry*) vUser1;
183 UserListEntry *u2 = (UserListEntry*) vUser2;
185 return (u2->UID / 10) != (u1->UID / 10);
189 * Sort By Date /// TODO!
191 int CompareLastLogon(const void *vUser1, const void *vUser2)
193 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
194 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
196 return (u1->LastLogonT > u2->LastLogonT);
199 int CompareLastLogonRev(const void *vUser1, const void *vUser2)
201 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
202 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
204 return (u2->LastLogonT > u1->LastLogonT);
207 int GroupchangeLastLogon(const void *vUser1, const void *vUser2)
209 UserListEntry *u1 = (UserListEntry*) vUser1;
210 UserListEntry *u2 = (UserListEntry*) vUser2;
212 return (u2->LastLogonT != u1->LastLogonT);
216 * Sort By Number of Logons
218 int ComparenLogons(const void *vUser1, const void *vUser2)
220 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
221 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
223 return (u1->nLogons > u2->nLogons);
226 int ComparenLogonsRev(const void *vUser1, const void *vUser2)
228 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
229 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
231 return (u2->nLogons > u1->nLogons);
234 int GroupchangenLogons(const void *vUser1, const void *vUser2)
236 UserListEntry *u1 = (UserListEntry*) vUser1;
237 UserListEntry *u2 = (UserListEntry*) vUser2;
239 return (u2->nLogons / 100) != (u1->nLogons / 100);
243 * Sort By Number of Posts
245 int ComparenPosts(const void *vUser1, const void *vUser2)
247 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
248 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
250 return (u1->nPosts > u2->nPosts);
253 int ComparenPostsRev(const void *vUser1, const void *vUser2)
255 UserListEntry *u1 = (UserListEntry*) GetSearchPayload(vUser1);
256 UserListEntry *u2 = (UserListEntry*) GetSearchPayload(vUser2);
258 return (u2->nPosts > u1->nPosts);
261 int GroupchangenPosts(const void *vUser1, const void *vUser2)
263 UserListEntry *u1 = (UserListEntry*) vUser1;
264 UserListEntry *u2 = (UserListEntry*) vUser2;
266 return (u2->nPosts / 100) != (u1->nPosts / 100);
270 HashList *iterate_load_userlist(StrBuf *Target, WCTemplputParams *TP)
274 HashList *Hash = NULL;
280 WCTemplputParams SubTP;
282 memset(&SubTP, 0, sizeof(WCTemplputParams));
285 StrBuf_ServGetln(Buf);
286 if (GetServerStatus(Buf, NULL) == 1) {
287 Hash = NewHash(1, Flathash);
290 len = StrBuf_ServGetln(Buf);
293 !strcmp(ChrPtr(Buf), "000")))
298 ul = NewUserListEntry(Buf);
302 Put(Hash, IKEY(ul->UID), ul, DeleteUserListEntry);
306 StrBuf_ServGetln(Buf);
307 if (GetServerStatus(Buf, NULL) == 1)
310 len = StrBuf_ServGetln(Buf);
313 !strcmp(ChrPtr(Buf), "000")))
318 UID = atoi(ChrPtr(Buf));
319 if (GetHash(Hash, IKEY(UID), &vData) && vData != 0)
321 ul = (UserListEntry*)vData;
325 SubTP.Filter.ContextType = CTX_USERLIST;
326 SortIt = RetrieveSort(&SubTP, HKEY("USER"), HKEY("user:uid"), 0);
328 SortByPayload(Hash, SortIt);
330 SortByPayload(Hash, CompareUID);
337 void tmplput_USERLIST_UserName(StrBuf *Target, WCTemplputParams *TP)
339 UserListEntry *ul = (UserListEntry*) CTX;
340 StrBufAppendTemplate(Target, TP, ul->UserName, 0);
343 void tmplput_USERLIST_Password(StrBuf *Target, WCTemplputParams *TP)
345 UserListEntry *ul = (UserListEntry*) CTX;
346 StrBufAppendTemplate(Target, TP, ul->Passvoid, 0);
349 void tmplput_USERLIST_AccessLevelNo(StrBuf *Target, WCTemplputParams *TP)
351 UserListEntry *ul = (UserListEntry*) CTX;
353 StrBufAppendPrintf(Target, "%d", ul->AccessLevel, 0);
356 void tmplput_USERLIST_AccessLevelStr(StrBuf *Target, WCTemplputParams *TP)
358 UserListEntry *ul = (UserListEntry*) CTX;
360 StrBufAppendBufPlain(Target, _(axdefs[ul->AccessLevel]), -1, 0);
363 void tmplput_USERLIST_UID(StrBuf *Target, WCTemplputParams *TP)
365 UserListEntry *ul = (UserListEntry*) CTX;
367 StrBufAppendPrintf(Target, "%d", ul->UID, 0);
370 void tmplput_USERLIST_LastLogonNo(StrBuf *Target, WCTemplputParams *TP)
372 UserListEntry *ul = (UserListEntry*) CTX;
374 StrBufAppendPrintf(Target,"%ld", ul->LastLogonT, 0);
376 void tmplput_USERLIST_LastLogonStr(StrBuf *Target, WCTemplputParams *TP)
378 UserListEntry *ul = (UserListEntry*) CTX;
379 StrEscAppend(Target, NULL, asctime(localtime(&ul->LastLogonT)), 0, 0);
382 void tmplput_USERLIST_nLogons(StrBuf *Target, WCTemplputParams *TP)
384 UserListEntry *ul = (UserListEntry*) CTX;
386 StrBufAppendPrintf(Target, "%d", ul->nLogons, 0);
389 void tmplput_USERLIST_nPosts(StrBuf *Target, WCTemplputParams *TP)
391 UserListEntry *ul = (UserListEntry*) CTX;
393 StrBufAppendPrintf(Target, "%d", ul->nPosts, 0);
396 void tmplput_USERLIST_Flags(StrBuf *Target, WCTemplputParams *TP)
398 UserListEntry *ul = (UserListEntry*) CTX;
400 StrBufAppendPrintf(Target, "%d", ul->Flags, 0);
403 void tmplput_USERLIST_DaysTillPurge(StrBuf *Target, WCTemplputParams *TP)
405 UserListEntry *ul = (UserListEntry*) CTX;
407 StrBufAppendPrintf(Target, "%d", ul->DaysTillPurge, 0);
410 int ConditionalUser(StrBuf *Target, WCTemplputParams *TP)
412 UserListEntry *ul = (UserListEntry*) CTX;
413 if (havebstr("usernum")) {
414 return ibstr("usernum") == ul->UID;
416 else if (havebstr("username")) {
417 return strcmp(bstr("username"), ChrPtr(ul->UserName)) == 0;
423 int ConditionalFlagINetEmail(StrBuf *Target, WCTemplputParams *TP)
425 UserListEntry *ul = (UserListEntry*) CTX;
426 return (ul->Flags & US_INTERNET) != 0;
429 int ConditionalUserAccess(StrBuf *Target, WCTemplputParams *TP)
431 UserListEntry *ul = (UserListEntry*) CTX;
436 return GetTemplateTokenNumber(Target,
443 int ConditionalHaveBIO(StrBuf *Target, WCTemplputParams *TP)
445 UserListEntry *ul = (UserListEntry*) CTX;
452 void tmplput_USER_BIO(StrBuf *Target, WCTemplputParams *TP)
459 GetTemplateTokenString(Target, TP, 0, &who, &len);
462 serv_printf("RBIO %s", who);
463 StrBuf_ServGetln(Buf);
464 if (GetServerStatus(Buf, NULL) == 1) {
465 StrBuf *BioBuf = NewStrBufPlain(NULL, SIZ);
466 while (!Done && StrBuf_ServGetln(Buf)>=0) {
467 if ( (StrLength(Buf)==3) &&
468 !strcmp(ChrPtr(Buf), "000"))
471 StrBufAppendBuf(BioBuf, Buf, 0);
473 StrBufAppendTemplate(Target, TP, BioBuf, 1);
479 int Conditional_USER_HAS_PIC(StrBuf *Target, WCTemplputParams *TP)
485 GetTemplateTokenString(Target, TP, 2, &who, &len);
488 serv_printf("OIMG _userpic_|%s", who);
489 StrBuf_ServGetln(Buf);
490 if (GetServerStatus(Buf, NULL) != 2) {
492 StrBuf_ServGetln(Buf);
493 GetServerStatus(Buf, NULL);
504 * Locate the message number of a user's vCard in the current room
505 * Returns the message id of his vcard
507 long locate_user_vcard_in_this_room(message_summary **VCMsg, wc_mime_attachment **VCAtt)
515 message_summary *Msg;
516 wc_mime_attachment *Att;
518 long vcard_msgnum = (-1L);
519 int already_tried_creating_one = 0;
520 StrBuf *FoundCharset = NewStrBuf();
521 StrBuf *Error = NULL;
522 SharedMessageStatus Stat;
527 memset(&Stat, 0, sizeof(SharedMessageStatus));
528 Stat.maxload = 10000;
529 Stat.lowest_found = (-1);
530 Stat.highest_found = (-1);
531 /* Search for the user's vCard */
532 if (load_msg_ptrs("MSGS ALL||||1", &Stat, NULL) > 0) {
533 at = GetNewHashPos(WCC->summ, 0);
534 while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) {
535 Msg = (message_summary*) vMsg;
536 Msg->MsgBody = (wc_mime_attachment*) malloc(sizeof(wc_mime_attachment));
537 memset(Msg->MsgBody, 0, sizeof(wc_mime_attachment));
538 Msg->MsgBody->msgnum = Msg->msgnum;
540 load_message(Msg, FoundCharset, &Error);
542 if (Msg->AllAttach != NULL) {
543 att = GetNewHashPos(Msg->AllAttach, 0);
544 while (GetNextHashPos(Msg->AllAttach, att, &HKLen, &HashKey, &vMsg) &&
545 (vcard_msgnum == -1)) {
546 Att = (wc_mime_attachment*) vMsg;
548 (strcasecmp(ChrPtr(Att->ContentType), "text/x-vcard") == 0)
549 || (strcasecmp(ChrPtr(Att->ContentType), "text/vcard") == 0)
553 vcard_msgnum = Msg->msgnum;
554 if (Att->Data == NULL) {
561 FreeStrBuf(&Error); /* don't care... */
567 /* If there's no vcard, create one */
568 if ((*VCMsg == NULL) && (already_tried_creating_one == 0)) {
570 already_tried_creating_one = 1;
571 serv_puts("ENT0 1|||4");
572 StrBuf_ServGetln(Buf);
573 if (GetServerStatus(Buf, NULL) == 4) {
574 serv_puts("Content-type: text/x-vcard");
576 serv_puts("begin:vcard");
577 serv_puts("end:vcard");
581 syslog(1, "Error while creating user vcard: %s\n", ChrPtr(Buf));
585 FreeStrBuf(&FoundCharset);
587 return(vcard_msgnum);
592 * Display the form for editing a user's address book entry
593 * username the name of the user
594 * usernum the citadel-uid of the user
596 void display_edit_address_book_entry(const char *username, long usernum) {
597 message_summary *VCMsg = NULL;
598 wc_mime_attachment *VCAtt = NULL;
601 long vcard_msgnum = (-1L);
603 /* Locate the user's config room, creating it if necessary */
605 roomname = NewStrBuf();
606 StrBufPrintf(roomname, "%010ld.%s", usernum, USERCONFIGROOM);
607 serv_printf("GOTO %s||1", ChrPtr(roomname));
608 StrBuf_ServGetln(Buf);
609 if (GetServerStatus(Buf, NULL) != 2) {
610 serv_printf("CRE8 1|%s|5|||1|", ChrPtr(roomname));
611 StrBuf_ServGetln(Buf);
612 GetServerStatus(Buf, NULL);
613 serv_printf("GOTO %s||1", ChrPtr(roomname));
614 StrBuf_ServGetln(Buf);
615 if (GetServerStatusMsg(Buf, NULL, 1, 2) != 2) {
616 select_user_to_edit(username);
618 FreeStrBuf(&roomname);
624 locate_user_vcard_in_this_room(&VCMsg, &VCAtt);
627 AppendImportantMessage(_("An error occurred while trying to create or edit this address book entry."), -1);
628 select_user_to_edit(username);
629 FreeStrBuf(&roomname);
633 do_edit_vcard(vcard_msgnum, "1",
636 "select_user_to_edit",
638 FreeStrBuf(&roomname);
643 * username the name of the user to remove
645 void delete_user(char *username) {
649 serv_printf("ASUP %s|0|0|0|0|0|", username);
650 StrBuf_ServGetln(Buf);
651 GetServerStatusMsg(Buf, NULL, 1, 2);
653 select_user_to_edit( bstr("username"));
658 void display_edituser(const char *supplied_username, int is_new) {
664 if (supplied_username != NULL) {
665 safestrncpy(username, supplied_username, sizeof username);
668 safestrncpy(username, bstr("username"), sizeof username);
672 serv_printf("AGUP %s", username);
673 StrBuf_ServGetln(Buf);
674 if (GetServerStatusMsg(Buf, NULL, 1, 2) != 2) {
675 select_user_to_edit(username);
680 Pos = ChrPtr(Buf) + 4;
681 UL = NewUserListOneEntry(Buf, Pos);
682 if ((UL != NULL) && havebstr("edit_abe_button")) {
683 display_edit_address_book_entry(username, UL->UID);
685 else if ((UL != NULL) && havebstr("delete_button")) {
686 delete_user(username);
688 else if (UL != NULL) {
689 WCTemplputParams SubTP;
690 memset(&SubTP, 0, sizeof(WCTemplputParams));
691 SubTP.Filter.ContextType = CTX_USERLIST;
693 output_headers(1, 0, 0, 0, 1, 0);
694 DoTemplate(HKEY("aide_edituser_detailview"), NULL, &SubTP);
697 DeleteUserListEntry(UL);
704 * do the backend operation of the user edit on the server
706 void edituser(void) {
708 unsigned int flags = 0;
709 const char *username;
711 is_new = ibstr("is_new");
712 username = bstr("username");
714 if (!havebstr("ok_button")) {
715 AppendImportantMessage(_("Changes were not saved."), -1);
718 StrBuf *Buf = NewStrBuf();
720 flags = ibstr("flags");
721 if (yesbstr("inetmail")) {
722 flags |= US_INTERNET;
725 flags &= ~US_INTERNET ;
728 if ((havebstr("newname")) && (strcasecmp(bstr("username"), bstr("newname")))) {
729 serv_printf("RENU %s|%s", bstr("username"), bstr("newname"));
730 StrBuf_ServGetln(Buf);
731 if (GetServerStatusMsg(Buf, NULL, 1, 2) != 2) {
732 username = bstr("newname");
736 serv_printf("ASUP %s|%s|%d|%s|%s|%s|%s|%s|%s|",
747 StrBuf_ServGetln(Buf);
748 GetServerStatusMsg(Buf, NULL, 1, 2);
753 * If we are in the middle of creating a new user, move on to
754 * the vCard edit screen.
757 display_edit_address_book_entry(username, lbstr("usernum") );
760 select_user_to_edit(username);
768 * take the web environment username and create it on the citadel server
770 void create_user(void) {
773 const char *username;
776 username = bstr("username");
777 serv_printf("CREU %s", username);
778 StrBuf_ServGetln(Buf);
779 if (GetServerStatus(Buf, &FullState) == 2) {
780 AppendImportantMessage(_("A new user has been created."), -1);
781 display_edituser(username, 1);
783 else if (FullState == 570) {
784 AppendImportantMessage(_("You are attempting to create a new user from within Citadel "
785 "while running in host based authentication mode. In this mode, "
786 "you must create new users on the host system, not within Citadel."),
788 select_user_to_edit(NULL);
791 AppendImportantMessage(ChrPtr(Buf) + 4, StrLength(Buf) - 4);
792 select_user_to_edit(NULL);
798 void _select_user_to_edit(void) {
799 select_user_to_edit(NULL);
803 void _display_edituser(void) {
804 display_edituser(NULL, 0);
809 output_headers(1, 0, 0, 0, 1, 0);
810 do_template("user_show");
819 WebcitAddUrlHandler(HKEY("showuser"), "", 0, showuser, 0);
820 WebcitAddUrlHandler(HKEY("select_user_to_edit"), "", 0, _select_user_to_edit, 0);
821 WebcitAddUrlHandler(HKEY("display_edituser"), "", 0, _display_edituser, 0);
822 WebcitAddUrlHandler(HKEY("edituser"), "", 0, edituser, 0);
823 WebcitAddUrlHandler(HKEY("create_user"), "", 0, create_user, 0);
825 RegisterNamespace("USERLIST:USERNAME", 0, 1, tmplput_USERLIST_UserName, NULL, CTX_USERLIST);
826 RegisterNamespace("USERLIST:PASSWD", 0, 1, tmplput_USERLIST_Password, NULL, CTX_USERLIST);
827 RegisterNamespace("USERLIST:ACCLVLNO", 0, 0, tmplput_USERLIST_AccessLevelNo, NULL, CTX_USERLIST);
828 RegisterNamespace("USERLIST:ACCLVLSTR", 0, 0, tmplput_USERLIST_AccessLevelStr, NULL, CTX_USERLIST);
829 RegisterNamespace("USERLIST:UID", 0, 0, tmplput_USERLIST_UID, NULL, CTX_USERLIST);
830 RegisterNamespace("USERLIST:LASTLOGON:STR", 0, 0, tmplput_USERLIST_LastLogonStr, NULL, CTX_USERLIST);
831 RegisterNamespace("USERLIST:LASTLOGON:NO", 0, 0, tmplput_USERLIST_LastLogonNo, NULL, CTX_USERLIST);
832 RegisterNamespace("USERLIST:NLOGONS", 0, 0, tmplput_USERLIST_nLogons, NULL, CTX_USERLIST);
833 RegisterNamespace("USERLIST:NPOSTS", 0, 0, tmplput_USERLIST_nPosts, NULL, CTX_USERLIST);
835 RegisterNamespace("USERLIST:FLAGS", 0, 0, tmplput_USERLIST_Flags, NULL, CTX_USERLIST);
836 RegisterNamespace("USERLIST:DAYSTILLPURGE", 0, 0, tmplput_USERLIST_DaysTillPurge, NULL, CTX_USERLIST);
838 RegisterNamespace("USER:BIO", 1, 2, tmplput_USER_BIO, NULL, CTX_NONE);
840 RegisterConditional(HKEY("COND:USERNAME"), 0, ConditionalUser, CTX_USERLIST);
841 RegisterConditional(HKEY("COND:USERACCESS"), 0, ConditionalUserAccess, CTX_USERLIST);
842 RegisterConditional(HKEY("COND:USERLIST:FLAG:USE_INTERNET"), 0, ConditionalFlagINetEmail, CTX_USERLIST);
843 RegisterConditional(HKEY("COND:USERLIST:HAVEBIO"), 0, ConditionalHaveBIO, CTX_USERLIST);
845 RegisterConditional(HKEY("COND:USER:PIC"), 1, Conditional_USER_HAS_PIC, CTX_NONE);
847 RegisterIterator("USERLIST", 0, NULL, iterate_load_userlist, NULL, DeleteHash, CTX_USERLIST, CTX_NONE, IT_FLAG_DETECT_GROUPCHANGE);
851 RegisterSortFunc(HKEY("user:name"),
854 CompareUserListNameRev,
855 GroupchangeUserListName,
857 RegisterSortFunc(HKEY("user:accslvl"),
860 CompareAccessLevelRev,
861 GroupchangeAccessLevel,
864 RegisterSortFunc(HKEY("user:nlogons"),
871 RegisterSortFunc(HKEY("user:uid"),
878 RegisterSortFunc(HKEY("user:lastlogon"),
882 GroupchangeLastLogon,
885 RegisterSortFunc(HKEY("user:nmsgposts"),
892 REGISTERTokenParamDefine(AxDeleted);
893 REGISTERTokenParamDefine(AxNewU);
894 REGISTERTokenParamDefine(AxProbU);
895 REGISTERTokenParamDefine(AxLocU);
896 REGISTERTokenParamDefine(AxNetU);
897 REGISTERTokenParamDefine(AxPrefU);
898 REGISTERTokenParamDefine(AxAideU);