Commit c8fa3071 authored by Per Cederqvist's avatar Per Cederqvist

(person_text_read_access): Give everybody read access to texts with a

	world-readable aux-item.
parent 5b13507a
/*
* $Id: text.c,v 0.94 2002/03/29 22:29:40 ceder Exp $
* $Id: text.c,v 0.95 2002/04/07 11:22:28 ceder Exp $
* Copyright (C) 1991-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -41,6 +41,7 @@
#include <sys/types.h>
#include <sys/types.h>
#include "aux.h"
#include "server/smalloc.h"
#include "s-string.h"
#include "misc-types.h"
......@@ -1259,7 +1260,26 @@ person_text_read_access(Text_no text_no,
if (text_no == kom_info.motd_of_lyskom)
return TRUE;
/* Users who are not logged in may not read anything else */
if (text_stat == NULL
&& (text_stat = cached_get_text_stat(text_no)) == NULL)
{
if (!pers_no)
{
/* If you are not logged in, you are not allowed to know
if the text exists or not. */
err_stat = 0;
kom_errno = KOM_LOGIN;
}
return FALSE;
}
/* Check for world-readable aux item. */
for (i = 0; i < text_stat->aux_item_list.length; i++)
if (text_stat->aux_item_list.items[i].tag == aux_world_readable)
return TRUE;
/* Users who are not logged in may not read anything else. */
if (!pers_no)
{
......@@ -1268,16 +1288,12 @@ person_text_read_access(Text_no text_no,
return FALSE;
}
if (text_stat == NULL)
GET_T_STAT(text_stat, text_no, FALSE);
/* Some bits let you read everything */
/* Some bits let you read everything. */
if (active_connection && pers_no == ACTPERS && ENA(wheel, 10))
return TRUE;
/* Additional checks on CWC if pers_no is ACTPERS */
/* Additional checks on CWC if pers_no is ACTPERS. */
if (active_connection && pers_no == ACTPERS)
{
......
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