Commit 7887b9cf authored by David Byers's avatar David Byers
Browse files

(set_info): New function.

(sync_kom): Checks that the calling session is logged in and an
administrator unless the configuration file has
permissive_sync on.
parent 2c59f0d5
/*
* $Id: admin.c,v 0.18 1995/01/01 19:31:42 ceder Exp $
* $Id: admin.c,v 0.19 1996/06/09 13:54:07 byers Exp $
* Copyright (C) 1991, 1993, 1994, 1995 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.18 1995/01/01 19:31:42 ceder Exp $";
static char *rcsid = "$Id: admin.c,v 0.19 1996/06/09 13:54:07 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -95,6 +95,40 @@ get_version_info( Version_info *result )
return OK;
}
/* /// */
extern Success
set_info(Info *info)
{
Conference *conf;
Text_stat *text;
Success tmp;
CHK_LOGIN(FAILURE);
if ( !ENA(admin, 1) )
{
kom_errno = KOM_PERM;
return FAILURE;
}
/* Check that everything mentioned exists */
GET_T_STAT(text, info->motd_of_lyskom, FAILURE);
GET_C_STAT(conf, info->conf_pres_conf, FAILURE);
GET_C_STAT(conf, info->pers_pres_conf, FAILURE);
GET_C_STAT(conf, info->motd_conf, FAILURE);
GET_C_STAT(conf, info->kom_news_conf, FAILURE);
if ((tmp = set_motd_of_lyskom(info->motd_of_lyskom)) != OK)
return tmp;
kom_info.conf_pres_conf = info->conf_pres_conf;
kom_info.pers_pres_conf = info->pers_pres_conf;
kom_info.motd_conf = info->motd_conf;
kom_info.kom_news_conf = info->kom_news_conf;
return OK;
}
/* /// */
extern Success
set_motd_of_lyskom (Text_no motd)
......@@ -221,6 +255,16 @@ send_message (Conf_no recipient,
extern Success
sync_kom (void)
{
if (!param.permissive_sync)
{
CHK_LOGIN(FAILURE);
if ( !ENA(admin, 1) )
{
kom_errno = KOM_PERM;
return FAILURE;
}
}
cache_sync_all();
dump_statistics();
return OK;
......
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