2 * Header file for server functions which perform operations on user objects.
4 * Copyright (c) 1987-2019 by the citadel.org team
6 * This program is open source software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License, version 3.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #ifndef __USER_OPS_H__
16 #define __USER_OPS_H__
23 int is_room_aide (void);
24 int CtdlCheckInternetMailPermission(struct ctdluser *who);
25 void rebuild_usersbynumber(void);
26 void session_startup (void);
27 void logged_in_response(void);
28 int purge_user (char *pname);
29 int getuserbyuid(struct ctdluser *usbuf, uid_t number);
31 int create_user(char *newusername, int become_user, uid_t uid);
33 CREATE_USER_DO_NOT_BECOME_USER,
34 CREATE_USER_BECOME_USER
36 #define NATIVE_AUTH_UID (-1)
39 int CtdlInvtKick(char *iuser, int op);
40 void ForEachUser(void (*CallBack) (char *, void *out_data), void *in_data);
41 int NewMailCount(void);
42 int InitialMailCheck(void);
43 void put_visit(visit *newvisit);
44 /* MailboxName is deprecated us CtdlMailboxName instead */
45 void MailboxName(char *buf, size_t n, const struct ctdluser *who,
46 const char *prefix) __attribute__ ((deprecated));
47 int GenerateRelationshipIndex( char *IndexBuf,
51 int CtdlAssociateSystemUser(char *screenname, char *loginname);
56 void CtdlSetPassword(char *new_pw);
58 int CtdlForgetThisRoom(void);
60 void cmd_newu (char *cmdbuf);
61 void start_chkpwd_daemon(void);
64 #define RENAMEUSER_OK 0 /* Operation succeeded */
65 #define RENAMEUSER_LOGGED_IN 1 /* Cannot rename a user who is currently logged in */
66 #define RENAMEUSER_NOT_FOUND 2 /* The old user name does not exist */
67 #define RENAMEUSER_ALREADY_EXISTS 3 /* An account with the desired new name already exists */
69 int rename_user(char *oldname, char *newname);
71 long cutusername(char *username);
72 void makeuserkey(char *key, const char *username, long len);
73 int internal_create_user(char *username, struct ctdluser *usbuf, uid_t uid);