Removed safe cracker door
This commit is contained in:
@@ -9,19 +9,19 @@ SRCS = grlist.c m_domain.c m_fgroup.c m_lang.c m_marea.c m_new.c \
|
||||
m_limits.c m_menu.c m_ngroup.c m_service.c m_tty.c mutil.c m_archive.c \
|
||||
m_fdb.c m_global.c m_magic.c m_mgroup.c m_node.c m_task.c m_users.c \
|
||||
screen.c m_bbs.c m_ff.c m_hatch.c m_mail.c m_modem.c m_ol.c m_tic.c \
|
||||
m_virus.c stlist.c m_bbslist.c m_safe.c m_route.c
|
||||
m_virus.c stlist.c m_bbslist.c m_route.c
|
||||
HDRS = grlist.h m_domain.h m_fgroup.h m_lang.h m_marea.h m_new.h m_protocol.h \
|
||||
m_ticarea.h mutil.h ledit.h m_farea.h m_fido.h m_limits.h m_menu.h \
|
||||
m_ngroup.h m_service.h m_tty.h screen.h m_archive.h m_fdb.h m_global.h \
|
||||
m_magic.h m_mgroup.h m_node.h m_task.h m_users.h stlist.h m_bbs.h m_ff.h \
|
||||
m_hatch.h m_mail.h m_modem.h m_ol.h m_tic.h m_virus.h m_bbslist.h m_safe.h \
|
||||
m_hatch.h m_mail.h m_modem.h m_ol.h m_tic.h m_virus.h m_bbslist.h \
|
||||
m_route.h
|
||||
OBJS = grlist.o m_domain.o m_fgroup.o m_lang.o m_marea.o m_new.o m_protocol.o \
|
||||
m_ticarea.o mbsetup.o ledit.o m_farea.o m_fido.o m_limits.o m_menu.o \
|
||||
m_ngroup.o m_service.o m_tty.o mutil.o m_archive.o m_fdb.o m_global.o \
|
||||
m_magic.o m_mgroup.o m_node.o m_task.o m_users.o screen.o m_bbs.o m_ff.o \
|
||||
m_hatch.o m_mail.o m_modem.o m_ol.o m_tic.o m_virus.o stlist.o m_bbslist.o \
|
||||
m_safe.o m_route.o
|
||||
m_route.o
|
||||
LIBS += ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a
|
||||
OTHER = Makefile
|
||||
|
||||
@@ -80,7 +80,7 @@ m_marea.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/u
|
||||
m_new.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h grlist.h m_new.h m_lang.h m_marea.h m_ngroup.h
|
||||
m_protocol.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../paths.h screen.h mutil.h ledit.h stlist.h m_global.h m_protocol.h
|
||||
m_ticarea.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h grlist.h m_global.h m_node.h m_fgroup.h m_farea.h m_archive.h m_ticarea.h
|
||||
mbsetup.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h screen.h mutil.h ledit.h m_global.h m_bbs.h m_farea.h m_fgroup.h m_mail.h m_mgroup.h m_hatch.h m_tic.h m_ticarea.h m_magic.h m_fido.h m_lang.h m_archive.h m_virus.h m_tty.h m_limits.h m_users.h m_node.h m_fdb.h m_new.h m_ol.h m_bbslist.h m_safe.h m_protocol.h m_ff.h m_modem.h m_marea.h m_ngroup.h m_service.h m_domain.h m_task.h m_route.h
|
||||
mbsetup.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h screen.h mutil.h ledit.h m_global.h m_bbs.h m_farea.h m_fgroup.h m_mail.h m_mgroup.h m_hatch.h m_tic.h m_ticarea.h m_magic.h m_fido.h m_lang.h m_archive.h m_virus.h m_tty.h m_limits.h m_users.h m_node.h m_fdb.h m_new.h m_ol.h m_bbslist.h m_protocol.h m_ff.h m_modem.h m_marea.h m_ngroup.h m_service.h m_domain.h m_task.h m_route.h
|
||||
ledit.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h screen.h mutil.h ledit.h
|
||||
m_farea.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_global.h m_fgroup.h m_archive.h m_farea.h m_fgroup.h m_ngroup.h
|
||||
m_fido.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_fido.h
|
||||
@@ -99,7 +99,7 @@ m_node.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/us
|
||||
m_task.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_task.h
|
||||
m_users.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_lang.h m_global.h m_archive.h m_protocol.h m_users.h
|
||||
screen.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/ansi.h ../lib/common.h ../lib/clcomm.h screen.h
|
||||
m_bbs.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h screen.h mutil.h ledit.h m_lang.h m_protocol.h m_ol.h m_fgroup.h m_farea.h m_menu.h m_safe.h m_bbs.h m_bbslist.h m_limits.h
|
||||
m_bbs.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h screen.h mutil.h ledit.h m_lang.h m_protocol.h m_ol.h m_fgroup.h m_farea.h m_menu.h m_bbs.h m_bbslist.h m_limits.h
|
||||
m_ff.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h screen.h mutil.h ledit.h stlist.h m_global.h m_ff.h m_lang.h m_marea.h
|
||||
m_hatch.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h m_fgroup.h m_ticarea.h m_hatch.h
|
||||
m_mail.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h screen.h mutil.h ledit.h m_global.h m_marea.h m_mgroup.h m_mail.h
|
||||
@@ -109,6 +109,5 @@ m_tic.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/com
|
||||
m_virus.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../paths.h screen.h mutil.h ledit.h stlist.h m_global.h m_virus.h
|
||||
stlist.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h stlist.h
|
||||
m_bbslist.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_global.h m_bbslist.h
|
||||
m_safe.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h m_global.h m_safe.h
|
||||
m_route.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h screen.h mutil.h ledit.h stlist.h m_global.h grlist.h m_node.h m_route.h
|
||||
# End of generated dependencies
|
||||
|
@@ -2087,8 +2087,6 @@ char *getmenutype(int val)
|
||||
case 20: return (char *)"Display .A?? file with Enter";
|
||||
case 21: return (char *)"Display Text Only";
|
||||
|
||||
case 25: return (char *)"Safe cracker door";
|
||||
|
||||
case 101: return (char *)"Select new file area";
|
||||
case 102: return (char *)"List files in current area";
|
||||
case 103: return (char *)"View file contents";
|
||||
|
@@ -42,7 +42,6 @@
|
||||
#include "m_fgroup.h"
|
||||
#include "m_farea.h"
|
||||
#include "m_menu.h"
|
||||
#include "m_safe.h"
|
||||
#include "m_bbs.h"
|
||||
#include "m_bbslist.h"
|
||||
#include "m_limits.h"
|
||||
@@ -64,9 +63,8 @@ void bbs_menu(void)
|
||||
mvprintw(11, 6, "5. Edit Transfer Protocols");
|
||||
mvprintw(12, 6, "6. Edit BBS List Data");
|
||||
mvprintw(13, 6, "7. Edit Oneliners");
|
||||
mvprintw(14, 6, "8. Edit Safecracker Data");
|
||||
|
||||
switch(select_menu(8)) {
|
||||
switch(select_menu(7)) {
|
||||
case 0: return;
|
||||
|
||||
case 1: EditLimits();
|
||||
@@ -89,9 +87,6 @@ void bbs_menu(void)
|
||||
|
||||
case 7: ol_menu();
|
||||
break;
|
||||
|
||||
case 8: EditSafe();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -545,55 +545,11 @@ void e_colors(void)
|
||||
|
||||
|
||||
|
||||
void e_safe_door(void)
|
||||
{
|
||||
clr_index();
|
||||
set_color(WHITE, BLACK);
|
||||
mvprintw( 5, 2, "1.9 EDIT SAFE DOOR");
|
||||
set_color(CYAN, BLACK);
|
||||
mvprintw( 7, 2, "1. Digit 1");
|
||||
mvprintw( 8, 2, "2. Digit 2");
|
||||
mvprintw( 9, 2, "3. Digit 3");
|
||||
mvprintw(10, 2, "4. Max trys");
|
||||
mvprintw(11, 2, "5. Max numb");
|
||||
mvprintw(12, 2, "6. Num gen");
|
||||
mvprintw(13, 2, "7. Prize");
|
||||
mvprintw(14, 2, "8. Welcome");
|
||||
mvprintw(15, 2, "9. Opened");
|
||||
for (;;) {
|
||||
set_color(WHITE, BLACK);
|
||||
show_int( 7,16, CFG.iSafeFirstDigit);
|
||||
show_int( 8,16, CFG.iSafeSecondDigit);
|
||||
show_int( 9,16, CFG.iSafeThirdDigit);
|
||||
show_int(10,16, CFG.iSafeMaxTrys);
|
||||
show_int(11,16, CFG.iSafeMaxNumber);
|
||||
show_bool(12,16, CFG.iSafeNumGen);
|
||||
show_str(13,16,64, CFG.sSafePrize);
|
||||
show_str(14,16,64, CFG.sSafeWelcome);
|
||||
show_str(15,16,64, CFG.sSafeOpened);
|
||||
|
||||
switch(select_menu(9)) {
|
||||
case 0: return;
|
||||
case 1: E_INT( 7,16, CFG.iSafeFirstDigit, "Enter ^first^ digit of the safe")
|
||||
case 2: E_INT( 8,16, CFG.iSafeSecondDigit, "Enter ^second^ digit of the safe")
|
||||
case 3: E_INT( 9,16, CFG.iSafeThirdDigit, "Enter ^third^ digit of the safe")
|
||||
case 4: E_INT( 10,16, CFG.iSafeMaxTrys, "Maximum ^trys^ per day")
|
||||
case 5: E_INT( 11,16, CFG.iSafeMaxNumber, "^Maximum number^ of each digit")
|
||||
case 6: E_BOOL(12,16, CFG.iSafeNumGen, "^Automatic^ number generation")
|
||||
case 7: E_STR( 13,16,64, CFG.sSafePrize, "The ^prize^ the user wins when he opens the safe")
|
||||
case 8: E_STR( 14,16,64, CFG.sSafeWelcome, "The ^welcome^ screen for the safe door")
|
||||
case 9: E_STR( 15,16,64, CFG.sSafeOpened, "The file to display when the safe is ^opened^")
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
void e_paging(void)
|
||||
{
|
||||
clr_index();
|
||||
set_color(WHITE, BLACK);
|
||||
mvprintw( 5, 2, "1.10 EDIT SYSOP PAGING");
|
||||
mvprintw( 5, 2, "1.9 EDIT SYSOP PAGING");
|
||||
set_color(CYAN, BLACK);
|
||||
mvprintw( 7, 2, "1. Ext. Chat");
|
||||
mvprintw( 8, 2, "2. Chat Device");
|
||||
@@ -697,7 +653,7 @@ void e_flags(int Users)
|
||||
if (Users)
|
||||
mvprintw( 5, 6, "1.6 EDIT USER FLAG DESCRIPTIONS");
|
||||
else
|
||||
mvprintw( 5, 6, "1.18 EDIT MANAGER FLAG DESCRIPTIONS");
|
||||
mvprintw( 5, 6, "1.17 EDIT MANAGER FLAG DESCRIPTIONS");
|
||||
|
||||
set_color(CYAN, BLACK);
|
||||
for (i = 0; i < 32; i++) {
|
||||
@@ -767,7 +723,7 @@ void e_ticconf(void)
|
||||
|
||||
clr_index();
|
||||
set_color(WHITE, BLACK);
|
||||
mvprintw( 5, 6, "1.11 EDIT FILEECHO PROCESSING");
|
||||
mvprintw( 5, 6, "1.10 EDIT FILEECHO PROCESSING");
|
||||
set_color(CYAN, BLACK);
|
||||
|
||||
mvprintw( 7, 2, "1. Keep days");
|
||||
@@ -859,7 +815,7 @@ void s_fidomailcfg(void)
|
||||
{
|
||||
clr_index();
|
||||
set_color(WHITE, BLACK);
|
||||
mvprintw( 5, 5, "1.12 EDIT FIDONET MAIL AND ECHOMAIL PROCESSING");
|
||||
mvprintw( 5, 5, "1.11 EDIT FIDONET MAIL AND ECHOMAIL PROCESSING");
|
||||
set_color(CYAN, BLACK);
|
||||
mvprintw( 7, 2, "1. Badboard");
|
||||
mvprintw( 8, 2, "2. Dupeboard");
|
||||
@@ -967,7 +923,7 @@ void s_intmailcfg(void)
|
||||
{
|
||||
clr_index();
|
||||
set_color(WHITE, BLACK);
|
||||
mvprintw( 5, 5, "1.13 EDIT INTERNET MAIL AND NEWS PROCESSING");
|
||||
mvprintw( 5, 5, "1.12 EDIT INTERNET MAIL AND NEWS PROCESSING");
|
||||
set_color(CYAN, BLACK);
|
||||
mvprintw( 7, 2, "1. POP3 node");
|
||||
mvprintw( 8, 2, "2. SMTP node");
|
||||
@@ -1036,7 +992,7 @@ void e_uucp(void)
|
||||
|
||||
clr_index();
|
||||
set_color(WHITE, BLACK);
|
||||
mvprintw( 5, 6, "1.13 EDIT UUCP GATEWAY");
|
||||
mvprintw( 5, 6, "1.12 EDIT UUCP GATEWAY");
|
||||
set_color(CYAN, BLACK);
|
||||
mvprintw( 7, 6, "1. Zone");
|
||||
mvprintw( 8, 6, "2. Net");
|
||||
@@ -1090,7 +1046,7 @@ void e_intmailcfg(void)
|
||||
case 6: E_STR( 12,16,15, CFG.nntpuser, "The ^Username^ for the NNTP server if needed.")
|
||||
case 7: E_STR( 13,16,15, CFG.nntppass, "The ^Password^ for the NNTP server if needed.")
|
||||
case 8: E_INT( 14,16, CFG.nntpdupes, "The number of ^dupes^ to store in the news articles dupes database.")
|
||||
case 9: tmp = PickAka((char *)"1.15.9", FALSE);
|
||||
case 9: tmp = PickAka((char *)"1.13.9", FALSE);
|
||||
if (tmp != -1)
|
||||
CFG.EmailFidoAka = CFG.aka[tmp];
|
||||
s_intmailcfg();
|
||||
@@ -1120,7 +1076,7 @@ void s_newfiles(void)
|
||||
{
|
||||
clr_index();
|
||||
set_color(WHITE, BLACK);
|
||||
mvprintw( 5, 2, "1.14 ALLFILES & NEWFILES LISTINGS");
|
||||
mvprintw( 5, 2, "1.13 ALLFILES & NEWFILES LISTINGS");
|
||||
set_color(CYAN, BLACK);
|
||||
mvprintw( 7, 2, "1. New days");
|
||||
mvprintw( 8, 2, "2. Security");
|
||||
@@ -1143,7 +1099,7 @@ void e_newfiles(void)
|
||||
switch(select_menu(3)) {
|
||||
case 0: return;
|
||||
case 1: E_INT(7,16, CFG.newdays, "Add files younger than this in newfiles report.")
|
||||
case 2: E_SEC(8,16, CFG.security, "1.16 NEWFILES REPORTS SECURITY", s_newfiles)
|
||||
case 2: E_SEC(8,16, CFG.security, "1.13 NEWFILES REPORTS SECURITY", s_newfiles)
|
||||
case 3: temp = CFG.new_groups;
|
||||
temp = edit_int( 9, 16, temp, (char *)"The maximum of ^newfiles^ groups in the newfiles database");
|
||||
if (temp < CountNewfiles()) {
|
||||
@@ -1311,7 +1267,7 @@ void s_mailer(void)
|
||||
{
|
||||
clr_index();
|
||||
set_color(WHITE, BLACK);
|
||||
mvprintw( 5, 2, "1.15 EDIT MAILER SETTINGS");
|
||||
mvprintw( 5, 2, "1.14 EDIT MAILER SETTINGS");
|
||||
set_color(CYAN, BLACK);
|
||||
mvprintw( 7, 2, "1. Mailer logl.");
|
||||
mvprintw( 8, 2, "2. Default phone");
|
||||
@@ -1346,7 +1302,7 @@ void e_trans(int start)
|
||||
|
||||
clr_index();
|
||||
set_color(WHITE, BLACK);
|
||||
mvprintw( 5, 6, "1.15 EDIT PHONE TRANSLATION");
|
||||
mvprintw( 5, 6, "1.14 EDIT PHONE TRANSLATION");
|
||||
set_color(CYAN, BLACK);
|
||||
mvprintw( 7, 12, "String to match String to replace");
|
||||
for (i = 0; i < 10; i++) {
|
||||
@@ -1398,7 +1354,7 @@ void e_mailer(void)
|
||||
|
||||
switch(select_menu(23)) {
|
||||
case 0: return;
|
||||
case 1: E_LOGL(CFG.cico_loglevel, "1.15.1", s_mailer)
|
||||
case 1: E_LOGL(CFG.cico_loglevel, "1.14.1", s_mailer)
|
||||
case 2: E_STR( 8,23,20,CFG.Phone, "The mailer default ^phone number^ for this system")
|
||||
case 3: E_STR( 9,23,30,CFG.Flags, "The mailer ^TCP/IP capability flags^ for this system")
|
||||
case 4: E_INT( 10,23, CFG.Speed, "The mailer ^default linespeed^ for this system")
|
||||
@@ -1434,7 +1390,7 @@ void e_ftpd(void)
|
||||
{
|
||||
clr_index();
|
||||
set_color(WHITE, BLACK);
|
||||
mvprintw( 5, 2, "1.16 EDIT FTPD SETTINGS");
|
||||
mvprintw( 5, 2, "1.15 EDIT FTPD SETTINGS");
|
||||
set_color(CYAN, BLACK);
|
||||
mvprintw( 7, 2, "1. Upload pth");
|
||||
mvprintw( 8, 2, "2. Banner msg");
|
||||
@@ -1510,7 +1466,7 @@ void e_html(void)
|
||||
{
|
||||
clr_index();
|
||||
set_color(WHITE, BLACK);
|
||||
mvprintw( 5, 2, "1.17 EDIT HTML SETTINGS");
|
||||
mvprintw( 5, 2, "1.16 EDIT HTML SETTINGS");
|
||||
set_color(CYAN, BLACK);
|
||||
mvprintw( 7, 2, "1. Docs root");
|
||||
mvprintw( 8, 2, "2. Link to ftp");
|
||||
@@ -1628,19 +1584,18 @@ void global_menu(void)
|
||||
mvprintw(12, 6, "6. Edit User flag Descriptions");
|
||||
mvprintw(13, 6, "7. Edit New Users defaults");
|
||||
mvprintw(14, 6, "8. Edit Text Colors");
|
||||
mvprintw(15, 6, "9. Edit Safe Door");
|
||||
mvprintw(16, 6, "10. Edit Sysop Paging");
|
||||
mvprintw(15, 6, "9. Edit Sysop Paging");
|
||||
|
||||
mvprintw( 7,46, "11. Edit Files Processing");
|
||||
mvprintw( 8,46, "12. Edit Fidonet Mail/Echomail");
|
||||
mvprintw( 9,46, "13. Edit Internet Mail/News");
|
||||
mvprintw(10,46, "14. Edit All-/Newfiles lists");
|
||||
mvprintw(11,46, "15. Edit Mailer global setup");
|
||||
mvprintw(12,46, "16. Edit Ftp daemon setup");
|
||||
mvprintw(13,46, "17. Edit HTML pages setup");
|
||||
mvprintw(14,46, "18. Edit Mgr flag descriptions");
|
||||
mvprintw( 7,46, "10. Edit Files Processing");
|
||||
mvprintw( 8,46, "11. Edit Fidonet Mail/Echomail");
|
||||
mvprintw( 9,46, "12. Edit Internet Mail/News");
|
||||
mvprintw(10,46, "13. Edit All-/Newfiles lists");
|
||||
mvprintw(11,46, "14. Edit Mailer global setup");
|
||||
mvprintw(12,46, "15. Edit Ftp daemon setup");
|
||||
mvprintw(13,46, "16. Edit HTML pages setup");
|
||||
mvprintw(14,46, "17. Edit Mgr flag descriptions");
|
||||
|
||||
switch(select_menu(18)) {
|
||||
switch(select_menu(17)) {
|
||||
case 0:
|
||||
crc1 = 0xffffffff;
|
||||
crc1 = upd_crc32((char *)&CFG, crc1, sizeof(CFG));
|
||||
@@ -1677,33 +1632,30 @@ void global_menu(void)
|
||||
e_colors();
|
||||
break;
|
||||
case 9:
|
||||
e_safe_door();
|
||||
break;
|
||||
case 10:
|
||||
e_paging();
|
||||
break;
|
||||
case 11:
|
||||
case 10:
|
||||
e_ticconf();
|
||||
break;
|
||||
case 12:
|
||||
case 11:
|
||||
e_fidomailcfg();
|
||||
break;
|
||||
case 13:
|
||||
case 12:
|
||||
e_intmailcfg();
|
||||
break;
|
||||
case 14:
|
||||
case 13:
|
||||
e_newfiles();
|
||||
break;
|
||||
case 15:
|
||||
case 14:
|
||||
e_mailer();
|
||||
break;
|
||||
case 16:
|
||||
case 15:
|
||||
e_ftpd();
|
||||
break;
|
||||
case 17:
|
||||
case 16:
|
||||
e_html();
|
||||
break;
|
||||
case 18:
|
||||
case 17:
|
||||
e_flags(FALSE);
|
||||
break;
|
||||
}
|
||||
@@ -1927,20 +1879,8 @@ int global_doc(FILE *fp, FILE *toc, int page)
|
||||
fprintf(fp, " File description %s on %s\n", get_color(CFG.FiledescF), get_color(CFG.FiledescB));
|
||||
fprintf(fp, " Message input %s on %s\n", get_color(CFG.MsgInputColourF), get_color(CFG.MsgInputColourB));
|
||||
|
||||
addtoc(fp, toc, 1, 10, page, (char *)"Safecracker door");
|
||||
|
||||
fprintf(fp, " Digit nr 1 %d\n", CFG.iSafeFirstDigit);
|
||||
fprintf(fp, " Digit nr 2 %d\n", CFG.iSafeSecondDigit);
|
||||
fprintf(fp, " Digit nr 3 %d\n", CFG.iSafeThirdDigit);
|
||||
fprintf(fp, " Maximum tries %d\n", CFG.iSafeMaxTrys);
|
||||
fprintf(fp, " Maximum number %d\n", CFG.iSafeMaxNumber);
|
||||
fprintf(fp, " Show generator %s\n", getboolean(CFG.iSafeNumGen));
|
||||
fprintf(fp, " Prize %s\n", CFG.sSafePrize);
|
||||
fprintf(fp, " Safe welcome %s\n", CFG.sSafeWelcome);
|
||||
fprintf(fp, " Safe opened file %s\n", CFG.sSafeOpened);
|
||||
|
||||
page = newpage(fp, page);
|
||||
addtoc(fp, toc, 1, 11, page, (char *)"Sysop paging");
|
||||
addtoc(fp, toc, 1, 10, page, (char *)"Sysop paging");
|
||||
|
||||
fprintf(fp, " Ext. Chat program %s\n", CFG.sExternalChat);
|
||||
fprintf(fp, " Chat device %s\n", CFG.sChatDevice);
|
||||
@@ -1964,7 +1904,7 @@ int global_doc(FILE *fp, FILE *toc, int page)
|
||||
fprintf(fp, " Friday %s %s\n", CFG.cStartTime[5], CFG.cStopTime[5]);
|
||||
fprintf(fp, " Saterday %s %s\n", CFG.cStartTime[6], CFG.cStopTime[6]);
|
||||
|
||||
addtoc(fp, toc, 1, 12, page, (char *)"Fileecho processing");
|
||||
addtoc(fp, toc, 1, 11, page, (char *)"Fileecho processing");
|
||||
|
||||
fprintf(fp, " Keep days on hold %d\n", CFG.tic_days);
|
||||
fprintf(fp, " Hatch password %s\n", CFG.hatchpasswd);
|
||||
@@ -1983,7 +1923,7 @@ int global_doc(FILE *fp, FILE *toc, int page)
|
||||
fprintf(fp, " FileMgr: pause %s\n", getboolean(CFG.ct_Pause));
|
||||
|
||||
page = newpage(fp, page);
|
||||
addtoc(fp, toc, 1, 13, page, (char *)"Fidonet Mail and Echomail processing");
|
||||
addtoc(fp, toc, 1, 12, page, (char *)"Fidonet Mail and Echomail processing");
|
||||
|
||||
fprintf(fp, " Max .pkt size %d Kb.\n", CFG.maxpktsize);
|
||||
fprintf(fp, " Max archive size %d Kb.\n", CFG.maxarcsize);
|
||||
@@ -2003,7 +1943,7 @@ int global_doc(FILE *fp, FILE *toc, int page)
|
||||
fprintf(fp, " AreaMgr: passwd %s\n", getboolean(CFG.ca_Passwd));
|
||||
fprintf(fp, " AreaMgr: pause %s\n", getboolean(CFG.ca_Pause));
|
||||
|
||||
addtoc(fp, toc, 1, 14, page, (char *)"Internet Mail and News processing");
|
||||
addtoc(fp, toc, 1, 13, page, (char *)"Internet Mail and News processing");
|
||||
|
||||
fprintf(fp, " Split messages at %d KBytes\n", CFG.new_split);
|
||||
fprintf(fp, " Force split at %d KBytes\n", CFG.new_force);
|
||||
@@ -2029,14 +1969,14 @@ int global_doc(FILE *fp, FILE *toc, int page)
|
||||
fprintf(fp, " Allow control msgs %s\n", getboolean(CFG.allowcontrol));
|
||||
fprintf(fp, " Don't regate msgs %s\n", getboolean(CFG.dontregate));
|
||||
|
||||
addtoc(fp, toc, 1, 15, page, (char *)"Newfile reports");
|
||||
addtoc(fp, toc, 1, 14, page, (char *)"Newfile reports");
|
||||
|
||||
fprintf(fp, " New files days %d\n", CFG.newdays);
|
||||
fprintf(fp, " Highest sec. level %s\n", get_secstr(CFG.security));
|
||||
fprintf(fp, " Max. newfile grps %ld\n", CFG.new_groups);
|
||||
|
||||
page = newpage(fp, page);
|
||||
addtoc(fp, toc, 1, 16, page, (char *)"Mailer setup");
|
||||
addtoc(fp, toc, 1, 15, page, (char *)"Mailer setup");
|
||||
|
||||
p = getloglevel(CFG.cico_loglevel);
|
||||
fprintf(fp, " Mailer loglevel %s\n", p);
|
||||
@@ -2063,7 +2003,7 @@ int global_doc(FILE *fp, FILE *toc, int page)
|
||||
fprintf(fp, " Translate %-20s %s\n", CFG.phonetrans[i].match, CFG.phonetrans[i].repl);
|
||||
|
||||
page = newpage(fp, page);
|
||||
addtoc(fp, toc, 1, 17, page, (char *)"FTP server setup");
|
||||
addtoc(fp, toc, 1, 16, page, (char *)"FTP server setup");
|
||||
|
||||
fprintf(fp, " Connections limit %d\n", CFG.ftp_limit);
|
||||
fprintf(fp, " Login fails %d\n", CFG.ftp_loginfails);
|
||||
@@ -2083,7 +2023,7 @@ int global_doc(FILE *fp, FILE *toc, int page)
|
||||
fprintf(fp, " Path filter %s\n", CFG.ftp_pth_filter);
|
||||
fprintf(fp, " Path message %s\n", CFG.ftp_pth_message);
|
||||
|
||||
addtoc(fp, toc, 1, 18, page, (char *)"WWW server setup");
|
||||
addtoc(fp, toc, 1, 17, page, (char *)"WWW server setup");
|
||||
|
||||
fprintf(fp, " HTML root %s\n", CFG.www_root);
|
||||
fprintf(fp, " Link to FTP base %s\n", CFG.www_link2ftp);
|
||||
@@ -2094,7 +2034,7 @@ int global_doc(FILE *fp, FILE *toc, int page)
|
||||
fprintf(fp, " File per webpage %d\n", CFG.www_files_page);
|
||||
|
||||
page = newpage(fp, page);
|
||||
addtoc(fp, toc, 1,19, page, (char *)"Manager flag descriptions");
|
||||
addtoc(fp, toc, 1,18, page, (char *)"Manager flag descriptions");
|
||||
fprintf(fp, " 1 1 2 2 3 3\n");
|
||||
fprintf(fp, " 1 5 0 5 0 5 0 2\n");
|
||||
fprintf(fp, " --------------------------------\n");
|
||||
|
@@ -136,13 +136,13 @@ void Show_A_Menu(void)
|
||||
S_COL(15,16, "Normal display color", le_int(menus.ForeGnd), le_int(menus.BackGnd))
|
||||
S_COL(16,16, "Bright display color", le_int(menus.HiForeGnd), le_int(menus.HiBackGnd))
|
||||
set_color(WHITE, BLACK);
|
||||
show_bool(17,16, menus.AutoExec);
|
||||
show_bool(17,16, le_int(menus.AutoExec));
|
||||
if (le_int(menus.MenuType) == 7) {
|
||||
show_bool(13,58, menus.NoDoorsys);
|
||||
show_bool(14,58, menus.Y2Kdoorsys);
|
||||
show_bool(15,58, menus.Comport);
|
||||
show_bool(16,58, menus.NoSuid);
|
||||
show_bool(17,58, menus.NoPrompt);
|
||||
show_bool(13,58, le_int(menus.NoDoorsys));
|
||||
show_bool(14,58, le_int(menus.Y2Kdoorsys));
|
||||
show_bool(15,58, le_int(menus.Comport));
|
||||
show_bool(16,58, le_int(menus.NoSuid));
|
||||
show_bool(17,58, le_int(menus.NoPrompt));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ int GetMenuType(void)
|
||||
mvprintw(12, 6, "6. BBS List menus");
|
||||
|
||||
switch (select_menu(6)) {
|
||||
case 1: return GetSubmenu(1, 25);
|
||||
case 1: return GetSubmenu(1, 21);
|
||||
case 2: return GetSubmenu(101, 19);
|
||||
case 3: return GetSubmenu(201, 21);
|
||||
case 4: return GetSubmenu(301, 19);
|
||||
@@ -254,25 +254,38 @@ void Edit_A_Menu(void)
|
||||
menus.HiBackGnd = le_int(bg);
|
||||
Show_A_Menu();
|
||||
break;
|
||||
case 10:E_BOOL(17,16, menus.AutoExec, "Is this an ^Autoexecute^ menu item")
|
||||
case 10:temp = le_int(menus.AutoExec);
|
||||
temp = edit_bool(17,16, temp, (char *)"Is this an ^Autoexecute^ menu item");
|
||||
menus.AutoExec = le_int(temp);
|
||||
break;
|
||||
case 11:if (le_int(menus.MenuType) == 7) {
|
||||
E_BOOL(13,58, menus.NoDoorsys, "Suppress writing ^door.sys^ dropfile")
|
||||
temp = le_int(menus.NoDoorsys);
|
||||
temp = edit_bool(13,58, temp, (char *)"Suppress writing ^door.sys^ dropfile");
|
||||
menus.NoDoorsys = le_int(temp);
|
||||
} else
|
||||
break;
|
||||
case 12:if (le_int(menus.MenuType) == 7) {
|
||||
E_BOOL(14,58, menus.Y2Kdoorsys, "Create ^door.sys^ with 4 digit yearnumbers")
|
||||
temp = le_int(menus.Y2Kdoorsys);
|
||||
temp = edit_bool(14,58, temp, (char *)"Create ^door.sys^ with 4 digit yearnumbers");
|
||||
menus.Y2Kdoorsys = le_int(temp);
|
||||
} else
|
||||
break;
|
||||
case 13:if (le_int(menus.MenuType) == 7) {
|
||||
E_BOOL(15,58, menus.Comport, "Write real ^COM port^ in door.sys for Vmodem patch")
|
||||
temp = le_int(menus.Comport);
|
||||
temp = edit_bool(15,58, temp, (char *)"Write real ^COM port^ in door.sys for Vmodem patch");
|
||||
menus.Comport = le_int(temp);
|
||||
} else
|
||||
break;
|
||||
case 14:if (le_int(menus.MenuType) == 7) {
|
||||
E_BOOL(16,58, menus.NoSuid, "Run the door as ^real user (nosuid)^")
|
||||
temp = le_int(menus.NoSuid);
|
||||
temp = edit_bool(16,58, temp, (char *)"Run the door as ^real user (nosuid)^");
|
||||
menus.NoSuid = le_int(temp);
|
||||
} else
|
||||
break;
|
||||
case 15:if (le_int(menus.MenuType) == 7) {
|
||||
E_BOOL(17,58, menus.NoPrompt, "^Don't display prompt^ when door is finished")
|
||||
temp = le_int(menus.NoPrompt);
|
||||
temp = edit_bool(17,58, temp, (char *)"^Don't display prompt^ when door is finished");
|
||||
menus.NoPrompt = le_int(temp);
|
||||
} else
|
||||
break;
|
||||
}
|
||||
@@ -326,7 +339,7 @@ void EditMenu(char *Name)
|
||||
if (menus.MenuKey[0] || menus.AutoExec) {
|
||||
set_color(CYAN, BLACK);
|
||||
mvprintw(y, 5, "%3d. ", o + i);
|
||||
if (menus.AutoExec) {
|
||||
if (le_int(menus.AutoExec)) {
|
||||
set_color(LIGHTRED, BLACK);
|
||||
mvprintw(y, 10, "a");
|
||||
set_color(CYAN, BLACK);
|
||||
@@ -334,10 +347,12 @@ void EditMenu(char *Name)
|
||||
mvprintw(y, 10, "%1s", menus.MenuKey);
|
||||
}
|
||||
if (le_int(menus.MenuType) == 999 ) {
|
||||
mvprintw(y, 12, "%-29s %5d %s", menus.TypeDesc, le_int(menus.MenuSecurity.level), menus.Display);
|
||||
sprintf(temp, "%-29s %5d %s", menus.TypeDesc, le_int(menus.MenuSecurity.level), menus.Display);
|
||||
} else {
|
||||
mvprintw(y, 12, "%-29s %5d %s", menus.TypeDesc, le_int(menus.MenuSecurity.level), menus.OptionalData);
|
||||
sprintf(temp, "%-29s %5d %s", menus.TypeDesc, le_int(menus.MenuSecurity.level), menus.OptionalData);
|
||||
}
|
||||
temp[68] = '\0';
|
||||
mvprintw(y, 12, temp);
|
||||
} else {
|
||||
set_color(LIGHTBLUE, BLACK);
|
||||
mvprintw(y, 5, "%3d.", o + i);
|
||||
@@ -588,7 +603,7 @@ int bbs_menu_doc(FILE *fp, FILE *toc, int page)
|
||||
while (fread(&menus, sizeof(menus), 1, mn) == 1) {
|
||||
if (menus.MenuKey[0])
|
||||
fprintf(fp, " Menu select %s\n", menus.MenuKey);
|
||||
if (menus.AutoExec)
|
||||
if (le_int(menus.AutoExec))
|
||||
fprintf(fp, " Menu select Autoexec\n");
|
||||
fprintf(fp, " Type %d %s\n", le_int(menus.MenuType), menus.TypeDesc);
|
||||
fprintf(fp, " Opt. data %s\n", menus.OptionalData);
|
||||
@@ -601,11 +616,11 @@ int bbs_menu_doc(FILE *fp, FILE *toc, int page)
|
||||
fprintf(fp, " Hi-colors %s on %s\n",
|
||||
get_color(le_int(menus.HiForeGnd)), get_color(le_int(menus.HiBackGnd)));
|
||||
if (le_int(menus.MenuType) == 7) {
|
||||
fprintf(fp, " No door.sys %s\n", getboolean(menus.NoDoorsys));
|
||||
fprintf(fp, " Y2K door.sys %s\n", getboolean(menus.Y2Kdoorsys));
|
||||
fprintf(fp, " Use COM port %s\n", getboolean(menus.Comport));
|
||||
fprintf(fp, " No setuid %s\n", getboolean(menus.NoSuid));
|
||||
fprintf(fp, " No Prompt %s\n", getboolean(menus.NoPrompt));
|
||||
fprintf(fp, " No door.sys %s\n", getboolean(le_int(menus.NoDoorsys)));
|
||||
fprintf(fp, " Y2K door.sys %s\n", getboolean(le_int(menus.Y2Kdoorsys)));
|
||||
fprintf(fp, " Use COM port %s\n", getboolean(le_int(menus.Comport)));
|
||||
fprintf(fp, " No setuid %s\n", getboolean(le_int(menus.NoSuid)));
|
||||
fprintf(fp, " No Prompt %s\n", getboolean(le_int(menus.NoPrompt)));
|
||||
}
|
||||
fprintf(fp, "\n\n");
|
||||
j++;
|
||||
|
349
mbsetup/m_safe.c
349
mbsetup/m_safe.c
@@ -1,349 +0,0 @@
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
* Purpose ...............: Setup Safecracker Data
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2002
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
* 1971 BV IJmuiden
|
||||
* the Netherlands
|
||||
*
|
||||
* This file is part of MBSE safe.
|
||||
*
|
||||
* This safe is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2, or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* MB safe is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with MB safe; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../config.h"
|
||||
#include "../lib/libs.h"
|
||||
#include "../lib/memwatch.h"
|
||||
#include "../lib/structs.h"
|
||||
#include "../lib/users.h"
|
||||
#include "../lib/records.h"
|
||||
#include "../lib/common.h"
|
||||
#include "../lib/clcomm.h"
|
||||
#include "screen.h"
|
||||
#include "mutil.h"
|
||||
#include "ledit.h"
|
||||
#include "m_global.h"
|
||||
#include "m_safe.h"
|
||||
|
||||
|
||||
|
||||
int SafeUpdated = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Count nr of safecracker records in the database.
|
||||
* Creates the database if it doesn't exist.
|
||||
*/
|
||||
int CountSafe(void)
|
||||
{
|
||||
FILE *fil;
|
||||
char ffile[PATH_MAX];
|
||||
int count;
|
||||
|
||||
sprintf(ffile, "%s/etc/safe.data", getenv("MBSE_ROOT"));
|
||||
if ((fil = fopen(ffile, "r")) == NULL) {
|
||||
if ((fil = fopen(ffile, "a+")) != NULL) {
|
||||
Syslog('+', "created new %s", ffile);
|
||||
safehdr.hdrsize = sizeof(safehdr);
|
||||
safehdr.recsize = sizeof(safe);
|
||||
fwrite(&safehdr, sizeof(safehdr), 1, fil);
|
||||
fclose(fil);
|
||||
chmod(ffile, 0660);
|
||||
return 0;
|
||||
} else
|
||||
return -1;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
fread(&safehdr, sizeof(safehdr), 1, fil);
|
||||
|
||||
while (fread(&safe, safehdr.recsize, 1, fil) == 1) {
|
||||
count++;
|
||||
}
|
||||
fclose(fil);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Open database for editing. The datafile is copied, if the format
|
||||
* is changed it will be converted on the fly. All editing must be
|
||||
* done on the copied file.
|
||||
*/
|
||||
int OpenSafe(void);
|
||||
int OpenSafe(void)
|
||||
{
|
||||
FILE *fin, *fout;
|
||||
char fnin[PATH_MAX], fnout[PATH_MAX];
|
||||
long oldsize;
|
||||
|
||||
sprintf(fnin, "%s/etc/safe.data", getenv("MBSE_ROOT"));
|
||||
sprintf(fnout, "%s/etc/safe.temp", getenv("MBSE_ROOT"));
|
||||
if ((fin = fopen(fnin, "r")) != NULL) {
|
||||
if ((fout = fopen(fnout, "w")) != NULL) {
|
||||
fread(&safehdr, sizeof(safehdr), 1, fin);
|
||||
/*
|
||||
* In case we are automaic upgrading the data format
|
||||
* we save the old format. If it is changed, the
|
||||
* database must always be updated.
|
||||
*/
|
||||
oldsize = safehdr.recsize;
|
||||
if (oldsize != sizeof(safe)) {
|
||||
SafeUpdated = 1;
|
||||
Syslog('+', "Upgraded %s, format changed", fnin);
|
||||
} else
|
||||
SafeUpdated = 0;
|
||||
safehdr.hdrsize = sizeof(safehdr);
|
||||
safehdr.recsize = sizeof(safe);
|
||||
fwrite(&safehdr, sizeof(safehdr), 1, fout);
|
||||
|
||||
/*
|
||||
* The datarecord is filled with zero's before each
|
||||
* read, so if the format changed, the new fields
|
||||
* will be empty.
|
||||
*/
|
||||
memset(&safe, 0, sizeof(safe));
|
||||
while (fread(&safe, oldsize, 1, fin) == 1) {
|
||||
fwrite(&safe, sizeof(safe), 1, fout);
|
||||
memset(&safe, 0, sizeof(safe));
|
||||
}
|
||||
|
||||
fclose(fin);
|
||||
fclose(fout);
|
||||
return 0;
|
||||
} else
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CloseSafe(int);
|
||||
void CloseSafe(int force)
|
||||
{
|
||||
char fin[PATH_MAX], fout[PATH_MAX];
|
||||
|
||||
sprintf(fin, "%s/etc/safe.data", getenv("MBSE_ROOT"));
|
||||
sprintf(fout,"%s/etc/safe.temp", getenv("MBSE_ROOT"));
|
||||
|
||||
if (SafeUpdated == 1) {
|
||||
if (force || (yes_no((char *)"Database is changed, save changes") == 1)) {
|
||||
working(1, 0, 0);
|
||||
if ((rename(fout, fin)) == 0)
|
||||
unlink(fout);
|
||||
chmod(fin, 0660);
|
||||
Syslog('+', "Updated \"safe.data\"");
|
||||
return;
|
||||
}
|
||||
}
|
||||
chmod(fin, 0660);
|
||||
working(1, 0, 0);
|
||||
unlink(fout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Edit one record, return -1 if there are errors, 0 if ok.
|
||||
*/
|
||||
int EditSafeRec(int Area)
|
||||
{
|
||||
FILE *fil;
|
||||
char mfile[PATH_MAX];
|
||||
long offset;
|
||||
int j, Open;
|
||||
unsigned long crc, crc1;
|
||||
|
||||
clr_index();
|
||||
working(1, 0, 0);
|
||||
IsDoing("Edit Safe");
|
||||
|
||||
sprintf(mfile, "%s/etc/safe.temp", getenv("MBSE_ROOT"));
|
||||
if ((fil = fopen(mfile, "r")) == NULL) {
|
||||
working(2, 0, 0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
offset = sizeof(safehdr) + ((Area -1) * sizeof(safe));
|
||||
if (fseek(fil, offset, 0) != 0) {
|
||||
working(2, 0, 0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
fread(&safe, sizeof(safe), 1, fil);
|
||||
fclose(fil);
|
||||
crc = 0xffffffff;
|
||||
crc = upd_crc32((char *)&safe, crc, sizeof(safe));
|
||||
working(0, 0, 0);
|
||||
|
||||
set_color(WHITE, BLACK);
|
||||
mvprintw( 5, 5, "8.8 EDIT safe");
|
||||
set_color(CYAN, BLACK);
|
||||
|
||||
mvprintw( 7, 5, "1. Name");
|
||||
mvprintw( 8, 5, "2. Date");
|
||||
mvprintw( 9, 5, "3. Tries");
|
||||
mvprintw(10, 5, "4. Opended");
|
||||
|
||||
for (;;) {
|
||||
set_color(WHITE, BLACK);
|
||||
show_str( 7,17,35, safe.Name);
|
||||
show_str( 8,17,10, safe.Date);
|
||||
show_int( 9,17, safe.Trys);
|
||||
show_bool(10,17, safe.Opened);
|
||||
|
||||
j = select_menu(4);
|
||||
switch(j) {
|
||||
case 0: crc1 = 0xffffffff;
|
||||
crc1 = upd_crc32((char *)&safe, crc1, sizeof(safe));
|
||||
if (crc != crc1) {
|
||||
if (yes_no((char *)"Record is changed, save") == 1) {
|
||||
working(1, 0, 0);
|
||||
if ((fil = fopen(mfile, "r+")) == NULL) {
|
||||
working(2, 0, 0);
|
||||
return -1;
|
||||
}
|
||||
fseek(fil, offset, 0);
|
||||
fwrite(&safe, sizeof(safe), 1, fil);
|
||||
fclose(fil);
|
||||
SafeUpdated = 1;
|
||||
working(1, 0, 0);
|
||||
working(0, 0, 0);
|
||||
}
|
||||
}
|
||||
IsDoing("Browsing Menu");
|
||||
return 0;
|
||||
case 1: E_STR( 7,17,35, safe.Name, "The Safecrackers ^Username^")
|
||||
case 2: E_STR( 8,17,10, safe.Date, "The ^last date^ attempt to open the safe (DD-MM-YYYY)")
|
||||
case 3: E_INT( 9,17, safe.Trys, "The ^number of tries^ for today to open the safe")
|
||||
case 4: Open = edit_bool(10,17, safe.Opened, (char *)"Set or reset the safe ^cracked^ status");
|
||||
if (safe.Opened && !Open) {
|
||||
safe.Opened = FALSE;
|
||||
safe.Trys = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void EditSafe(void)
|
||||
{
|
||||
int records, i, x, y, o;
|
||||
char pick[12];
|
||||
FILE *fil;
|
||||
char temp[PATH_MAX];
|
||||
long offset;
|
||||
|
||||
clr_index();
|
||||
working(1, 0, 0);
|
||||
IsDoing("Browsing Menu");
|
||||
if (config_read() == -1) {
|
||||
working(2, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
records = CountSafe();
|
||||
if (records == -1) {
|
||||
working(2, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (OpenSafe() == -1) {
|
||||
working(2, 0, 0);
|
||||
return;
|
||||
}
|
||||
working(0, 0, 0);
|
||||
o = 0;
|
||||
|
||||
for (;;) {
|
||||
clr_index();
|
||||
set_color(WHITE, BLACK);
|
||||
mvprintw( 5, 5, "8.8 SAFE CRACKER SETUP");
|
||||
set_color(CYAN, BLACK);
|
||||
if (records != 0) {
|
||||
sprintf(temp, "%s/etc/safe.temp", getenv("MBSE_ROOT"));
|
||||
working(1, 0, 0);
|
||||
if ((fil = fopen(temp, "r")) != NULL) {
|
||||
fread(&safehdr, sizeof(safehdr), 1, fil);
|
||||
x = 2;
|
||||
y = 7;
|
||||
set_color(CYAN, BLACK);
|
||||
for (i = 1; i <= 20; i++) {
|
||||
if (i == 11) {
|
||||
x = 42;
|
||||
y = 7;
|
||||
}
|
||||
if ((o + i) <= records) {
|
||||
offset = sizeof(safehdr) + (((o + i) - 1) * safehdr.recsize);
|
||||
fseek(fil, offset, 0);
|
||||
fread(&safe, safehdr.recsize, 1, fil);
|
||||
if (safe.Opened)
|
||||
set_color(LIGHTRED, BLACK);
|
||||
else
|
||||
set_color(CYAN, BLACK);
|
||||
sprintf(temp, "%3d. %-32s", o + i, safe.Name);
|
||||
temp[38] = '\0';
|
||||
mvprintw(y, x, temp);
|
||||
y++;
|
||||
}
|
||||
}
|
||||
fclose(fil);
|
||||
}
|
||||
}
|
||||
working(0, 0, 0);
|
||||
strcpy(pick, select_pick(records,20));
|
||||
|
||||
if (strncmp(pick, "-", 1) == 0) {
|
||||
CloseSafe(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strncmp(pick, "N", 1) == 0)
|
||||
if ((o + 20) < records)
|
||||
o = o + 20;
|
||||
|
||||
if (strncmp(pick, "P", 1) == 0)
|
||||
if ((o - 20) >= 0)
|
||||
o = o - 20;
|
||||
|
||||
if ((atoi(pick) >= 1) && (atoi(pick) <= records)) {
|
||||
EditSafeRec(atoi(pick));
|
||||
o = ((atoi(pick) - 1) / 20) * 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void InitSafe(void)
|
||||
{
|
||||
CountSafe();
|
||||
OpenSafe();
|
||||
CloseSafe(TRUE);
|
||||
}
|
||||
|
||||
|
@@ -1,12 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef _SAFE_H
|
||||
#define _SAFE_H
|
||||
|
||||
|
||||
int CountSafe(void);
|
||||
void EditSafe(void);
|
||||
void InitSafe(void);
|
||||
|
||||
#endif
|
||||
|
@@ -62,7 +62,6 @@
|
||||
#include "m_new.h"
|
||||
#include "m_ol.h"
|
||||
#include "m_bbslist.h"
|
||||
#include "m_safe.h"
|
||||
#include "m_protocol.h"
|
||||
#include "m_ff.h"
|
||||
#include "m_modem.h"
|
||||
@@ -386,7 +385,6 @@ void initdatabases(void)
|
||||
InitNodes();
|
||||
InitOneline();
|
||||
InitBBSlist();
|
||||
InitSafe();
|
||||
InitProtocol();
|
||||
InitService();
|
||||
InitTicarea();
|
||||
|
Reference in New Issue
Block a user