]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/ctdlproto/serv_user.c
more places where we can use cm_lengths;
[citadel.git] / citadel / modules / ctdlproto / serv_user.c
index c8c8aaa2dfae9899332d774cf58b56410a3926b4..eee6516b864d0af2be766d0ce9f89e8d4f650269 100644 (file)
  * GNU General Public License for more details.
  */
 
-#include "sysdep.h"
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <pwd.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <syslog.h>
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
-#include <string.h>
-#include <limits.h>
-#include <libcitadel.h>
-#include "auth.h"
-#include "citadel.h"
-#include "server.h"
-#include "database.h"
-#include "sysdep_decls.h"
 #include "support.h"
-#include "room_ops.h"
-#include "file_ops.h"
 #include "control.h"
-#include "msgbase.h"
-#include "config.h"
-#include "citserver.h"
-#include "citadel_dirs.h"
-#include "genstamp.h"
-#include "threads.h"
-#include "citadel_ldap.h"
-#include "context.h"
 #include "ctdl_module.h"
+
+#include "citserver.h"
+
 #include "user_ops.h"
 #include "internet_addressing.h"
 
@@ -699,6 +657,25 @@ void cmd_asup(char *cmdbuf)
 }
 
 
+/*
+ * Citadel protocol command to do the same
+ */
+void cmd_isme(char *argbuf) {
+       char addr[256];
+
+       if (CtdlAccessCheck(ac_logged_in)) return;
+       extract_token(addr, argbuf, 0, '|', sizeof addr);
+
+       if (CtdlIsMe(addr, sizeof addr)) {
+               cprintf("%d %s\n", CIT_OK, addr);
+       }
+       else {
+               cprintf("%d Not you.\n", ERROR + ILLEGAL_VALUE);
+       }
+
+}
+
+
 /*
  * Set the preferred view for the current user/room combination
  */
@@ -805,6 +782,7 @@ CTDL_MODULE_INIT(serv_user)
                CtdlRegisterProtoHook(cmd_view, "VIEW", "Set preferred view for user/room combination");
                CtdlRegisterProtoHook(cmd_renu, "RENU", "Rename a user");
                CtdlRegisterProtoHook(cmd_newu, "NEWU", "Log in as a new user");
+               CtdlRegisterProtoHook(cmd_isme, "ISME", "Determine whether an email address belongs to a user");
        }
        /* return our Subversion id for the Log */
        return "user";