6 /* getuser is deprecated, use CtdlGetUser instead */
7 int getuser (struct ctdluser *, char *) __attribute__ ((deprecated));
8 /* lgetuser is deprecated, use CtdlGetUserLock instead */
9 int lgetuser (struct ctdluser *, char *) __attribute__ ((deprecated));
10 /* putuser is deprecated, use CtdlPutUser instead */
11 void putuser (struct ctdluser *) __attribute__ ((deprecated));
12 /* lputuser is deprecated, use CtdlPutUserLock instead */
13 void lputuser (struct ctdluser *) __attribute__ ((deprecated));
15 int is_room_aide (void);
16 /* getuserbynumber is deprecated, use CtdlGetUserByNumber instead */
17 int getuserbynumber (struct ctdluser *usbuf, long int number) __attribute__ ((deprecated));
18 void rebuild_usersbynumber(void);
19 void cmd_user (char *cmdbuf);
20 void session_startup (void);
21 void logged_in_response(void);
22 /* logout() is deprecated use CtdlUserLogout() instead */
23 void logout (void) __attribute__ ((deprecated));
24 int purge_user (char *pname);
25 int create_user (const char *newusername, long len, int become_user);
27 int CtdlInvtKick(char *iuser, int op);
28 void ForEachUser(void (*CallBack)(struct ctdluser *EachUser, void *out_data),
30 void ListThisUser(struct ctdluser *usbuf, void *data);
31 int NewMailCount(void);
32 int InitialMailCheck(void);
33 void put_visit(visit *newvisit);
34 /* MailboxName is deprecated us CtdlMailboxName instead */
35 void MailboxName(char *buf, size_t n, const struct ctdluser *who,
36 const char *prefix) __attribute__ ((deprecated));
37 int GenerateRelationshipIndex( char *IndexBuf,
41 int CtdlAssociateSystemUser(char *screenname, char *loginname);
46 void CtdlSetPassword(char *new_pw);
48 int CtdlForgetThisRoom(void);
50 void cmd_newu (char *cmdbuf);
51 void start_chkpwd_daemon(void);
54 #define RENAMEUSER_OK 0 /* Operation succeeded */
55 #define RENAMEUSER_LOGGED_IN 1 /* Cannot rename a user who is currently logged in */
56 #define RENAMEUSER_NOT_FOUND 2 /* The old user name does not exist */
57 #define RENAMEUSER_ALREADY_EXISTS 3 /* An account with the desired new name already exists */
59 int rename_user(char *oldname, char *newname);
61 ///#ifndef CTDL_INLINE_USR
62 ////#define CTDL_INLINE_USR static INLINE
66 static INLINE long cutuserkey(char *username) {
68 len = strlen(username);
69 if (len >= USERNAME_SIZE)
71 CtdlLogPrintf (CTDL_EMERG, "Username to long: %s", username);
73 len = USERNAME_SIZE - 1;
74 ((char*)username)[USERNAME_SIZE - 1]='\0';
80 * makeuserkey() - convert a username into the format used as a database key
81 * (it's just the username converted into lower case)
84 static INLINE void makeuserkey(char *key, const char *username, long len) {
87 if (len >= USERNAME_SIZE)
89 CtdlLogPrintf (CTDL_EMERG, "Username to long: %s", username);
91 len = USERNAME_SIZE - 1;
93 for (i=0; i<=len; ++i) {
94 key[i] = tolower(username[i]);
99 int internal_create_user (const char *username, long len, struct ctdluser *usbuf, uid_t uid);