7 /* getuser is deprecated, use CtdlGetUser instead */
8 int getuser (struct ctdluser *, char *) __attribute__ ((deprecated));
9 /* lgetuser is deprecated, use CtdlGetUserLock instead */
10 int lgetuser (struct ctdluser *, char *) __attribute__ ((deprecated));
11 /* putuser is deprecated, use CtdlPutUser instead */
12 void putuser (struct ctdluser *) __attribute__ ((deprecated));
13 /* lputuser is deprecated, use CtdlPutUserLock instead */
14 void lputuser (struct ctdluser *) __attribute__ ((deprecated));
16 int is_room_aide (void);
17 /* getuserbynumber is deprecated, use CtdlGetUserByNumber instead */
18 int getuserbynumber (struct ctdluser *usbuf, long int number) __attribute__ ((deprecated));
19 void rebuild_usersbynumber(void);
20 void cmd_user (char *cmdbuf);
21 void session_startup (void);
22 void logged_in_response(void);
23 int purge_user (char *pname);
24 int create_user (const char *newusername, long len, int become_user);
26 int CtdlInvtKick(char *iuser, int op);
27 void ForEachUser(void (*CallBack)(struct ctdluser *EachUser, void *out_data),
29 void ListThisUser(struct ctdluser *usbuf, void *data);
30 int NewMailCount(void);
31 int InitialMailCheck(void);
32 void put_visit(visit *newvisit);
33 /* MailboxName is deprecated us CtdlMailboxName instead */
34 void MailboxName(char *buf, size_t n, const struct ctdluser *who,
35 const char *prefix) __attribute__ ((deprecated));
36 int GenerateRelationshipIndex( char *IndexBuf,
40 int CtdlAssociateSystemUser(char *screenname, char *loginname);
45 void CtdlSetPassword(char *new_pw);
47 int CtdlForgetThisRoom(void);
49 void cmd_newu (char *cmdbuf);
50 void start_chkpwd_daemon(void);
53 #define RENAMEUSER_OK 0 /* Operation succeeded */
54 #define RENAMEUSER_LOGGED_IN 1 /* Cannot rename a user who is currently logged in */
55 #define RENAMEUSER_NOT_FOUND 2 /* The old user name does not exist */
56 #define RENAMEUSER_ALREADY_EXISTS 3 /* An account with the desired new name already exists */
58 int rename_user(char *oldname, char *newname);
60 ///#ifndef CTDL_INLINE_USR
61 ////#define CTDL_INLINE_USR static INLINE
65 static INLINE long cutuserkey(char *username) {
67 len = strlen(username);
68 if (len >= USERNAME_SIZE)
70 syslog(LOG_EMERG, "Username to long: %s", username);
72 len = USERNAME_SIZE - 1;
79 * makeuserkey() - convert a username into the format used as a database key
80 * (it's just the username converted into lower case)
83 static INLINE void makeuserkey(char *key, const char *username, long len) {
86 if (len >= USERNAME_SIZE)
88 syslog(LOG_EMERG, "Username to long: %s", username);
90 len = USERNAME_SIZE - 1;
92 for (i=0; i<=len; ++i) {
93 key[i] = tolower(username[i]);
98 int internal_create_user (const char *username, long len, struct ctdluser *usbuf, uid_t uid);