printf("You are unsubscribed from this conference. Rejoin (N)? ");
gets(line);
log("Unsubscribed. Resubscribe? %s", line);
if (ToLower(line[0]) == 'y')
resubscribe(conf);
else
return 0;
}
if (parms.ua_xrc && conf[0] == 'x' && conf[1] == '-')
{
printf("This is a Restricted Access (X-RATED) conference. The material within\n may be unsuitable for, or unacceptable to, some users of UNaXcess.\n\nDo you still wish to join this conference (N)? ");
if (user.u_access != A_WITNESS && strcmp(getowner(mfile), user.u_name) != 0)
{
puts("Sorry, you don't own that message.");
log("Security violation: KILL by non-owner");
return;
}
if (unlink(mfile) < 0)
{
printf("No such message: %d", msg);
log("Error %d unlinking %s", errno, mfile);
return;
}
log("Deleted %s:%d", conference, msg);
}
char *getowner(file)
char *file;
{
FILE *f;
char line[1024], *p;
static char owner[256];
strcpy(owner, parms.ua_sysop);
if ((f = fopen(file, "r")) == NULL)
return owner;
while (fgets(line, 1024, f) != NULL)
if (line[0] == '\n')
break;
else if (strncmp(line, "From: ", 6) == 0)
{
strcpy(owner, &line[6]);
break;
}
fclose(f);
for (p = owner; *p != '\0'; p++)
*p = ToLower(*p);
return owner;
}
newconf(conf)
char *conf;
{
char line[256];
FILE *f;
if (user.u_access == A_GUEST)
{
log("Security violation: attempted MKCONF by guest");
puts("Sorry, there is no such conference.");
return 0;
}
printf("There is no conference by that name. Do you want to create it (N)? ");
gets(line);
log("Nonexistent. Create? %s", line);
if (ToLower(line[0]) != 'y')
return 0;
if (parms.ua_xrc && conf[0] == 'x' && conf[1] == '-')
{
printf("Conferences beginning with \"x-\" are designated as Restricted Access (X-RATED)\nconferences under UNaXcess, and will often carry information unsuitable for some\n");
printf("users or unacceptable to some users. If you do not wish to create such a\nconference, answer NO to the next question and choose a conference name not\n");
printf("beginning with the characters \"x-\".\n\nDo you wish to create an X-RATED conference (N)? ");
gets(line);
log("Restricted. Create? %s", line);
if (ToLower(line[0]) != 'y')
return 0;
}
if (parms.ua_roc && conf[0] == 'r' && conf[1] == '-')
if (user.u_access != A_WITNESS)
{
puts("Only Fairwitnesses can make READ-ONLY conferences.");
log("Attempted mk of RO conf by non-FW");
return 0;
}
else
{
puts("This conference will be READ-ONLY, except to Fairwitnesses.\nIf you want anyone to be able to add to it, answer NO and use a name not\nbeginning with \"R-\".");
printf("\nDo you want to make this READ-ONLY conference (N)? ");
puts("Can't create high message file. Strange...");
return 0;
}
fputs("0", f);
fclose(f);
puts("You will now be placed in the message editor to make a message describing\nthis conferemnce. It will be addressed to, and readable by, all users.");
mkmsg("All", "This conference", conf, 0);
return 1;
}
isprivate(msg)
char *msg;
{
FILE *fp;
char line[1024], to[1024], from[1024];
short pflag;
if (user.u_access == A_WITNESS)
return 0;
if ((fp = fopen(msg, "r")) == NULL)
return 0;
strcpy(to, "All");
pflag = 0;
while (fgets(line, 1024, fp) != NULL)
{
if (line[0] == '\n')
break;
else if (strncmp(line, "To: ", 4) == 0)
strcpy(to, &line[4]);
else if (strncmp(line, "From: ", 6) == 0)
strcpy(from, &line[6]);
else if (strncmp(line, "Subject (Private): ", 19) == 0)
pflag = 1;
}
fclose(fp);
if (pflag && strcmp(user.u_name, to) == 0)
return 0;
else if (pflag && strcmp(user.u_name, from) == 0)
return 0;
else if (pflag)
{
log("Message %s is private.", msg);
return 1;
}
else
return 0;
}
isunsub(conf)
char *conf; {
struct _himsg *hip;
for (hip = hicnts; hip != NULL; hip = hip->hi_next)
if (strcmp(hip->hi_conf, conf) == 0)
break;
return (hip != NULL && hip->hi_uns == HI_UNSUB);
}
unsubscribe(conf)
char *conf; {
struct _himsg *hip, *workp;
char line[512];
if (s_cmp(conf, "general") == 0) {
puts("Can't unsubscribe the general conference.");
log("Attempted to unsubscribe to general.");
return;
}
if (s_cmp(conf, user.u_lconf) == 0) {
printf("Unsubscribe to login conference (N)? ");
gets(line);
log("Unsub login conf? %s", line);
if (ToLower(line[0]) != 'y')
return;
strcpy(user.u_lconf, "general");
}
for (hip = hicnts; hip != NULL; hip = hip->hi_next)