4 * Manage user preferences with a little help from the Citadel server.
12 HashList *PreferenceHooks;
14 typedef struct _PrefDef {
22 typedef struct _Preference {
32 void DestroyPrefDef(void *vPrefDef)
34 PrefDef *Prefdef = (PrefDef*) vPrefDef;
35 FreeStrBuf(&Prefdef->Setting);
36 FreeStrBuf(&Prefdef->OnLoadName);
40 void DestroyPreference(void *vPref)
42 Preference *Pref = (Preference*) vPref;
43 FreeStrBuf(&Pref->Key);
44 FreeStrBuf(&Pref->Val);
45 FreeStrBuf(&Pref->DeQPed);
49 void _RegisterPreference(const char *Setting, long SettingLen,
53 const char *OnLoadName)
55 PrefDef *Newpref = (PrefDef*) malloc(sizeof(PrefDef));
56 Newpref->Setting = NewStrBufPlain(Setting, SettingLen);
57 Newpref->PrefStr = PrefStr;
59 Newpref->OnLoad = OnLoad;
60 if (Newpref->OnLoad != NULL) {
61 Newpref->OnLoadName = NewStrBufPlain(OnLoadName, -1);
64 Newpref->OnLoadName = NULL;
65 Put(PreferenceHooks, Setting, SettingLen, Newpref, DestroyPrefDef);
68 const char *PrefGetLocalStr(const char *Setting, long len)
71 if (GetHash(PreferenceHooks, Setting, len, &hash_value) != 0) {
72 PrefDef *Newpref = (PrefDef*) hash_value;
73 return _(Newpref->PrefStr);
80 inline const char *PrintPref(void *vPref)
82 Preference *Pref = (Preference*) vPref;
83 if (Pref->DeQPed != NULL)
84 return ChrPtr(Pref->DeQPed);
86 return ChrPtr(Pref->Val);
90 void GetPrefTypes(HashList *List)
100 It = GetNewHashPos(List, 0);
101 while (GetNextHashPos(List, It, &len, &Key, &vSetting))
103 Pref = (Preference*) vSetting;
104 if (GetHash(PreferenceHooks, SKEY(Pref->Key), &vPrefDef) &&
107 PrefType = (PrefDef*) vPrefDef;
108 Pref->Type = PrefType;
110 lprintf(1, "Loading [%s]with type [%ld] [\"%s\"]\n",
115 switch (Pref->Type->Type)
121 Pref->lval = StrTol(Pref->Val);
125 Pref->DeQPed = NewStrBufPlain(NULL, StrLength(Pref->Val));
126 StrBufEUid_unescapize(Pref->DeQPed, Pref->Val);
130 Pref->lval = strcmp(ChrPtr(Pref->Val), "yes") == 0;
135 if (PrefType->OnLoad != NULL){
137 lprintf(1, "Loading with: -> %s(\"%s\", %ld)\n",
138 ChrPtr(PrefType->OnLoadName),
141 PrefType->OnLoad(Pref->Val, Pref->lval);
148 void ParsePref(HashList **List, StrBuf *ReadBuf)
151 Preference *Data = NULL;
152 Preference *LastData = NULL;
155 StrBuf_ServGetln(ReadBuf);
156 if ( (StrLength(ReadBuf)==3) &&
157 !strcmp(ChrPtr(ReadBuf), "000")) {
162 if ((ChrPtr(ReadBuf)[0] == ' ') &&
163 (LastData != NULL)) {
164 StrBufAppendBuf(LastData->Val, ReadBuf, 1);
167 LastData = Data = malloc(sizeof(Preference));
168 memset(Data, 0, sizeof(Preference));
169 Data->Key = NewStrBuf();
170 Data->Val = NewStrBuf();
171 StrBufExtract_token(Data->Key, ReadBuf, 0, '|');
172 StrBufExtract_token(Data->Val, ReadBuf, 1, '|');
173 if (!IsEmptyStr(ChrPtr(Data->Key)))
183 lprintf(1, "ignoring spurious preference line: [%s]\n",
185 DestroyPreference(Data);
196 * display preferences dialog
198 void load_preferences(void)
206 memset(&Room, 0, sizeof(folder));
207 ReadBuf = NewStrBufPlain(NULL, SIZ * 4);
208 if (goto_config_room(ReadBuf, &Room) != 0) {
209 FreeStrBuf(&ReadBuf);
212 return; /* oh well. */
215 serv_puts("MSGS ALL|0|1");
216 StrBuf_ServGetln(ReadBuf);
217 if (GetServerStatus(ReadBuf, NULL) == 8) {
218 serv_puts("subj|__ WebCit Preferences __");
222 StrBuf_ServGetln(ReadBuf)) {
223 if ( (StrLength(ReadBuf)==3) &&
224 !strcmp(ChrPtr(ReadBuf), "000")) {
228 msgnum = StrTol(ReadBuf);
232 serv_printf("MSG0 %ld", msgnum);
233 StrBuf_ServGetln(ReadBuf);
234 if (GetServerStatus(ReadBuf, NULL) == 1) {
235 while (StrBuf_ServGetln(ReadBuf),
236 (strcmp(ChrPtr(ReadBuf), "text") &&
237 strcmp(ChrPtr(ReadBuf), "000"))) {
239 if (!strcmp(ChrPtr(ReadBuf), "text")) {
240 ParsePref(&WCC->hash_prefs, ReadBuf);
245 /* Go back to the room we're supposed to be in */
246 if (StrLength(WCC->CurRoom.name) > 0) {
247 serv_printf("GOTO %s", ChrPtr(WCC->CurRoom.name));
248 StrBuf_ServGetln(ReadBuf);
249 GetServerStatus(ReadBuf, NULL);
251 FreeStrBuf(&ReadBuf);
256 * Goto the user's configuration room, creating it if necessary.
257 * returns 0 on success or nonzero upon failure.
259 int goto_config_room(StrBuf *Buf, folder *Room)
261 serv_printf("GOTO %s", USERCONFIGROOM);
262 StrBuf_ServGetln(Buf);
263 if (GetServerStatus(Buf, NULL) != 2) { /* try to create the config room if not there */
264 serv_printf("CRE8 1|%s|4|0", USERCONFIGROOM);
265 StrBuf_ServGetln(Buf);
266 GetServerStatus(Buf, NULL);
268 serv_printf("GOTO %s", USERCONFIGROOM);
269 StrBuf_ServGetln(Buf);
270 if (GetServerStatus(Buf, NULL) != 2) {
274 ParseGoto(Room, Buf);
278 void WritePrefsToServer(HashList *Hash)
286 StrBuf *SubBuf = NULL;
288 Hash = WCC->hash_prefs;
289 #ifdef DBG_PREFS_HASH
290 dbg_PrintHash(Hash, PrintPref, NULL);
292 HashPos = GetNewHashPos(Hash, 0);
293 while (GetNextHashPos(Hash, HashPos, &len, &Key, &vPref)!=0)
298 Pref = (Preference*) vPref;
299 nchars = StrLength(Pref->Val);
302 size_t offset, nchars;
304 SubBuf = NewStrBufPlain(NULL, SIZ);
313 nchars = StrBufSub(SubBuf, Pref->Val, offset, nchars);
316 serv_printf("%s|%s", ChrPtr(Pref->Key), ChrPtr(SubBuf));
318 serv_printf(" %s", ChrPtr(SubBuf));
321 nchars = StrLength(Pref->Val) - offset;
327 serv_printf("%s|%s", ChrPtr(Pref->Key), ChrPtr(Pref->Val));
331 DeleteHashPos(&HashPos);
335 * \brief save the modifications
337 void save_preferences(void)
345 ReadBuf = NewStrBuf();
346 memset(&Room, 0, sizeof(folder));
347 if (goto_config_room(ReadBuf, &Room) != 0) {
348 FreeStrBuf(&ReadBuf);
351 return; /* oh well. */
354 /* make shure the config room has the right type, else it might reject our config */
355 if (Room.view != VIEW_BBS) {
356 serv_printf("VIEW %d", VIEW_BBS);
357 StrBuf_ServGetln(ReadBuf);
358 if (GetServerStatus(ReadBuf, NULL) != 2) {
361 else if (goto_config_room(ReadBuf, &Room) != 0) {
362 FreeStrBuf(&ReadBuf);
365 return; /* oh well. */
369 serv_puts("MSGS ALL|0|1");
370 StrBuf_ServGetln(ReadBuf);
371 if (GetServerStatus(ReadBuf, NULL) == 8) {
372 serv_puts("subj|__ WebCit Preferences __");
376 StrBuf_ServGetln(ReadBuf)) {
377 if ( (StrLength(ReadBuf)==3) &&
378 !strcmp(ChrPtr(ReadBuf), "000")) {
382 msgnum = StrTol(ReadBuf);
386 serv_printf("DELE %ld", msgnum);
387 StrBuf_ServGetln(ReadBuf);
388 GetServerStatus(ReadBuf, NULL);
391 serv_printf("ENT0 1||0|1|__ WebCit Preferences __|");
392 StrBuf_ServGetln(ReadBuf);
393 if (GetServerStatus(ReadBuf, NULL) == 4) {
395 WritePrefsToServer(WCC->hash_prefs);
400 /** Go back to the room we're supposed to be in */
401 if (StrLength(WCC->CurRoom.name) > 0) {
402 serv_printf("GOTO %s", ChrPtr(WCC->CurRoom.name));
403 StrBuf_ServGetln(ReadBuf);
404 GetServerStatus(ReadBuf, NULL);
406 FreeStrBuf(&ReadBuf);
411 * \brief query the actual setting of key in the citadel database
412 * \param key config key to query
413 * \param keylen length of the key string
414 * \param value StrBuf-value to the key to get
417 int get_pref_backend(const char *key, size_t keylen, Preference **Pref)
419 void *hash_value = NULL;
420 #ifdef DBG_PREFS_HASH
421 dbg_PrintHash(WC->hash_prefs, PrintPref, NULL);
423 if (GetHash(WC->hash_prefs, key, keylen, &hash_value) == 0) {
428 *Pref = (Preference*) hash_value;
433 int get_PREFERENCE(const char *key, size_t keylen, StrBuf **value)
438 Ret = get_pref_backend(key, keylen, &Pref);
447 * \brief Write a key into the webcit preferences database for this user
449 * \params key key whichs value is to be modified
450 * \param keylen length of the key string
451 * \param value value to set
452 * \param save_to_server 1 = flush all data to the server, 0 = cache it for now
454 void set_preference_backend(const char *key, size_t keylen,
465 Pref = (Preference*) malloc(sizeof(Preference));
466 memset(Pref, 0, sizeof(Preference));
467 Pref->Key = NewStrBufPlain(key, keylen);
469 if ((PrefType == NULL) &&
470 GetHash(PreferenceHooks, SKEY(Pref->Key), &vPrefDef) &&
472 PrefType = (PrefDef*) vPrefDef;
474 if (PrefType != NULL)
476 Pref->Type = PrefType;
477 if (Pref->Type->Type != lPrefType)
478 lprintf(1, "warning: saving preference with wrong type [%s] %ld != %ld \n",
479 key, Pref->Type->Type, lPrefType);
480 switch (Pref->Type->Type)
489 if (Pref->Val == NULL)
490 Pref->Val = NewStrBufPlain(NULL, 64);
491 StrBufPrintf(Pref->Val, "%ld", lvalue);
495 Pref->DeQPed = value;
496 Pref->Val = NewStrBufPlain(NULL, StrLength(Pref->DeQPed) * 3);
497 StrBufEUid_escapize(Pref->Val, Pref->DeQPed);
503 Pref->Val = NewStrBufPlain(HKEY("yes"));
505 Pref->Val = NewStrBufPlain(HKEY("no"));
509 if (Pref->Type->OnLoad != NULL)
510 Pref->Type->OnLoad(Pref->Val, Pref->lval);
522 if (Pref->Val == NULL)
523 Pref->Val = NewStrBufPlain(NULL, 64);
524 StrBufPrintf(Pref->Val, "%ld", lvalue);
528 Pref->DeQPed = value;
529 Pref->Val = NewStrBufPlain(NULL, StrLength(Pref->DeQPed) * 3);
530 StrBufEUid_escapize(Pref->Val, Pref->DeQPed);
536 Pref->Val = NewStrBufPlain(HKEY("yes"));
538 Pref->Val = NewStrBufPlain(HKEY("no"));
543 Put(WCC->hash_prefs, key, keylen, Pref, DestroyPreference);
545 if (save_to_server) WCC->SavePrefsToServer = 1;
548 void set_PREFERENCE(const char *key, size_t keylen, StrBuf *value, int save_to_server)
550 set_preference_backend(key, keylen, 0, value, PRF_STRING, save_to_server, NULL);
553 int get_PREF_LONG(const char *key, size_t keylen, long *value, long Default)
558 Ret = get_pref_backend(key, keylen, &Pref);
567 *value = Pref->lval = atol(ChrPtr(Pref->Val));
574 void set_PREF_LONG(const char *key, size_t keylen, long value, int save_to_server)
576 set_preference_backend(key, keylen, value, NULL, PRF_INT, save_to_server, NULL);
579 int get_PREF_YESNO(const char *key, size_t keylen, int *value, int Default)
584 Ret = get_pref_backend(key, keylen, &Pref);
593 *value = Pref->lval = strcmp(ChrPtr(Pref->Val), "yes") == 0;
599 void set_PREF_YESNO(const char *key, size_t keylen, long value, int save_to_server)
601 set_preference_backend(key, keylen, value, NULL, PRF_YESNO, save_to_server, NULL);
604 int get_room_prefs_backend(const char *key, size_t keylen,
610 pref_name = NewStrBufPlain (HKEY("ROOM:"));
611 StrBufAppendBuf(pref_name, WC->CurRoom.name, 0);
612 StrBufAppendBufPlain(pref_name, HKEY(":"), 0);
613 StrBufAppendBufPlain(pref_name, key, keylen, 0);
614 Ret = get_pref_backend(SKEY(pref_name), Pref);
615 FreeStrBuf(&pref_name);
620 const StrBuf *get_X_PREFS(const char *key, size_t keylen,
621 const char *xkey, size_t xkeylen)
627 pref_name = NewStrBufPlain (HKEY("XPREF:"));
628 StrBufAppendBufPlain(pref_name, xkey, xkeylen, 0);
629 StrBufAppendBufPlain(pref_name, HKEY(":"), 0);
630 StrBufAppendBufPlain(pref_name, key, keylen, 0);
632 ret = get_pref_backend(SKEY(pref_name), &Prf);
633 FreeStrBuf(&pref_name);
640 void set_X_PREFS(const char *key, size_t keylen, const char *xkey, size_t xkeylen, StrBuf *value, int save_to_server)
644 pref_name = NewStrBufPlain (HKEY("XPREF:"));
645 StrBufAppendBufPlain(pref_name, xkey, xkeylen, 0);
646 StrBufAppendBufPlain(pref_name, HKEY(":"), 0);
647 StrBufAppendBufPlain(pref_name, key, keylen, 0);
649 set_preference_backend(SKEY(pref_name), 0, value, PRF_STRING, save_to_server, NULL);
650 FreeStrBuf(&pref_name);
654 long get_ROOM_PREFS_LONG(const char *key, size_t keylen, long *value, long Default)
659 Ret = get_room_prefs_backend(key, keylen, &Pref);
669 *value = Pref->lval = atol(ChrPtr(Pref->Val));
676 StrBuf *get_ROOM_PREFS(const char *key, size_t keylen)
681 Ret = get_room_prefs_backend(key, keylen, &Pref);
690 void set_ROOM_PREFS(const char *key, size_t keylen, StrBuf *value, int save_to_server)
694 pref_name = NewStrBufPlain (HKEY("ROOM:"));
695 StrBufAppendBuf(pref_name, WC->CurRoom.name, 0);
696 StrBufAppendBufPlain(pref_name, HKEY(":"), 0);
697 StrBufAppendBufPlain(pref_name, key, keylen, 0);
698 set_preference_backend(SKEY(pref_name), 0, value, PRF_STRING, save_to_server, NULL);
699 FreeStrBuf(&pref_name);
703 void GetPreferences(HashList *Setting)
715 Tmp = WCC->hash_prefs;
716 WCC->hash_prefs = Setting;
718 It = GetNewHashPos(PreferenceHooks, 0);
719 while (GetNextHashPos(PreferenceHooks, It, &len, &Key, &vSetting)) {
720 PrefType = (PrefDef*) vSetting;
722 if (!HaveBstr(SKEY(PrefType->Setting)))
724 switch (PrefType->Type) {
726 Buf = NewStrBufDup(SBstr(SKEY(PrefType->Setting)));
727 set_preference_backend(SKEY(PrefType->Setting),
735 lval = LBstr(SKEY(PrefType->Setting));
736 set_preference_backend(SKEY(PrefType->Setting),
744 Buf = NewStrBufDup(SBstr(SKEY(PrefType->Setting)));
745 set_preference_backend(SKEY(PrefType->Setting),
753 lval = YesBstr(SKEY(PrefType->Setting));
754 set_preference_backend(SKEY(PrefType->Setting),
763 WCC->hash_prefs = Tmp;
769 * \brief Commit new preferences and settings
771 void set_preferences(void)
773 if (!havebstr("change_button")) {
774 safestrncpy(WC->ImportantMessage,
775 _("Cancelled. No settings were changed."),
776 sizeof WC->ImportantMessage);
780 GetPreferences(WC->hash_prefs);
785 void tmplput_CFG_Value(StrBuf *Target, WCTemplputParams *TP)
788 if (get_pref_backend(TKEY(0), &Pref))
790 if (Pref->Type == NULL) {
791 StrBufAppendTemplate(Target, TP, Pref->Val, 1);
793 switch (Pref->Type->Type)
796 StrBufAppendTemplate(Target, TP, Pref->Val, 1);
799 if (Pref->decoded != 1) {
800 if (Pref->Val == NULL)
801 Pref->Val = NewStrBufPlain(NULL, 64);
802 StrBufPrintf(Pref->Val, "%ld", Pref->lval);
805 StrBufAppendTemplate(Target, TP, Pref->Val, 1);
808 if (Pref->decoded != 1) {
809 if (Pref->DeQPed == NULL)
810 Pref->DeQPed = NewStrBufPlain(NULL, StrLength(Pref->Val));
812 StrBufEUid_unescapize(Pref->DeQPed, Pref->Val);
815 StrBufAppendTemplate(Target, TP, Pref->DeQPed, 1);
818 if (Pref->decoded != 1) {
819 Pref->lval = strcmp(ChrPtr(Pref->Val), "yes") == 0;
822 StrBufAppendTemplate(Target, TP, Pref->Val, 1);
828 void tmplput_CFG_Descr(StrBuf *Target, WCTemplputParams *TP)
830 const char *SettingStr;
831 SettingStr = PrefGetLocalStr(TKEY(0));
832 if (SettingStr != NULL)
833 StrBufAppendBufPlain(Target, SettingStr, -1, 0);
835 void tmplput_CFG_RoomValueLong(StrBuf *Target, WCTemplputParams *TP)
841 defval = GetTemplateTokenNumber(Target, TP, 1, 0);
842 get_ROOM_PREFS_LONG(TKEY(0), &lvalue, defval);
843 StrBufAppendPrintf(Target, "%ld", lvalue);
845 void tmplput_CFG_RoomValue(StrBuf *Target, WCTemplputParams *TP)
847 StrBuf *pref = get_ROOM_PREFS(TKEY(0));
849 StrBufAppendBuf(Target, pref, 0);
851 int ConditionalHasRoomPreference(StrBuf *Target, WCTemplputParams *TP)
853 if (get_ROOM_PREFS(TP->Tokens->Params[0]->Start,
854 TP->Tokens->Params[0]->len) != NULL)
860 int ConditionalPreference(StrBuf *Target, WCTemplputParams *TP)
864 if (!get_PREFERENCE(TKEY(2), &Pref))
867 if (!HAVE_PARAM(3)) {
870 else if (TP->Tokens->Params[3]->Type == TYPE_STR)
871 return ((TP->Tokens->Params[3]->len == StrLength(Pref)) &&
872 (strcmp(TP->Tokens->Params[3]->Start, ChrPtr(Pref)) == 0));
874 return (StrTol(Pref) == TP->Tokens->Params[3]->lvalue);
877 int ConditionalHasPreference(StrBuf *Target, WCTemplputParams *TP)
881 if (!get_PREFERENCE(TKEY(2), &Pref) ||
889 /********************************************************************************
890 * preferences stored discrete in citserver
891 ********************************************************************************/
892 HashList *GetGVEAHash(StrBuf *Target, WCTemplputParams *TP)
895 HashList *List = NULL;
902 StrBuf_ServGetln(Rcp);
903 if (GetServerStatus(Rcp, NULL) == 1) {
905 List = NewHash(1, NULL);
906 while (!Done && (StrBuf_ServGetln(Rcp)>=0)) {
907 if ( (StrLength(Rcp)==3) &&
908 !strcmp(ChrPtr(Rcp), "000"))
913 i = snprintf(N, sizeof(N), "%d", n);
915 Put(List, N, i, Rcp, HFreeStrBuf);
924 void DeleteGVEAHash(HashList **KillMe)
929 HashList *GetGVSNHash(StrBuf *Target, WCTemplputParams *TP)
932 HashList *List = NULL;
939 StrBuf_ServGetln(Rcp);
940 if (GetServerStatus(Rcp, NULL) == 1) {
942 List = NewHash(1, NULL);
943 while (!Done && (StrBuf_ServGetln(Rcp)>=0)) {
944 if ( (StrLength(Rcp)==3) &&
945 !strcmp(ChrPtr(Rcp), "000"))
950 i = snprintf(N, sizeof(N), "%d", n);
952 Put(List, N, i, Rcp, HFreeStrBuf);
961 void DeleteGVSNHash(HashList **KillMe)
970 * Offer to make any page the user's "start page."
972 void offer_start_page(StrBuf *Target, WCTemplputParams *TP)
974 wc_printf("<a href=\"change_start_page?startpage=");
975 urlescputs(ChrPtr(WC->Hdr->this_page));
977 wc_printf(_("Make this my start page"));
983 * Change the user's start page
985 void change_start_page(void)
987 if (!havebstr("startpage")) {
988 set_preference_backend(HKEY("startpage"),
990 NewStrBufPlain(HKEY("")),
994 safestrncpy(WC->ImportantMessage,
995 _("You no longer have a start page selected."),
996 sizeof( WC->ImportantMessage));
1001 set_preference_backend(HKEY("startpage"),
1003 NewStrBufDup(sbstr("startpage")),
1008 output_headers(1, 1, 0, 0, 0, 0);
1009 do_template("newstartpage", NULL);
1014 void LoadStartpage(StrBuf *URL, long lvalue)
1017 pch = strchr(ChrPtr(URL), '?');
1019 /* purge the sins of the past... */
1020 pch = strchr(ChrPtr(URL), '&');
1022 StrBufPeek(URL, pch, -1, '?');
1023 WC->SavePrefsToServer = 1;
1030 InitModule_PREFERENCES
1033 WebcitAddUrlHandler(HKEY("set_preferences"), "", 0, set_preferences, 0);
1034 WebcitAddUrlHandler(HKEY("change_start_page"), "", 0, change_start_page, 0);
1036 RegisterPreference("startpage", _("Prefered startpage"), PRF_STRING, LoadStartpage);
1038 RegisterNamespace("OFFERSTARTPAGE", 0, 0, offer_start_page, NULL, CTX_NONE);
1039 RegisterNamespace("PREF:ROOM:VALUE", 1, 2, tmplput_CFG_RoomValue, NULL, CTX_NONE);
1040 RegisterNamespace("PREF:ROOM:VALUE:INT", 1, 2, tmplput_CFG_RoomValueLong, NULL, CTX_NONE);
1041 RegisterNamespace("PREF:VALUE", 1, 2, tmplput_CFG_Value, NULL, CTX_NONE);
1043 RegisterNamespace("PREF:DESCR", 1, 1, tmplput_CFG_Descr, NULL, CTX_NONE);
1045 RegisterConditional(HKEY("COND:PREF"), 4, ConditionalPreference, CTX_NONE);
1046 RegisterConditional(HKEY("COND:PREF:SET"), 4, ConditionalHasPreference, CTX_NONE);
1047 RegisterConditional(HKEY("COND:ROOM:SET"), 4, ConditionalHasRoomPreference, CTX_NONE);
1049 RegisterIterator("PREF:VALID:EMAIL:ADDR", 0, NULL,
1050 GetGVEAHash, NULL, DeleteGVEAHash, CTX_STRBUF, CTX_NONE, IT_NOFLAG);
1051 RegisterIterator("PREF:VALID:EMAIL:NAME", 0, NULL,
1052 GetGVSNHash, NULL, DeleteGVSNHash, CTX_STRBUF, CTX_NONE, IT_NOFLAG);
1058 ServerStartModule_PREFERENCES
1061 PreferenceHooks = NewHash(1, NULL);
1067 ServerShutdownModule_PREFERENCES
1070 DeleteHash(&PreferenceHooks);
1074 SessionDetachModule__PREFERENCES
1077 if (sess->SavePrefsToServer) {
1079 sess->SavePrefsToServer = 0;
1084 SessionNewModule_PREFERENCES
1087 sess->hash_prefs = NewHash(1,NULL);
1091 SessionDestroyModule_PREFERENCES
1094 DeleteHash(&sess->hash_prefs);