Commit 7e542b42 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(map_created_texts_reverse): New request.

parent 6b77ea96
/*
* $Id: person.c,v 0.83 2003/08/20 08:26:06 ceder Exp $
* $Id: person.c,v 0.84 2003/08/22 06:45:02 ceder Exp $
* Copyright (C) 1991-1999, 2001-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -930,6 +930,54 @@ map_created_texts(Pers_no pers_no,
}
extern Success
map_created_texts_reverse(Pers_no pers_no,
Local_text_no local_no_ceiling,
unsigned long no_of_texts,
Text_mapping_reverse *result)
{
Person *pers_p;
enum access acc;
Local_text_no ceiling;
CHK_CONNECTION(FAILURE);
if (no_of_texts > 255)
{
err_stat = 255;
kom_errno = KOM_LONG_ARRAY;
return FAILURE;
}
GET_P_STAT(pers_p, pers_no, FAILURE);
CHK_CONNECTION(FAILURE);
CHK_LOGIN(FAILURE);
acc = access_perm(pers_no, active_connection, read_protected);
if (acc == error)
return FAILURE;
if (acc <= none)
{
err_stat = pers_no;
kom_errno = KOM_UNDEF_PERS;
return FAILURE;
}
ceiling = l2g_first_appendable_key(&pers_p->created_texts);
if (local_no_ceiling == 0 || local_no_ceiling > ceiling)
result->ceiling = ceiling;
else
result->ceiling = local_no_ceiling;
result->no_of_texts = no_of_texts;
result->l2g = &pers_p->created_texts;
return OK;
}
/*
* Set privilege bits of a person. You must have the wheel bit set
......
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