9 int is_room_aide (void);
10 int CtdlCheckInternetMailPermission(struct ctdluser *who);
11 void rebuild_usersbynumber(void);
12 void session_startup (void);
13 void logged_in_response(void);
14 int purge_user (char *pname);
16 int create_user(char *newusername, int become_user, uid_t uid);
18 CREATE_USER_DO_NOT_BECOME_USER,
19 CREATE_USER_BECOME_USER
21 #define NATIVE_AUTH_UID (-1)
24 int CtdlInvtKick(char *iuser, int op);
25 void ForEachUser(void (*CallBack)(struct ctdluser *EachUser, void *out_data),
27 void ListThisUser(struct ctdluser *usbuf, void *data);
28 int NewMailCount(void);
29 int InitialMailCheck(void);
30 void put_visit(visit *newvisit);
31 /* MailboxName is deprecated us CtdlMailboxName instead */
32 void MailboxName(char *buf, size_t n, const struct ctdluser *who,
33 const char *prefix) __attribute__ ((deprecated));
34 int GenerateRelationshipIndex( char *IndexBuf,
38 int CtdlAssociateSystemUser(char *screenname, char *loginname);
43 void CtdlSetPassword(char *new_pw);
45 int CtdlForgetThisRoom(void);
47 void cmd_newu (char *cmdbuf);
48 void start_chkpwd_daemon(void);
51 #define RENAMEUSER_OK 0 /* Operation succeeded */
52 #define RENAMEUSER_LOGGED_IN 1 /* Cannot rename a user who is currently logged in */
53 #define RENAMEUSER_NOT_FOUND 2 /* The old user name does not exist */
54 #define RENAMEUSER_ALREADY_EXISTS 3 /* An account with the desired new name already exists */
56 int rename_user(char *oldname, char *newname);
58 ///#ifndef CTDL_INLINE_USR
59 ////#define CTDL_INLINE_USR static INLINE
63 static INLINE long cutuserkey(char *username) {
65 len = strlen(username);
66 if (len >= USERNAME_SIZE)
68 syslog(LOG_INFO, "Username too long: %s", username);
70 len = USERNAME_SIZE - 1;
77 * makeuserkey() - convert a username into the format used as a database key
78 * (it's just the username converted into lower case)
81 static INLINE void makeuserkey(char *key, const char *username, long len) {
84 if (len >= USERNAME_SIZE)
86 syslog(LOG_INFO, "Username too long: %s", username);
88 len = USERNAME_SIZE - 1;
90 for (i=0; i<=len; ++i) {
91 key[i] = tolower(username[i]);
96 int internal_create_user(char *username, struct ctdluser *usbuf, uid_t uid);