diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-03-31 09:24:38 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-03-31 09:24:38 +0800 |
commit | b12f10b3f034ab09558c7040b7c5ed254e76d680 (patch) | |
tree | 3021d28cdbdc5678fe8761b85d5c6f80357a3ee8 /util/birth.c | |
parent | 2c775c59bd63b03eb301232e888163d041e15afe (diff) | |
download | pttbbs-b12f10b3f034ab09558c7040b7c5ed254e76d680.tar pttbbs-b12f10b3f034ab09558c7040b7c5ed254e76d680.tar.gz pttbbs-b12f10b3f034ab09558c7040b7c5ed254e76d680.tar.bz2 pttbbs-b12f10b3f034ab09558c7040b7c5ed254e76d680.tar.lz pttbbs-b12f10b3f034ab09558c7040b7c5ed254e76d680.tar.xz pttbbs-b12f10b3f034ab09558c7040b7c5ed254e76d680.tar.zst pttbbs-b12f10b3f034ab09558c7040b7c5ed254e76d680.zip |
debug cuser
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1645 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/birth.c')
-rw-r--r-- | util/birth.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/util/birth.c b/util/birth.c index 20bd65c0..4a4a6fd0 100644 --- a/util/birth.c +++ b/util/birth.c @@ -5,18 +5,18 @@ #define OUTFILE BBSHOME "/etc/birth.today" -struct userec_t cuser; +struct userec_t user; int bad_user_id(char *userid) { register char ch; int j; - if (strlen(cuser.userid) < 2 || !isalpha(cuser.userid[0])) + if (strlen(user.userid) < 2 || !isalpha(user.userid[0])) return 1; - if (cuser.numlogins == 0 || cuser.numlogins > 15000) + if (user.numlogins == 0 || user.numlogins > 15000) return 1; - if (cuser.numposts > 15000) + if (user.numposts > 15000) return 1; - for (j = 1; (ch = cuser.userid[j]); j++) + for (j = 1; (ch = user.userid[j]); j++) { if (!isalnum(ch)) return 1; @@ -60,29 +60,29 @@ int main(argc, argv) "[40m¡¹[32m¡¹[33m¡¹[34m¡¹[35m¡¹[1m¡¹[m \n\n"); fprintf(fp1, "[33m¡i[1;45m¥»¤é¹Ø¬P[40;33m¡j[m \n"); for(j = 1; j <= MAX_USERS; j++) { - passwd_query(j, &cuser); + passwd_query(j, &user); if (bad_user_id(NULL)) continue; - if (cuser.month == ptime->tm_mon + 1) + if (user.month == ptime->tm_mon + 1) { - if (cuser.day == ptime->tm_mday) + if (user.day == ptime->tm_mday) { char genbuf[200]; - sprintf(genbuf, BBSHOME "/home/%c/%s", cuser.userid[0], cuser.userid); + sprintf(genbuf, BBSHOME "/home/%c/%s", user.userid[0], user.userid); stampfile(genbuf, &mymail); strcpy(mymail.owner, BBSNAME); strcpy(mymail.title, "!! ¥Í¤é§Ö¼Ö !!"); unlink(genbuf); Link(BBSHOME "/etc/Welcome_birth", genbuf); - sprintf(genbuf, BBSHOME "/home/%c/%s/.DIR", cuser.userid[0], cuser.userid); + sprintf(genbuf, BBSHOME "/home/%c/%s/.DIR", user.userid[0], user.userid); append_record(genbuf, &mymail, sizeof(mymail)); - if ((cuser.numlogins + cuser.numposts) < 20) + if ((user.numlogins + user.numposts) < 20) continue; fprintf(fp1, " [33m[%2d/%-2d] %-14s[0m %-24s login:%-5d post:%-5d\n", - ptime->tm_mon + 1, ptime->tm_mday, cuser.userid, - cuser.username, cuser.numlogins, cuser.numposts); + ptime->tm_mon + 1, ptime->tm_mday, user.userid, + user.username, user.numlogins, user.numposts); } } } |