Added archiver selection for nodes in node setup

This commit is contained in:
Michiel Broek 2006-02-24 20:33:27 +00:00
parent 7ba32f5d22
commit fc4f560781
10 changed files with 110 additions and 80 deletions

View File

@ -12,6 +12,10 @@ $Id$
v0.83.14 23-Feb-2006 v0.83.14 23-Feb-2006
mbsetup:
Added archiver selection for nodes in node setup.
v0.83.13 13-Feb-2006 - 23-Feb-2006 v0.83.13 13-Feb-2006 - 23-Feb-2006
upgrade: upgrade:

View File

@ -1738,6 +1738,7 @@ struct _nodes {
char Ct_remark[65]; /* Remark */ char Ct_remark[65]; /* Remark */
securityrec Security; /* Security flags */ securityrec Security; /* Security flags */
char Archiver[6]; /* Archiver to use */
}; };

View File

@ -95,7 +95,7 @@ m_fdb.o: ../config.h ../lib/mbselib.h ../lib/users.h ../lib/mbsedb.h screen.h mu
m_global.o: ../config.h ../paths.h ../lib/mbselib.h screen.h mutil.h ledit.h m_node.h m_marea.h m_ticarea.h m_new.h m_fgroup.h m_mgroup.h m_limits.h m_global.h m_global.o: ../config.h ../paths.h ../lib/mbselib.h screen.h mutil.h ledit.h m_node.h m_marea.h m_ticarea.h m_new.h m_fgroup.h m_mgroup.h m_limits.h m_global.h
m_magic.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h stlist.h m_ticarea.h m_global.h m_magic.h m_magic.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h stlist.h m_ticarea.h m_global.h m_magic.h
m_mgroup.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h stlist.h m_global.h m_node.h m_marea.h m_mgroup.h m_mgroup.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h stlist.h m_global.h m_node.h m_marea.h m_mgroup.h
m_node.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h grlist.h stlist.h m_global.h m_lang.h m_ticarea.h m_marea.h m_node.h m_node.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h grlist.h stlist.h m_global.h m_lang.h m_ticarea.h m_marea.h m_archive.h m_node.h
m_task.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h m_task.h m_task.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h m_task.h
m_users.o: ../config.h ../lib/mbselib.h ../lib/users.h screen.h mutil.h ledit.h m_lang.h m_global.h m_archive.h m_protocol.h m_users.h m_users.o: ../config.h ../lib/mbselib.h ../lib/users.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/mbselib.h screen.h screen.o: ../config.h ../lib/mbselib.h screen.h

View File

@ -710,10 +710,10 @@ void InitArchive(void)
char *PickArchive(char *shdr) char *PickArchive(char *shdr, int mailmode)
{ {
static char Arch[6] = ""; static char Arch[6] = "";
int records, i, x, y; int records, i, y, o = 0;
char pick[12]; char pick[12];
FILE *fil; FILE *fil;
char temp[PATH_MAX]; char temp[PATH_MAX];
@ -733,43 +733,51 @@ char *PickArchive(char *shdr)
return Arch; return Arch;
} }
if (records != 0) {
snprintf(temp, PATH_MAX, "%s/etc/archiver.data", getenv("MBSE_ROOT"));
if ((fil = fopen(temp, "r")) != NULL) {
fread(&archiverhdr, sizeof(archiverhdr), 1, fil);
for (;;) {
clr_index(); clr_index();
set_color(WHITE, BLACK); set_color(WHITE, BLACK);
snprintf(temp, 81, "%s. ARCHIVER SELECT", shdr); snprintf(temp, 81, "%s. ARCHIVER SELECT", shdr);
mbse_mvprintw( 5, 4, temp); mbse_mvprintw( 5, 4, temp);
set_color(CYAN, BLACK); set_color(CYAN, BLACK);
if (records != 0) {
snprintf(temp, PATH_MAX, "%s/etc/archiver.data", getenv("MBSE_ROOT"));
if ((fil = fopen(temp, "r")) != NULL) {
fread(&archiverhdr, sizeof(archiverhdr), 1, fil);
x = 2;
y = 7; y = 7;
set_color(CYAN, BLACK); for (i = 1; i <= 10; i++) {
for (i = 1; i <= records; i++) { if ((o + i) <= records) {
offset = sizeof(archiverhdr) + ((i - 1) * archiverhdr.recsize); offset = sizeof(archiverhdr) + (((o + i) - 1) * archiverhdr.recsize);
fseek(fil, offset, 0); fseek(fil, offset, 0);
fread(&archiver, archiverhdr.recsize, 1, fil); fread(&archiver, archiverhdr.recsize, 1, fil);
if (i == 11) { if (mailmode && archiver.available && strlen(archiver.marc))
x = 41; set_color(CYAN, BLACK);
y = 7; else if (! mailmode && archiver.available && strlen(archiver.farc))
}
if (archiver.available)
set_color(CYAN, BLACK); set_color(CYAN, BLACK);
else else
set_color(LIGHTBLUE, BLACK); set_color(LIGHTBLUE, BLACK);
snprintf(temp, 81, "%3d. %-32s", i, archiver.comment); snprintf(temp, 81, "%3d. %-5s %-32s", o+i, archiver.name, archiver.comment);
temp[37] = 0; mbse_mvprintw(y, 2, temp);
mbse_mvprintw(y, x, temp);
y++; y++;
} }
strcpy(pick, select_pick(records, 20)); }
strcpy(pick, select_pick(records, 10));
if (strncmp(pick, "N", 1) == 0)
if ((o + 10) < records)
o = o + 10;
if (strncmp(pick, "P", 1) == 0)
if ((o - 10) >= 0)
o = o - 10;
if ((atoi(pick) >= 1) && (atoi(pick) <= records)) { if ((atoi(pick) >= 1) && (atoi(pick) <= records)) {
offset = sizeof(archiverhdr) + ((atoi(pick) - 1) * archiverhdr.recsize); offset = sizeof(archiverhdr) + ((atoi(pick) - 1) * archiverhdr.recsize);
fseek(fil, offset, 0); fseek(fil, offset, 0);
fread(&archiver, archiverhdr.recsize, 1, fil); fread(&archiver, archiverhdr.recsize, 1, fil);
strcpy(Arch, archiver.name); strcpy(Arch, archiver.name);
break;
}
} }
fclose(fil); fclose(fil);
} }

View File

@ -6,7 +6,7 @@
int CountArchive(void); int CountArchive(void);
void EditArchive(void); void EditArchive(void);
char *PickArchive(char *); char *PickArchive(char *, int);
void InitArchive(void); void InitArchive(void);
int archive_doc(FILE *, FILE *, int); int archive_doc(FILE *, FILE *, int);

View File

@ -480,7 +480,7 @@ int EditFileRec(int Area)
case 19:E_INT( 12,73, area.DLdays, "The not ^downloaded days^ to move/kill files") case 19:E_INT( 12,73, area.DLdays, "The not ^downloaded days^ to move/kill files")
case 20:E_INT( 13,73, area.FDdays, "The ^file age^ in days to move/kill files") case 20:E_INT( 13,73, area.FDdays, "The ^file age^ in days to move/kill files")
case 21:E_INT( 14,73, area.MoveArea, "The ^area to move^ files to, 0 is kill") case 21:E_INT( 14,73, area.MoveArea, "The ^area to move^ files to, 0 is kill")
case 22:strcpy(area.Archiver, PickArchive((char *)"8.4")); case 22:strcpy(area.Archiver, PickArchive((char *)"8.4", FALSE));
FileScreen(); FileScreen();
break; break;
case 23:E_INT( 16,73, area.Upload, "The ^upload^ area, 0 if upload in this area") case 23:E_INT( 16,73, area.Upload, "The ^upload^ area, 0 if upload in this area")

View File

@ -4,7 +4,7 @@
* Purpose ...............: Setup FGroups. * Purpose ...............: Setup FGroups.
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2005 * Copyright (C) 1997-2006
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -425,7 +425,7 @@ int EditFGrpRec(int Area)
case 6: E_STR( 11,16,12,fgroup.AreaFile, "The name of the ^Areas File^ from the uplink (case sensitive)") case 6: E_STR( 11,16,12,fgroup.AreaFile, "The name of the ^Areas File^ from the uplink (case sensitive)")
case 7: E_BOOL(12,16, fgroup.FileGate, "Is the areas file in ^filegate.zxx^ format") case 7: E_BOOL(12,16, fgroup.FileGate, "Is the areas file in ^filegate.zxx^ format")
case 8: E_STR( 13,16,14,fgroup.Banner, "The ^banner^ to add to the archives") case 8: E_STR( 13,16,14,fgroup.Banner, "The ^banner^ to add to the archives")
case 9: strcpy(fgroup.Convert, PickArchive((char *)"10.1.9")); case 9: strcpy(fgroup.Convert, PickArchive((char *)"10.1.9", FALSE));
FgScreen(); FgScreen();
break; break;
case 10:strncpy(fgroup.BbsGroup, PickFGroup((char *)"8.4.17"), 12); case 10:strncpy(fgroup.BbsGroup, PickFGroup((char *)"8.4.17"), 12);

View File

@ -39,6 +39,7 @@
#include "m_lang.h" #include "m_lang.h"
#include "m_ticarea.h" #include "m_ticarea.h"
#include "m_marea.h" #include "m_marea.h"
#include "m_archive.h"
#include "m_node.h" #include "m_node.h"
@ -154,6 +155,9 @@ int OpenNoderec(void)
nodes.Security.level = 1; nodes.Security.level = 1;
nodes.Security.flags = 1; nodes.Security.flags = 1;
} }
if (strlen(nodes.Archiver) == 0) {
snprintf(nodes.Archiver, 6, (char *)"ZIP");
}
} }
fwrite(&nodes, sizeof(nodes), 1, fout); fwrite(&nodes, sizeof(nodes), 1, fout);
memset(&nodes, 0, sizeof(nodes)); memset(&nodes, 0, sizeof(nodes));
@ -435,6 +439,11 @@ void E_UplMgr(void)
void E_Mail(void); void E_Mail(void);
void E_Mail(void) void E_Mail(void)
{ {
char temp[6];
int show = TRUE;
for (;;) {
if (show) {
clr_index(); clr_index();
set_color(WHITE, BLACK); set_color(WHITE, BLACK);
mbse_mvprintw( 5, 6, "7.4 EDIT NODE - MAIL PROCESSING"); mbse_mvprintw( 5, 6, "7.4 EDIT NODE - MAIL PROCESSING");
@ -444,22 +453,30 @@ void E_Mail(void)
mbse_mvprintw( 9, 6, "3. Mail forward"); mbse_mvprintw( 9, 6, "3. Mail forward");
mbse_mvprintw(10, 6, "4. ARCmail comp."); mbse_mvprintw(10, 6, "4. ARCmail comp.");
mbse_mvprintw(11, 6, "5. ARCmail a..z"); mbse_mvprintw(11, 6, "5. ARCmail a..z");
mbse_mvprintw(12, 6, "6. Archiver");
show = FALSE;
}
for (;;) {
set_color(WHITE, BLACK); set_color(WHITE, BLACK);
show_str( 7,25,15, (char *)"***************"); show_str( 7,25,15, (char *)"***************");
show_bool( 8,25, nodes.MailPwdCheck); show_bool( 8,25, nodes.MailPwdCheck);
show_bool( 9,25, nodes.MailFwd); show_bool( 9,25, nodes.MailFwd);
show_bool(10,25, nodes.ARCmailCompat); show_bool(10,25, nodes.ARCmailCompat);
show_bool(11,25, nodes.ARCmailAlpha); show_bool(11,25, nodes.ARCmailAlpha);
show_str( 12,25, 5, nodes.Archiver);
switch(select_menu(5)) { switch(select_menu(6)) {
case 0: return; case 0: return;
case 1: E_STR( 7,25,15, nodes.Epasswd, "The ^Mail (.pkt)^ password^ for this node") case 1: E_STR( 7,25,15, nodes.Epasswd, "The ^Mail (.pkt)^ password^ for this node")
case 2: E_BOOL( 8,25, nodes.MailPwdCheck, "Check the ^mail PKT^ password") case 2: E_BOOL( 8,25, nodes.MailPwdCheck, "Check the ^mail PKT^ password")
case 3: E_BOOL( 9,25, nodes.MailFwd, "^Forward^ echomail for this node") case 3: E_BOOL( 9,25, nodes.MailFwd, "^Forward^ echomail for this node")
case 4: E_BOOL(10,25, nodes.ARCmailCompat, "Use ^ARCmail 0.60^ file naming convention for out of zone mail") case 4: E_BOOL(10,25, nodes.ARCmailCompat, "Use ^ARCmail 0.60^ file naming convention for out of zone mail")
case 5: E_BOOL(11,25, nodes.ARCmailAlpha, "Allow ^0..9 and a..z^ filename extensions for ARCmail archives") case 5: E_BOOL(11,25, nodes.ARCmailAlpha, "Allow ^0..9 and a..z^ filename extensions for ARCmail archives")
case 6: strcpy(temp, PickArchive((char *)"7.4", TRUE));
if (strlen(temp) != 0)
strcpy(nodes.Archiver, temp);
show = TRUE;
break;
} }
} }
} }

View File

@ -4,7 +4,7 @@
* Purpose ...............: TIC Areas Setup Program * Purpose ...............: TIC Areas Setup Program
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2005 * Copyright (C) 1997-2006
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -959,7 +959,7 @@ int EditTicRec(int Area)
tic.Aka = CFG.aka[tmp]; tic.Aka = CFG.aka[tmp];
SetTicScreen(); SetTicScreen();
break; break;
case 9: strcpy(tic.Convert, PickArchive((char *)"10.2.9")); case 9: strcpy(tic.Convert, PickArchive((char *)"10.2.9", FALSE));
SetTicScreen(); SetTicScreen();
break; break;
case 10:E_STR(15,16,14, tic.Banner, "The ^banner^ to put in the file archives"); case 10:E_STR(15,16,14, tic.Banner, "The ^banner^ to put in the file archives");

View File

@ -4,7 +4,7 @@
* Purpose ...............: Edit Users * Purpose ...............: Edit Users
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2005 * Copyright (C) 1997-2006
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -403,7 +403,7 @@ int EditUsrRec2(void)
clr_index(); clr_index();
Screen2(); Screen2();
break; break;
case 12:strcpy(temp, PickArchive((char *)"15")); case 12:strcpy(temp, PickArchive((char *)"15", TRUE));
if (strlen(temp) != 0) if (strlen(temp) != 0)
strcpy(usrconfig.Archiver, temp); strcpy(usrconfig.Archiver, temp);
clr_index(); clr_index();