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 /* logout() is deprecated use CtdlUserLogout() instead */
24 void logout (void) __attribute__ ((deprecated));
25 int purge_user (char *pname);
26 int create_user (const char *newusername, long len, int become_user);
28 int CtdlInvtKick(char *iuser, int op);
29 void ForEachUser(void (*CallBack)(struct ctdluser *EachUser, void *out_data),
31 void ListThisUser(struct ctdluser *usbuf, void *data);
32 int NewMailCount(void);
33 int InitialMailCheck(void);
34 void put_visit(visit *newvisit);
35 /* MailboxName is deprecated us CtdlMailboxName instead */
36 void MailboxName(char *buf, size_t n, const struct ctdluser *who,
37 const char *prefix) __attribute__ ((deprecated));
38 int GenerateRelationshipIndex( char *IndexBuf,
42 int CtdlAssociateSystemUser(char *screenname, char *loginname);
47 void CtdlSetPassword(char *new_pw);
49 int CtdlForgetThisRoom(void);
51 void cmd_newu (char *cmdbuf);
52 void start_chkpwd_daemon(void);
55 #define RENAMEUSER_OK 0 /* Operation succeeded */
56 #define RENAMEUSER_LOGGED_IN 1 /* Cannot rename a user who is currently logged in */
57 #define RENAMEUSER_NOT_FOUND 2 /* The old user name does not exist */
58 #define RENAMEUSER_ALREADY_EXISTS 3 /* An account with the desired new name already exists */
60 int rename_user(char *oldname, char *newname);
62 ///#ifndef CTDL_INLINE_USR
63 ////#define CTDL_INLINE_USR static INLINE
67 static INLINE long cutuserkey(char *username) {
69 len = strlen(username);
70 if (len >= USERNAME_SIZE)
72 CtdlLogPrintf (CTDL_EMERG, "Username to long: %s", username);
74 len = USERNAME_SIZE - 1;
75 ((char*)username)[USERNAME_SIZE - 1]='\0';
81 * makeuserkey() - convert a username into the format used as a database key
82 * (it's just the username converted into lower case)
85 static INLINE void makeuserkey(char *key, const char *username, long len) {
88 if (len >= USERNAME_SIZE)
90 CtdlLogPrintf (CTDL_EMERG, "Username to long: %s", username);
92 len = USERNAME_SIZE - 1;
94 for (i=0; i<=len; ++i) {
95 key[i] = tolower(username[i]);
100 int internal_create_user (const char *username, long len, struct ctdluser *usbuf, uid_t uid);