output_headers(1, 1, 2, 0, 0, 0);
wprintf("<div id=\"banner\">\n");
- wprintf("<table width=100%% border=0 bgcolor=#444455><tr>"
- "<td>"
- "<span class=\"titlebar\">"
- "<img src=\"static/usermanag_48x.gif\">");
+ wprintf("<img src=\"static/usermanag_48x.gif\">");
+ wprintf("<h1>");
wprintf(_("Edit or delete users"));
- wprintf("</span></td></tr></table>\n"
- "</div>\n<div id=\"content\">\n"
- );
+ wprintf("</h1>");
+ wprintf("</div>");
+
+ wprintf("<div id=\"content\" class=\"service\">\n");
if (message != NULL) wprintf(message);
wprintf("<br /><br />");
wprintf("<center><form method=\"POST\" action=\"create_user\">\n");
+ wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
wprintf(_("New user: "));
wprintf("<input type=\"text\" name=\"username\"><br />\n"
"<input type=\"submit\" name=\"create_button\" value=\"%s\">"
wprintf("<center>"
"<form method=\"POST\" action=\"display_edituser\">\n");
+ wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
wprintf("<select name=\"username\" size=10 style=\"width:100%%\">\n");
serv_puts("LIST");
serv_getln(buf, sizeof buf);
if (!strncasecmp(buf, "part=", 5)) {
extract_token(partnum, &buf[5], 2, '|', sizeof partnum);
extract_token(content_type, &buf[5], 4, '|', sizeof content_type);
- if (!strcasecmp(content_type,
- "text/x-vcard")) {
+ if ( (!strcasecmp(content_type, "text/x-vcard"))
+ || (!strcasecmp(content_type, "text/vcard")) ) {
vcard_msgnum = stuff->msgnum;
}
}
return;
}
- do_edit_vcard(vcard_msgnum, "1", "select_user_to_edit");
+ do_edit_vcard(vcard_msgnum, "1", "select_user_to_edit", roomname);
}
lastcall = extract_long(&buf[4], 7);
purgedays = extract_long(&buf[4], 8);
- if (strlen(bstr("edit_abe_button")) > 0) {
+ if (!IsEmptyStr(bstr("edit_abe_button"))) {
display_edit_address_book_entry(username, usernum);
return;
}
- if (strlen(bstr("delete_button")) > 0) {
+ if (!IsEmptyStr(bstr("delete_button"))) {
delete_user(username);
return;
}
output_headers(1, 1, 2, 0, 0, 0);
wprintf("<div id=\"banner\">\n");
- wprintf("<table width=100%% border=0 bgcolor=\"#444455\"><tr><td>");
- wprintf("<span class=\"titlebar\">");
+ wprintf("<h1>");
wprintf(_("Edit user account: "));
escputs(username);
- wprintf("</span></td></tr></table>\n");
- wprintf("</div>\n<div id=\"content\">\n");
+ wprintf("</h1>");
+ wprintf("</div>");
+
+ wprintf("<div id=\"content\" class=\"service\">\n");
wprintf("<div class=\"fix_scrollbar_bug\">"
- "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
+ "<table class=\"useredit_background\"><tr><td>\n");
wprintf("<form method=\"POST\" action=\"edituser\">\n"
"<input type=\"hidden\" name=\"username\" value=\"");
escputs(username);
wprintf("<input type=\"hidden\" name=\"is_new\" value=\"%d\">\n"
"<input type=\"hidden\" name=\"usernum\" value=\"%ld\">\n",
is_new, usernum);
+ wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
wprintf("<input type=\"hidden\" name=\"flags\" value=\"%d\">\n", flags);
is_new = atoi(bstr("is_new"));
- if (strlen(bstr("ok_button")) == 0) {
+ if (IsEmptyStr(bstr("ok_button"))) {
safestrncpy(message, _("Changes were not saved."), sizeof message);
}
else {
serv_getln(buf, sizeof buf);
if (buf[0] == '2') {
- sprintf(WC->ImportantMessage,
- _("A new user has been created."));
+ sprintf(WC->ImportantMessage, _("A new user has been created."));
display_edituser(username, 1);
}
+ else if (!strncmp(buf, "570", 3)) {
+ sprintf(error_message,
+ "<img src=\"static/error.gif\" align=center>"
+ "%s<br /><br />\n",
+ _("You are attempting to create a new user from within Citadel "
+ "while running in host based authentication mode. In this mode, "
+ "you must create new users on the host system, not within Citadel.")
+ );
+ select_user_to_edit(error_message, NULL);
+ }
else {
sprintf(error_message,
"<img src=\"static/error.gif\" align=center>"