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
a1db507d
Commit
a1db507d
authored
5 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Eliminate unnecessary/unused DLLCALL macro definition/use from this module.
parent
19c881ed
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sbbs3/userdat.c
+70
-70
70 additions, 70 deletions
src/sbbs3/userdat.c
src/sbbs3/userdat.h
+75
-85
75 additions, 85 deletions
src/sbbs3/userdat.h
with
145 additions
and
155 deletions
src/sbbs3/userdat.c
+
70
−
70
View file @
a1db507d
...
...
@@ -53,7 +53,7 @@ static const char* strIpFilterExemptConfigFile = "ipfilter_exempt.cfg";
/* Makes dots and underscores synonymous with spaces for comparisons */
/* Returns the number of the perfect matched username or 0 if no match */
/****************************************************************************/
uint
DLLCALL
matchuser
(
scfg_t
*
cfg
,
const
char
*
name
,
BOOL
sysop_alias
)
uint
matchuser
(
scfg_t
*
cfg
,
const
char
*
name
,
BOOL
sysop_alias
)
{
int
file
,
c
;
char
*
p
;
...
...
@@ -124,7 +124,7 @@ uint DLLCALL matchuser(scfg_t* cfg, const char *name, BOOL sysop_alias)
}
/****************************************************************************/
uint
DLLCALL
total_users
(
scfg_t
*
cfg
)
uint
total_users
(
scfg_t
*
cfg
)
{
char
str
[
MAX_PATH
+
1
];
uint
total_users
=
0
;
...
...
@@ -154,7 +154,7 @@ uint DLLCALL total_users(scfg_t* cfg)
/****************************************************************************/
/* Returns the number of the last user in user.dat (deleted ones too) */
/****************************************************************************/
uint
DLLCALL
lastuser
(
scfg_t
*
cfg
)
uint
lastuser
(
scfg_t
*
cfg
)
{
char
str
[
256
];
long
length
;
...
...
@@ -171,7 +171,7 @@ uint DLLCALL lastuser(scfg_t* cfg)
/****************************************************************************/
/* Deletes (completely removes) last user record in user.dat */
/****************************************************************************/
BOOL
DLLCALL
del_lastuser
(
scfg_t
*
cfg
)
BOOL
del_lastuser
(
scfg_t
*
cfg
)
{
int
file
;
long
length
;
...
...
@@ -194,7 +194,7 @@ BOOL DLLCALL del_lastuser(scfg_t* cfg)
/****************************************************************************/
/* Opens the user database returning the file descriptor or -1 on error */
/****************************************************************************/
int
DLLCALL
openuserdat
(
scfg_t
*
cfg
,
BOOL
for_modify
)
int
openuserdat
(
scfg_t
*
cfg
,
BOOL
for_modify
)
{
char
path
[
MAX_PATH
+
1
];
...
...
@@ -205,7 +205,7 @@ int DLLCALL openuserdat(scfg_t* cfg, BOOL for_modify)
return
nopen
(
path
,
for_modify
?
(
O_RDWR
|
O_CREAT
|
O_DENYNONE
)
:
(
O_RDONLY
|
O_DENYNONE
));
}
int
DLLCALL
closeuserdat
(
int
file
)
int
closeuserdat
(
int
file
)
{
return
close
(
file
);
}
...
...
@@ -215,7 +215,7 @@ int DLLCALL closeuserdat(int file)
/* buffer of U_LEN+1 in size. */
/* Returns 0 on success. */
/****************************************************************************/
int
DLLCALL
readuserdat
(
scfg_t
*
cfg
,
unsigned
user_number
,
char
*
userdat
,
int
infile
)
int
readuserdat
(
scfg_t
*
cfg
,
unsigned
user_number
,
char
*
userdat
,
int
infile
)
{
int
i
,
file
;
...
...
@@ -265,7 +265,7 @@ int DLLCALL readuserdat(scfg_t* cfg, unsigned user_number, char* userdat, int in
/* Fills the structure 'user' with info for user.number from userdat */
/* (a buffer representing a single user 'record' from the user.dat file */
/****************************************************************************/
int
DLLCALL
parseuserdat
(
scfg_t
*
cfg
,
char
*
userdat
,
user_t
*
user
)
int
parseuserdat
(
scfg_t
*
cfg
,
char
*
userdat
,
user_t
*
user
)
{
char
str
[
U_LEN
+
1
];
int
i
;
...
...
@@ -409,7 +409,7 @@ int DLLCALL parseuserdat(scfg_t* cfg, char *userdat, user_t *user)
/****************************************************************************/
/* Fills the structure 'user' with info for user.number from user.dat file */
/****************************************************************************/
int
DLLCALL
getuserdat
(
scfg_t
*
cfg
,
user_t
*
user
)
int
getuserdat
(
scfg_t
*
cfg
,
user_t
*
user
)
{
int
retval
;
int
file
;
...
...
@@ -435,7 +435,7 @@ int DLLCALL getuserdat(scfg_t* cfg, user_t *user)
}
/* Fast getuserdat() (leaves user.dat file open) */
int
DLLCALL
fgetuserdat
(
scfg_t
*
cfg
,
user_t
*
user
,
int
file
)
int
fgetuserdat
(
scfg_t
*
cfg
,
user_t
*
user
,
int
file
)
{
int
retval
;
char
userdat
[
U_LEN
+
1
];
...
...
@@ -476,7 +476,7 @@ static void dirtyuserdat(scfg_t* cfg, uint usernumber)
/****************************************************************************/
/****************************************************************************/
int
DLLCALL
is_user_online
(
scfg_t
*
cfg
,
uint
usernumber
)
int
is_user_online
(
scfg_t
*
cfg
,
uint
usernumber
)
{
int
i
;
node_t
node
;
...
...
@@ -494,7 +494,7 @@ int DLLCALL is_user_online(scfg_t* cfg, uint usernumber)
/* Writes into user.number's slot in user.dat data in structure 'user' */
/* Called from functions newuser, useredit and main */
/****************************************************************************/
int
DLLCALL
putuserdat
(
scfg_t
*
cfg
,
user_t
*
user
)
int
putuserdat
(
scfg_t
*
cfg
,
user_t
*
user
)
{
int
i
,
file
;
char
userdat
[
U_LEN
],
str
[
MAX_PATH
+
1
];
...
...
@@ -641,7 +641,7 @@ int DLLCALL putuserdat(scfg_t* cfg, user_t* user)
/* Returns the username in 'str' that corresponds to the 'usernumber' */
/* Called from functions everywhere */
/****************************************************************************/
char
*
DLLCALL
username
(
scfg_t
*
cfg
,
int
usernumber
,
char
*
name
)
char
*
username
(
scfg_t
*
cfg
,
int
usernumber
,
char
*
name
)
{
char
str
[
256
];
int
c
;
...
...
@@ -682,7 +682,7 @@ char* DLLCALL username(scfg_t* cfg, int usernumber, char *name)
/****************************************************************************/
/* Puts 'name' into slot 'number' in user/name.dat */
/****************************************************************************/
int
DLLCALL
putusername
(
scfg_t
*
cfg
,
int
number
,
char
*
name
)
int
putusername
(
scfg_t
*
cfg
,
int
number
,
char
*
name
)
{
char
str
[
256
];
int
file
;
...
...
@@ -729,7 +729,7 @@ int DLLCALL putusername(scfg_t* cfg, int number, char *name)
/****************************************************************************/
/* Returns the age derived from the string 'birth' in the format MM/DD/YY */
/****************************************************************************/
uint
DLLCALL
getage
(
scfg_t
*
cfg
,
char
*
birth
)
uint
getage
(
scfg_t
*
cfg
,
char
*
birth
)
{
uint
age
;
struct
tm
tm
;
...
...
@@ -770,7 +770,7 @@ uint DLLCALL getage(scfg_t* cfg, char *birth)
/* Reads the data for node number 'number' into the structure 'node' */
/* from node.dab */
/****************************************************************************/
int
DLLCALL
getnodedat
(
scfg_t
*
cfg
,
uint
number
,
node_t
*
node
,
int
*
fdp
)
int
getnodedat
(
scfg_t
*
cfg
,
uint
number
,
node_t
*
node
,
int
*
fdp
)
{
char
str
[
MAX_PATH
+
1
];
int
rd
;
...
...
@@ -820,7 +820,7 @@ int DLLCALL getnodedat(scfg_t* cfg, uint number, node_t *node, int* fdp)
/****************************************************************************/
/* Write the data from the structure 'node' into node.dab */
/****************************************************************************/
int
DLLCALL
putnodedat
(
scfg_t
*
cfg
,
uint
number
,
node_t
*
node
,
int
file
)
int
putnodedat
(
scfg_t
*
cfg
,
uint
number
,
node_t
*
node
,
int
file
)
{
size_t
wr
=
0
;
int
wrerr
=
0
;
...
...
@@ -854,7 +854,7 @@ int DLLCALL putnodedat(scfg_t* cfg, uint number, node_t* node, int file)
/* Packs the password 'pass' into 5bit ASCII inside node_t. 32bits in */
/* node.extaux, and the other 8bits in the upper byte of node.aux */
/****************************************************************************/
void
DLLCALL
packchatpass
(
char
*
pass
,
node_t
*
node
)
void
packchatpass
(
char
*
pass
,
node_t
*
node
)
{
char
bits
;
int
i
,
j
;
...
...
@@ -882,7 +882,7 @@ void DLLCALL packchatpass(char *pass, node_t *node)
/* Unpacks the password 'pass' from the 5bit ASCII inside node_t. 32bits in */
/* node.extaux, and the other 8bits in the upper byte of node.aux */
/****************************************************************************/
char
*
DLLCALL
unpackchatpass
(
char
*
pass
,
node_t
*
node
)
char
*
unpackchatpass
(
char
*
pass
,
node_t
*
node
)
{
char
bits
;
int
i
;
...
...
@@ -927,7 +927,7 @@ static char* node_connection_desc(ushort conn, char* str)
return
str
;
}
char
*
DLLCALL
nodestatus
(
scfg_t
*
cfg
,
node_t
*
node
,
char
*
buf
,
size_t
buflen
)
char
*
nodestatus
(
scfg_t
*
cfg
,
node_t
*
node
,
char
*
buf
,
size_t
buflen
)
{
char
str
[
256
];
char
tmp
[
128
];
...
...
@@ -1144,7 +1144,7 @@ char* DLLCALL nodestatus(scfg_t* cfg, node_t* node, char* buf, size_t buflen)
/****************************************************************************/
/* Displays the information for node number 'number' contained in 'node' */
/****************************************************************************/
void
DLLCALL
printnodedat
(
scfg_t
*
cfg
,
uint
number
,
node_t
*
node
)
void
printnodedat
(
scfg_t
*
cfg
,
uint
number
,
node_t
*
node
)
{
char
status
[
128
];
...
...
@@ -1152,7 +1152,7 @@ void DLLCALL printnodedat(scfg_t* cfg, uint number, node_t* node)
}
/****************************************************************************/
uint
DLLCALL
userdatdupe
(
scfg_t
*
cfg
,
uint
usernumber
,
uint
offset
,
uint
datlen
uint
userdatdupe
(
scfg_t
*
cfg
,
uint
usernumber
,
uint
offset
,
uint
datlen
,
char
*
dat
,
BOOL
del
,
BOOL
next
,
void
(
*
progress
)(
void
*
,
int
,
int
),
void
*
cbdata
)
{
char
str
[
MAX_PATH
+
1
];
...
...
@@ -1222,7 +1222,7 @@ uint DLLCALL userdatdupe(scfg_t* cfg, uint usernumber, uint offset, uint datlen
/****************************************************************************/
/* Creates a short message for 'usernumber' that contains 'strin' */
/****************************************************************************/
int
DLLCALL
putsmsg
(
scfg_t
*
cfg
,
int
usernumber
,
char
*
strin
)
int
putsmsg
(
scfg_t
*
cfg
,
int
usernumber
,
char
*
strin
)
{
char
str
[
256
];
int
file
,
i
;
...
...
@@ -1261,7 +1261,7 @@ int DLLCALL putsmsg(scfg_t* cfg, int usernumber, char *strin)
/****************************************************************************/
/* Returns any short messages waiting for user number, buffer must be freed */
/****************************************************************************/
char
*
DLLCALL
getsmsg
(
scfg_t
*
cfg
,
int
usernumber
)
char
*
getsmsg
(
scfg_t
*
cfg
,
int
usernumber
)
{
char
str
[
MAX_PATH
+
1
],
*
buf
;
int
i
;
...
...
@@ -1307,7 +1307,7 @@ char* DLLCALL getsmsg(scfg_t* cfg, int usernumber)
return
(
buf
);
/* caller must free */
}
char
*
DLLCALL
getnmsg
(
scfg_t
*
cfg
,
int
node_num
)
char
*
getnmsg
(
scfg_t
*
cfg
,
int
node_num
)
{
char
str
[
MAX_PATH
+
1
];
char
*
buf
;
...
...
@@ -1352,7 +1352,7 @@ char* DLLCALL getnmsg(scfg_t* cfg, int node_num)
/****************************************************************************/
/* Creates a short message for node 'num' that contains 'strin' */
/****************************************************************************/
int
DLLCALL
putnmsg
(
scfg_t
*
cfg
,
int
num
,
char
*
strin
)
int
putnmsg
(
scfg_t
*
cfg
,
int
num
,
char
*
strin
)
{
char
str
[
256
];
int
file
,
i
;
...
...
@@ -1972,7 +1972,7 @@ static BOOL ar_exp(scfg_t* cfg, uchar **ptrptr, user_t* user, client_t* client)
return
(
result
);
}
BOOL
DLLCALL
chk_ar
(
scfg_t
*
cfg
,
uchar
*
ar
,
user_t
*
user
,
client_t
*
client
)
BOOL
chk_ar
(
scfg_t
*
cfg
,
uchar
*
ar
,
user_t
*
user
,
client_t
*
client
)
{
uchar
*
p
;
...
...
@@ -1988,7 +1988,7 @@ BOOL DLLCALL chk_ar(scfg_t* cfg, uchar *ar, user_t* user, client_t* client)
/* Fills 'str' with record for usernumber starting at start for length bytes*/
/* Called from function ??? */
/****************************************************************************/
int
DLLCALL
getuserrec
(
scfg_t
*
cfg
,
int
usernumber
,
int
start
,
int
length
,
char
*
str
)
int
getuserrec
(
scfg_t
*
cfg
,
int
usernumber
,
int
start
,
int
length
,
char
*
str
)
{
char
path
[
256
];
int
i
,
c
,
file
;
...
...
@@ -2040,7 +2040,7 @@ int DLLCALL getuserrec(scfg_t* cfg, int usernumber,int start, int length, char *
/* Places into user.dat at the offset for usernumber+start for length bytes */
/* Called from various locations */
/****************************************************************************/
int
DLLCALL
putuserrec
(
scfg_t
*
cfg
,
int
usernumber
,
int
start
,
uint
length
,
const
char
*
str
)
int
putuserrec
(
scfg_t
*
cfg
,
int
usernumber
,
int
start
,
uint
length
,
const
char
*
str
)
{
char
str2
[
256
];
int
file
;
...
...
@@ -2100,7 +2100,7 @@ int DLLCALL putuserrec(scfg_t* cfg, int usernumber,int start, uint length, const
/* Updates user 'usernumber's record (numeric string) by adding 'adj' to it */
/* returns the new value. */
/****************************************************************************/
ulong
DLLCALL
adjustuserrec
(
scfg_t
*
cfg
,
int
usernumber
,
int
start
,
int
length
,
long
adj
)
ulong
adjustuserrec
(
scfg_t
*
cfg
,
int
usernumber
,
int
start
,
int
length
,
long
adj
)
{
char
str
[
256
],
path
[
256
];
char
tmp
[
32
];
...
...
@@ -2169,7 +2169,7 @@ ulong DLLCALL adjustuserrec(scfg_t* cfg, int usernumber, int start, int length,
/* Subtract credits from the current user online, accounting for the new */
/* "free credits" field. */
/****************************************************************************/
void
DLLCALL
subtract_cdt
(
scfg_t
*
cfg
,
user_t
*
user
,
long
amt
)
void
subtract_cdt
(
scfg_t
*
cfg
,
user_t
*
user
,
long
amt
)
{
char
tmp
[
64
];
long
mod
;
...
...
@@ -2192,7 +2192,7 @@ void DLLCALL subtract_cdt(scfg_t* cfg, user_t* user, long amt)
user
->
cdt
=
adjustuserrec
(
cfg
,
user
->
number
,
U_CDT
,
10
,
-
amt
);
}
BOOL
DLLCALL
user_posted_msg
(
scfg_t
*
cfg
,
user_t
*
user
,
int
count
)
BOOL
user_posted_msg
(
scfg_t
*
cfg
,
user_t
*
user
,
int
count
)
{
if
(
user
==
NULL
)
return
(
FALSE
);
...
...
@@ -2203,7 +2203,7 @@ BOOL DLLCALL user_posted_msg(scfg_t* cfg, user_t* user, int count)
return
(
TRUE
);
}
BOOL
DLLCALL
user_sent_email
(
scfg_t
*
cfg
,
user_t
*
user
,
int
count
,
BOOL
feedback
)
BOOL
user_sent_email
(
scfg_t
*
cfg
,
user_t
*
user
,
int
count
,
BOOL
feedback
)
{
if
(
user
==
NULL
)
return
(
FALSE
);
...
...
@@ -2217,7 +2217,7 @@ BOOL DLLCALL user_sent_email(scfg_t* cfg, user_t* user, int count, BOOL feedback
return
(
TRUE
);
}
BOOL
DLLCALL
user_downloaded
(
scfg_t
*
cfg
,
user_t
*
user
,
int
files
,
long
bytes
)
BOOL
user_downloaded
(
scfg_t
*
cfg
,
user_t
*
user
,
int
files
,
long
bytes
)
{
if
(
user
==
NULL
)
return
(
FALSE
);
...
...
@@ -2228,7 +2228,7 @@ BOOL DLLCALL user_downloaded(scfg_t* cfg, user_t* user, int files, long bytes)
return
(
TRUE
);
}
BOOL
DLLCALL
user_uploaded
(
scfg_t
*
cfg
,
user_t
*
user
,
int
files
,
long
bytes
)
BOOL
user_uploaded
(
scfg_t
*
cfg
,
user_t
*
user
,
int
files
,
long
bytes
)
{
if
(
user
==
NULL
)
return
(
FALSE
);
...
...
@@ -2239,7 +2239,7 @@ BOOL DLLCALL user_uploaded(scfg_t* cfg, user_t* user, int files, long bytes)
return
(
TRUE
);
}
BOOL
DLLCALL
user_adjust_credits
(
scfg_t
*
cfg
,
user_t
*
user
,
long
amount
)
BOOL
user_adjust_credits
(
scfg_t
*
cfg
,
user_t
*
user
,
long
amount
)
{
if
(
user
==
NULL
)
return
(
FALSE
);
...
...
@@ -2252,7 +2252,7 @@ BOOL DLLCALL user_adjust_credits(scfg_t* cfg, user_t* user, long amount)
return
(
TRUE
);
}
BOOL
DLLCALL
user_adjust_minutes
(
scfg_t
*
cfg
,
user_t
*
user
,
long
amount
)
BOOL
user_adjust_minutes
(
scfg_t
*
cfg
,
user_t
*
user
,
long
amount
)
{
if
(
user
==
NULL
)
return
(
FALSE
);
...
...
@@ -2264,7 +2264,7 @@ BOOL DLLCALL user_adjust_minutes(scfg_t* cfg, user_t* user, long amount)
/****************************************************************************/
/****************************************************************************/
BOOL
DLLCALL
logoutuserdat
(
scfg_t
*
cfg
,
user_t
*
user
,
time_t
now
,
time_t
logontime
)
BOOL
logoutuserdat
(
scfg_t
*
cfg
,
user_t
*
user
,
time_t
now
,
time_t
logontime
)
{
char
str
[
128
];
time_t
tused
;
...
...
@@ -2300,7 +2300,7 @@ BOOL DLLCALL logoutuserdat(scfg_t* cfg, user_t* user, time_t now, time_t logonti
/****************************************************************************/
/****************************************************************************/
void
DLLCALL
resetdailyuserdat
(
scfg_t
*
cfg
,
user_t
*
user
,
BOOL
write
)
void
resetdailyuserdat
(
scfg_t
*
cfg
,
user_t
*
user
,
BOOL
write
)
{
char
str
[
128
];
...
...
@@ -2333,7 +2333,7 @@ void DLLCALL resetdailyuserdat(scfg_t* cfg, user_t* user, BOOL write)
/* 'addr' is the target buffer for the full address. */
/* Pass cfg=NULL to NOT have "@address" portion appended. */
/****************************************************************************/
char
*
DLLCALL
usermailaddr
(
scfg_t
*
cfg
,
char
*
addr
,
const
char
*
name
)
char
*
usermailaddr
(
scfg_t
*
cfg
,
char
*
addr
,
const
char
*
name
)
{
int
i
;
...
...
@@ -2364,7 +2364,7 @@ char* DLLCALL usermailaddr(scfg_t* cfg, char* addr, const char* name)
return
(
addr
);
}
char
*
DLLCALL
alias
(
scfg_t
*
cfg
,
const
char
*
name
,
char
*
buf
)
char
*
alias
(
scfg_t
*
cfg
,
const
char
*
name
,
char
*
buf
)
{
char
line
[
128
];
char
*
p
;
...
...
@@ -2430,7 +2430,7 @@ char* DLLCALL alias(scfg_t* cfg, const char* name, char* buf)
return
(
p
);
}
int
DLLCALL
newuserdat
(
scfg_t
*
cfg
,
user_t
*
user
)
int
newuserdat
(
scfg_t
*
cfg
,
user_t
*
user
)
{
char
str
[
MAX_PATH
+
1
];
char
tmp
[
128
];
...
...
@@ -2527,7 +2527,7 @@ int DLLCALL newuserdat(scfg_t* cfg, user_t* user)
}
/* Returns length of specified user record 'field', or -1 if invalid */
int
DLLCALL
user_rec_len
(
int
offset
)
int
user_rec_len
(
int
offset
)
{
switch
(
offset
)
{
...
...
@@ -2625,7 +2625,7 @@ int DLLCALL user_rec_len(int offset)
/****************************************************************************/
/* Determine if the specified user can or cannot access the specified sub */
/****************************************************************************/
BOOL
DLLCALL
can_user_access_sub
(
scfg_t
*
cfg
,
uint
subnum
,
user_t
*
user
,
client_t
*
client
)
BOOL
can_user_access_sub
(
scfg_t
*
cfg
,
uint
subnum
,
user_t
*
user
,
client_t
*
client
)
{
if
(
!
VALID_CFG
(
cfg
))
return
FALSE
;
...
...
@@ -2642,7 +2642,7 @@ BOOL DLLCALL can_user_access_sub(scfg_t* cfg, uint subnum, user_t* user, client_
/****************************************************************************/
/* Determine if the specified user can or cannot read the specified sub */
/****************************************************************************/
BOOL
DLLCALL
can_user_read_sub
(
scfg_t
*
cfg
,
uint
subnum
,
user_t
*
user
,
client_t
*
client
)
BOOL
can_user_read_sub
(
scfg_t
*
cfg
,
uint
subnum
,
user_t
*
user
,
client_t
*
client
)
{
if
(
!
can_user_access_sub
(
cfg
,
subnum
,
user
,
client
))
return
FALSE
;
...
...
@@ -2654,7 +2654,7 @@ BOOL DLLCALL can_user_read_sub(scfg_t* cfg, uint subnum, user_t* user, client_t*
/* 'reason' is an (optional) pointer to a text.dat item number, indicating */
/* the reason the user cannot post, when returning FALSE. */
/****************************************************************************/
BOOL
DLLCALL
can_user_post
(
scfg_t
*
cfg
,
uint
subnum
,
user_t
*
user
,
client_t
*
client
,
uint
*
reason
)
BOOL
can_user_post
(
scfg_t
*
cfg
,
uint
subnum
,
user_t
*
user
,
client_t
*
client
,
uint
*
reason
)
{
if
(
reason
!=
NULL
)
*
reason
=
NoAccessSub
;
...
...
@@ -2684,7 +2684,7 @@ BOOL DLLCALL can_user_post(scfg_t* cfg, uint subnum, user_t* user, client_t* cli
/* 'reason' is an (optional) pointer to a text.dat item number */
/* usernumber==0 for netmail */
/****************************************************************************/
BOOL
DLLCALL
can_user_send_mail
(
scfg_t
*
cfg
,
enum
smb_net_type
net_type
,
uint
usernumber
,
user_t
*
user
,
uint
*
reason
)
BOOL
can_user_send_mail
(
scfg_t
*
cfg
,
enum
smb_net_type
net_type
,
uint
usernumber
,
user_t
*
user
,
uint
*
reason
)
{
if
(
reason
!=
NULL
)
*
reason
=
R_Email
;
...
...
@@ -2715,7 +2715,7 @@ BOOL DLLCALL can_user_send_mail(scfg_t* cfg, enum smb_net_type net_type, uint us
/****************************************************************************/
/* Determine if the specified user is a sub-board operator */
/****************************************************************************/
BOOL
DLLCALL
is_user_subop
(
scfg_t
*
cfg
,
uint
subnum
,
user_t
*
user
,
client_t
*
client
)
BOOL
is_user_subop
(
scfg_t
*
cfg
,
uint
subnum
,
user_t
*
user
,
client_t
*
client
)
{
if
(
user
==
NULL
)
return
FALSE
;
...
...
@@ -2731,7 +2731,7 @@ BOOL DLLCALL is_user_subop(scfg_t* cfg, uint subnum, user_t* user, client_t* cli
/* Determine if downloads from the specified directory are free for the */
/* specified user */
/****************************************************************************/
BOOL
DLLCALL
is_download_free
(
scfg_t
*
cfg
,
uint
dirnum
,
user_t
*
user
,
client_t
*
client
)
BOOL
is_download_free
(
scfg_t
*
cfg
,
uint
dirnum
,
user_t
*
user
,
client_t
*
client
)
{
if
(
!
VALID_CFG
(
cfg
))
return
(
FALSE
);
...
...
@@ -2754,7 +2754,7 @@ BOOL DLLCALL is_download_free(scfg_t* cfg, uint dirnum, user_t* user, client_t*
return
(
chk_ar
(
cfg
,
cfg
->
dir
[
dirnum
]
->
ex_ar
,
user
,
client
));
}
BOOL
DLLCALL
is_host_exempt
(
scfg_t
*
cfg
,
const
char
*
ip_addr
,
const
char
*
host_name
)
BOOL
is_host_exempt
(
scfg_t
*
cfg
,
const
char
*
ip_addr
,
const
char
*
host_name
)
{
char
exempt
[
MAX_PATH
+
1
];
...
...
@@ -2766,7 +2766,7 @@ BOOL DLLCALL is_host_exempt(scfg_t* cfg, const char* ip_addr, const char* host_n
/* Add an IP address (with comment) to the IP filter/trashcan file */
/* ToDo: Move somewhere more appropriate (filter.c?) */
/****************************************************************************/
BOOL
DLLCALL
filter_ip
(
scfg_t
*
cfg
,
const
char
*
prot
,
const
char
*
reason
,
const
char
*
host
BOOL
filter_ip
(
scfg_t
*
cfg
,
const
char
*
prot
,
const
char
*
reason
,
const
char
*
host
,
const
char
*
ip_addr
,
const
char
*
username
,
const
char
*
fname
)
{
char
ip_can
[
MAX_PATH
+
1
];
...
...
@@ -2811,7 +2811,7 @@ BOOL DLLCALL filter_ip(scfg_t* cfg, const char* prot, const char* reason, const
/****************************************************************************/
/* Note: This function does not account for timed events! */
/****************************************************************************/
time_t
DLLCALL
gettimeleft
(
scfg_t
*
cfg
,
user_t
*
user
,
time_t
starttime
)
time_t
gettimeleft
(
scfg_t
*
cfg
,
user_t
*
user
,
time_t
starttime
)
{
time_t
now
;
long
tleft
;
...
...
@@ -2845,7 +2845,7 @@ time_t DLLCALL gettimeleft(scfg_t* cfg, user_t* user, time_t starttime)
/*************************************************************************/
/* Check a supplied name/alias and see if it's valid by our standards. */
/*************************************************************************/
BOOL
DLLCALL
check_name
(
scfg_t
*
cfg
,
const
char
*
name
)
BOOL
check_name
(
scfg_t
*
cfg
,
const
char
*
name
)
{
char
tmp
[
512
];
size_t
len
;
...
...
@@ -2871,13 +2871,13 @@ BOOL DLLCALL check_name(scfg_t* cfg, const char* name)
/****************************************************************************/
/****************************************************************************/
link_list_t
*
DLLCALL
loginAttemptListInit
(
link_list_t
*
list
)
link_list_t
*
loginAttemptListInit
(
link_list_t
*
list
)
{
return
listInit
(
list
,
LINK_LIST_MUTEX
);
}
/****************************************************************************/
BOOL
DLLCALL
loginAttemptListFree
(
link_list_t
*
list
)
BOOL
loginAttemptListFree
(
link_list_t
*
list
)
{
return
listFree
(
list
);
}
...
...
@@ -2885,7 +2885,7 @@ BOOL DLLCALL loginAttemptListFree(link_list_t* list)
/****************************************************************************/
/* Returns negative value on failure */
/****************************************************************************/
long
DLLCALL
loginAttemptListCount
(
link_list_t
*
list
)
long
loginAttemptListCount
(
link_list_t
*
list
)
{
long
count
;
...
...
@@ -2900,7 +2900,7 @@ long DLLCALL loginAttemptListCount(link_list_t* list)
/* Returns number of items (attempts) removed from the list */
/* Returns negative value on failure */
/****************************************************************************/
long
DLLCALL
loginAttemptListClear
(
link_list_t
*
list
)
long
loginAttemptListClear
(
link_list_t
*
list
)
{
long
count
;
...
...
@@ -2941,7 +2941,7 @@ static list_node_t* login_attempted(link_list_t* list, const union xp_sockaddr*
/****************************************************************************/
/* Returns negative value on failure */
/****************************************************************************/
long
DLLCALL
loginAttempts
(
link_list_t
*
list
,
const
union
xp_sockaddr
*
addr
)
long
loginAttempts
(
link_list_t
*
list
,
const
union
xp_sockaddr
*
addr
)
{
long
count
=
0
;
list_node_t
*
node
;
...
...
@@ -2958,7 +2958,7 @@ long DLLCALL loginAttempts(link_list_t* list, const union xp_sockaddr* addr)
}
/****************************************************************************/
void
DLLCALL
loginSuccess
(
link_list_t
*
list
,
const
union
xp_sockaddr
*
addr
)
void
loginSuccess
(
link_list_t
*
list
,
const
union
xp_sockaddr
*
addr
)
{
list_node_t
*
node
;
...
...
@@ -2973,7 +2973,7 @@ void DLLCALL loginSuccess(link_list_t* list, const union xp_sockaddr* addr)
/****************************************************************************/
/* Returns number of *unique* login attempts (excludes consecutive dupes) */
/****************************************************************************/
ulong
DLLCALL
loginFailure
(
link_list_t
*
list
,
const
union
xp_sockaddr
*
addr
,
const
char
*
prot
,
const
char
*
user
,
const
char
*
pass
)
ulong
loginFailure
(
link_list_t
*
list
,
const
union
xp_sockaddr
*
addr
,
const
char
*
prot
,
const
char
*
user
,
const
char
*
pass
)
{
list_node_t
*
node
;
login_attempt_t
first
;
...
...
@@ -3011,7 +3011,7 @@ ulong DLLCALL loginFailure(link_list_t* list, const union xp_sockaddr* addr, con
}
#if !defined(NO_SOCKET_SUPPORT)
ulong
DLLCALL
loginBanned
(
scfg_t
*
cfg
,
link_list_t
*
list
,
SOCKET
sock
,
const
char
*
host_name
ulong
loginBanned
(
scfg_t
*
cfg
,
link_list_t
*
list
,
SOCKET
sock
,
const
char
*
host_name
,
struct
login_attempt_settings
settings
,
login_attempt_t
*
details
)
{
char
ip_addr
[
128
];
...
...
@@ -3067,7 +3067,7 @@ ulong DLLCALL loginBanned(scfg_t* cfg, link_list_t* list, SOCKET sock, const cha
/****************************************************************************/
/* Message-new-scan pointer/configuration functions */
/****************************************************************************/
BOOL
DLLCALL
getmsgptrs
(
scfg_t
*
cfg
,
user_t
*
user
,
subscan_t
*
subscan
,
void
(
*
progress
)(
void
*
,
int
,
int
),
void
*
cbdata
)
BOOL
getmsgptrs
(
scfg_t
*
cfg
,
user_t
*
user
,
subscan_t
*
subscan
,
void
(
*
progress
)(
void
*
,
int
,
int
),
void
*
cbdata
)
{
char
path
[
MAX_PATH
+
1
];
uint
i
;
...
...
@@ -3153,7 +3153,7 @@ BOOL DLLCALL getmsgptrs(scfg_t* cfg, user_t* user, subscan_t* subscan, void (*pr
/* Writes to data/user/####.subs the msgptr array for the current user */
/* Pass usernumber value of 0 to indicate "Guest" login */
/****************************************************************************/
BOOL
DLLCALL
putmsgptrs
(
scfg_t
*
cfg
,
user_t
*
user
,
subscan_t
*
subscan
)
BOOL
putmsgptrs
(
scfg_t
*
cfg
,
user_t
*
user
,
subscan_t
*
subscan
)
{
char
path
[
MAX_PATH
+
1
];
uint
i
;
...
...
@@ -3204,7 +3204,7 @@ BOOL DLLCALL putmsgptrs(scfg_t* cfg, user_t* user, subscan_t* subscan)
/* Initialize new-msg-scan pointers (e.g. for new users) */
/* If 'days' is specified as 0, just set pointer to last message (faster) */
/****************************************************************************/
BOOL
DLLCALL
initmsgptrs
(
scfg_t
*
cfg
,
subscan_t
*
subscan
,
unsigned
days
,
void
(
*
progress
)(
void
*
,
int
,
int
),
void
*
cbdata
)
BOOL
initmsgptrs
(
scfg_t
*
cfg
,
subscan_t
*
subscan
,
unsigned
days
,
void
(
*
progress
)(
void
*
,
int
,
int
),
void
*
cbdata
)
{
uint
i
;
smb_t
smb
;
...
...
@@ -3244,7 +3244,7 @@ BOOL DLLCALL initmsgptrs(scfg_t* cfg, subscan_t* subscan, unsigned days, void (*
/* Insure message new-scan pointers are within the range of the msgs in */
/* the sub-board. */
/****************************************************************************/
BOOL
DLLCALL
fixmsgptrs
(
scfg_t
*
cfg
,
subscan_t
*
subscan
)
BOOL
fixmsgptrs
(
scfg_t
*
cfg
,
subscan_t
*
subscan
)
{
uint
i
;
smb_t
smb
;
...
...
@@ -3281,12 +3281,12 @@ static char* sysop_available_semfile(scfg_t* scfg)
return
semfile
;
}
BOOL
DLLCALL
sysop_available
(
scfg_t
*
scfg
)
BOOL
sysop_available
(
scfg_t
*
scfg
)
{
return
fexist
(
sysop_available_semfile
(
scfg
));
}
BOOL
DLLCALL
set_sysop_availability
(
scfg_t
*
scfg
,
BOOL
available
)
BOOL
set_sysop_availability
(
scfg_t
*
scfg
,
BOOL
available
)
{
if
(
available
)
return
ftouch
(
sysop_available_semfile
(
scfg
));
...
...
@@ -3305,7 +3305,7 @@ static FILE* user_ini_open(scfg_t* scfg, unsigned user_number, BOOL create)
return
iniOpenFile
(
path
,
create
);
}
BOOL
DLLCALL
user_get_property
(
scfg_t
*
scfg
,
unsigned
user_number
,
const
char
*
section
,
const
char
*
key
,
char
*
value
,
size_t
maxlen
)
BOOL
user_get_property
(
scfg_t
*
scfg
,
unsigned
user_number
,
const
char
*
section
,
const
char
*
key
,
char
*
value
,
size_t
maxlen
)
{
FILE
*
fp
;
char
buf
[
INI_MAX_VALUE_LEN
];
...
...
@@ -3320,7 +3320,7 @@ BOOL DLLCALL user_get_property(scfg_t* scfg, unsigned user_number, const char* s
return
result
!=
NULL
;
}
BOOL
DLLCALL
user_set_property
(
scfg_t
*
scfg
,
unsigned
user_number
,
const
char
*
section
,
const
char
*
key
,
const
char
*
value
)
BOOL
user_set_property
(
scfg_t
*
scfg
,
unsigned
user_number
,
const
char
*
section
,
const
char
*
key
,
const
char
*
value
)
{
FILE
*
fp
;
str_list_t
ini
;
...
...
@@ -3337,7 +3337,7 @@ BOOL DLLCALL user_set_property(scfg_t* scfg, unsigned user_number, const char* s
return
result
!=
NULL
;
}
BOOL
DLLCALL
user_set_time_property
(
scfg_t
*
scfg
,
unsigned
user_number
,
const
char
*
section
,
const
char
*
key
,
time_t
value
)
BOOL
user_set_time_property
(
scfg_t
*
scfg
,
unsigned
user_number
,
const
char
*
section
,
const
char
*
key
,
time_t
value
)
{
FILE
*
fp
;
str_list_t
ini
;
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/userdat.h
+
75
−
85
View file @
a1db507d
...
...
@@ -43,29 +43,19 @@
#ifdef DLLEXPORT
#undef DLLEXPORT
#endif
#ifdef DLLCALL
#undef DLLCALL
#endif
#ifdef _WIN32
#ifdef __MINGW32__
#define DLLEXPORT
#define DLLCALL
#else
#ifdef SBBS_EXPORTS
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT __declspec(dllimport)
#endif
#ifdef __BORLANDC__
#define DLLCALL
#else
#define DLLCALL
#endif
#endif
#else
#define DLLEXPORT
#define DLLCALL
#endif
#ifdef __cplusplus
...
...
@@ -75,84 +65,84 @@ extern "C" {
extern
char
*
crlf
;
extern
char
*
nulstr
;
DLLEXPORT
int
DLLCALL
openuserdat
(
scfg_t
*
,
BOOL
for_modify
);
DLLEXPORT
int
DLLCALL
closeuserdat
(
int
);
DLLEXPORT
int
DLLCALL
readuserdat
(
scfg_t
*
,
unsigned
user_number
,
char
*
userdat
,
int
infile
);
DLLEXPORT
int
DLLCALL
parseuserdat
(
scfg_t
*
,
char
*
userdat
,
user_t
*
);
DLLEXPORT
int
DLLCALL
getuserdat
(
scfg_t
*
,
user_t
*
);
/* Fill userdat struct with user data */
DLLEXPORT
int
DLLCALL
fgetuserdat
(
scfg_t
*
,
user_t
*
,
int
file
);
DLLEXPORT
int
DLLCALL
putuserdat
(
scfg_t
*
,
user_t
*
);
/* Put userdat struct into user file */
DLLEXPORT
int
DLLCALL
newuserdat
(
scfg_t
*
,
user_t
*
);
/* Create new userdat in user file */
DLLEXPORT
uint
DLLCALL
matchuser
(
scfg_t
*
,
const
char
*
str
,
BOOL
sysop_alias
);
/* Checks for a username match */
DLLEXPORT
char
*
DLLCALL
alias
(
scfg_t
*
,
const
char
*
name
,
char
*
buf
);
DLLEXPORT
int
DLLCALL
putusername
(
scfg_t
*
,
int
number
,
char
*
name
);
DLLEXPORT
uint
DLLCALL
total_users
(
scfg_t
*
);
DLLEXPORT
uint
DLLCALL
lastuser
(
scfg_t
*
);
DLLEXPORT
BOOL
DLLCALL
del_lastuser
(
scfg_t
*
);
DLLEXPORT
uint
DLLCALL
getage
(
scfg_t
*
,
char
*
birthdate
);
DLLEXPORT
char
*
DLLCALL
username
(
scfg_t
*
,
int
usernumber
,
char
*
str
);
DLLEXPORT
char
*
DLLCALL
usermailaddr
(
scfg_t
*
,
char
*
addr
,
const
char
*
name
);
DLLEXPORT
int
DLLCALL
getnodedat
(
scfg_t
*
,
uint
number
,
node_t
*
node
,
int
*
file
);
DLLEXPORT
int
DLLCALL
putnodedat
(
scfg_t
*
,
uint
number
,
node_t
*
node
,
int
file
);
DLLEXPORT
char
*
DLLCALL
nodestatus
(
scfg_t
*
,
node_t
*
node
,
char
*
buf
,
size_t
buflen
);
DLLEXPORT
void
DLLCALL
printnodedat
(
scfg_t
*
,
uint
number
,
node_t
*
node
);
DLLEXPORT
int
DLLCALL
is_user_online
(
scfg_t
*
,
uint
usernumber
);
DLLEXPORT
void
DLLCALL
packchatpass
(
char
*
pass
,
node_t
*
node
);
DLLEXPORT
char
*
DLLCALL
unpackchatpass
(
char
*
pass
,
node_t
*
node
);
DLLEXPORT
char
*
DLLCALL
getsmsg
(
scfg_t
*
,
int
usernumber
);
DLLEXPORT
int
DLLCALL
putsmsg
(
scfg_t
*
,
int
usernumber
,
char
*
strin
);
DLLEXPORT
char
*
DLLCALL
getnmsg
(
scfg_t
*
,
int
node_num
);
DLLEXPORT
int
DLLCALL
putnmsg
(
scfg_t
*
,
int
num
,
char
*
strin
);
DLLEXPORT
uint
DLLCALL
userdatdupe
(
scfg_t
*
,
uint
usernumber
,
uint
offset
,
uint
datlen
,
char
*
dat
,
BOOL
del
,
BOOL
next
,
void
(
*
progress
)(
void
*
,
int
,
int
),
void
*
cbdata
);
DLLEXPORT
BOOL
DLLCALL
chk_ar
(
scfg_t
*
,
uchar
*
str
,
user_t
*
,
client_t
*
);
/* checks access requirements */
DLLEXPORT
int
DLLCALL
getuserrec
(
scfg_t
*
,
int
usernumber
,
int
start
,
int
length
,
char
*
str
);
DLLEXPORT
int
DLLCALL
putuserrec
(
scfg_t
*
,
int
usernumber
,
int
start
,
uint
length
,
const
char
*
str
);
DLLEXPORT
ulong
DLLCALL
adjustuserrec
(
scfg_t
*
,
int
usernumber
,
int
start
,
int
length
,
long
adj
);
DLLEXPORT
BOOL
DLLCALL
logoutuserdat
(
scfg_t
*
,
user_t
*
,
time_t
now
,
time_t
logontime
);
DLLEXPORT
void
DLLCALL
resetdailyuserdat
(
scfg_t
*
,
user_t
*
,
BOOL
write
);
DLLEXPORT
void
DLLCALL
subtract_cdt
(
scfg_t
*
,
user_t
*
,
long
amt
);
DLLEXPORT
int
DLLCALL
user_rec_len
(
int
offset
);
DLLEXPORT
BOOL
DLLCALL
can_user_access_sub
(
scfg_t
*
,
uint
subnum
,
user_t
*
,
client_t
*
client
);
DLLEXPORT
BOOL
DLLCALL
can_user_read_sub
(
scfg_t
*
,
uint
subnum
,
user_t
*
,
client_t
*
client
);
DLLEXPORT
BOOL
DLLCALL
can_user_post
(
scfg_t
*
,
uint
subnum
,
user_t
*
,
client_t
*
client
,
uint
*
reason
);
DLLEXPORT
BOOL
DLLCALL
can_user_send_mail
(
scfg_t
*
,
enum
smb_net_type
,
uint
usernumber
,
user_t
*
,
uint
*
reason
);
DLLEXPORT
BOOL
DLLCALL
is_user_subop
(
scfg_t
*
,
uint
subnum
,
user_t
*
,
client_t
*
client
);
DLLEXPORT
BOOL
DLLCALL
is_download_free
(
scfg_t
*
,
uint
dirnum
,
user_t
*
,
client_t
*
client
);
DLLEXPORT
BOOL
DLLCALL
is_host_exempt
(
scfg_t
*
,
const
char
*
ip_addr
,
const
char
*
host_name
);
DLLEXPORT
BOOL
DLLCALL
filter_ip
(
scfg_t
*
,
const
char
*
prot
,
const
char
*
reason
,
const
char
*
host
DLLEXPORT
int
openuserdat
(
scfg_t
*
,
BOOL
for_modify
);
DLLEXPORT
int
closeuserdat
(
int
);
DLLEXPORT
int
readuserdat
(
scfg_t
*
,
unsigned
user_number
,
char
*
userdat
,
int
infile
);
DLLEXPORT
int
parseuserdat
(
scfg_t
*
,
char
*
userdat
,
user_t
*
);
DLLEXPORT
int
getuserdat
(
scfg_t
*
,
user_t
*
);
/* Fill userdat struct with user data */
DLLEXPORT
int
fgetuserdat
(
scfg_t
*
,
user_t
*
,
int
file
);
DLLEXPORT
int
putuserdat
(
scfg_t
*
,
user_t
*
);
/* Put userdat struct into user file */
DLLEXPORT
int
newuserdat
(
scfg_t
*
,
user_t
*
);
/* Create new userdat in user file */
DLLEXPORT
uint
matchuser
(
scfg_t
*
,
const
char
*
str
,
BOOL
sysop_alias
);
/* Checks for a username match */
DLLEXPORT
char
*
alias
(
scfg_t
*
,
const
char
*
name
,
char
*
buf
);
DLLEXPORT
int
putusername
(
scfg_t
*
,
int
number
,
char
*
name
);
DLLEXPORT
uint
total_users
(
scfg_t
*
);
DLLEXPORT
uint
lastuser
(
scfg_t
*
);
DLLEXPORT
BOOL
del_lastuser
(
scfg_t
*
);
DLLEXPORT
uint
getage
(
scfg_t
*
,
char
*
birthdate
);
DLLEXPORT
char
*
username
(
scfg_t
*
,
int
usernumber
,
char
*
str
);
DLLEXPORT
char
*
usermailaddr
(
scfg_t
*
,
char
*
addr
,
const
char
*
name
);
DLLEXPORT
int
getnodedat
(
scfg_t
*
,
uint
number
,
node_t
*
node
,
int
*
file
);
DLLEXPORT
int
putnodedat
(
scfg_t
*
,
uint
number
,
node_t
*
node
,
int
file
);
DLLEXPORT
char
*
nodestatus
(
scfg_t
*
,
node_t
*
node
,
char
*
buf
,
size_t
buflen
);
DLLEXPORT
void
printnodedat
(
scfg_t
*
,
uint
number
,
node_t
*
node
);
DLLEXPORT
int
is_user_online
(
scfg_t
*
,
uint
usernumber
);
DLLEXPORT
void
packchatpass
(
char
*
pass
,
node_t
*
node
);
DLLEXPORT
char
*
unpackchatpass
(
char
*
pass
,
node_t
*
node
);
DLLEXPORT
char
*
getsmsg
(
scfg_t
*
,
int
usernumber
);
DLLEXPORT
int
putsmsg
(
scfg_t
*
,
int
usernumber
,
char
*
strin
);
DLLEXPORT
char
*
getnmsg
(
scfg_t
*
,
int
node_num
);
DLLEXPORT
int
putnmsg
(
scfg_t
*
,
int
num
,
char
*
strin
);
DLLEXPORT
uint
userdatdupe
(
scfg_t
*
,
uint
usernumber
,
uint
offset
,
uint
datlen
,
char
*
dat
,
BOOL
del
,
BOOL
next
,
void
(
*
progress
)(
void
*
,
int
,
int
),
void
*
cbdata
);
DLLEXPORT
BOOL
chk_ar
(
scfg_t
*
,
uchar
*
str
,
user_t
*
,
client_t
*
);
/* checks access requirements */
DLLEXPORT
int
getuserrec
(
scfg_t
*
,
int
usernumber
,
int
start
,
int
length
,
char
*
str
);
DLLEXPORT
int
putuserrec
(
scfg_t
*
,
int
usernumber
,
int
start
,
uint
length
,
const
char
*
str
);
DLLEXPORT
ulong
adjustuserrec
(
scfg_t
*
,
int
usernumber
,
int
start
,
int
length
,
long
adj
);
DLLEXPORT
BOOL
logoutuserdat
(
scfg_t
*
,
user_t
*
,
time_t
now
,
time_t
logontime
);
DLLEXPORT
void
resetdailyuserdat
(
scfg_t
*
,
user_t
*
,
BOOL
write
);
DLLEXPORT
void
subtract_cdt
(
scfg_t
*
,
user_t
*
,
long
amt
);
DLLEXPORT
int
user_rec_len
(
int
offset
);
DLLEXPORT
BOOL
can_user_access_sub
(
scfg_t
*
,
uint
subnum
,
user_t
*
,
client_t
*
client
);
DLLEXPORT
BOOL
can_user_read_sub
(
scfg_t
*
,
uint
subnum
,
user_t
*
,
client_t
*
client
);
DLLEXPORT
BOOL
can_user_post
(
scfg_t
*
,
uint
subnum
,
user_t
*
,
client_t
*
client
,
uint
*
reason
);
DLLEXPORT
BOOL
can_user_send_mail
(
scfg_t
*
,
enum
smb_net_type
,
uint
usernumber
,
user_t
*
,
uint
*
reason
);
DLLEXPORT
BOOL
is_user_subop
(
scfg_t
*
,
uint
subnum
,
user_t
*
,
client_t
*
client
);
DLLEXPORT
BOOL
is_download_free
(
scfg_t
*
,
uint
dirnum
,
user_t
*
,
client_t
*
client
);
DLLEXPORT
BOOL
is_host_exempt
(
scfg_t
*
,
const
char
*
ip_addr
,
const
char
*
host_name
);
DLLEXPORT
BOOL
filter_ip
(
scfg_t
*
,
const
char
*
prot
,
const
char
*
reason
,
const
char
*
host
,
const
char
*
ip_addr
,
const
char
*
username
,
const
char
*
fname
);
/* user .ini file access */
DLLEXPORT
BOOL
DLLCALL
user_get_property
(
scfg_t
*
,
unsigned
user_number
,
const
char
*
section
,
const
char
*
key
,
char
*
value
,
size_t
maxlen
);
DLLEXPORT
BOOL
DLLCALL
user_set_property
(
scfg_t
*
,
unsigned
user_number
,
const
char
*
section
,
const
char
*
key
,
const
char
*
value
);
DLLEXPORT
BOOL
DLLCALL
user_set_time_property
(
scfg_t
*
,
unsigned
user_number
,
const
char
*
section
,
const
char
*
key
,
time_t
);
DLLEXPORT
BOOL
user_get_property
(
scfg_t
*
,
unsigned
user_number
,
const
char
*
section
,
const
char
*
key
,
char
*
value
,
size_t
maxlen
);
DLLEXPORT
BOOL
user_set_property
(
scfg_t
*
,
unsigned
user_number
,
const
char
*
section
,
const
char
*
key
,
const
char
*
value
);
DLLEXPORT
BOOL
user_set_time_property
(
scfg_t
*
,
unsigned
user_number
,
const
char
*
section
,
const
char
*
key
,
time_t
);
/* New-message-scan pointer functions: */
DLLEXPORT
BOOL
DLLCALL
getmsgptrs
(
scfg_t
*
,
user_t
*
,
subscan_t
*
,
void
(
*
progress
)(
void
*
,
int
,
int
),
void
*
cbdata
);
DLLEXPORT
BOOL
DLLCALL
putmsgptrs
(
scfg_t
*
,
user_t
*
,
subscan_t
*
);
DLLEXPORT
BOOL
DLLCALL
fixmsgptrs
(
scfg_t
*
,
subscan_t
*
);
DLLEXPORT
BOOL
DLLCALL
initmsgptrs
(
scfg_t
*
,
subscan_t
*
,
unsigned
days
,
void
(
*
progress
)(
void
*
,
int
,
int
),
void
*
cbdata
);
DLLEXPORT
BOOL
getmsgptrs
(
scfg_t
*
,
user_t
*
,
subscan_t
*
,
void
(
*
progress
)(
void
*
,
int
,
int
),
void
*
cbdata
);
DLLEXPORT
BOOL
putmsgptrs
(
scfg_t
*
,
user_t
*
,
subscan_t
*
);
DLLEXPORT
BOOL
fixmsgptrs
(
scfg_t
*
,
subscan_t
*
);
DLLEXPORT
BOOL
initmsgptrs
(
scfg_t
*
,
subscan_t
*
,
unsigned
days
,
void
(
*
progress
)(
void
*
,
int
,
int
),
void
*
cbdata
);
/* New atomic numeric user field adjustment functions: */
DLLEXPORT
BOOL
DLLCALL
user_posted_msg
(
scfg_t
*
,
user_t
*
,
int
count
);
DLLEXPORT
BOOL
DLLCALL
user_sent_email
(
scfg_t
*
,
user_t
*
,
int
count
,
BOOL
feedback
);
DLLEXPORT
BOOL
DLLCALL
user_downloaded
(
scfg_t
*
,
user_t
*
,
int
files
,
long
bytes
);
DLLEXPORT
BOOL
DLLCALL
user_uploaded
(
scfg_t
*
,
user_t
*
,
int
files
,
long
bytes
);
DLLEXPORT
BOOL
DLLCALL
user_adjust_credits
(
scfg_t
*
,
user_t
*
,
long
amount
);
DLLEXPORT
BOOL
DLLCALL
user_adjust_minutes
(
scfg_t
*
,
user_t
*
,
long
amount
);
DLLEXPORT
BOOL
user_posted_msg
(
scfg_t
*
,
user_t
*
,
int
count
);
DLLEXPORT
BOOL
user_sent_email
(
scfg_t
*
,
user_t
*
,
int
count
,
BOOL
feedback
);
DLLEXPORT
BOOL
user_downloaded
(
scfg_t
*
,
user_t
*
,
int
files
,
long
bytes
);
DLLEXPORT
BOOL
user_uploaded
(
scfg_t
*
,
user_t
*
,
int
files
,
long
bytes
);
DLLEXPORT
BOOL
user_adjust_credits
(
scfg_t
*
,
user_t
*
,
long
amount
);
DLLEXPORT
BOOL
user_adjust_minutes
(
scfg_t
*
,
user_t
*
,
long
amount
);
DLLEXPORT
time_t
DLLCALL
gettimeleft
(
scfg_t
*
,
user_t
*
,
time_t
starttime
);
DLLEXPORT
time_t
gettimeleft
(
scfg_t
*
,
user_t
*
,
time_t
starttime
);
DLLEXPORT
BOOL
DLLCALL
check_name
(
scfg_t
*
,
const
char
*
name
);
DLLEXPORT
BOOL
DLLCALL
sysop_available
(
scfg_t
*
);
DLLEXPORT
BOOL
DLLCALL
set_sysop_availability
(
scfg_t
*
,
BOOL
available
);
DLLEXPORT
BOOL
check_name
(
scfg_t
*
,
const
char
*
name
);
DLLEXPORT
BOOL
sysop_available
(
scfg_t
*
);
DLLEXPORT
BOOL
set_sysop_availability
(
scfg_t
*
,
BOOL
available
);
DLLEXPORT
int
DLLCALL
lookup_user
(
scfg_t
*
,
link_list_t
*
,
const
char
*
name
);
DLLEXPORT
int
lookup_user
(
scfg_t
*
,
link_list_t
*
,
const
char
*
name
);
/* Login attempt/hack tracking */
typedef
struct
{
...
...
@@ -165,14 +155,14 @@ typedef struct {
char
pass
[
128
];
}
login_attempt_t
;
DLLEXPORT
link_list_t
*
DLLCALL
loginAttemptListInit
(
link_list_t
*
);
DLLEXPORT
BOOL
DLLCALL
loginAttemptListFree
(
link_list_t
*
);
DLLEXPORT
long
DLLCALL
loginAttemptListCount
(
link_list_t
*
);
DLLEXPORT
long
DLLCALL
loginAttemptListClear
(
link_list_t
*
);
DLLEXPORT
long
DLLCALL
loginAttempts
(
link_list_t
*
,
const
union
xp_sockaddr
*
);
DLLEXPORT
void
DLLCALL
loginSuccess
(
link_list_t
*
,
const
union
xp_sockaddr
*
);
DLLEXPORT
ulong
DLLCALL
loginFailure
(
link_list_t
*
,
const
union
xp_sockaddr
*
,
const
char
*
prot
,
const
char
*
user
,
const
char
*
pass
);
DLLEXPORT
ulong
DLLCALL
loginBanned
(
scfg_t
*
,
link_list_t
*
,
SOCKET
,
const
char
*
host_name
,
struct
login_attempt_settings
,
login_attempt_t
*
);
DLLEXPORT
link_list_t
*
loginAttemptListInit
(
link_list_t
*
);
DLLEXPORT
BOOL
loginAttemptListFree
(
link_list_t
*
);
DLLEXPORT
long
loginAttemptListCount
(
link_list_t
*
);
DLLEXPORT
long
loginAttemptListClear
(
link_list_t
*
);
DLLEXPORT
long
loginAttempts
(
link_list_t
*
,
const
union
xp_sockaddr
*
);
DLLEXPORT
void
loginSuccess
(
link_list_t
*
,
const
union
xp_sockaddr
*
);
DLLEXPORT
ulong
loginFailure
(
link_list_t
*
,
const
union
xp_sockaddr
*
,
const
char
*
prot
,
const
char
*
user
,
const
char
*
pass
);
DLLEXPORT
ulong
loginBanned
(
scfg_t
*
,
link_list_t
*
,
SOCKET
,
const
char
*
host_name
,
struct
login_attempt_settings
,
login_attempt_t
*
);
#ifdef __cplusplus
}
...
...
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