X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fuser_ops.h;h=2a9c41f30ed446581d5c424290c512e50bfcb414;hb=f59e2e6772d87d323d065f09919ec0876bf2e0be;hp=9769754b2380d989e4d3c16abecb11f4841ef1fb;hpb=4fcc6e3ede3207ba80d92ae52443cf53edf175e0;p=citadel.git diff --git a/citadel/user_ops.h b/citadel/user_ops.h index 9769754b2..2a9c41f30 100644 --- a/citadel/user_ops.h +++ b/citadel/user_ops.h @@ -1,3 +1,17 @@ +/* + * Header file for server functions which perform operations on user objects. + * + * Copyright (c) 1987-2020 by the citadel.org team + * + * This program is open source software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + #ifndef __USER_OPS_H__ #define __USER_OPS_H__ @@ -12,12 +26,18 @@ void rebuild_usersbynumber(void); void session_startup (void); void logged_in_response(void); int purge_user (char *pname); -int create_user (const char *newusername, long len, int become_user); +int getuserbyuid(struct ctdluser *usbuf, uid_t number); + +int create_user(char *newusername, int become_user, uid_t uid); +enum { + CREATE_USER_DO_NOT_BECOME_USER, + CREATE_USER_BECOME_USER +}; +#define NATIVE_AUTH_UID (-1) + void do_login(void); int CtdlInvtKick(char *iuser, int op); -void ForEachUser(void (*CallBack)(struct ctdluser *EachUser, void *out_data), - void *in_data); -void ListThisUser(struct ctdluser *usbuf, void *data); +void ForEachUser(void (*CallBack) (char *, void *out_data), void *in_data); int NewMailCount(void); int InitialMailCheck(void); void put_visit(visit *newvisit); @@ -47,45 +67,10 @@ void start_chkpwd_daemon(void); #define RENAMEUSER_ALREADY_EXISTS 3 /* An account with the desired new name already exists */ int rename_user(char *oldname, char *newname); +void reindex_user_928(char *username, void *out_data); -///#ifndef CTDL_INLINE_USR -////#define CTDL_INLINE_USR static INLINE -///#endif - -///CTDL_INLINE_USR -static INLINE long cutuserkey(char *username) { - long len; - len = strlen(username); - if (len >= USERNAME_SIZE) - { - syslog(LOG_INFO, "Username too long: %s", username); - cit_backtrace (); - len = USERNAME_SIZE - 1; - username[len]='\0'; - } - return len; -} - -/* - * makeuserkey() - convert a username into the format used as a database key - * (it's just the username converted into lower case) - */ -///CTDL_INLINE_USR -static INLINE void makeuserkey(char *key, const char *username, long len) { - int i; - - if (len >= USERNAME_SIZE) - { - syslog(LOG_INFO, "Username too long: %s", username); - cit_backtrace (); - len = USERNAME_SIZE - 1; - } - for (i=0; i<=len; ++i) { - key[i] = tolower(username[i]); - } -} - - -int internal_create_user(char *username, long len, struct ctdluser *usbuf, uid_t uid); +void makeuserkey(char *key, const char *username); +int CtdlUserCmp(char *s1, char *s2); +int internal_create_user(char *username, struct ctdluser *usbuf, uid_t uid); #endif