*/
void display_whok(void);
+int ConditionalHaveRoomeditRights(StrBuf *Target, WCTemplputParams *TP);
/*
* Initialize the viewdefs with localized strings
room->is_inbox = StrBufExtractNext_long(Line, &Pos, '|'); // is_mailbox
flag = StrBufExtractNext_long(Line, &Pos, '|');
- if (WCC->is_aide || flag)
+ if (WCC->is_aide || flag) {
room->RAFlags |= UA_ADMINALLOWED;
+ }
room->UsersNewMAilboxMessages = StrBufExtractNext_long(Line, &Pos, '|');
wc_printf("</td>\n");
wc_printf("<td> </td>\n");
- if ( (WC->axlevel >= 6) || (WC->is_room_aide) ) {
+ if ( ConditionalHaveRoomeditRights(NULL, NULL)) {
wc_printf("<td class=\"");
if (!strcmp(tab, "config")) {
wc_printf("<ul><li>");
wc_printf(_("Name of room: "));
- wc_printf("<input type=\"text\" NAME=\"er_name\" VALUE=\"%s\" MAXLENGTH=\"%d\">\n",
+ wc_printf("<input type=\"text\" NAME=\"er_name\" VALUE=\"%s\" MAXLENGTH=\""ULONG_FMT"\">\n",
er_name,
(sizeof(er_name)-1)
);
int er_floor;
int er_num_type;
int er_view;
+ wcsession *WCC = WC;
if (!havebstr("ok_button")) {
strcpy(WC->ImportantMessage,
serv_getln(buf, sizeof buf);
if (buf[0] != '2') {
- strcpy(WC->ImportantMessage, &buf[4]);
+ strcpy(WCC->ImportantMessage, &buf[4]);
display_main_menu();
return;
}
- /** TODO: Room created, now udate the left hand icon bar for this user */
+ /** TODO: Room created, now update the left hand icon bar for this user */
burn_folder_cache(0); /* burn the old folder cache */
-
gotoroom(er_name);
- do_change_view(er_view); /* Now go there */
+
+ serv_printf("VIEW %d", er_view);
+ serv_getln(buf, sizeof buf);
+ WCC->CurRoom.view = er_view;
+
+ if ( (WCC != NULL) && ( (WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) ) {
+ display_editroom ();
+ } else {
+ do_change_view(er_view); /* Now go there */
+ }
+
}
set_preference("roomlistview", ListView, 1);
}
/** Sanitize the input so its safe */
- if(!get_preference("roomlistview", &ListView) ||
+ if((get_preference("roomlistview", &ListView) != 0)||
((strcasecmp(ChrPtr(ListView), "folders") != 0) &&
(strcasecmp(ChrPtr(ListView), "table") != 0)))
{
if (ListView == NULL) {
ListView = NewStrBufPlain(HKEY("rooms"));
set_preference("roomlistview", ListView, 0);
+ ListView = NULL;
}
else {
- StrBufPlain(ListView, HKEY("rooms"));
- save_preferences();
+ ListView = NewStrBufPlain(HKEY("rooms"));
+ set_preference("roomlistview", ListView, 0);
+ ListView = NULL;
}
}
+ FreeStrBuf(&ListView);
url_do_template();
}
int ConditionalRoomAide(StrBuf *Target, WCTemplputParams *TP)
{
wcsession *WCC = WC;
- return (WCC != NULL)? (WCC->is_room_aide == 0) : 0;
+ return (WCC != NULL)?
+ ((WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) : 0;
}
int ConditionalRoomAcessDelete(StrBuf *Target, WCTemplputParams *TP)
{
wcsession *WCC = WC;
return (WCC == NULL)? 0 :
- ( (WCC->is_room_aide) || /////TODO!
+ ( ((WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) ||
(WCC->CurRoom.is_inbox) ||
(WCC->CurRoom.QRFlags2 & QR2_COLLABDEL) );
}
return ( (WCC!= NULL) &&
((WCC->axlevel >= 6) ||
- (WCC->is_room_aide) ||
+ ((WCC->CurRoom.RAFlags & UA_ADMINALLOWED) != 0) ||
(WCC->CurRoom.is_inbox) ));
}
int ConditionalIsRoomtype(StrBuf *Target, WCTemplputParams *TP)
{
wcsession *WCC = WC;
- int whichtype;
if ((WCC == NULL) ||
(TP->Tokens->nParameters < 3))
return 0;
- whichtype = GetTemplateTokenNumber(Target, TP, 2, VIEW_BBS);
- switch(WCC->CurRoom.view) {
- case VIEW_BBS:
- return whichtype == VIEW_BBS;
- case VIEW_MAILBOX:
- return whichtype == VIEW_MAILBOX;
- case VIEW_ADDRESSBOOK:
- return whichtype == VIEW_ADDRESSBOOK;
- case VIEW_TASKS:
- return whichtype == VIEW_TASKS;
- case VIEW_NOTES:
- return whichtype == VIEW_NOTES;
- case VIEW_WIKI:
- return whichtype == VIEW_WIKI;
- case VIEW_JOURNAL:
- return whichtype == VIEW_JOURNAL;
- case VIEW_CALENDAR:
- return whichtype == VIEW_CALENDAR;
- case VIEW_CALBRIEF:
- return whichtype == VIEW_CALBRIEF;
- default:
- return 0;
- }
+ return WCC->CurRoom.view == GetTemplateTokenNumber(Target, TP, 2, VIEW_BBS);
}
void
REGISTERTokenParamDefine(US_COLOR);
REGISTERTokenParamDefine(US_USER_SET);
-
REGISTERTokenParamDefine(VIEW_BBS);
REGISTERTokenParamDefine(VIEW_MAILBOX);
REGISTERTokenParamDefine(VIEW_ADDRESSBOOK);
REGISTERTokenParamDefine(VIEW_JOURNAL);
REGISTERTokenParamDefine(VIEW_BLOG);
+
+ REGISTERTokenParamDefine(ignet_push_share);
+ REGISTERTokenParamDefine(listrecp);
+ REGISTERTokenParamDefine(digestrecp);
+ REGISTERTokenParamDefine(pop3client);
+ REGISTERTokenParamDefine(rssclient);
+ REGISTERTokenParamDefine(participate);
+
RegisterConditional(HKEY("COND:ROOMAIDE"), 2, ConditionalRoomAide, CTX_NONE);
RegisterConditional(HKEY("COND:ACCESS:DELETE"), 2, ConditionalRoomAcessDelete, CTX_NONE);