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)
486 GetTemplateTokenString(Target, TP, 2, &who, &len);
489 serv_printf("OIMG _userpic_|%s", who);
490 StrBuf_ServGetln(Buf);
491 if (GetServerStatus(Buf, NULL) != 2) {
498 StrBuf_ServGetln(Buf);
499 GetServerStatus(Buf, NULL);
506 * Locate the message number of a user's vCard in the current room
507 * Returns the message id of his vcard
509 long locate_user_vcard_in_this_room(message_summary **VCMsg, wc_mime_attachment **VCAtt)
517 message_summary *Msg;
518 wc_mime_attachment *Att;
520 long vcard_msgnum = (-1L);
521 int already_tried_creating_one = 0;
522 StrBuf *FoundCharset = NewStrBuf();
523 StrBuf *Error = NULL;
524 SharedMessageStatus Stat;
529 memset(&Stat, 0, sizeof(SharedMessageStatus));
530 Stat.maxload = 10000;
531 Stat.lowest_found = (-1);
532 Stat.highest_found = (-1);
533 /* Search for the user's vCard */
534 if (load_msg_ptrs("MSGS ALL||||1", &Stat, NULL) > 0) {
535 at = GetNewHashPos(WCC->summ, 0);
536 while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) {
537 Msg = (message_summary*) vMsg;
538 Msg->MsgBody = (wc_mime_attachment*) malloc(sizeof(wc_mime_attachment));
539 memset(Msg->MsgBody, 0, sizeof(wc_mime_attachment));
540 Msg->MsgBody->msgnum = Msg->msgnum;
542 load_message(Msg, FoundCharset, &Error);
544 if (Msg->AllAttach != NULL) {
545 att = GetNewHashPos(Msg->AllAttach, 0);
546 while (GetNextHashPos(Msg->AllAttach, att, &HKLen, &HashKey, &vMsg) &&
547 (vcard_msgnum == -1)) {
548 Att = (wc_mime_attachment*) vMsg;
550 (strcasecmp(ChrPtr(Att->ContentType), "text/x-vcard") == 0)
551 || (strcasecmp(ChrPtr(Att->ContentType), "text/vcard") == 0)
555 vcard_msgnum = Msg->msgnum;
556 if (Att->Data == NULL) {
563 FreeStrBuf(&Error); /* don't care... */
569 /* If there's no vcard, create one */
570 if ((*VCMsg == NULL) && (already_tried_creating_one == 0)) {
572 already_tried_creating_one = 1;
573 serv_puts("ENT0 1|||4");
574 StrBuf_ServGetln(Buf);
575 if (GetServerStatus(Buf, NULL) == 4) {
576 serv_puts("Content-type: text/x-vcard");
578 serv_puts("begin:vcard");
579 serv_puts("end:vcard");
583 syslog(1, "Error while creating user vcard: %s\n", ChrPtr(Buf));
587 FreeStrBuf(&FoundCharset);
589 return(vcard_msgnum);
594 * Display the form for editing a user's address book entry
595 * username the name of the user
596 * usernum the citadel-uid of the user
598 void display_edit_address_book_entry(const char *username, long usernum) {
599 message_summary *VCMsg = NULL;
600 wc_mime_attachment *VCAtt = NULL;
603 long vcard_msgnum = (-1L);
605 /* Locate the user's config room, creating it if necessary */
607 roomname = NewStrBuf();
608 StrBufPrintf(roomname, "%010ld.%s", usernum, USERCONFIGROOM);
609 serv_printf("GOTO %s||1", ChrPtr(roomname));
610 StrBuf_ServGetln(Buf);
611 if (GetServerStatus(Buf, NULL) != 2) {
612 serv_printf("CRE8 1|%s|5|||1|", ChrPtr(roomname));
613 StrBuf_ServGetln(Buf);
614 GetServerStatus(Buf, NULL);
615 serv_printf("GOTO %s||1", ChrPtr(roomname));
616 StrBuf_ServGetln(Buf);
617 if (GetServerStatusMsg(Buf, NULL, 1, 2) != 2) {
618 select_user_to_edit(username);
620 FreeStrBuf(&roomname);
626 locate_user_vcard_in_this_room(&VCMsg, &VCAtt);
629 AppendImportantMessage(_("An error occurred while trying to create or edit this address book entry."), -1);
630 select_user_to_edit(username);
631 FreeStrBuf(&roomname);
635 do_edit_vcard(vcard_msgnum, "1",
638 "select_user_to_edit",
640 FreeStrBuf(&roomname);
645 * username the name of the user to remove
647 void delete_user(char *username) {
651 serv_printf("ASUP %s|0|0|0|0|0|", username);
652 StrBuf_ServGetln(Buf);
653 GetServerStatusMsg(Buf, NULL, 1, 2);
655 select_user_to_edit( bstr("username"));
660 void display_edituser(const char *supplied_username, int is_new) {
666 if (supplied_username != NULL) {
667 safestrncpy(username, supplied_username, sizeof username);
670 safestrncpy(username, bstr("username"), sizeof username);
674 serv_printf("AGUP %s", username);
675 StrBuf_ServGetln(Buf);
676 if (GetServerStatusMsg(Buf, NULL, 1, 2) != 2) {
677 select_user_to_edit(username);
682 Pos = ChrPtr(Buf) + 4;
683 UL = NewUserListOneEntry(Buf, Pos);
684 if ((UL != NULL) && havebstr("edit_abe_button")) {
685 display_edit_address_book_entry(username, UL->UID);
687 else if ((UL != NULL) && havebstr("delete_button")) {
688 delete_user(username);
690 else if (UL != NULL) {
691 WCTemplputParams SubTP;
692 memset(&SubTP, 0, sizeof(WCTemplputParams));
693 SubTP.Filter.ContextType = CTX_USERLIST;
695 output_headers(1, 0, 0, 0, 1, 0);
696 DoTemplate(HKEY("aide_edituser_detailview"), NULL, &SubTP);
699 DeleteUserListEntry(UL);
706 * do the backend operation of the user edit on the server
708 void edituser(void) {
710 unsigned int flags = 0;
711 const char *username;
713 is_new = ibstr("is_new");
714 username = bstr("username");
716 if (!havebstr("ok_button")) {
717 AppendImportantMessage(_("Changes were not saved."), -1);
720 StrBuf *Buf = NewStrBuf();
722 flags = ibstr("flags");
723 if (yesbstr("inetmail")) {
724 flags |= US_INTERNET;
727 flags &= ~US_INTERNET ;
730 if ((havebstr("newname")) && (strcasecmp(bstr("username"), bstr("newname")))) {
731 serv_printf("RENU %s|%s", bstr("username"), bstr("newname"));
732 StrBuf_ServGetln(Buf);
733 if (GetServerStatusMsg(Buf, NULL, 1, 2) != 2) {
734 username = bstr("newname");
738 serv_printf("ASUP %s|%s|%d|%s|%s|%s|%s|%s|%s|",
749 StrBuf_ServGetln(Buf);
750 GetServerStatusMsg(Buf, NULL, 1, 2);
755 * If we are in the middle of creating a new user, move on to
756 * the vCard edit screen.
759 display_edit_address_book_entry(username, lbstr("usernum") );
762 select_user_to_edit(username);
770 * take the web environment username and create it on the citadel server
772 void create_user(void) {
775 const char *username;
778 username = bstr("username");
779 serv_printf("CREU %s", username);
780 StrBuf_ServGetln(Buf);
781 if (GetServerStatus(Buf, &FullState) == 2) {
782 AppendImportantMessage(_("A new user has been created."), -1);
783 display_edituser(username, 1);
785 else if (FullState == 570) {
786 AppendImportantMessage(_("You are attempting to create a new user from within Citadel "
787 "while running in host based authentication mode. In this mode, "
788 "you must create new users on the host system, not within Citadel."),
790 select_user_to_edit(NULL);
793 AppendImportantMessage(ChrPtr(Buf) + 4, StrLength(Buf) - 4);
794 select_user_to_edit(NULL);
800 void _select_user_to_edit(void) {
801 select_user_to_edit(NULL);
805 void _display_edituser(void) {
806 display_edituser(NULL, 0);
811 output_headers(1, 0, 0, 0, 1, 0);
812 do_template("user_show");
821 WebcitAddUrlHandler(HKEY("showuser"), "", 0, showuser, 0);
822 WebcitAddUrlHandler(HKEY("select_user_to_edit"), "", 0, _select_user_to_edit, 0);
823 WebcitAddUrlHandler(HKEY("display_edituser"), "", 0, _display_edituser, 0);
824 WebcitAddUrlHandler(HKEY("edituser"), "", 0, edituser, 0);
825 WebcitAddUrlHandler(HKEY("create_user"), "", 0, create_user, 0);
827 RegisterNamespace("USERLIST:USERNAME", 0, 1, tmplput_USERLIST_UserName, NULL, CTX_USERLIST);
828 RegisterNamespace("USERLIST:PASSWD", 0, 1, tmplput_USERLIST_Password, NULL, CTX_USERLIST);
829 RegisterNamespace("USERLIST:ACCLVLNO", 0, 0, tmplput_USERLIST_AccessLevelNo, NULL, CTX_USERLIST);
830 RegisterNamespace("USERLIST:ACCLVLSTR", 0, 0, tmplput_USERLIST_AccessLevelStr, NULL, CTX_USERLIST);
831 RegisterNamespace("USERLIST:UID", 0, 0, tmplput_USERLIST_UID, NULL, CTX_USERLIST);
832 RegisterNamespace("USERLIST:LASTLOGON:STR", 0, 0, tmplput_USERLIST_LastLogonStr, NULL, CTX_USERLIST);
833 RegisterNamespace("USERLIST:LASTLOGON:NO", 0, 0, tmplput_USERLIST_LastLogonNo, NULL, CTX_USERLIST);
834 RegisterNamespace("USERLIST:NLOGONS", 0, 0, tmplput_USERLIST_nLogons, NULL, CTX_USERLIST);
835 RegisterNamespace("USERLIST:NPOSTS", 0, 0, tmplput_USERLIST_nPosts, NULL, CTX_USERLIST);
837 RegisterNamespace("USERLIST:FLAGS", 0, 0, tmplput_USERLIST_Flags, NULL, CTX_USERLIST);
838 RegisterNamespace("USERLIST:DAYSTILLPURGE", 0, 0, tmplput_USERLIST_DaysTillPurge, NULL, CTX_USERLIST);
840 RegisterNamespace("USER:BIO", 1, 2, tmplput_USER_BIO, NULL, CTX_NONE);
842 RegisterConditional(HKEY("COND:USERNAME"), 0, ConditionalUser, CTX_USERLIST);
843 RegisterConditional(HKEY("COND:USERACCESS"), 0, ConditionalUserAccess, CTX_USERLIST);
844 RegisterConditional(HKEY("COND:USERLIST:FLAG:USE_INTERNET"), 0, ConditionalFlagINetEmail, CTX_USERLIST);
845 RegisterConditional(HKEY("COND:USERLIST:HAVEBIO"), 0, ConditionalHaveBIO, CTX_USERLIST);
847 RegisterConditional(HKEY("COND:USER:PIC"), 1, Conditional_USER_HAS_PIC, CTX_NONE);
849 RegisterIterator("USERLIST", 0, NULL, iterate_load_userlist, NULL, DeleteHash, CTX_USERLIST, CTX_NONE, IT_FLAG_DETECT_GROUPCHANGE);
853 RegisterSortFunc(HKEY("user:name"),
856 CompareUserListNameRev,
857 GroupchangeUserListName,
859 RegisterSortFunc(HKEY("user:accslvl"),
862 CompareAccessLevelRev,
863 GroupchangeAccessLevel,
866 RegisterSortFunc(HKEY("user:nlogons"),
873 RegisterSortFunc(HKEY("user:uid"),
880 RegisterSortFunc(HKEY("user:lastlogon"),
884 GroupchangeLastLogon,
887 RegisterSortFunc(HKEY("user:nmsgposts"),
894 REGISTERTokenParamDefine(AxDeleted);
895 REGISTERTokenParamDefine(AxNewU);
896 REGISTERTokenParamDefine(AxProbU);
897 REGISTERTokenParamDefine(AxLocU);
898 REGISTERTokenParamDefine(AxNetU);
899 REGISTERTokenParamDefine(AxPrefU);
900 REGISTERTokenParamDefine(AxAideU);