Commit 875d00a3 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(create_person): Set change_name according to param.default_change_name.

Check param.anyone_can_create_new_persons and create_pers.
parent 7d83e3f0
/* /*
* $Id: person.c,v 0.28 1994/04/05 08:02:56 ceder Exp $ * $Id: person.c,v 0.29 1994/06/18 20:35:55 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994 Lysator Academic Computer Association. * Copyright (C) 1991, 1992, 1993, 1994 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
* All atomic calls that deals with persons. * All atomic calls that deals with persons.
*/ */
static char *rcsid = "$Id: person.c,v 0.28 1994/04/05 08:02:56 ceder Exp $"; static char *rcsid = "$Id: person.c,v 0.29 1994/06/18 20:35:55 ceder Exp $";
#include "rcs.h" #include "rcs.h"
USE(rcsid); USE(rcsid);
...@@ -489,9 +489,10 @@ unmark_text(Text_no text_no) ...@@ -489,9 +489,10 @@ unmark_text(Text_no text_no)
/* /*
* Create a new person. * Create a new person.
* *
* If CREATE_PERSON_BEFORE_LOGIN (#define'd in config.h) is true * If parameter ``Anyone can create new persons'' is true
* anyone can create themself. Otherwise you must be logged in to * anyone can create themself. Otherwise you must be logged in to
* create a new person. * create a new person, and you must have the ``create_pers'' bit
* set, or ``Anyone can create_new_persons'' must be set.
* *
* If you are not logged in an auto-login as the created person is * If you are not logged in an auto-login as the created person is
* performed. (This is so that it is impossible to create a million * performed. (This is so that it is impossible to create a million
...@@ -501,8 +502,9 @@ unmark_text(Text_no text_no) ...@@ -501,8 +502,9 @@ unmark_text(Text_no text_no)
* If you are logged in you will be supervisor and creator of the new * If you are logged in you will be supervisor and creator of the new
* person, otherwise the new person will be supervisor and creator. * person, otherwise the new person will be supervisor and creator.
* *
* The new person will be rd_prot, but not secret. His privileges will * The new person will be rd_prot, but not secret. He will have no
* be as defined in DEFAULT_PRIV_BITS in kom-types.c. * privileges, except maybe change_name (if ``Default change name
* capability'' is true).
* *
* This function returns the Pers_no of the new person, or 0 if an error * This function returns the Pers_no of the new person, or 0 if an error
* occured. (0 is an illegal Pers_no). * occured. (0 is an illegal Pers_no).
...@@ -516,10 +518,22 @@ create_person (String name, ...@@ -516,10 +518,22 @@ create_person (String name,
Person * pers_p; Person * pers_p;
if (!param.create_person_before_login && ACTPERS == 0 ) if (ACTPERS == 0)
{ {
kom_errno = KOM_LOGIN; if (!param.create_person_before_login && ACTPERS == 0 )
return 0; {
kom_errno = KOM_LOGIN;
return 0;
}
}
else
{
if (param.anyone_can_create_new_persons == FALSE
&& !ENA(create_pers, 0) )
{
kom_errno = KOM_PERM;
return 0;
}
} }
#if 0 #if 0
...@@ -593,6 +607,8 @@ create_person (String name, ...@@ -593,6 +607,8 @@ create_person (String name,
if ( do_set_passwd( pers_p->pwd, passwd) != OK ) if ( do_set_passwd( pers_p->pwd, passwd) != OK )
restart_kom("create_person(): can't set passwd\n"); restart_kom("create_person(): can't set passwd\n");
pers_p->privileges.change_name = param.default_change_name;
mark_person_as_changed( new_user ); mark_person_as_changed( new_user );
do_add_member( new_user, mailbox, new_user, pers_p, UCHAR_MAX, 0 ); do_add_member( new_user, mailbox, new_user, pers_p, UCHAR_MAX, 0 );
......
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