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);
15 int create_user (const char *newusername, int become_user);
17 int CtdlInvtKick(char *iuser, int op);
18 void ForEachUser(void (*CallBack)(struct ctdluser *EachUser, void *out_data),
20 void ListThisUser(struct ctdluser *usbuf, void *data);
21 int NewMailCount(void);
22 int InitialMailCheck(void);
23 void put_visit(visit *newvisit);
24 /* MailboxName is deprecated us CtdlMailboxName instead */
25 void MailboxName(char *buf, size_t n, const struct ctdluser *who,
26 const char *prefix) __attribute__ ((deprecated));
27 int GenerateRelationshipIndex( char *IndexBuf,
31 int CtdlAssociateSystemUser(char *screenname, char *loginname);
36 void CtdlSetPassword(char *new_pw);
38 int CtdlForgetThisRoom(void);
40 void cmd_newu (char *cmdbuf);
41 void start_chkpwd_daemon(void);
44 #define RENAMEUSER_OK 0 /* Operation succeeded */
45 #define RENAMEUSER_LOGGED_IN 1 /* Cannot rename a user who is currently logged in */
46 #define RENAMEUSER_NOT_FOUND 2 /* The old user name does not exist */
47 #define RENAMEUSER_ALREADY_EXISTS 3 /* An account with the desired new name already exists */
49 int rename_user(char *oldname, char *newname);
51 ///#ifndef CTDL_INLINE_USR
52 ////#define CTDL_INLINE_USR static INLINE
56 static INLINE long cutuserkey(char *username) {
58 len = strlen(username);
59 if (len >= USERNAME_SIZE)
61 syslog(LOG_INFO, "Username too long: %s", username);
63 len = USERNAME_SIZE - 1;
70 * makeuserkey() - convert a username into the format used as a database key
71 * (it's just the username converted into lower case)
74 static INLINE void makeuserkey(char *key, const char *username, long len) {
77 if (len >= USERNAME_SIZE)
79 syslog(LOG_INFO, "Username too long: %s", username);
81 len = USERNAME_SIZE - 1;
83 for (i=0; i<=len; ++i) {
84 key[i] = tolower(username[i]);
89 int internal_create_user(char *username, struct ctdluser *usbuf, uid_t uid);