/*
* Manage user preferences with a little help from the Citadel server.
+ *
+ * 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"
#include "webserver.h"
#include "groupdav.h"
Pref->Type = PrefType;
Pref->eFlatPrefType = Pref->Type->eType;
- syslog(1, "Loading [%s]with type [%ld] [\"%s\"]\n",
+ syslog(1, "Loading [%s]with type [%d] [\"%s\"]\n",
ChrPtr(Pref->Key),
Pref->Type->eType,
ChrPtr(Pref->Val));
Preference *LastData = NULL;
while (!Done) {
- StrBuf_ServGetln(ReadBuf);
+ if (StrBuf_ServGetln(ReadBuf) < 0)
+ break;
if ( (StrLength(ReadBuf)==3) &&
!strcmp(ChrPtr(ReadBuf), "000")) {
Done = 1;
serv_puts("000");
}
while (!Done &&
- StrBuf_ServGetln(ReadBuf)) {
+ (StrBuf_ServGetln(ReadBuf) >= 0)) {
if ( (StrLength(ReadBuf)==3) &&
!strcmp(ChrPtr(ReadBuf), "000")) {
Done = 1;
serv_printf("MSG0 %ld", msgnum);
StrBuf_ServGetln(ReadBuf);
if (GetServerStatus(ReadBuf, NULL) == 1) {
- while (StrBuf_ServGetln(ReadBuf),
+ while ((StrBuf_ServGetln(ReadBuf) >= 0) &&
(strcmp(ChrPtr(ReadBuf), "text") &&
strcmp(ChrPtr(ReadBuf), "000"))) {
}
serv_puts("000");
}
while (!Done &&
- StrBuf_ServGetln(ReadBuf)) {
+ (StrBuf_ServGetln(ReadBuf) >= 0)) {
if ( (StrLength(ReadBuf)==3) &&
!strcmp(ChrPtr(ReadBuf), "000")) {
Done = 1;
Pref->Type = PrefType;
Pref->eFlatPrefType = PrefType->eType;
if (Pref->Type->eType != lPrefType)
- syslog(1, "warning: saving preference with wrong type [%s] %ld != %ld \n",
+ syslog(1, "warning: saving preference with wrong type [%s] %d != %ld \n",
key, Pref->Type->eType, lPrefType);
switch (Pref->Type->eType)
{
void set_preferences(void)
{
if (!havebstr("change_button")) {
- safestrncpy(WC->ImportantMessage,
- _("Cancelled. No settings were changed."),
- sizeof WC->ImportantMessage);
+ AppendImportantMessage(_("Cancelled. No settings were changed."), -1);
display_main_menu();
return;
}
1,
NULL);
if (ProhibitSave == 1)
- StrBufAppendBufPlain(WCC->ImportantMsg,
- _("This isn't allowed to become the start page."),
- -1, 0);
+ AppendImportantMessage(_("This isn't allowed to become the start page."), -1);
else
- StrBufAppendBufPlain(WCC->ImportantMsg,
- _("You no longer have a start page selected."),
- -1, 0);
+ AppendImportantMessage(_("You no longer have a start page selected."), -1);
display_main_menu();
return;
}
NULL);
output_headers(1, 1, 0, 0, 0, 0);
- do_template("newstartpage", NULL);
+ do_template("newstartpage");
wDumpContent(1);
}