Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 4495717e authored by rswindell's avatar rswindell

Created sbbs_t::getusrsub() and getusrgrp() methods to return user-based sub

and group number for a specified (0-based) subnum.
parent 824135f3
......@@ -581,6 +581,39 @@ void sbbs_t::getusrdirs()
while(curdir[curlib]>=usrdirs[curlib] && curdir[curlib]) curdir[curlib]--;
}
uint sbbs_t::getusrgrp(uint subnum)
{
uint ugrp;
if(subnum==INVALID_SUB)
return(0);
if(usrgrps<=0)
return(0);
for(ugrp=0;ugrp<usrgrps;ugrp++)
if(usrgrp[ugrp]==cfg.sub[subnum]->grp)
break;
return(ugrp+1);
}
uint sbbs_t::getusrsub(uint subnum)
{
uint usub;
uint ugrp;
ugrp = getusrgrp(subnum);
if(ugrp<=0)
return(0);
for(usub=0;usub<usrsubs[ugrp];usub++)
if(usrsub[ugrp][usub]==subnum)
break;
return(usub+1);
}
int sbbs_t::dir_op(uint dirnum)
{
return(SYSOP || (cfg.dir[dirnum]->op_ar[0] && chk_ar(cfg.dir[dirnum]->op_ar,&useron)));
......
......@@ -383,6 +383,9 @@ public:
void putmsgptrs(void);
void getusrsubs(void);
void getusrdirs(void);
uint getusrsub(uint subnum);
uint getusrgrp(uint subnum);
uint userdatdupe(uint usernumber, uint offset, uint datlen, char *dat
,bool del);
void gettimeleft(void);
......
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