Commit 6f1b295a authored by rswindell's avatar rswindell
Browse files

Better checking of 'C' restriction for chat functions.

parent b6feaca6
......@@ -44,6 +44,8 @@ const char *weekday[]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Frida
const char *month[]={"January","February","March","April","May","June"
,"July","August","September","October","November","December"};
/****************************************************************************/
/****************************************************************************/
void sbbs_t::multinodechat(int channel)
{
char line[256],str[256],ch,done
......@@ -55,6 +57,11 @@ void sbbs_t::multinodechat(int channel)
long i,j,k,n;
node_t node;
if(useron.rest&FLAG('C')) {
bputs(text[R_Chat]);
return;
}
if(channel<1 || channel>cfg.total_chans)
channel=1;
......@@ -491,6 +498,8 @@ void sbbs_t::multinodechat(int channel)
lncntr=0;
}
/****************************************************************************/
/****************************************************************************/
bool sbbs_t::guru_page(void)
{
char path[MAX_PATH+1];
......@@ -498,6 +507,11 @@ bool sbbs_t::guru_page(void)
int file;
long i;
if(useron.rest&FLAG('C')) {
bputs(text[R_Chat]);
return(false);
}
if(!cfg.total_gurus) {
bprintf(text[SysopIsNotAvailable],"The Guru");
return(false);
......@@ -536,6 +550,11 @@ void sbbs_t::chatsection()
{
char str[256],ch,no_rip_menu;
if(useron.rest&FLAG('C')) {
bputs(text[R_Chat]);
return;
}
action=NODE_CHAT;
if(useron.misc&(RIP|WIP) || !(useron.misc&EXPERT))
menu("chat");
......@@ -617,10 +636,17 @@ void sbbs_t::chatsection()
// FREE(gurubuf);
}
/****************************************************************************/
/****************************************************************************/
bool sbbs_t::sysop_page(void)
{
int i;
if(useron.rest&FLAG('C')) {
bputs(text[R_Chat]);
return(false);
}
if(startup->options&BBS_OPT_SYSOP_AVAILABLE
|| (cfg.sys_chat_ar[0] && chk_ar(cfg.sys_chat_ar,&useron))
|| useron.exempt&FLAG('C')) {
......@@ -691,6 +717,11 @@ void sbbs_t::privchat(bool local)
int local_y,remote_y;
node_t node;
if(useron.rest&FLAG('C')) {
bputs(text[R_Chat]);
return;
}
if(local)
n=0;
else {
......@@ -1190,7 +1221,8 @@ void sbbs_t::nodemsg()
while(online && !done) {
if(useron.rest&FLAG('C')) {
bputs(text[R_SendMessages]);
break; }
break;
}
SYNC;
mnemonics(text[PrivateMsgPrompt]);
sys_status&=~SS_ABORT;
......
......@@ -121,10 +121,7 @@ int sbbs_t::exec_function(csi_t *csi)
logline("*+",str); } }
return(0);
case CS_CHAT_SECTION:
if(useron.rest&FLAG('C'))
bputs(text[R_Chat]);
else
chatsection();
chatsection();
return(0);
case CS_USER_DEFAULTS:
maindflts(&useron);
......@@ -286,32 +283,7 @@ int sbbs_t::exec_function(csi_t *csi)
csi->logic=!sysop_page();
return(0);
case CS_PAGE_GURU:
#if 0 /* old way */
csi->logic=LOGIC_FALSE;
for(i=0;i<cfg.total_gurus;i++)
if(!stricmp(csi->str,cfg.guru[i]->code)
&& chk_ar(cfg.guru[i]->ar,&useron))
break;
if(i>=cfg.total_gurus)
return(0);
sprintf(str,"%s%s.dat", cfg.ctrl_dir, cfg.guru[i]->code);
int file;
if((file=nopen(str,O_RDONLY))==-1) {
errormsg(WHERE,ERR_OPEN,str,O_RDONLY);
return(0); }
if((p=(uchar *)MALLOC(filelength(file)+1))==NULL) {
close(file);
errormsg(WHERE,ERR_ALLOC,str,filelength(file)+1);
return(0); }
read(file,p,filelength(file));
p[filelength(file)]=0;
close(file);
localguru((char*)p,i);
FREE(p);
csi->logic=LOGIC_TRUE;
#else
csi->logic=!guru_page();
#endif
return(0);
case CS_SPY:
i=atoi(csi->str);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment