]> andersk Git - moira.git/commitdiff
If using a PIN for registration preauth, assign EXCHANGE pobox.
authorzacheiss <zacheiss>
Fri, 6 Feb 2009 21:25:19 +0000 (21:25 +0000)
committerzacheiss <zacheiss>
Fri, 6 Feb 2009 21:25:19 +0000 (21:25 +0000)
reg_svr/reg_svr.pc

index 504712f719752e0da3c2465d2e13c36e792d5050..a08450ce30e2673afedc3fe66e5b18bd7a320b7f 100644 (file)
@@ -788,6 +788,9 @@ void QUIT(reg_client *rc, int argc, char **argv)
 /* Register a user in Moira */
 int register_user(int uid, char *username)
 {
+  EXEC SQL BEGIN DECLARE SECTION;
+  char pin[USERS_PIN_SIZE];
+  EXEC SQL END DECLARE SECTION;
   char uidbuf[10], *qargv[3], *motd = NULL;
   long status;
 
@@ -816,10 +819,20 @@ int register_user(int uid, char *username)
       return MR_INTERNAL;
     }
 
+  EXEC SQL SELECT pin INTO :pin FROM users WHERE unix_uid = :uid;
+
   sprintf(uidbuf, "%d", uid);
   qargv[0] = uidbuf;
   qargv[1] = username;
-  qargv[2] = "IMAP";
+
+  /* HACK: If user has a PIN set, they're from Sloan.
+   * Give them Exchange poboxes.
+   */ 
+  if (*pin != '\0')
+      qargv[2] = "EXCHANGE";
+  else 
+    qargv[2] = "IMAP";
+
   status = mr_query("register_user", 3, qargv, NULL, NULL);
   mr_disconnect();
   return status;
This page took 0.056901 seconds and 5 git commands to generate.