Commit b8ba9bbf authored by David Byers's avatar David Byers

New membership data type. Multiple bug fixes

parent 6fdcfb3c
1998-06-10 David Byers <davby@ida.liu.se>
* src/server/membership.c (sub_member): Return KOM_NOT_MEMBER for
secret memberships.
1998-06-08 David Byers <davby@ida.liu.se>
* src/server/membership.c (set_membership_type): New function.
* src/server/prot-a-output.c (prot_a_output_membership): Output
added_at.
(prot_a_output_member): Output added_at
* src/server/membership.c (do_add_member): Set added_at.
(get_members): Filter out added_at.
* src/server/memory.c (init_membership): Init added_at.
* src/server/ram-output.c (foutput_member_2): Added output of
added_at.
* src/server/ram-parse.c (fparse_member_2): Added parsing of added_at.
* src/include/kom-types.h: Added added_at to Membership och Member.
* src/server/ram-parse.c (fparse_membership_2): Added parsning of
added_at.
* src/server/ram-output.c (foutput_membership_2): Added output of
added_at.
Fri Jan 16 22:51:52 1998 David Byers <davby@litefix.ida.liu.se>
* src/include/kom-types.h (Aux_item_flags): Added dont_garb.
* src/server/text-garb.c (garb_text): Check dont_garb aux-item
flag.
Mon Sep 22 19:06:05 1997 David Byers <davby@litefix.ida.liu.se>
* src/server/cache-node.h: New flags: snapshot and synced.
......
#! /bin/sh
# From configure.in Revision: 1.41
# From configure.in Revision: 1.42
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.12
......
No preview for this file type
This diff is collapsed.
.\" $Id: lyskomd.8,v 1.25 1997/09/13 15:31:34 byers Exp $
.\" $Id: lyskomd.8,v 1.26 1998/06/14 14:50:23 byers Exp $
.\" Copyright (C) 1991, 1994 Lysator Academic Computer Association.
.\"
.\" This file is part of the LysKOM server.
......@@ -21,8 +21,8 @@
.\"
.\" Please mail bug reports to bug-lyskom@lysator.liu.se.
.\"
.\" $Id: lyskomd.8,v 1.25 1997/09/13 15:31:34 byers Exp $
.\" $Date: 1997/09/13 15:31:34 $
.\" $Id: lyskomd.8,v 1.26 1998/06/14 14:50:23 byers Exp $
.\" $Date: 1998/06/14 14:50:23 $
.TH lyskomd 8 "January 12, 1994" "Lysator"
.SH NAME
lyskomd - LysKOM server
......@@ -402,6 +402,23 @@ is not allowed to create any text number
.I T
which meets the condition
.I T \% divident == remainder
.TP
.B Add members by invitation: bool
If this is set, then adding others as members to a conference sets the
invitation bit of the membership. If this is off, the membership bit is
set to whatever the caller specifies. The default is to set this.
.TP
.B Allow secret memberships: bool
If this is set, then memberships may be secret. Otherwise any attempt
to create a secret membership or change an existing membership to a
secret membership will fail. This is set by default.
.TP
.B allow reinvitations: bool
If this is set, then it is possible to set the invitation bit of a
membership even after it has been cleared. If it is not set, then the
invitation bit of a conference type can only be set when the
membership is created. It can be cleared at any time. This is off by
default.
.SH SIGNALS
There are some signals that have a special meaning to the LysKOM
server.
......
#
# $Id: aux-items.conf,v 1.2 1997/10/23 12:40:41 byers Exp $
# $Id: aux-items.conf,v 1.3 1998/06/14 14:50:24 byers Exp $
# Copyright (C) 1994, 1995, 1996 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
......@@ -39,6 +39,7 @@
unique = true;
secret = false;
hide-creator = false;
dont-garb = false;
inherit = false;
inherit-limit = 1;
validate = "^.*/.*$";
......@@ -53,6 +54,7 @@
{
secret = false;
hide-creator = false;
dont-garb = false;
inherit = false;
inherit-limit = 1;
}
......@@ -64,6 +66,7 @@
3 : cross-reference (text, conference)
{
dont-garb = false;
inherit = false;
inherit-limit = 1;
validate = "^[CTP][0-9]+";
......@@ -79,6 +82,7 @@
secret = false;
hide-creator = false;
author-only = true;
dont-garb = false;
inherit = false;
inherit-limit = 1;
}
......@@ -93,6 +97,7 @@
secret = false;
hide-creator = false;
author-only = true;
dont-garb = false;
inherit = false;
inherit-limit = 1;
}
......@@ -106,6 +111,7 @@
{
secret = false;
unique = true;
dont-garb = false;
inherit = false;
inherit-limit = 1;
}
......@@ -119,6 +125,7 @@
{
secret = false;
hide-creator = false;
dont-garb = false;
inherit = false;
inherit-limit = 1;
permanent = true;
......@@ -131,6 +138,7 @@
8 : redirect (conference)
{
dont-garb = false;
supervisor-only = true;
validate = "^(LysKOM|E-mail):";
}
......@@ -145,6 +153,7 @@
secret = false;
hide-creator = false;
supervisor-only = true;
dont-garb = false;
inherit = false;
inherit-limit = 1;
}
......@@ -156,6 +165,7 @@
10 : alternate-name (text, conference)
{
dont-garb = false;
inherit = false;
}
......@@ -168,6 +178,7 @@
{
permanent = true;
hide-creator = false;
dont-garb = false;
inherit = false;
inherit-limit = 1;
}
......@@ -181,6 +192,7 @@
{
author-only = true;
hide-creator = false;
dont-garb = false;
inherit = false;
inherit-limit = 1;
}
......@@ -194,6 +206,25 @@
{
author-only = true;
hide-creator = false;
dont-garb = false;
inherit = false;
inherit-limit = 1;
}
#
# FAQ in Text
#
14 : faq-text (conference, server)
{
author-only = true;
hide-creator = false;
secret = false;
dont-garb = false;
inherit = false;
inherit-limit = 1;
add-trigger = mark-text();
delete-trigger = unmark-text();
undelete-trigger= mark-text();
}
/*
* $Id: kom-errno.h,v 0.14 1997/09/13 15:31:39 byers Exp $
* $Id: kom-errno.h,v 0.15 1998/06/14 14:50:25 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -91,6 +91,7 @@ typedef enum
KOM_INTERNAL_ERROR = 51, /* Internal server error */
KOM_FEATURE_DISABLED = 52, /* Server feature is disabled */
KOM_MESSAGE_NOT_SENT = 53, /* Message not sent (no recipient found) */
KOM_INVALID_MEMBERSHIP_TYPE = 54, /* Invalid membership type */
KOM_num_errs /* End marker */
} Kom_err;
......
/*
* $Id: kom-types.h,v 0.24 1997/09/13 15:31:40 byers Exp $
* $Id: kom-types.h,v 0.25 1998/06/14 14:50:27 byers Exp $
* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -224,7 +224,7 @@ typedef struct {
unsigned int inherit : 1; /* Copy to comments */
unsigned int secret : 1; /* Don't show anyone */
unsigned int hide_creator : 1; /* Don't show the creator */
unsigned int reserved2 : 1;
unsigned int dont_garb : 1; /* Don't garb object */
unsigned int reserved3 : 1;
unsigned int reserved4 : 1;
unsigned int reserved5 : 1;
......@@ -290,7 +290,22 @@ typedef struct {
typedef struct {
Pers_no member;
Bool invitation : 1;
Bool passive : 1;
Bool secret : 1;
Bool reserved1 : 1;
Bool reserved2 : 1;
Bool reserved3 : 1;
Bool reserved4 : 1;
Bool reserved5 : 1;
} Membership_type;
typedef struct {
Pers_no member;
Pers_no added_by;
Time added_at;
Membership_type type;
} Member;
......@@ -304,6 +319,7 @@ typedef struct {
/* Information about a person's membership in a conference */
typedef struct {
Conf_no conf_no;
unsigned char priority; /* Interrupt priority */
......@@ -314,6 +330,9 @@ typedef struct {
unsigned short no_of_read;
Local_text_no * read_texts; /* Texts after last_text_read. Sorted
in ascending order */
Pers_no added_by;
Time added_at;
Membership_type type;
} Membership;
......
/*
* $Id: services.h,v 0.32 1997/09/13 15:31:41 byers Exp $
* $Id: services.h,v 0.33 1998/06/14 14:50:28 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -173,6 +173,13 @@ KOM_( get_created_texts (Pers_no person,
unsigned long no_of_texts,
Text_list * created_texts ));
extern Success
KOM_( get_membership_old (Pers_no person,
unsigned short first,
unsigned short no_of_confs,
Bool want_read_texts,
Membership_list * memberships ));
extern Success
KOM_( get_membership (Pers_no person,
unsigned short first,
......@@ -180,8 +187,6 @@ KOM_( get_membership (Pers_no person,
Bool want_read_texts,
Membership_list * memberships ));
extern Success
KOM_( set_priv_bits (Pers_no person,
Priv_bits privileges ));
......@@ -197,6 +202,11 @@ KOM_( set_passwd (Pers_no person,
/* You can query for unread texts without logging in. */
extern Success
KOM_( query_read_texts_old (Pers_no pers_no,
Conf_no conf_no,
Membership * result ));
extern Success
KOM_( query_read_texts (Pers_no pers_no,
Conf_no conf_no,
......@@ -306,7 +316,14 @@ extern Success
KOM_( get_members (Conf_no conf,
unsigned short first,
unsigned short no_of_members,
Member_list * members ));
Member_list * members
));
extern Success
KOM_( get_members_old (Conf_no conf,
unsigned short first,
unsigned short no_of_members,
Member_list * members ));
......@@ -315,7 +332,19 @@ extern Success
KOM_( add_member (Conf_no conf_no,
Pers_no pers_no,
unsigned char priority,
unsigned short where )); /* Range of where is [0..] */
unsigned short where, /* Range of where is [0..] */
Membership_type * type ));
extern Success
KOM_( add_member_old (Conf_no conf_no,
Pers_no pers_no,
unsigned char priority,
unsigned short where )); /* Range of where is [0..] */
extern Success
KOM_( set_membership_type (Pers_no pers_no,
Conf_no conf_no,
Membership_type *type ));
extern Success
......
......@@ -161,7 +161,7 @@ fnc-def-init.incl: fnc-def-init.awk fncdef-no-str-limit.txt
> fnc-def-init.incl
aux-item-def.tab.c: aux-item-def.y
$(BISON) -d -p aux_item_def -o aux-item-def.tab.c aux-item-def.y
$(BISON) -d -p aux_item_def_ -o aux-item-def.tab.c aux-item-def.y
aux-item-def.lex.c: aux-item-def.l
$(FLEX) -oaux-item-def.lex.c aux-item-def.l
......
#
# $Id: Makefile.src,v 1.30 1997/09/13 15:31:45 byers Exp $
# $Id: Makefile.src,v 1.31 1998/06/14 14:50:31 byers Exp $
# Copyright (C) 1991, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
......@@ -114,7 +114,7 @@ fnc-def-init.incl: fnc-def-init.awk fncdef-no-str-limit.txt
> fnc-def-init.incl
aux-item-def.tab.c: aux-item-def.y
$(BISON) -d -p aux_item_def -o aux-item-def.tab.c aux-item-def.y
$(BISON) -d -p aux_item_def_ -o aux-item-def.tab.c aux-item-def.y
aux-item-def.lex.c: aux-item-def.l
$(FLEX) -oaux-item-def.lex.c aux-item-def.l
......
dbck: Fixa s} att membership-list och member-list st{mmer |verens.
-----------------
Borde ha en skedjuler f|r sync&garb. Sync&garb borde returnera antalet
millisekunder tills de skall bli anropade igen. Det minsta av dessa
v{rden borde vara timeout till isc_getnextevent.
......
/*
* $Id: admin.c,v 0.24 1997/09/13 15:31:47 byers Exp $
* $Id: admin.c,v 0.25 1998/06/14 14:50:34 byers Exp $
* Copyright (C) 1991, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* Administrative calls.
*/
static char *rcsid = "$Id: admin.c,v 0.24 1997/09/13 15:31:47 byers Exp $";
static char *rcsid = "$Id: admin.c,v 0.25 1998/06/14 14:50:34 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -268,6 +268,9 @@ send_message (Conf_no recipient,
retval = FAILURE;
for (ix = 0; ix < end; ix++)
{
if (conf_c->members.members[ix].type.passive)
continue;
if (async_send_group_message(conf_c->members.members[ix].member,
recipient,
ACTPERS,
......@@ -352,11 +355,16 @@ modify_server_info(Number_list *items_to_delete,
if (check_delete_aux_item_list(items_to_delete,
&kom_info.aux_item_list)!=OK)
return FAILURE;
delete_aux_item_list(items_to_delete, &kom_info.aux_item_list);
delete_aux_item_list(items_to_delete,
&kom_info.aux_item_list,
OTHER_OBJECT_TYPE,
0, NULL);
if (system_check_add_aux_item_list(&kom_info, items_to_add, ACTPERS) != OK)
{
undelete_aux_item_list(items_to_delete, &kom_info.aux_item_list);
undelete_aux_item_list(items_to_delete, &kom_info.aux_item_list,
OTHER_OBJECT_TYPE,
0, NULL);
return FAILURE;
}
......
%{
/*
* $Id: aux-item-def.l,v 1.1 1997/09/13 15:31:48 byers Exp $
* $Id: aux-item-def.l,v 1.2 1998/06/14 14:50:35 byers Exp $
* Copyright (C) 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -87,7 +87,16 @@ letterbox {
}
server {
yylloc.first_line = yylineno;
RETURN SERVER;
RETURN TOK_SERVER;
}
create {
yylloc.first_line = yylineno;
RETURN CREATE;
}
modify {
yylloc.first_line = yylineno;
RETURN MODIFY;
}
......@@ -97,6 +106,7 @@ server {
[[:alpha:]][\-[:alnum:]_]* {
char *s = yytext;
do { *s=tolower(*s); } while(*(++s));
yylval.str = EMPTY_STRING;
s_crea_str(&yylval.str, yytext);
yylloc.first_line = yylineno;
RETURN ID;
......
This diff is collapsed.
This diff is collapsed.
......@@ -37,8 +37,10 @@ typedef
#define TEXT 263
#define CONFERENCE 264
#define LETTERBOX 265
#define SERVER 266
#define TOK_SERVER 266
#define VOID 267
#define CREATE 268
#define MODIFY 269
extern YYSTYPE aux_item_def_lval;
%{
/*
* $Id: aux-item-def.y,v 1.1 1997/09/13 15:31:53 byers Exp $
* $Id: aux-item-def.y,v 1.2 1998/06/14 14:50:41 byers Exp $
* Copyright (C) 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -41,7 +41,14 @@
#include "kom-types.h"
#include "aux-items.h"
#include "s-string.h"
#include "server/smalloc.h"
#include "lyskomd.h"
#include "debug.h"
#include "log.h"
BUGDECL;
#define YYDEBUG 1
static Aux_item_definition def;
static Bool errorFlag = FALSE;
......@@ -91,6 +98,12 @@ static int aux_item_def_check_assign(char *,
struct aux_item_def_value_type *,
int);
static char *aux_item_def_typename(int);
short aux_item_def_check_trigger(char *check_name,
int type,
String trigger_name,
String function_name,
unsigned long *counter,
Aux_item_trigger **triggers);
#define YYERROR_VERBOSE
......@@ -113,9 +126,11 @@ static char *aux_item_def_typename(int);
%token <num> NUMBER BOOLEAN
%token <str> ID STRING
%token DISABLED TEXT CONFERENCE LETTERBOX SERVER VOID
%token DISABLED TEXT CONFERENCE LETTERBOX TOK_SERVER
%token VOID CREATE MODIFY
%type <value> value
%type <num> action
%%
......@@ -134,6 +149,11 @@ head : NUMBER ':' ID '(' targets ')'
{
def.tag = $1;
def.name = s_crea_c_str($3);
if (buglevel)
{
log("Parsing definition of aux-iem %ld (%s)\n",
def.tag, def.name);
}
s_clear(&($3));
$3 = EMPTY_STRING;
yylval.str = EMPTY_STRING;
......@@ -152,12 +172,17 @@ targets : targets ',' target
| target
;
target : TEXT { def.texts = TRUE; }
| CONFERENCE { def.confs = TRUE; }
| LETTERBOX { def.letterboxes = TRUE; }
| SERVER { def.system = TRUE; }
target : action TEXT { def.texts = TRUE; def.text_a = $1; }
| action CONFERENCE { def.confs = TRUE; def.conf_a = $1; }
| action LETTERBOX { def.letterboxes = TRUE;
def.conf_a = $1; }
| TOK_SERVER { def.system = TRUE; }
;
action : action CREATE { $$ = $1 | AUX_ITEM_ADD_ON_CREATE; }
| action MODIFY { $$ = $1 | AUX_ITEM_ADD_ON_MODIFY; }
| /* Empty */ { $$ = 0; }
body : body assign
| body error
| /* Empty */
......@@ -168,7 +193,7 @@ assign : ID '=' value ';'
int found = 0;
CHK_ASSIGN("author-only", author_only, BOOLEAN,
$1, $3,@3.first_line);
$1, $3, @3.first_line);
CHK_ASSIGN("supervisor-only", supervisor_only,
BOOLEAN, $1, $3, @3.first_line);
CHK_ASSIGN("inherit-limit", inherit_limit, NUMBER,
......@@ -183,10 +208,63 @@ assign : ID '=' value ';'
CHK_FLAG_A("secret", secret, $1, $3, @3.first_line);
CHK_FLAG_A("hide-creator", hide_creator,
$1, $3, @3.first_line);
CHK_FLAG_A("reserved-1", reserved2, $1, $3, @3.first_line);
CHK_FLAG_A("dont-garb", dont_garb, $1, $3, @3.first_line);
CHK_FLAG_A("reserved-2", reserved3, $1, $3, @3.first_line);
CHK_FLAG_A("reserved-3", reserved4, $1, $3, @3.first_line);
CHK_FLAG_A("reserved-4", reserved5, $1, $3, @3.first_line);
if (s_strcmp(s_fcrea_str("add-trigger"), $1) == 0)
{
found = 1;
if ($3.type != ID)
{
yyerror("invalid type: expected %s, got %s", \
aux_item_def_typename(BOOLEAN), \
aux_item_def_typename(ID)); \
found = 0;
}
}
if (s_strcmp(s_fcrea_str("delete-trigger"), $1) == 0)
{
found = 1;
if ($3.type != ID)
{
yyerror("invalid type: expected %s, got %s", \
aux_item_def_typename(BOOLEAN), \
aux_item_def_typename(ID)); \
found = 0;
}
}
found = found ? 1 :
aux_item_def_check_trigger("delete-trigger",
$3.type,
$1,
$3.val.str,
&def.num_delete_triggers,
&def.delete_triggers);
found = found ? 1 :
aux_item_def_check_trigger("undelete-trigger",
$3.type,
$1,
$3.val.str,
&def.num_undelete_triggers,
&def.undelete_triggers);
found = found ? 1 :
aux_item_def_check_trigger("add-trigger",
$3.type,
$1,
$3.val.str,
&def.num_add_triggers,
&def.add_triggers);
if (found == 0)
{
char *tmp;
......@@ -212,6 +290,7 @@ assign : ID '=' value ';'
value : BOOLEAN { $$.val.num = $1; $$.type = BOOLEAN; }
| STRING { $$.val.str = $1; $$.type = STRING; }
| NUMBER { $$.val.num = $1; $$.type = NUMBER; }
| ID '(' ')' { $$.val.str = $1; $$.type = ID;}
| VOID { YYERROR; }
;
......@@ -251,6 +330,7 @@ static char *aux_item_def_typename(int type)
case STRING: return "string";
case NUMBER: return "number";
case BOOLEAN: return "boolean";
case ID: return "identifier";
default:
return "unknown";
}
......@@ -298,6 +378,51 @@ static int aux_item_def_check_assign(char *id,
}
}
short aux_item_def_check_trigger(char *check_name,
int type,
String trigger_name,
String function_name,
unsigned long *counter,
Aux_item_trigger **triggers)
{
Aux_item_trigger trigger;
char *tmp_string;