X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fuser_ops.h;h=02bcf394babce2299a15790a1cae4eef042ff9a2;hb=03b525bdbd5fa51c1b5a56c5fdecfdb8200cb046;hp=146a0eed5b68d66eb99478954e6f4f0c8aaf6a9c;hpb=92b1da07f5a90221fdf7f2adfb2258c9c2cdc7a1;p=citadel.git diff --git a/citadel/user_ops.h b/citadel/user_ops.h index 146a0eed5..02bcf394b 100644 --- a/citadel/user_ops.h +++ b/citadel/user_ops.h @@ -12,6 +12,7 @@ void rebuild_usersbynumber(void); void session_startup (void); void logged_in_response(void); int purge_user (char *pname); +int getuserbyuid(struct ctdluser *usbuf, uid_t number); int create_user(char *newusername, int become_user, uid_t uid); enum { @@ -22,8 +23,7 @@ enum { void do_login(void); int CtdlInvtKick(char *iuser, int op); -void ForEachUser(void (*CallBack)(struct ctdluser *EachUser, void *out_data), - void *in_data); +void ForEachUser(void (*CallBack)(struct ctdluser *EachUser, void *out_data), void *in_data); void ListThisUser(struct ctdluser *usbuf, void *data); int NewMailCount(void); int InitialMailCheck(void); @@ -55,44 +55,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); - 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]); - } -} - - +long cutuserkey(char *username); +void makeuserkey(char *key, const char *username, long len); int internal_create_user(char *username, struct ctdluser *usbuf, uid_t uid); #endif