projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cac8538
)
* undo linebuffering, its going away under that name
author
Wilfried Göesgens
<willi@citadel.org>
Mon, 4 May 2009 20:06:33 +0000
(20:06 +0000)
committer
Wilfried Göesgens
<willi@citadel.org>
Mon, 4 May 2009 20:06:33 +0000
(20:06 +0000)
* fix user loading
webcit/useredit.c
patch
|
blob
|
history
diff --git
a/webcit/useredit.c
b/webcit/useredit.c
index 672dbc732aed6818c8e34db83fd239c90774dcb5..daa04f461937e678eef680f219d11406dad3d976 100644
(file)
--- a/
webcit/useredit.c
+++ b/
webcit/useredit.c
@@
-34,9
+34,8
@@
typedef struct _UserListEntry {
} UserListEntry;
} UserListEntry;
-UserListEntry* NewUserListOneEntry(StrBuf *SerializedUser)
+UserListEntry* NewUserListOneEntry(StrBuf *SerializedUser
, const char *Pos
)
{
{
- const char *Pos;
UserListEntry *ul;
if (StrLength(SerializedUser) < 8)
UserListEntry *ul;
if (StrLength(SerializedUser) < 8)
@@
-256,12
+255,12
@@
HashList *iterate_load_userlist(StrBuf *Target, WCTemplputParams *TP)
memset(&SubTP, 0, sizeof(WCTemplputParams));
serv_puts("LIST");
Buf = NewStrBuf();
memset(&SubTP, 0, sizeof(WCTemplputParams));
serv_puts("LIST");
Buf = NewStrBuf();
- StrBuf_ServGetln
Buffered
(Buf);
+ StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) == 1) {
Hash = NewHash(1, NULL);
while (!Done) {
if (GetServerStatus(Buf, NULL) == 1) {
Hash = NewHash(1, NULL);
while (!Done) {
- len = StrBuf_ServGetln
Buffered
(Buf);
+ len = StrBuf_ServGetln(Buf);
if ((len == 3) &&
(strcmp(ChrPtr(Buf), "000")==0)) {
Done = 1;
if ((len == 3) &&
(strcmp(ChrPtr(Buf), "000")==0)) {
Done = 1;
@@
-452,7
+451,7
@@
TRYAGAIN:
if ((*VCMsg == NULL) && (already_tried_creating_one == 0)) {
already_tried_creating_one = 1;
serv_puts("ENT0 1|||4");
if ((*VCMsg == NULL) && (already_tried_creating_one == 0)) {
already_tried_creating_one = 1;
serv_puts("ENT0 1|||4");
- StrBuf_ServGetln
Buffered
(Buf);
+ StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) != 4) {
serv_puts("Content-type: text/x-vcard");
serv_puts("");
if (GetServerStatus(Buf, NULL) != 4) {
serv_puts("Content-type: text/x-vcard");
serv_puts("");
@@
-485,13
+484,13
@@
void display_edit_address_book_entry(const char *username, long usernum) {
roomname = NewStrBuf();
StrBufPrintf(roomname, "%010ld.%s", usernum, USERCONFIGROOM);
serv_printf("GOTO %s||1", ChrPtr(roomname));
roomname = NewStrBuf();
StrBufPrintf(roomname, "%010ld.%s", usernum, USERCONFIGROOM);
serv_printf("GOTO %s||1", ChrPtr(roomname));
- StrBuf_ServGetln
Buffered
(Buf);
+ StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) != 2) {
serv_printf("CRE8 1|%s|5|||1|", ChrPtr(roomname));
if (GetServerStatus(Buf, NULL) != 2) {
serv_printf("CRE8 1|%s|5|||1|", ChrPtr(roomname));
- StrBuf_ServGetln
Buffered
(Buf);
+ StrBuf_ServGetln(Buf);
GetServerStatus(Buf, NULL);
serv_printf("GOTO %s||1", ChrPtr(roomname));
GetServerStatus(Buf, NULL);
serv_printf("GOTO %s||1", ChrPtr(roomname));
- StrBuf_ServGetln
Buffered
(Buf);
+ StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) != 2) {
FlushStrBuf(WCC->ImportantMsg);
StrBufAppendBuf(WCC->ImportantMsg, Buf, 4);
if (GetServerStatus(Buf, NULL) != 2) {
FlushStrBuf(WCC->ImportantMsg);
StrBufAppendBuf(WCC->ImportantMsg, Buf, 4);
@@
-524,6
+523,7
@@
void display_edit_address_book_entry(const char *username, long usernum) {
void display_edituser(const char *supplied_username, int is_new) {
void display_edituser(const char *supplied_username, int is_new) {
+ const char *Pos;
wcsession *WCC = WC;
UserListEntry* UL;
StrBuf *Buf;
wcsession *WCC = WC;
UserListEntry* UL;
StrBuf *Buf;
@@
-538,7
+538,7
@@
void display_edituser(const char *supplied_username, int is_new) {
Buf = NewStrBuf();
serv_printf("AGUP %s", username);
Buf = NewStrBuf();
serv_printf("AGUP %s", username);
- StrBuf_ServGetln
Buffered
(Buf);
+ StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) != 2) {
FlushStrBuf(WCC->ImportantMsg);
StrBufAppendBuf(WCC->ImportantMsg, Buf, 4);
if (GetServerStatus(Buf, NULL) != 2) {
FlushStrBuf(WCC->ImportantMsg);
StrBufAppendBuf(WCC->ImportantMsg, Buf, 4);
@@
-547,8
+547,8
@@
void display_edituser(const char *supplied_username, int is_new) {
return;
}
else {
return;
}
else {
-
StrBufCutLeft(Buf, 4)
;
- UL = NewUserListOneEntry(Buf);
+
Pos = ChrPtr(Buf) + 4
;
+ UL = NewUserListOneEntry(Buf
, Pos
);
if ((UL != NULL) && havebstr("edit_abe_button")) {
display_edit_address_book_entry(username, UL->UID);
}
if ((UL != NULL) && havebstr("edit_abe_button")) {
display_edit_address_book_entry(username, UL->UID);
}
@@
-598,7
+598,7
@@
void edituser(void) {
if ((havebstr("newname")) && (strcasecmp(bstr("username"), bstr("newname")))) {
serv_printf("RENU %s|%s", bstr("username"), bstr("newname"));
if ((havebstr("newname")) && (strcasecmp(bstr("username"), bstr("newname")))) {
serv_printf("RENU %s|%s", bstr("username"), bstr("newname"));
- StrBuf_ServGetln
Buffered
(Buf);
+ StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) == 2) {
FlushStrBuf(WCC->ImportantMsg);
StrBufAppendBuf(WCC->ImportantMsg, Buf, 4);
if (GetServerStatus(Buf, NULL) == 2) {
FlushStrBuf(WCC->ImportantMsg);
StrBufAppendBuf(WCC->ImportantMsg, Buf, 4);
@@
-619,7
+619,7
@@
void edituser(void) {
bstr("lastcall"),
bstr("purgedays")
);
bstr("lastcall"),
bstr("purgedays")
);
- StrBuf_ServGetln
Buffered
(Buf);
+ StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) == 2) {
StrBufAppendBuf(WCC->ImportantMsg, Buf, 4);
}
if (GetServerStatus(Buf, NULL) == 2) {
StrBufAppendBuf(WCC->ImportantMsg, Buf, 4);
}
@@
-648,7
+648,7
@@
void delete_user(char *username) {
Buf = NewStrBuf();
serv_printf("ASUP %s|0|0|0|0|0|", username);
Buf = NewStrBuf();
serv_printf("ASUP %s|0|0|0|0|0|", username);
- StrBuf_ServGetln
Buffered
(Buf);
+ StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) != 2)
StrBufAppendBuf(WCC->ImportantMsg, Buf, 4);
if (GetServerStatus(Buf, NULL) != 2)
StrBufAppendBuf(WCC->ImportantMsg, Buf, 4);
@@
-671,7
+671,7
@@
void create_user(void) {
Buf = NewStrBuf();
username = bstr("username");
serv_printf("CREU %s", username);
Buf = NewStrBuf();
username = bstr("username");
serv_printf("CREU %s", username);
- StrBuf_ServGetln
Buffered
(Buf);
+ StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, &FullState) == 2) {
sprintf(WC->ImportantMessage, _("A new user has been created."));
display_edituser(username, 1);
if (GetServerStatus(Buf, &FullState) == 2) {
sprintf(WC->ImportantMessage, _("A new user has been created."));
display_edituser(username, 1);