/*======================================================================* * Program to allow global changes of ALL userlog records. * *======================================================================*/ #version $50 #reserve 6 #copyright "Globalsl.cmd Written By Stephen J. Carden 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() { char option; while (1) { option = upcase (main_menu()); echo (option); cr_lf(); pr_count = 0; case (option) { 'C' : change_command_security(); 'F' : change_file_security(); 'M' : change_msg_security(); 'Q' : return; } } } main_menu () { header(); echose (" Globally change:"); cr_lf(); echose (" [C]ommand security levels"); echose (" [F]ile SIG security levels"); echose (" [M]essage security levels"); echose (" [Q]uit"); cr_lf(); echos (" Option: "); return ( get_key() ); } header() { echo(125); cr_lf(); echose (" BBS Express! Professional"); echose (" Global Security Level Maintenance"); echose (" Copyright 1995 K-Products"); cr_lf(); } change_file_security() { int user; byte x, write_error; char ch; header(); echose (" >>> Editing FILE SIG security <<<"); cr_lf(); say_options(); echos ("Read "); for (x=1; x < 33; ++x) { do { ch = upcase (get_key()); } while (ch != '0' && ch != '1' && ch != '-'); echo (ch); file_sec [x] = ch; } cr_lf(); cr_lf(); echos ("Are you SURE you want to do this? "); if (y_or_n() == 'N') return; cr_lf(); echose("Updating file SIG read flags"); 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; for (x=1; x < 33; ++x) { if (file_sec [x] == '0') clr_lvl (t_sigread, x); else if (file_sec [x] == '1') set_lvl (t_sigread, x); } 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(); } change_command_security() { int user; byte x, write_error; char ch; header(); echose (" >>> Editing COMMAND security <<<"); cr_lf(); say_options(); echos ("SLvl "); for (x=1; x < 33; ++x) { do { ch = upcase (get_key()); } while (ch != '0' && ch != '1' && ch != '-'); echo (ch); com_sec [x] = ch; } cr_lf(); cr_lf(); echos ("Are you SURE you want to do this? "); if (y_or_n() == 'N') return; cr_lf(); echose("Updating Command ability flags"); 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; for (x=1; x < 33; ++x) { if (com_sec [x] == '0') clr_lvl (t_seclvl, x); else if (com_sec [x] == '1') set_lvl (t_seclvl, x); } 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 { echos ("done! Users 12 - "); echoc (user - 1); echose(" updated."); } get_a_return(); } change_msg_security() { int user; byte x, write_error; char ch; header(); echose (" >>> Editing MESSAGE security <<<"); cr_lf(); say_options(); echos ("Read "); for (x=1; x < 33; ++x) { do { ch = upcase (get_key()); } while (ch != '0' && ch != '1' && ch != '-'); echo (ch); msgr_sec [x] = ch; } cr_lf(); echos ("Post "); for (x=1; x < 33; ++x) { do { ch = upcase (get_key()); } while (ch != '0' && ch != '1' && ch != '-'); echo (ch); msgp_sec [x] = ch; } cr_lf(); cr_lf(); echos ("Are you SURE you want to do this? "); if (y_or_n() == 'N') return; cr_lf(); echose("Updating Message and Quickscan flags"); 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; for (x=1; x < 33; ++x) { if (msgr_sec [x] == '0') { clr_lvl (t_msgread, x); clr_lvl (t_qscan, x); } else if (msgr_sec [x] == '1') { set_lvl (t_msgread, x); set_lvl (t_qscan, x); } if (msgp_sec [x] == '0') clr_lvl (t_msgpost, x); else if (msgp_sec [x] == '1') set_lvl (t_msgpost, x); } 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 { echos ("done! Users 12 - "); echoc (user - 1); echose(" updated."); } get_a_return(); } say_options() { echose ("Place a '0' under the levels that"); echose (" you want turned -OFF-"); echose ("Place a '1' under the levels that"); echose (" you want turned -ON-"); echose ("Place a '-' under the levels that"); echose (" are not affected."); cr_lf(); cr_lf(); echose (" 1 1 2 2 3 "); echose (" ----5----0----5----0----5----0--"); } get_a_return() { char temp [10]; cr_lf(); echos ("Press ..."); get_string (temp, 1, 0, 1); }