#include "genstamp.h"
#include "threads.h"
#include "citadel_ldap.h"
+#include "context.h"
#include "ctdl_module.h"
*
*/
int rename_user(char *oldname, char *newname) {
- struct CitContext *cptr;
+ CitContext *cptr;
int retcode = RENAMEUSER_OK;
struct ctdluser usbuf;
char newnamekey[USERNAME_SIZE];
/* We cannot rename a user who is currently logged in */
+/* FIXME: This is very broken!!!!
+ * We check that the user is not already logged in because we can't rename them
+ * if they are logged in.
+ * BUT THEN WE LEAVE A HUGE WINDOW FOR THEM TO LOG IN BEFORE WE LOCK TO RENAME THEM!!!!!
+ */
for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
if (!strcasecmp(cptr->user.fullname, oldname)) {
return(RENAMEUSER_LOGGED_IN);
*/
void logout(void)
{
- struct CitContext *CCC = CC; /* CachedCitContext - performance boost */
+ CitContext *CCC = CC; /* CachedCitContext - performance boost */
/*
* If there is a download in progress, abort it.
*/
char filename[64];
struct ctdluser usbuf;
char usernamekey[USERNAME_SIZE];
- struct CitContext *ccptr;
+ CitContext *ccptr;
int user_is_logged_in = 0;
makeuserkey(usernamekey, pname);
* receive a new mail notification without having to hit the database.
*/
void BumpNewMailCounter(long which_user) {
- struct CitContext *ptr;
+ CitContext *ptr;
begin_critical_section(S_SESSION_TABLE);