void check_reg_extra() { struct schoolmate_info schmate; struct userec *urec = ¤tuser; char buf[192], bufe[192]; sethomefile(buf, currentuser.userid, ".regextra"); if (!dashf(buf)) { do { memset(&schmate, 0, sizeof(schmate)); strlcpy(schmate.userid, currentuser.userid, sizeof(schmate.userid)); screen_move(1, 0); //% prints("请输入个人信息. 如果输入错误,可以重新输入.\n"); prints("\xc7\xeb\xca\xe4\xc8\xeb\xb8\xf6\xc8\xcb\xd0\xc5\xcf\xa2. \xc8\xe7\xb9\xfb\xca\xe4\xc8\xeb\xb4\xed\xce\xf3,\xbf\xc9\xd2\xd4\xd6\xd8\xd0\xc2\xca\xe4\xc8\xeb.\n"); /*default value is 0*/ do { //% getdata(2, 0, "输入以前的学号: ", schmate.school_num, getdata(2, 0, "\xca\xe4\xc8\xeb\xd2\xd4\xc7\xb0\xb5\xc4\xd1\xa7\xba\xc5: ", schmate.school_num, sizeof(schmate.school_num), DOECHO, YEA); } while (!isNumStr(schmate.school_num)); //如果有输入非数字,重新输入!下同 do { //% getdata(4, 0, "输入邮箱(外部邮箱亦可): ", schmate.email, STRLEN, getdata(4, 0, "\xca\xe4\xc8\xeb\xd3\xca\xcf\xe4(\xcd\xe2\xb2\xbf\xd3\xca\xcf\xe4\xd2\xe0\xbf\xc9): ", schmate.email, sizeof(schmate.email), DOECHO, YEA); } while (!valid_addr(schmate.email)); do { //% getdata(6, 0, "输入身份证号码: ", schmate.identity_card_num, getdata(6, 0, "\xca\xe4\xc8\xeb\xc9\xed\xb7\xdd\xd6\xa4\xba\xc5\xc2\xeb: ", schmate.identity_card_num, sizeof(schmate.identity_card_num), DOECHO, YEA); } while (!isNumStrPlusX(schmate.identity_card_num) || strlen(schmate.identity_card_num) !=IDCARDLEN); do { //% getdata(8, 0, "输入毕业证书编号: ", schmate.diploma_num, getdata(8, 0, "\xca\xe4\xc8\xeb\xb1\xcf\xd2\xb5\xd6\xa4\xca\xe9\xb1\xe0\xba\xc5: ", schmate.diploma_num, sizeof(schmate.diploma_num), DOECHO, YEA); } while (!isNumStr(schmate.diploma_num)); do { //% getdata(10, 0, "输入手机或固定电话号码: ", schmate.mobile_num, getdata(10, 0, "\xca\xe4\xc8\xeb\xca\xd6\xbb\xfa\xbb\xf2\xb9\xcc\xb6\xa8\xb5\xe7\xbb\xb0\xba\xc5\xc2\xeb: ", schmate.mobile_num, sizeof(schmate.mobile_num), DOECHO, YEA); } while (!isNumStr(schmate.mobile_num)); strcpy(buf, ""); //% getdata(11, 0, "以上信息输入正确并进行邮箱绑定认证[Y/n]", buf, 2, DOECHO, YEA); getdata(11, 0, "\xd2\xd4\xc9\xcf\xd0\xc5\xcf\xa2\xca\xe4\xc8\xeb\xd5\xfd\xc8\xb7\xb2\xa2\xbd\xf8\xd0\xd0\xd3\xca\xcf\xe4\xb0\xf3\xb6\xa8\xc8\xcf\xd6\xa4[Y/n]", buf, 2, DOECHO, YEA); } while (buf[0] =='n' || buf[0] == 'N'); sprintf(buf, "%s, %s, %s, %s, %s\n", schmate.school_num, schmate.email, schmate.identity_card_num, schmate.diploma_num, schmate.mobile_num); sethomefile(bufe, currentuser.userid, ".regextra"); file_append(bufe, buf); do_report(".SCHOOLMATE", buf); register_send_email(urec, schmate.email); } screen_clear(); tui_check_reg_mail(); }
void check_reg_extra() { struct schoolmate_info schmate; struct userec *urec = ¤tuser; char buf[192], bufe[192]; sethomefile(buf, currentuser.userid, ".regextra"); if (!dashf(buf)) { do { memset(&schmate, 0, sizeof(schmate)); strcpy(schmate.userid, currentuser.userid); move(1, 0); prints("�����������Ϣ. ����������,������������.\n"); /*default value is 0*/ do { getdata(2, 0, "������ǰ��ѧ��: ", schmate.school_num, SCHOOLNUMLEN+1, DOECHO, YEA); } while (!isNumStr(schmate.school_num)); //��������������,��������!��ͬ do { getdata(4, 0, "��������(�ⲿ�������): ", schmate.email, STRLEN, DOECHO, YEA); } while (invalidaddr(schmate.email)); do { getdata(6, 0, "�������֤����: ", schmate.identity_card_num, IDCARDLEN+1, DOECHO, YEA); } while (!isNumStrPlusX(schmate.identity_card_num) || strlen(schmate.identity_card_num) !=IDCARDLEN); do { getdata(8, 0, "�����ҵ֤����: ", schmate.diploma_num, DIPLOMANUMLEN+1, DOECHO, YEA); } while (!isNumStr(schmate.diploma_num)); do { getdata(10, 0, "�����ֻ���̶��绰����: ", schmate.mobile_num, MOBILENUMLEN+1, DOECHO, YEA); } while (!isNumStr(schmate.mobile_num)); strcpy(buf, ""); getdata(11, 0, "������Ϣ������ȷ�������������֤[Y/n]", buf, 2, DOECHO, YEA); } while (buf[0] =='n' || buf[0] == 'N'); sprintf(buf, "%s, %s, %s, %s, %s\n", schmate.school_num, schmate.email, schmate.identity_card_num, schmate.diploma_num, schmate.mobile_num); sethomefile(bufe, currentuser.userid, ".regextra"); file_append(bufe, buf); do_report(".SCHOOLMATE", buf); regmail_send(urec, schmate.email); } clear(); check_reg_mail(); }