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 (const char *newusername, int become_user);
18 CREATE_USER_DO_NOT_BECOME_USER,
19 CREATE_USER_BECOME_USER
23 int CtdlInvtKick(char *iuser, int op);
24 void ForEachUser(void (*CallBack)(struct ctdluser *EachUser, void *out_data),
26 void ListThisUser(struct ctdluser *usbuf, void *data);
27 int NewMailCount(void);
28 int InitialMailCheck(void);
29 void put_visit(visit *newvisit);
30 /* MailboxName is deprecated us CtdlMailboxName instead */
31 void MailboxName(char *buf, size_t n, const struct ctdluser *who,
32 const char *prefix) __attribute__ ((deprecated));
33 int GenerateRelationshipIndex( char *IndexBuf,
37 int CtdlAssociateSystemUser(char *screenname, char *loginname);
42 void CtdlSetPassword(char *new_pw);
44 int CtdlForgetThisRoom(void);
46 void cmd_newu (char *cmdbuf);
47 void start_chkpwd_daemon(void);
50 #define RENAMEUSER_OK 0 /* Operation succeeded */
51 #define RENAMEUSER_LOGGED_IN 1 /* Cannot rename a user who is currently logged in */
52 #define RENAMEUSER_NOT_FOUND 2 /* The old user name does not exist */
53 #define RENAMEUSER_ALREADY_EXISTS 3 /* An account with the desired new name already exists */
55 int rename_user(char *oldname, char *newname);
57 ///#ifndef CTDL_INLINE_USR
58 ////#define CTDL_INLINE_USR static INLINE
62 static INLINE long cutuserkey(char *username) {
64 len = strlen(username);
65 if (len >= USERNAME_SIZE)
67 syslog(LOG_INFO, "Username too long: %s", username);
69 len = USERNAME_SIZE - 1;
76 * makeuserkey() - convert a username into the format used as a database key
77 * (it's just the username converted into lower case)
80 static INLINE void makeuserkey(char *key, const char *username, long len) {
83 if (len >= USERNAME_SIZE)
85 syslog(LOG_INFO, "Username too long: %s", username);
87 len = USERNAME_SIZE - 1;
89 for (i=0; i<=len; ++i) {
90 key[i] = tolower(username[i]);
95 int internal_create_user(char *username, struct ctdluser *usbuf, uid_t uid);