extern unsigned userflags;
extern char *axdefs[7];
extern char sigcaught;
-extern struct CtdlServInfo serv_info;
extern char rc_floor_mode;
extern int rc_ansi_color;
extern int rc_prompt_control;
color(COLOR_PUSH);
color(DIM_RED);
- scr_printf("%s\r",serv_info.serv_moreprompt);
+ scr_printf("%s\r", ipc->ServInfo.moreprompt);
color(COLOR_POP);
sttybbs(0);
b=inkey();
- for (a=0; a<strlen(serv_info.serv_moreprompt); ++a)
+ for (a=0; a<strlen(ipc->ServInfo.moreprompt); ++a)
scr_putc(' ');
scr_putc(13);
sttybbs(1);
{
char buf[SIZ];
char who[USERNAME_SIZE];
- struct usersupp *user = NULL;
+ struct ctdluser *user = NULL;
int newnow = 0;
int r; /* IPC response code */
}
user->axlevel = intprompt("Access level", user->axlevel, 0, 6);
+
+ user->flags = set_attr(ipc, user->flags,
+ "Permission to send Internet mail",
+ US_INTERNET, 0);
+
if (boolprompt("Ask user to register again", !(user->flags & US_REGIS)))
user->flags &= ~US_REGIS;
else
void enter_config(CtdlIPC *ipc, int mode)
{
char buf[SIZ];
- struct usersupp *user = NULL;
+ struct ctdluser *user = NULL;
int r; /* IPC response code */
r = CtdlIPCGetConfig(ipc, &user, buf);
}
-/* display internal error as defined in errmsgs */
-/*
-void interr(int errnum) {
- scr_printf("*** INTERNAL ERROR %d\n"
- "(Press any key to continue)\n", errnum);
- inkey();
- logoff(errnum);
-}
-*/
-
-
void strproc(char *string)
{
int a;
#endif
-void progress(unsigned long curr, unsigned long cmax)
+void progress(CtdlIPC* ipc, unsigned long curr, unsigned long cmax)
{
static char dots[] =
"**************************************************";
if (curr >= cmax) {
sln_printf("\r%79s\r","");
- status_line(serv_info.serv_humannode, serv_info.serv_bbs_city,
+ status_line(ipc->ServInfo.humannode, ipc->ServInfo.bbs_city,
room_name, secure, 0);
} else {
/* a will be range 0-50 rather than 0-100 */
* NOT the same locate_host() in locate_host.c. This one just does a
* 'who am i' to try to discover where the user is...
*/
-void locate_host(char *hbuf)
+void locate_host(CtdlIPC* ipc, char *hbuf)
{
#ifndef HAVE_UTMP_H
char buf[SIZ];
who = (FILE *)popen("who am i","r");
if (who==NULL) {
- strcpy(hbuf,serv_info.serv_fqdn);
+ strcpy(hbuf, ipc->ServInfo.fqdn);
return;
}
fgets(buf,sizeof buf,who);
if ((buf[a]=='(')||(buf[a]==')')) ++b;
}
if (b<2) {
- strcpy(hbuf,serv_info.serv_fqdn);
+ strcpy(hbuf, ipc->ServInfo.fqdn);
return;
}
if (buf[a]==')') buf[a] = 0;
}
- if (strlen(buf)==0) strcpy(hbuf,serv_info.serv_fqdn);
+ if (strlen(buf)==0) strcpy(hbuf, ipc->ServInfo.fqdn);
else strncpy(hbuf,buf,24);
#else
char *tty = ttyname(0);
if (tty == NULL) {
fail:
- safestrncpy(hbuf, serv_info.serv_fqdn, 24);
+ safestrncpy(hbuf, ipc->ServInfo.fqdn, 24);
return;
}
void misc_server_cmd(CtdlIPC *ipc, char *cmd) {
char buf[SIZ];
- CtdlIPC_putline(ipc, cmd);
- CtdlIPC_getline(ipc, buf);
+ CtdlIPC_chat_send(ipc, cmd);
+ CtdlIPC_chat_recv(ipc, buf);
scr_printf("%s\n",buf);
if (buf[0]=='1') {
set_keepalives(KA_HALF);
- while (CtdlIPC_getline(ipc, buf), strcmp(buf,"000")) {
+ while (CtdlIPC_chat_recv(ipc, buf), strcmp(buf,"000")) {
scr_printf("%s\n",buf);
}
set_keepalives(KA_YES);
if (buf[0]=='4') {
do {
newprompt("> ",buf,255);
- CtdlIPC_putline(ipc, buf);
+ CtdlIPC_chat_send(ipc, buf);
} while(strcmp(buf,"000"));
return;
}