Commit 948a2f08 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(async_new_text): Don't send any message unless username_valid is set.

(async_i_am_on): Likewise.
(async_logout): Likewise.
(async_new_name): Likewise.
(async_sync_db): Likewise.
(async_forced_leave_conf): Likewise.
(async_login): Likewise.
(async_rejected_connection): Likewise.
(async_send_group_message): Likewise.
parent 6a62f2ae
/*
* $Id: send-async.c,v 0.17 1996/07/28 12:46:31 ceder Exp $
* $Id: send-async.c,v 0.18 1996/07/28 15:17:05 ceder Exp $
* Copyright (C) 1991, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* Written by Per Cederqvist 1990-07-22--23
*/
static char *rcsid = "$Id: send-async.c,v 0.17 1996/07/28 12:46:31 ceder Exp $";
static char *rcsid = "$Id: send-async.c,v 0.18 1996/07/28 15:17:05 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -69,7 +69,8 @@ async_new_text(struct connection *cptr,
case 0:
break;
case 'A':
prot_a_async_new_text(cptr, text_no, text_s);
if (cptr->username_valid == TRUE)
prot_a_async_new_text(cptr, text_no, text_s);
break;
default:
restart_kom("async_new_text(): bad protocol.\n");
......@@ -98,7 +99,8 @@ async_i_am_on(Who_info info)
case 0: /* Not yet logged on. */
break;
case 'A':
prot_a_async_i_am_on(cptr, info);
if (cptr->username_valid == TRUE)
prot_a_async_i_am_on(cptr, info);
break;
default:
restart_kom("async_i_am_on(): bad protocol.\n");
......@@ -132,7 +134,8 @@ async_logout(Pers_no pers_no,
case 0:
break;
case 'A':
prot_a_async_logout(cptr, pers_no, session_no);
if (cptr->username_valid == TRUE)
prot_a_async_logout(cptr, pers_no, session_no);
break;
default:
restart_kom("async_logout(): bad protocol.\n");
......@@ -169,9 +172,10 @@ async_new_name(Conf_no conf_no,
case 0:
break;
case 'A':
/* Should check that cptr has enough privileges to know
anything about the conference. +++ */
if (fast_access_perm(conf_no,
/* Check that cptr has enough privileges to know
anything about the conference. */
if (cptr->username_valid == TRUE &&
fast_access_perm(conf_no,
cptr->pers_no,
cptr->person) > none)
{
......@@ -218,7 +222,8 @@ async_sync_db(void)
case 0:
break;
case 'A':
prot_a_async_sync_db(cptr);
if (cptr->username_valid == TRUE)
prot_a_async_sync_db(cptr);
break;
default:
restart_kom("async_sync_db(): bad protocol.\n");
......@@ -240,7 +245,8 @@ async_forced_leave_conf (struct connection *cptr,
case 0:
break;
case 'A':
prot_a_async_forced_leave_conf(cptr, conf_no);
if (cptr->username_valid == TRUE)
prot_a_async_forced_leave_conf(cptr, conf_no);
break;
default:
restart_kom("async_forced_leave_conf(): bad protocol.\n");
......@@ -273,7 +279,8 @@ async_login(Pers_no pers_no,
case 0:
break;
case 'A':
prot_a_async_login(cptr, pers_no, client_no);
if (cptr->username_valid == TRUE)
prot_a_async_login(cptr, pers_no, client_no);
break;
default:
......@@ -315,7 +322,8 @@ async_rejected_connection(void)
case 0:
break;
case 'A':
prot_a_async_rejected_connection(cptr);
if (cptr->username_valid == TRUE)
prot_a_async_rejected_connection(cptr);
break;
default:
......@@ -372,8 +380,9 @@ async_send_group_message(Pers_no recipient,
case 0:
break;
case 'A':
if ( recipient == 0 ||
(recipient == cptr->pers_no && recipient != 0 ))
if ((recipient == 0 ||
(recipient == cptr->pers_no && recipient != 0 ))
&& cptr->username_valid == TRUE)
{
if (force_message)
{
......
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