else if (!rc->username)
reply(rc, FOUND, "GETL", "c", rc->suggestions, fullname, class);
else
- reply(rc, FORCED_USERNAME, "GETP", "c", NULL, rc->username);
+ {
+ if (status == US_NO_LOGIN_YET)
+ {
+ status = check_kerberos(login);
+ if (status == MR_SUCCESS)
+ status = register_user(rc->uid, login);
+ if (status == MR_IN_USE)
+ {
+ reply(rc, RESERVED_USERNAME_UNAVAILABLE, "INIT", "c", NULL,
+ rc->username);
+ return;
+ }
+ else if (status == MR_DOWN)
+ {
+ reply(rc, DATABASE_CLOSED, "INIT", "c", NULL);
+ return;
+ }
+ else if (status != MR_SUCCESS)
+ {
+ reply(rc, INTERNAL_ERROR, "INIT", "c", NULL,
+ error_message(status));
+ return;
+ }
+ }
+ reply(rc, FORCED_USERNAME, "GETP", "c", NULL, rc->username);
+ }
}
void SWRD(reg_client *rc, int argc, char **argv)