/*======================================================================* * Program to allow global changes of ALL userlog records. * *======================================================================*/ #version $50 #reserve 6 #copyright "Chgexpir.cmd Copyright 1995 K-Products" #address $7000 #include runtime.h #include bbs_pro.h #define ATASCII 0 #define ASCII 1 #define DISK2 2 #define FOREVER 1 #define MAX_YEARS 40 byte pr_count; char com_sec [33], file_sec [33], msgr_sec [33], msgp_sec [33]; main() { change_expiration_date(); } change_expiration_date() { int user; byte x, write_error, mm, dd, yy; char ch; echo(125); cr_lf(); echose (" >>> Editing EXPIRATION DATES <<<"); cr_lf(); echose ("Change all users to an expiration"); echose ("date of:"); cr_lf(); cr_lf(); echos ("Month: "); mm = get_byte(); cr_lf(); echos (" Day: "); dd = get_byte(); cr_lf(); echos (" Year: "); yy = get_byte(); cr_lf(); cr_lf(); cr_lf(); echos ("Are you SURE you want to do this? "); if (y_or_n() == 'N') return; cr_lf(); echose("Updating expiration dates"); cr_lf(); MIOsuspend(); if (open_ulog() > 127) { MIOresume(); echose ("Unable to open USERLOG!"); return; } write_error = 0; for (user = 12; user < 9999; ++user) { if (ck_range (user) != OK) break; if (read_user (user) != OK) break; if (pr_count == 0) printf ("%cUser: %d ", 156, user); ++pr_count; pr_count = pr_count & 15; t_expmm = mm; t_expdd = dd; t_expyy = yy; if (write_user (user) != OK) { write_error = 1; break; } } printf ("%cUser: %d ", 156, user); close_ulog(); MIOresume(); cr_lf(); if (write_error) echose ("FATAL - error writing user record!"); else { cr_lf(); echos ("done! Users 12 - "); echoc (user - 1); echose(" updated."); } get_a_return(); } get_a_return() { char temp [10]; cr_lf(); echos ("Press ..."); get_string (temp, 1, 0, 1); }