This is an omnibus commit which moves the Citadel Server from crusty old GNU Autotool...
[citadel.git] / citadel / server / user_ops.h
1 // Header file for server functions which perform operations on user objects.
2 //
3 // Copyright (c) 1987-2022 by the citadel.org team
4 //
5 // This program is open source software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License, version 3.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 // GNU General Public License for more details.
12
13 #ifndef __USER_OPS_H__
14 #define __USER_OPS_H__
15
16 #include <ctype.h>
17 #include <syslog.h>
18
19 int hash (char *str);
20 int is_aide (void);
21 int is_room_aide (void);
22 int CtdlCheckInternetMailPermission(struct ctdluser *who);
23 void rebuild_usersbynumber(void);
24 void session_startup (void);
25 void logged_in_response(void);
26 int purge_user (char *pname);
27 int getuserbyuid(struct ctdluser *usbuf, uid_t number);
28
29 int create_user(char *newusername, int become_user, uid_t uid);
30 enum {
31         CREATE_USER_DO_NOT_BECOME_USER,
32         CREATE_USER_BECOME_USER
33 };
34 #define NATIVE_AUTH_UID (-1)
35
36 void do_login(void);
37 int CtdlInvtKick(char *iuser, int op);
38 void ForEachUser(void (*CallBack) (char *, void *out_data), void *in_data);
39 int NewMailCount(void);
40 int InitialMailCheck(void);
41 void put_visit(visit *newvisit);
42 int GenerateRelationshipIndex(char *IndexBuf, long RoomID, long RoomGen, long UserID);
43 int CtdlAssociateSystemUser(char *screenname, char *loginname);
44
45 void CtdlSetPassword(char *new_pw);
46
47 int CtdlForgetThisRoom(void);
48
49 void cmd_newu (char *cmdbuf);
50 void start_chkpwd_daemon(void);
51
52
53 #define RENAMEUSER_OK                   0       // Operation succeeded
54 #define RENAMEUSER_LOGGED_IN            1       // Cannot rename a user who is currently logged in
55 #define RENAMEUSER_NOT_FOUND            2       // The old user name does not exist
56 #define RENAMEUSER_ALREADY_EXISTS       3       // An account with the desired new name already exists
57
58 int rename_user(char *oldname, char *newname);
59 void reindex_user_928(char *username, void *out_data);
60
61 void makeuserkey(char *key, const char *username);
62 int CtdlUserCmp(char *s1, char *s2);
63 int internal_create_user(char *username, struct ctdluser *usbuf, uid_t uid);
64
65 #endif