chiark / gitweb /
Use email_valid() to check email addresses throughout
[disorder] / server / server.c
index 1bfa29a05367fb4031c60f545567d07ea03a8458..c4c889a448f909d6b9bcff26dc14d90d6760735b 100644 (file)
@@ -879,8 +879,8 @@ static void logclient(const char *msg, void *user) {
     c->lo = 0;
     return;
   }
-  /* user-* messages are restricted */
-  if(!strncmp(msg, "user-", 5)) {
+  /* user_* messages are restricted */
+  if(!strncmp(msg, "user_", 5)) {
     /* They are only sent to admin users */
     if(!(c->rights & RIGHT_ADMIN))
       return;
@@ -1254,9 +1254,9 @@ static int c_edituser(struct conn *c,
             /* Notify any log connections */
             if(d->lo)
               sink_printf(ev_writer_sink(d->w),
-                          "%"PRIxMAX" rights-changed %s\n",
+                          "%"PRIxMAX" rights_changed %s\n",
                           (uintmax_t)time(0),
-                          new_rights);
+                          quoteutf8(new_rights));
           }
         }
       }
@@ -1426,9 +1426,8 @@ static int c_reminder(struct conn *c,
     sink_writes(ev_writer_sink(c->w), "550 Cannot send a reminder email\n");
     return 1;
   }
-  /* TODO use email_valid() */
   if(!(email = kvp_get(k, "email"))
-     || !strchr(email, '@')) {
+     || !email_valid(email)) {
     error(0, "user '%s' has no valid email address", vec[0]);
     sink_writes(ev_writer_sink(c->w), "550 Cannot send a reminder email\n");
     return 1;