Skip to content
Snippets Groups Projects
Commit 83d0c7d5 authored by rswindell's avatar rswindell
Browse files

Moved alias() from a static mailsrvr function to exported sbbs.dll function.

parent bf4073d1
No related branches found
No related tags found
No related merge requests found
......@@ -1375,3 +1375,51 @@ char* DLLCALL usermailaddr(scfg_t* cfg, char* addr, char* name)
strcat(addr,cfg->sys_inetaddr);
return(addr);
}
char* DLLCALL alias(scfg_t* cfg, SOCKET socket, char* name, char* buf)
{
int file;
char* p;
char* np;
char* tp;
char fname[MAX_PATH+1];
FILE* fp;
p=name;
if(!stricmp(p,"SYSOP") || !stricmp(p,cfg->sys_id)
|| !stricmp(p,"POSTMASTER") || !stricmp(p,cfg->sys_op)) {
strcpy(buf,"1");
return(buf);
}
sprintf(fname,"%salias.cfg",cfg->ctrl_dir);
if((file=sopen(fname,O_RDONLY|O_BINARY,SH_DENYNO))==-1)
return(name);
if((fp=fdopen(file,"rb"))==NULL) {
close(file);
return(name);
}
while(!feof(fp)) {
if(!fgets(buf,80,fp))
break;
np=buf;
while(*np && *np<=' ') np++;
if(*np==';')
continue;
tp=np;
while(*tp && *tp>' ') tp++;
if(*tp) *tp=0;
if(!stricmp(np,name)) {
np=tp+1;
while(*np && *np<=' ') np++;
p=np;
truncsp(p);
break;
}
}
fclose(fp);
return(p);
}
......@@ -75,6 +75,7 @@ DLLEXPORT int DLLCALL putuserdat(scfg_t* cfg, user_t* user); /* Put userdat stru
DLLEXPORT void DLLCALL getrec(char *instr,int start,int length,char *outstr); /* Retrieve a record from a string */
DLLEXPORT void DLLCALL putrec(char *outstr,int start,int length,char *instr); /* Place a record into a string */
DLLEXPORT uint DLLCALL matchuser(scfg_t* cfg, char *str); /* Checks for a username match */
DLLEXPORT char* DLLCALL alias(scfg_t* cfg, SOCKET socket, char* name, char* buf);
DLLEXPORT int DLLCALL putusername(scfg_t* cfg, int number, char * name);
DLLEXPORT uint DLLCALL lastuser(scfg_t* cfg);
DLLEXPORT char DLLCALL getage(scfg_t* cfg, char *birthdate);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment