Upgraded files database strcuture

This commit is contained in:
Michiel Broek
2004-03-06 21:48:41 +00:00
parent 7918118edc
commit cf922872da
48 changed files with 1436 additions and 1376 deletions

View File

@@ -232,9 +232,8 @@ void FileScreen(void)
mvprintw(12,59, "21. DL days");
mvprintw(13,59, "22. FD days");
mvprintw(14,59, "23. Move area");
mvprintw(15,59, "24. Cost");
mvprintw(16,59, "25. Archiver");
mvprintw(17,59, "26. Upload");
mvprintw(15,59, "24. Archiver");
mvprintw(16,59, "25. Upload");
}
@@ -303,11 +302,10 @@ int EditFileRec(int Area)
show_int(12,73, area.DLdays);
show_int(13,73, area.FDdays);
show_int(14,73, area.MoveArea);
show_int(15,73, area.Cost);
show_str(16,73, 5, area.Archiver);
show_int(17,73, area.Upload);
show_str(15,73, 5, area.Archiver);
show_int(16,73, area.Upload);
switch(select_menu(26)) {
switch(select_menu(25)) {
case 0: crc1 = 0xffffffff;
crc1 = upd_crc32((char *)&area, crc1, areahdr.recsize);
if (crc != crc1) {
@@ -366,14 +364,15 @@ int EditFileRec(int Area)
case 6: E_STR( 11,16,64, area.FilesBbs, "The path and name of \"files.bbs\" if area is on CDROM")
case 7: Available = edit_bool(12, 16, area.Available, (char *)"Is this area ^available^");
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/fdb/fdb%d.data", getenv("MBSE_ROOT"), Area);
sprintf(temp, "%s/fdb/file%d.data", getenv("MBSE_ROOT"), Area);
if (area.Available && !Available) {
/*
* Attempt to disable this area, but check first.
*/
if ((fp = fopen(temp, "r"))) {
fread(&fdbhdr, sizeof(fdbhdr), 1, fp);
fseek(fp, 0, SEEK_END);
files = ftell(fp) / sizeof(file);
files = ((ftell(fp) - fdbhdr.hdrsize) / fdbhdr.recsize);
if (files) {
errmsg("There are stil %d files in this area", files);
Available = TRUE;
@@ -444,11 +443,10 @@ int EditFileRec(int Area)
case 21:E_INT( 12,73, area.DLdays, "The not ^downloaded days^ to move/kill files")
case 22:E_INT( 13,73, area.FDdays, "The ^file age^ in days to move/kill files")
case 23:E_INT( 14,73, area.MoveArea, "The ^area to move^ files to, 0 is kill")
case 24:E_INT( 15,73, area.Cost, "The ^cost^ to download a file")
case 25:strcpy(area.Archiver, PickArchive((char *)"8.4"));
case 24:strcpy(area.Archiver, PickArchive((char *)"8.4"));
FileScreen();
break;
case 26:E_INT( 17,73, area.Upload, "The ^upload^ area, 0 if upload in this area")
case 25:E_INT( 16,73, area.Upload, "The ^upload^ area, 0 if upload in this area")
}
}
}

View File

@@ -44,71 +44,61 @@ void EditFile(void);
void FHeader(void)
{
clr_index();
set_color(WHITE, BLACK);
mvprintw( 5, 2, "14. EDIT FILE");
set_color(CYAN, BLACK);
mvprintw( 7, 2, " FileName");
mvprintw( 8, 2, " Long fn");
mvprintw( 9, 2, " FileSize");
mvprintw(10, 2, " FileDate");
mvprintw(11, 2, " Last DL.");
mvprintw(12, 2, " Upl.Date");
mvprintw(13, 2, "1. Uploader");
mvprintw(14, 2, "2. Times DL");
mvprintw(15, 2, "3. Times FTP");
mvprintw(16, 2, "4. Times Req");
mvprintw(17, 2, "5. Password");
mvprintw(18, 2, "6. Cost");
clr_index();
set_color(WHITE, BLACK);
mvprintw( 5, 2, "14. EDIT FILE");
set_color(CYAN, BLACK);
mvprintw( 7, 2, " FileName");
mvprintw( 8, 2, " Long fn");
mvprintw( 9, 2, " FileSize");
mvprintw(10, 2, " FileDate");
mvprintw(11, 2, " Last DL.");
mvprintw(12, 2, " Upl.Date");
mvprintw(13, 2, " TIC area");
mvprintw(14, 2, " Magic");
mvprintw(15, 2, "1. Uploader");
mvprintw(16, 2, "2. Times DL");
mvprintw(17, 2, "3. Password");
mvprintw(14,42, "7. Free");
mvprintw(15,42, "8. Deleted");
mvprintw(16,42, " Missing");
mvprintw(17,42, "9. No Kill");
mvprintw(18,42, "10. Announced");
mvprintw(15,61, "4. Deleted");
mvprintw(16,61, "5. No Kill");
mvprintw(17,61, "6. Announced");
}
void EditFile()
{
FHeader();
FHeader();
for (;;) {
set_color(WHITE, BLACK);
show_str( 7,16,12, file.Name);
show_str( 8,16,64, file.LName);
show_int( 9,16, file.Size);
mvprintw(10,16, (char *)"%s %s", StrDateDMY(file.FileDate), StrTimeHM(file.FileDate));
mvprintw(11,16, (char *)"%s %s", StrDateDMY(file.LastDL), StrTimeHM(file.LastDL));
mvprintw(12,16, (char *)"%s %s", StrDateDMY(file.UploadDate), StrTimeHM(file.UploadDate));
show_str(13,16,36, file.Uploader);
show_int(14,16, file.TimesDL);
show_int(15,16, file.TimesFTP);
show_int(16,16, file.TimesReq);
show_str(17,16,15, file.Password);
show_int(18,16, file.Cost);
for (;;) {
set_color(WHITE, BLACK);
show_str( 7,16,12, fdb.Name);
show_str( 8,16,64, fdb.LName);
show_int( 9,16, fdb.Size);
mvprintw(10,16, (char *)"%s %s", StrDateDMY(fdb.FileDate), StrTimeHM(fdb.FileDate));
mvprintw(11,16, (char *)"%s %s", StrDateDMY(fdb.LastDL), StrTimeHM(fdb.LastDL));
mvprintw(12,16, (char *)"%s %s", StrDateDMY(fdb.UploadDate), StrTimeHM(fdb.UploadDate));
show_str(13,16,20, fdb.TicArea);
show_str(14,16,20, fdb.Magic);
show_str(15,16,36, fdb.Uploader);
show_int(16,16, fdb.TimesDL);
show_str(17,16,15, fdb.Password);
show_bool(14,56, file.Free);
show_bool(15,56, file.Deleted);
show_bool(16,56, file.Missing);
show_bool(17,56, file.NoKill);
show_bool(18,56, file.Announced);
show_bool(15,75, fdb.Deleted);
show_bool(16,75, fdb.NoKill);
show_bool(17,75, fdb.Announced);
switch(select_menu(10)) {
case 0: return;
case 1: E_STR( 13,16,35, file.Uploader, "The ^uploader^ of this file")
case 2: E_INT( 14,16, file.TimesDL, "The number of times file is sent with ^download^")
case 3: E_INT( 15,16, file.TimesFTP, "The number of times file is sent with ^FTP or WWW^")
case 4: E_INT( 16,16, file.TimesReq, "The number of times file is sent with ^filerequest^")
case 5: E_STR( 17,16,15, file.Password, "The ^password^ to protect this file with")
case 6: E_INT( 18,16, file.Cost, "The ^cost^ of this file")
case 7: E_BOOL(14,56, file.Free, "If this file is a ^free^ download")
case 8: E_BOOL(15,56, file.Deleted, "Should this this file be ^deleted^")
case 9: E_BOOL(17,56, file.NoKill, "File can't be ^killed^ automatic")
case 10:E_BOOL(18,56, file.Announced, "File is ^announced^ as new file")
}
switch(select_menu(6)) {
case 0: return;
case 1: E_STR( 15,16,35, fdb.Uploader, "The ^uploader^ of this file")
case 2: E_INT( 16,16, fdb.TimesDL, "The number of times file is sent with ^download^")
case 3: E_STR( 17,16,15, fdb.Password, "The ^password^ to protect this file with")
case 4: E_BOOL(15,75, fdb.Deleted, "Should this this file be ^deleted^")
case 5: E_BOOL(16,75, fdb.NoKill, "File can't be ^killed^ automatic")
case 6: E_BOOL(17,75, fdb.Announced, "File is ^announced^ as new file")
}
}
}
@@ -126,7 +116,7 @@ void E_F(long areanr)
clr_index();
sprintf(temp, "%s/fdb/fdb%ld.data", getenv("MBSE_ROOT"), areanr);
sprintf(temp, "%s/fdb/file%ld.data", getenv("MBSE_ROOT"), areanr);
if ((fil = fopen(temp, "r+")) == NULL) {
working(2, 0, 0);
return;
@@ -134,8 +124,9 @@ void E_F(long areanr)
if (! check_free())
return;
fread(&fdbhdr, sizeof(fdbhdr), 1, fil);
fseek(fil, 0, SEEK_END);
records = ftell(fil) / sizeof(file);
records = ((ftell(fil) - fdbhdr.hdrsize) / fdbhdr.recsize);
o = 0;
for (;;) {
@@ -154,41 +145,41 @@ void E_F(long areanr)
for (i = 1; i <= 10; i++) {
if ((o + i) <= records) {
offset = ((o + i) - 1) * sizeof(file);
offset = (((o + i) - 1) * fdbhdr.recsize) + fdbhdr.hdrsize;
fseek(fil, offset, SEEK_SET);
fread(&file, sizeof(file), 1, fil);
fread(&fdb, fdbhdr.recsize, 1, fil);
set_color(WHITE, BLACK);
mvprintw(y, 1, (char *)"%4d.", o + i);
sprintf(temp, "%s/%s", area.Path, file.LName);
sprintf(temp, "%s/%s", area.Path, fdb.LName);
Ondisk = ((stat(temp, &statfile)) != -1);
if (file.Deleted)
if (fdb.Deleted)
set_color(LIGHTBLUE, BLACK);
else if (Ondisk)
set_color(CYAN, BLACK);
else
set_color(LIGHTRED, BLACK);
mvprintw(y, 8, (char *)"%-14s", file.Name);
mvprintw(y, 8, (char *)"%-14s", fdb.Name);
if (Ondisk) {
if (file.Size == statfile.st_size)
if (fdb.Size == statfile.st_size)
set_color(CYAN, BLACK);
else
set_color(LIGHTRED, BLACK);
mvprintw(y,23, (char *)"%8ld", file.Size);
mvprintw(y,23, (char *)"%8ld", fdb.Size);
if (file.FileDate == statfile.st_mtime)
if (fdb.FileDate == statfile.st_mtime)
set_color(CYAN, BLACK);
else
set_color(LIGHTRED, BLACK);
Time = file.FileDate;
Time = fdb.FileDate;
mvprintw(y,32, (char *)"%s %s", StrDateDMY(Time), StrTimeHM(Time));
}
set_color(CYAN, BLACK);
sprintf(temp, "%s", file.Desc[0]);
sprintf(temp, "%s", fdb.Desc[0]);
temp[30] = '\0';
mvprintw(y,49, (char *)"%s", temp);
y++;
@@ -234,26 +225,23 @@ void E_F(long areanr)
if ((atoi(menu) > 0) && (atoi(menu) <= records)) {
working(1, 0, 0);
offset = (atoi(menu) - 1) * sizeof(file);
offset = ((atoi(menu) - 1) * fdbhdr.recsize) + fdbhdr.hdrsize;
fseek(fil, offset, SEEK_SET);
fread(&file, sizeof(file), 1, fil);
fread(&fdb, fdbhdr.recsize, 1, fil);
crc = 0xffffffff;
crc = upd_crc32((char *)&file, crc, sizeof(file));
sprintf(temp, "%s/%s", area.Path, file.LName);
if (stat(temp, &statfile) == -1)
file.Missing = TRUE;
crc = upd_crc32((char *)&fdb, crc, fdbhdr.recsize);
sprintf(temp, "%s/%s", area.Path, fdb.LName);
EditFile();
crc1 = 0xffffffff;
crc1 = upd_crc32((char *)&file, crc1, sizeof(file));
crc1 = upd_crc32((char *)&fdb, crc1, fdbhdr.recsize);
if (crc != crc1) {
if (yes_no((char *)"Record is changed, save") == 1) {
working(1, 0, 0);
fseek(fil, offset, SEEK_SET);
fwrite(&file, sizeof(file), 1, fil);
fwrite(&fdb, fdbhdr.recsize, 1, fil);
working(6, 0, 0);
}
}
@@ -354,3 +342,118 @@ void EditFDB()
}
/*
* Init files database. Since version 0.51.2 the format is changed.
* Check this and automagic upgrade the database.
*/
void InitFDB(void)
{
int records, i;
long Area = 0;
char *temp, Magic[21];
FILE *fp1, *fp2, *fil, *ft, *fp;
DIR *dp;
struct dirent *de;
struct OldFILERecord old;
struct stat sb;
records = CountFilearea();
if (records <= 0)
return;
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/etc/fareas.data", getenv("MBSE_ROOT"));
if ((fil = fopen(temp, "r")) != NULL) {
fread(&areahdr, sizeof(areahdr), 1, fil);
while (fread(&area, areahdr.recsize, 1, fil)) {
Area++;
if (area.Available) {
sprintf(temp, "%s/fdb/fdb%ld.data", getenv("MBSE_ROOT"), Area);
if ((fp1 = fopen(temp, "r")) != NULL) {
/*
* Old area available, upgrade.
*/
sprintf(temp, "%s/fdb/file%ld.data", getenv("MBSE_ROOT"), Area);
if ((fp2 = fopen(temp, "w+")) == NULL) {
WriteError("$Can't create %s", temp);
} else {
fdbhdr.hdrsize = sizeof(fdbhdr);
fdbhdr.recsize = sizeof(fdb);
fwrite(&fdbhdr, sizeof(fdbhdr), 1, fp2);
while (fread(&old, sizeof(old), 1, fp1)) {
Nopper();
memset(&fdb, 0, fdbhdr.recsize);
strncpy(fdb.Name, old.Name, sizeof(fdb.Name) -1);
strncpy(fdb.LName, old.LName, sizeof(fdb.LName) -1);
sprintf(temp, "%s/etc/tic.data", getenv("MBSE_ROOT"));
if ((ft = fopen(temp, "r")) != NULL) {
fread(&tichdr, sizeof(tichdr), 1, ft);
while (fread(&tic, tichdr.recsize, 1, ft)) {
if (StringCRC32(tic.Name) == old.TicAreaCRC) {
strncpy(fdb.TicArea, tic.Name, sizeof(fdb.TicArea) -1);
break;
}
fseek(ft, tichdr.syssize, SEEK_CUR);
}
fclose(ft);
}
fdb.Size = old.Size;
fdb.Crc32 = old.Crc32;
strncpy(fdb.Uploader, old.Uploader, sizeof(fdb.Uploader) -1);
fdb.UploadDate = old.UploadDate;
fdb.FileDate = old.FileDate;
fdb.LastDL = old.LastDL;
fdb.TimesDL = old.TimesDL + old.TimesFTP + old.TimesReq;
strncpy(fdb.Password, old.Password, sizeof(fdb.Password) -1);
for (i = 0; i < 25; i++)
strncpy(fdb.Desc[i], old.Desc[i], 48);
/*
* Search the magic directory to see if this file is a magic file.
*/
sprintf(temp, "%s/magic", getenv("MBSE_ROOT"));
if ((dp = opendir(temp)) != NULL) {
while ((de = readdir(dp))) {
if (de->d_name[0] != '.') {
sprintf(temp, "%s/magic/%s", getenv("MBSE_ROOT"), de->d_name);
/*
* Only regular files without execute permission are magic requests.
*/
if ((lstat(temp, &sb) != -1) && (S_ISREG(sb.st_mode)) && (! (sb.st_mode & S_IXUSR))) {
if ((fp = fopen(temp, "r"))) {
fgets(Magic, sizeof(Magic) -1, fp);
Striplf(Magic);
if ((strcasecmp(Magic, fdb.Name) == 0) || (strcasecmp(Magic, fdb.LName) == 0)) {
strncpy(fdb.Magic, de->d_name, sizeof(fdb.Magic) -1);
}
fclose(fp);
}
}
}
}
closedir(dp);
}
fdb.Deleted = old.Deleted;
fdb.NoKill = old.NoKill;
fdb.Announced = old.Announced;
fdb.Double = old.Double;
fwrite(&fdb, fdbhdr.recsize, 1, fp2);
}
fclose(fp2);
Syslog('+', "Upgraded file area database %d", Area);
}
fclose(fp1);
sprintf(temp, "%s/fdb/fdb%ld.data", getenv("MBSE_ROOT"), Area);
unlink(temp);
}
}
}
fclose(fil);
}
free(temp);
}

View File

@@ -1,7 +1,10 @@
#ifndef _M_FDB_H
#define _M_FDB_H
/* $Id$ */
void EditFDB(void);
void InitFDB(void);
#endif

View File

@@ -219,7 +219,6 @@ int AppendFGroup(void)
if ((fil = fopen(ffile, "a")) != NULL) {
memset(&fgroup, 0, sizeof(fgroup));
fgroup.StartDate = time(NULL);
fgroup.DivideCost = TRUE;
fgroup.FileGate = TRUE;
fgroup.Secure = TRUE;
fgroup.VirScan = TRUE;
@@ -280,28 +279,24 @@ void FgScreen(void)
mvprintw(18, 2, "13. Deleted");
mvprintw(19, 2, "14. Start at");
mvprintw(11,32, "15. Unit Cost");
mvprintw(12,32, "16. Unit Size");
mvprintw(13,32, "17. Add Prom.");
mvprintw(14,32, "18. Divide");
mvprintw(15,32, "19. Auto chng");
mvprintw(16,32, "20. User chng");
mvprintw(17,32, "21. Replace");
mvprintw(18,32, "22. Dupecheck");
mvprintw(19,32, "23. Secure");
mvprintw(12,32, "15. Auto chng");
mvprintw(13,32, "16. User chng");
mvprintw(14,32, "17. Replace");
mvprintw(15,32, "18. Dupecheck");
mvprintw(16,32, "19. Secure");
mvprintw(17,32, "20. Touch");
mvprintw(18,32, "21. Virscan");
mvprintw(19,32, "22. Announce");
mvprintw( 9,56, "24. Touch");
mvprintw(10,56, "25. Virscan");
mvprintw(11,56, "26. Announce");
mvprintw(12,56, "27. Upd magic");
mvprintw(13,56, "28. File ID");
mvprintw(14,56, "29. Conv. all");
mvprintw(15,56, "30. Send orig");
mvprintw(16,56, "31. DL sec");
mvprintw(17,56, "32. UP sec");
mvprintw(18,56, "33. LT sec");
mvprintw(19,56, "34. Upl. area");
mvprintw(20,56, "35. Link sec");
mvprintw(11,56, "23. Upd magic");
mvprintw(12,56, "24. File ID");
mvprintw(13,56, "25. Conv. all");
mvprintw(14,56, "26. Send orig");
mvprintw(15,56, "27. DL sec");
mvprintw(16,56, "28. UP sec");
mvprintw(17,56, "29. LT sec");
mvprintw(18,56, "30. Upl. area");
mvprintw(19,56, "31. Link sec");
}
@@ -356,29 +351,25 @@ int EditFGrpRec(int Area)
show_bool(18,16, fgroup.Deleted);
show_int( 19,16, fgroup.StartArea);
show_int( 11,46, fgroup.UnitCost);
show_int( 12,46, fgroup.UnitSize);
show_int( 13,46, fgroup.AddProm);
show_bool(14,46, fgroup.DivideCost);
show_bool(15,46, fgroup.AutoChange);
show_bool(16,46, fgroup.UserChange);
show_bool(17,46, fgroup.Replace);
show_bool(18,46, fgroup.DupCheck);
show_bool(19,46, fgroup.Secure);
show_bool(12,46, fgroup.AutoChange);
show_bool(13,46, fgroup.UserChange);
show_bool(14,46, fgroup.Replace);
show_bool(15,46, fgroup.DupCheck);
show_bool(16,46, fgroup.Secure);
show_bool(17,46, fgroup.Touch);
show_bool(18,46, fgroup.VirScan);
show_bool(19,46, fgroup.Announce);
show_bool( 9,70, fgroup.Touch);
show_bool(10,70, fgroup.VirScan);
show_bool(11,70, fgroup.Announce);
show_bool(12,70, fgroup.UpdMagic);
show_bool(13,70, fgroup.FileId);
show_bool(14,70, fgroup.ConvertAll);
show_bool(15,70, fgroup.SendOrg);
show_int( 16,70, fgroup.DLSec.level);
show_int( 17,70, fgroup.UPSec.level);
show_int( 18,70, fgroup.LTSec.level);
show_int( 19,70, fgroup.Upload);
show_bool(11,70, fgroup.UpdMagic);
show_bool(12,70, fgroup.FileId);
show_bool(13,70, fgroup.ConvertAll);
show_bool(14,70, fgroup.SendOrg);
show_int( 15,70, fgroup.DLSec.level);
show_int( 16,70, fgroup.UPSec.level);
show_int( 17,70, fgroup.LTSec.level);
show_int( 18,70, fgroup.Upload);
j = select_menu(35);
j = select_menu(31);
switch(j) {
case 0: if (!fgroup.StartArea && strlen(fgroup.AreaFile)) {
errmsg("Areas file defined but no BBS start area");
@@ -450,38 +441,34 @@ int EditFGrpRec(int Area)
E_BOOL(18,16, fgroup.Deleted, "Is this file group ^Deleted^")
case 14:E_INT( 19,16, fgroup.StartArea, "The ^start area^ to create new BBS areas")
case 15:E_INT( 11,46, fgroup.UnitCost, "The ^cost per size unit^ files received in this tic group")
case 16:E_INT( 12,46, fgroup.UnitSize, "The ^unit size^ in KBytes, 0 means cost per file in this tic group")
case 17:E_INT( 13,46, fgroup.AddProm, "The ^Promillage^ to add or substract of the filecost")
case 18:E_BOOL(14,46, fgroup.DivideCost, "^Divide^ the cost over all downlinks or charge each link full cost")
case 19:E_BOOL(15,46, fgroup.AutoChange, "^Automatic change areas^ when a new arealist is received")
case 20:tmp = edit_bool(16,46, fgroup.UserChange, (char *)"Create new areas when ^users^ request new tic areas");
case 15:E_BOOL(12,46, fgroup.AutoChange, "^Automatic change areas^ when a new arealist is received")
case 16:tmp = edit_bool(13,46, fgroup.UserChange, (char *)"Create new areas when ^users^ request new tic areas");
if (tmp && !fgroup.UpLink.zone)
errmsg("It looks like you are at the toplevel, no Uplink defined");
else
fgroup.UserChange = tmp;
break;
case 21:E_BOOL(17,46, fgroup.Replace, "Set ^Replace^ in new created tic areas")
case 22:E_BOOL(18,46, fgroup.DupCheck, "Set ^Dupe check^ in new created tic areas")
case 23:E_BOOL(19,46, fgroup.Secure, "Set ^Secure^ tic processing in new created tic areas")
case 17:E_BOOL(14,46, fgroup.Replace, "Set ^Replace^ in new created tic areas")
case 18:E_BOOL(15,46, fgroup.DupCheck, "Set ^Dupe check^ in new created tic areas")
case 19:E_BOOL(16,46, fgroup.Secure, "Set ^Secure^ tic processing in new created tic areas")
case 20:E_BOOL(17,46, fgroup.Touch, "Set ^Touch filedate^ in new created tic areas")
case 21:E_BOOL(18,46, fgroup.VirScan, "Set ^Virus scanner^ in new created tic areas")
case 22:E_BOOL(19,46, fgroup.Announce, "Set ^Announce files^ in new created tic areas")
case 24:E_BOOL( 9,70, fgroup.Touch, "Set ^Touch filedate^ in new created tic areas")
case 25:E_BOOL(10,70, fgroup.VirScan, "Set ^Virus scanner^ in new created tic areas")
case 26:E_BOOL(11,70, fgroup.Announce, "Set ^Announce files^ in new created tic areas")
case 27:E_BOOL(12,70, fgroup.UpdMagic, "Set ^Update magic^ in new created tic areas")
case 28:E_BOOL(13,70, fgroup.FileId, "Set ^FILE_ID.DIZ extract^ in new created tic areas")
case 29:tmp = edit_bool(14,70, fgroup.ConvertAll, (char *)"Set ^Convert All^ setting in new created tic areas");
case 23:E_BOOL(11,70, fgroup.UpdMagic, "Set ^Update magic^ in new created tic areas")
case 24:E_BOOL(12,70, fgroup.FileId, "Set ^FILE_ID.DIZ extract^ in new created tic areas")
case 25:tmp = edit_bool(13,70, fgroup.ConvertAll, (char *)"Set ^Convert All^ setting in new created tic areas");
if (tmp && !fgroup.ConvertAll && (strlen(fgroup.Convert) == 0))
errmsg("No archiver configured to convert to, edit 9 first");
else
fgroup.ConvertAll = tmp;
break;
case 30:E_BOOL(15,70, fgroup.SendOrg, "Set ^Send original^ setting in new created tic areas")
case 31:E_SEC( 16,70, fgroup.DLSec, "10.1.31 FILE GROUP DOWNLOAD SECURITY", FgScreen)
case 32:E_SEC( 17,70, fgroup.UPSec, "10.1.32 FILE GROUP UPLOAD SECURITY", FgScreen)
case 33:E_SEC( 18,70, fgroup.LTSec, "10.1.33 FILE GROUP LIST SECURITY", FgScreen)
case 34:E_INT( 19,70, fgroup.Upload, "Set the default ^Upload area^ in new created file areas")
case 35:fgroup.LinkSec = edit_asec(fgroup.LinkSec, (char *)"10.1.35 DEFAULT NEW TIC AREAS SECURITY");
case 26:E_BOOL(14,70, fgroup.SendOrg, "Set ^Send original^ setting in new created tic areas")
case 27:E_SEC( 15,70, fgroup.DLSec, "10.1.27 FILE GROUP DOWNLOAD SECURITY", FgScreen)
case 28:E_SEC( 16,70, fgroup.UPSec, "10.1.28 FILE GROUP UPLOAD SECURITY", FgScreen)
case 29:E_SEC( 17,70, fgroup.LTSec, "10.1.29 FILE GROUP LIST SECURITY", FgScreen)
case 30:E_INT( 18,70, fgroup.Upload, "Set the default ^Upload area^ in new created file areas")
case 31:fgroup.LinkSec = edit_asec(fgroup.LinkSec, (char *)"10.1.31 DEFAULT NEW TIC AREAS SECURITY");
FgScreen();
break;
}
@@ -726,10 +713,6 @@ int tic_group_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " Use Aka %s\n", aka2str(fgroup.UseAka));
fprintf(fp, " Uplink %s\n", aka2str(fgroup.UpLink));
fprintf(fp, " Areas file %s\n", fgroup.AreaFile);
fprintf(fp, " Divice cost %s\n", getboolean(fgroup.DivideCost));
fprintf(fp, " Unit cost %ld\n", fgroup.UnitCost);
fprintf(fp, " Unit size %ld\n", fgroup.UnitSize);
fprintf(fp, " Add promille %ld\n", fgroup.AddProm);
fprintf(fp, " Start area %ld\n", fgroup.StartArea);
fprintf(fp, " Banner file %s\n", fgroup.Banner);
fprintf(fp, " Def. archiver %s\n", fgroup.Convert);

View File

@@ -440,15 +440,7 @@ void E_Files(void)
mvprintw(14, 6, "8. Advanced TIC");
mvprintw(15, 6, "9. Advanced SB");
mvprintw(16, 6, "10. To line in TIC");
mvprintw( 7,46, "11. File forward");
mvprintw( 8,46, "12. Billing (CSO)");
mvprintw( 9,46, "13. Bill direct");
mvprintw(10,46, "14. Credit");
mvprintw(11,46, "15. Debit");
mvprintw(12,46, "16. Add %");
mvprintw(13,46, "17. Warn level");
mvprintw(14,46, "18. Stop level");
mvprintw(17, 6, "11. File forward");
for (;;) {
set_color(WHITE, BLACK);
@@ -462,35 +454,21 @@ void E_Files(void)
show_bool(14,26, nodes.AdvTic);
show_bool(15,26, nodes.TIC_AdvSB);
show_bool(16,26, nodes.TIC_To);
show_bool( 7,66, nodes.FileFwd);
show_bool( 8,66, nodes.Billing);
show_bool( 9,66, nodes.BillDirect);
show_int( 10,66, nodes.Credit);
show_int( 11,66, nodes.Debet);
show_int( 12,66, nodes.AddPerc);
show_int( 13,66, nodes.WarnLevel);
show_int( 14,66, nodes.StopLevel);
show_bool(17,26, nodes.FileFwd);
switch(select_menu(18)) {
case 0: return;
case 1: E_STR( 7,26,15,nodes.Fpasswd, "The ^TIC^ files ^password^ for this node")
case 2: E_STR( 8,26,15,nodes.Apasswd, "The filemanager ^password^ for this node")
case 3: E_STR( 9,26,8, nodes.UplFmgrPgm, "The name of the uplink ^filemanager^ program")
case 4: E_STR( 10,26,15,nodes.UplFmgrPass,"The uplink filemanager ^password^")
case 5: E_BOOL(11,26, nodes.AddPlus, "Add ^+^ in uplink manager requests for new areas")
case 6: E_BOOL(12,26, nodes.Message, "Send ^messages^ with files send to this node")
case 7: E_BOOL(13,26, nodes.Tic, "Send ^TIC^ files to this node")
case 8: E_BOOL(14,26, nodes.AdvTic, "Send ^advanced^ TIC files to this node")
case 9: E_BOOL(15,26, nodes.TIC_AdvSB, "Send ^advanced Seen-By^ lines in ticfiles to this node")
case 10:E_BOOL(16,26, nodes.TIC_To, "Send ^To^ line in ticfiles to this node")
case 11:E_BOOL( 7,66, nodes.FileFwd, "^Forward TIC^ files for this node")
case 12:E_BOOL( 8,66, nodes.Billing, "Send ^bills^ to this node, Costsharing is active")
case 13:E_BOOL( 9,66, nodes.BillDirect, "Send bills ^direct^ after file processing")
case 14:E_INT( 10,66, nodes.Credit, "The ^credit^ this node has for costsharing")
case 15:E_INT( 11,66, nodes.Debet, "The ^debit^ in cents we have credit from this node")
case 16:E_INT( 12,66, nodes.AddPerc, "The + or - ^promille^ factor for this node")
case 17:E_INT( 13,66, nodes.WarnLevel, "Credit level in cents to ^Warn^ node for low credit")
case 18:E_INT( 14,66, nodes.StopLevel, "Credit level in cents to ^Stop^ sending files")
switch(select_menu(11)) {
case 0: return;
case 1: E_STR( 7,26,15,nodes.Fpasswd, "The ^TIC^ files ^password^ for this node")
case 2: E_STR( 8,26,15,nodes.Apasswd, "The filemanager ^password^ for this node")
case 3: E_STR( 9,26,8, nodes.UplFmgrPgm, "The name of the uplink ^filemanager^ program")
case 4: E_STR( 10,26,15,nodes.UplFmgrPass,"The uplink filemanager ^password^")
case 5: E_BOOL(11,26, nodes.AddPlus, "Add ^+^ in uplink manager requests for new areas")
case 6: E_BOOL(12,26, nodes.Message, "Send ^messages^ with files send to this node")
case 7: E_BOOL(13,26, nodes.Tic, "Send ^TIC^ files to this node")
case 8: E_BOOL(14,26, nodes.AdvTic, "Send ^advanced^ TIC files to this node")
case 9: E_BOOL(15,26, nodes.TIC_AdvSB, "Send ^advanced Seen-By^ lines in ticfiles to this node")
case 10:E_BOOL(16,26, nodes.TIC_To, "Send ^To^ line in ticfiles to this node")
case 11:E_BOOL(17,26, nodes.FileFwd, "^Forward TIC^ files for this node")
}
}
}
@@ -1486,8 +1464,6 @@ int node_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " Advanced TIC %s\n", getboolean(nodes.AdvTic));
fprintf(fp, " Advanded SB %s", getboolean(nodes.TIC_AdvSB));
fprintf(fp, " Sent To lines %s", getboolean(nodes.TIC_To));
fprintf(fp, " Billing %s\n", getboolean(nodes.Billing));
fprintf(fp, " Bill direct %s", getboolean(nodes.BillDirect));
fprintf(fp, " Uplink add + %s\n", getboolean(nodes.AddPlus));
fprintf(fp, " Security flags %s\n\n", getflag(nodes.Security.flags, nodes.Security.notflags));
@@ -1525,11 +1501,6 @@ int node_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " Total files %-8lu %-8lu %-8lu %-8lu\n", nodes.FilesSent.total, nodes.F_KbSent.total, nodes.FilesRcvd.total, nodes.F_KbSent.total);
fprintf(fp, " Total mail %-8lu %-8lu\n\n", nodes.MailSent.total, nodes.MailRcvd.total);
if (nodes.Billing) {
fprintf(fp, " Credit units %-8ld Warnlevel %ld\n", nodes.Credit, nodes.WarnLevel);
fprintf(fp, " Debit units %-8ld Stoplevel %ld\n", nodes.Debet, nodes.StopLevel);
fprintf(fp, " Add promille %ld\n\n", nodes.AddPerc);
}
fprintf(fp, " File groups:\n ");
groups = nodeshdr.filegrp / sizeof(group);
for (i = 0; i < groups; i++) {

View File

@@ -384,6 +384,7 @@ void initdatabases(void)
InitUsers();
InitVirus();
InitRoute();
InitFDB();
if (!init) {
clr_index();