Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
6f1b295a
Commit
6f1b295a
authored
23 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Better checking of 'C' restriction for chat functions.
parent
b6feaca6
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sbbs3/chat.cpp
+33
-1
33 additions, 1 deletion
src/sbbs3/chat.cpp
src/sbbs3/execfunc.cpp
+1
-29
1 addition, 29 deletions
src/sbbs3/execfunc.cpp
with
34 additions
and
30 deletions
src/sbbs3/chat.cpp
+
33
−
1
View file @
6f1b295a
...
@@ -44,6 +44,8 @@ const char *weekday[]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Frida
...
@@ -44,6 +44,8 @@ const char *weekday[]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Frida
const
char
*
month
[]
=
{
"January"
,
"February"
,
"March"
,
"April"
,
"May"
,
"June"
const
char
*
month
[]
=
{
"January"
,
"February"
,
"March"
,
"April"
,
"May"
,
"June"
,
"July"
,
"August"
,
"September"
,
"October"
,
"November"
,
"December"
};
,
"July"
,
"August"
,
"September"
,
"October"
,
"November"
,
"December"
};
/****************************************************************************/
/****************************************************************************/
void
sbbs_t
::
multinodechat
(
int
channel
)
void
sbbs_t
::
multinodechat
(
int
channel
)
{
{
char
line
[
256
],
str
[
256
],
ch
,
done
char
line
[
256
],
str
[
256
],
ch
,
done
...
@@ -55,6 +57,11 @@ void sbbs_t::multinodechat(int channel)
...
@@ -55,6 +57,11 @@ void sbbs_t::multinodechat(int channel)
long
i
,
j
,
k
,
n
;
long
i
,
j
,
k
,
n
;
node_t
node
;
node_t
node
;
if
(
useron
.
rest
&
FLAG
(
'C'
))
{
bputs
(
text
[
R_Chat
]);
return
;
}
if
(
channel
<
1
||
channel
>
cfg
.
total_chans
)
if
(
channel
<
1
||
channel
>
cfg
.
total_chans
)
channel
=
1
;
channel
=
1
;
...
@@ -491,6 +498,8 @@ void sbbs_t::multinodechat(int channel)
...
@@ -491,6 +498,8 @@ void sbbs_t::multinodechat(int channel)
lncntr
=
0
;
lncntr
=
0
;
}
}
/****************************************************************************/
/****************************************************************************/
bool
sbbs_t
::
guru_page
(
void
)
bool
sbbs_t
::
guru_page
(
void
)
{
{
char
path
[
MAX_PATH
+
1
];
char
path
[
MAX_PATH
+
1
];
...
@@ -498,6 +507,11 @@ bool sbbs_t::guru_page(void)
...
@@ -498,6 +507,11 @@ bool sbbs_t::guru_page(void)
int
file
;
int
file
;
long
i
;
long
i
;
if
(
useron
.
rest
&
FLAG
(
'C'
))
{
bputs
(
text
[
R_Chat
]);
return
(
false
);
}
if
(
!
cfg
.
total_gurus
)
{
if
(
!
cfg
.
total_gurus
)
{
bprintf
(
text
[
SysopIsNotAvailable
],
"The Guru"
);
bprintf
(
text
[
SysopIsNotAvailable
],
"The Guru"
);
return
(
false
);
return
(
false
);
...
@@ -536,6 +550,11 @@ void sbbs_t::chatsection()
...
@@ -536,6 +550,11 @@ void sbbs_t::chatsection()
{
{
char
str
[
256
],
ch
,
no_rip_menu
;
char
str
[
256
],
ch
,
no_rip_menu
;
if
(
useron
.
rest
&
FLAG
(
'C'
))
{
bputs
(
text
[
R_Chat
]);
return
;
}
action
=
NODE_CHAT
;
action
=
NODE_CHAT
;
if
(
useron
.
misc
&
(
RIP
|
WIP
)
||
!
(
useron
.
misc
&
EXPERT
))
if
(
useron
.
misc
&
(
RIP
|
WIP
)
||
!
(
useron
.
misc
&
EXPERT
))
menu
(
"chat"
);
menu
(
"chat"
);
...
@@ -617,10 +636,17 @@ void sbbs_t::chatsection()
...
@@ -617,10 +636,17 @@ void sbbs_t::chatsection()
// FREE(gurubuf);
// FREE(gurubuf);
}
}
/****************************************************************************/
/****************************************************************************/
bool
sbbs_t
::
sysop_page
(
void
)
bool
sbbs_t
::
sysop_page
(
void
)
{
{
int
i
;
int
i
;
if
(
useron
.
rest
&
FLAG
(
'C'
))
{
bputs
(
text
[
R_Chat
]);
return
(
false
);
}
if
(
startup
->
options
&
BBS_OPT_SYSOP_AVAILABLE
if
(
startup
->
options
&
BBS_OPT_SYSOP_AVAILABLE
||
(
cfg
.
sys_chat_ar
[
0
]
&&
chk_ar
(
cfg
.
sys_chat_ar
,
&
useron
))
||
(
cfg
.
sys_chat_ar
[
0
]
&&
chk_ar
(
cfg
.
sys_chat_ar
,
&
useron
))
||
useron
.
exempt
&
FLAG
(
'C'
))
{
||
useron
.
exempt
&
FLAG
(
'C'
))
{
...
@@ -691,6 +717,11 @@ void sbbs_t::privchat(bool local)
...
@@ -691,6 +717,11 @@ void sbbs_t::privchat(bool local)
int
local_y
,
remote_y
;
int
local_y
,
remote_y
;
node_t
node
;
node_t
node
;
if
(
useron
.
rest
&
FLAG
(
'C'
))
{
bputs
(
text
[
R_Chat
]);
return
;
}
if
(
local
)
if
(
local
)
n
=
0
;
n
=
0
;
else
{
else
{
...
@@ -1190,7 +1221,8 @@ void sbbs_t::nodemsg()
...
@@ -1190,7 +1221,8 @@ void sbbs_t::nodemsg()
while
(
online
&&
!
done
)
{
while
(
online
&&
!
done
)
{
if
(
useron
.
rest
&
FLAG
(
'C'
))
{
if
(
useron
.
rest
&
FLAG
(
'C'
))
{
bputs
(
text
[
R_SendMessages
]);
bputs
(
text
[
R_SendMessages
]);
break
;
}
break
;
}
SYNC
;
SYNC
;
mnemonics
(
text
[
PrivateMsgPrompt
]);
mnemonics
(
text
[
PrivateMsgPrompt
]);
sys_status
&=~
SS_ABORT
;
sys_status
&=~
SS_ABORT
;
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/execfunc.cpp
+
1
−
29
View file @
6f1b295a
...
@@ -121,9 +121,6 @@ int sbbs_t::exec_function(csi_t *csi)
...
@@ -121,9 +121,6 @@ int sbbs_t::exec_function(csi_t *csi)
logline
(
"*+"
,
str
);
}
}
logline
(
"*+"
,
str
);
}
}
return
(
0
);
return
(
0
);
case
CS_CHAT_SECTION
:
case
CS_CHAT_SECTION
:
if
(
useron
.
rest
&
FLAG
(
'C'
))
bputs
(
text
[
R_Chat
]);
else
chatsection
();
chatsection
();
return
(
0
);
return
(
0
);
case
CS_USER_DEFAULTS
:
case
CS_USER_DEFAULTS
:
...
@@ -286,32 +283,7 @@ int sbbs_t::exec_function(csi_t *csi)
...
@@ -286,32 +283,7 @@ int sbbs_t::exec_function(csi_t *csi)
csi
->
logic
=!
sysop_page
();
csi
->
logic
=!
sysop_page
();
return
(
0
);
return
(
0
);
case
CS_PAGE_GURU
:
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
();
csi
->
logic
=!
guru_page
();
#endif
return
(
0
);
return
(
0
);
case
CS_SPY
:
case
CS_SPY
:
i
=
atoi
(
csi
->
str
);
i
=
atoi
(
csi
->
str
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment