X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fuser_ops.h;h=040932c1df29d33c5b196ead00d5ab9c900cd784;hb=bdfa2e9b6af7e32b11461433a28dd6551f830888;hp=697554f13ffa61e1fcaa025965ffdd8b0d64dd3e;hpb=c750a06a241dc2737fa68c24b340a1bd82894f74;p=citadel.git diff --git a/citadel/user_ops.h b/citadel/user_ops.h index 697554f13..040932c1d 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-2019 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__ @@ -55,42 +69,8 @@ void start_chkpwd_daemon(void); int rename_user(char *oldname, char *newname); -///#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); - 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); - len = USERNAME_SIZE - 1; - } - for (i=0; i<=len; ++i) { - key[i] = tolower(username[i]); - } -} - - +long cutusername(char *username); +void makeuserkey(char *key, const char *username, long len); int internal_create_user(char *username, struct ctdluser *usbuf, uid_t uid); #endif