Commit ea40e3f0 authored by David Byers's avatar David Byers
Browse files

Anarchy bit checked for anonymous texts:

(check_anonymous_subm): New static function.
(create_text_check_misc): New argument: anonymous.  All callers
updated.  Check that the conference accepts anonymous texts if the
new argument is true.
parent 2f9330d4
/*
* $Id: text.c,v 0.36 1995/11/02 21:49:11 ceder Exp $
* $Id: text.c,v 0.37 1996/02/23 16:00:42 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* All atomic calls that deals with texts.
*/
static char *rcsid = "$Id: text.c,v 0.36 1995/11/02 21:49:11 ceder Exp $";
static char *rcsid = "$Id: text.c,v 0.37 1996/02/23 16:00:42 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -1443,6 +1443,25 @@ get_text_stat (Text_no text_no,
* Functions local to create_text:
*/
/*
* Check that the text can be submitted anonymously
*/
static Success
check_anonymous_subm (Misc_info *misc,
int loc,
Conf_no addressee)
{
Conf_type conf_type;
conf_type = cached_get_conf_type(addressee);
if (conf_type.anarchy)
return OK;
else
return FAILURE;
}
/*
* Check that the recipient or cc_recipient at LOC is not already a
* recipient or cc_recipient of this text.
......@@ -1544,7 +1563,8 @@ check_double_comm (Misc_info *misc,
*/
static Success
create_text_check_misc (u_short * no_of_misc,
Misc_info * misc )
Misc_info * misc,
Bool anonymous )
{
int i;
Text_stat * parent;
......@@ -1613,6 +1633,15 @@ create_text_check_misc (u_short * no_of_misc,
kom_errno = KOM_ILL_MISC;
return FAILURE;
}
/* Check that an anonymous text can be created */
if (anonymous && check_anonymous_subm(misc, i, addressee) != OK)
{
kom_errno = KOM_ACCESS;
return FAILURE;
}
break;
......@@ -1638,6 +1667,15 @@ create_text_check_misc (u_short * no_of_misc,
kom_errno = KOM_ILL_MISC;
return FAILURE;
}
/* Check that an anonymous text can be created */
if (anonymous && check_anonymous_subm(misc, i, addressee) != OK)
{
kom_errno = KOM_ACCESS;
return FAILURE;
}
break;
......@@ -1886,7 +1924,7 @@ create_text(const String message,
/* Check all misc-items */
if ( create_text_check_misc(&no_of_misc, misc) != OK
if ( create_text_check_misc(&no_of_misc, misc, 0) != OK
|| (text = cached_create_text( message )) == 0)
{
return 0;
......@@ -1966,7 +2004,7 @@ create_anonymous_text(const String message,
/* Check all misc-items */
if ( create_text_check_misc(&no_of_misc, misc) != OK
if ( create_text_check_misc(&no_of_misc, misc, 1) != OK
|| (text = cached_create_text( message )) == 0)
{
return 0;
......
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