Skip to content
Snippets Groups Projects
Commit f056efcc authored by rswindell's avatar rswindell
Browse files

TickIT patch supplied by Mark Lewis:

tickit.js version pulled from $ID string in .js file.
tickit version used in Created by line.
tickit version used in Path line.
utc time stamp of processing used in Path line per FTS-5006.001.
per area uploader.
address selection:
   per area aka matching in From and Path lines.
   per area source address in From and Path lines.
   global aka matching in From and Path lines (original addressing method).
   global source address in From and Path lines.
   main FTN address from system.fido_addr_list (preferred but last in line with
the above overrides).
can use domains on linked systems' addresses in sbbsecho.ini again.
can use domains on any address in tickit.ini.
domains are NOT currently written to the generated TIC files to avoid creating
possible problems for other TIC processors.
force replace is available globally and per area in the ini and not only the
command line.
parent 367077dd
No related branches found
No related tags found
No related merge requests found
......@@ -42,11 +42,11 @@ function TickITCfg() {
this.cfgfile = tcfg.name;
function get_bool(val) {
if (typeof val == 'undefined') return false;
if (typeof val == 'boolean') return val;
if (typeof val == 'number') return val != 0;
if (typeof val == 'undefined') return false;
if (typeof val == 'boolean') return val;
if (typeof val == 'number') return val != 0;
if (typeof val != 'string') return false;
return ['TRUE', 'YES', 'ON'].indexOf(val.toUpperCase()) > -1;
return ['TRUE', 'YES', 'ON'].indexOf(val.toUpperCase()) > -1;
}
function lcprops(obj)
......@@ -87,6 +87,9 @@ function TickITCfg() {
}
}
tcfg.close();
this.gcfg.addfileslogcap = get_bool(this.gcfg.addfileslogcap);
this.gcfg.akamatching = get_bool(this.gcfg.akamatching);
this.gcfg.forcereplace = get_bool(this.gcfg.forcereplace);
this.gcfg.ignorepassword = get_bool(this.gcfg.ignorepassword);
this.gcfg.secureonly = get_bool(this.gcfg.secureonly);
}
......@@ -182,6 +185,42 @@ TickITCfg.prototype.save = function()
tcfg.iniRemoveKey(section, 'Path');
else
tcfg.iniSetValue(section, 'Path', obj.path);
if (obj.sourceaddress === undefined)
tcfg.iniRemoveKey(section, 'SourceAddress');
else
tcfg.iniSetValue(section, 'SourceAddress', obj.sourceaddress);
if (obj.uploader === undefined)
tcfg.iniRemoveKey(section, 'Uploader');
else
tcfg.iniSetValue(section, 'Uploader', obj.uploader);
if (obj.addfileslogcap === undefined)
tcfg.iniRemoveKey(section, 'AddFilesLogCap');
else
tcfg.iniSetValue(section, 'AddFilesLogCap', obj.addfileslogcap);
if (obj.akamatching === undefined)
tcfg.iniRemoveKey(section, 'AKAMatching');
else
tcfg.iniSetValue(section, 'AKAMatching', obj.akamatching);
if (obj.forcereplace === undefined)
tcfg.iniRemoveKey(section, 'ForceReplace');
else
tcfg.iniSetValue(section, 'ForceReplace', obj.forcereplace);
if (obj.ignorepassword === undefined)
tcfg.iniRemoveKey(section, 'IgnorePassword');
else
tcfg.iniSetValue(section, 'IgnorePassword', obj.ignorepassword);
if (obj.secureonly === undefined)
tcfg.iniRemoveKey(section, 'SecureOnly');
else
tcfg.iniSetValue(section, 'SecureOnly', obj.secureonly);
}
if (!tcfg.open(tcfg.exists ? 'r+':'w+'))
......
......@@ -32,6 +32,18 @@ var tickit = new TickITCfg();
var files_bbs={};
var force_replace = false;
const REVISION = "$Revision$".split(' ')[1];
var tickitVersion = "TickIT "+REVISION;
// emit tickitVersion to the log for general purposes - wk42
log(LOG_INFO, tickitVersion);
// emit system.temp_dir to the log for debug purposes; mainly with which
// temp directory is used when tickit.js is executed (event vs jsexec) - wk42
log(LOG_DEBUG, "Using system.temp_dir = '"+system.temp_dir+"'");
// also let's log the logs_dir so we know where it is for the addfiles
// log if addfileslogcap is set in the ini... this is a manual setting - wk42
log(LOG_DEBUG, "Using system.logs_dir = '"+system.logs_dir+"'");
if (!String.prototype.repeat) {
String.prototype.repeat = function(count) {
'use strict';
......@@ -95,6 +107,9 @@ function process_tic(tic)
var handler;
var handler_arg;
log(LOG_INFO, "Processing...");
log(LOG_INFO, "Working with '"+tic.file+"' in '"+tic.area.toUpperCase()+"'.");
if (tickit.gcfg.path !== undefined)
path = backslash(tickit.gcfg.path);
if (tickit.gcfg.dir !== undefined)
......@@ -120,8 +135,10 @@ function process_tic(tic)
handler = cfg.handler;
handler_arg = cfg.handlerarg;
}
if (cfg.forcereplace !== undefined)
if (cfg.forcereplace !== undefined) {
log(LOG_INFO, "ForceReplace enabled for area "+tic.area.toUpperCase()+".");
force_replace_area = cfg.forcereplace;
}
}
if (handler !== undefined) {
......@@ -167,14 +184,14 @@ function process_tic(tic)
return true;
}
log(LOG_DEBUG, "Moving file from "+tic.full_path+" to "+path+".");
log(LOG_INFO, "Moving "+tic.full_path+" to "+path+".");
// TODO: optionally delete replaced files even if it's not an overwrite
if (file_exists(path+tic.file) && !force_replace && !force_replace_area) {
if (typeof tic.replaces == 'undefined') {
log(LOG_ERROR, format('"%s" already exists in "%s", but has no matching Replaces line', tic.file, path));
return false;
} else if (!wildmatch(tic.file, tic.replaces)) {
log(LOG_ERROR, format('"%s" already exists in "%s", but TIC Replaces line is "%s"', tic.file, path, tic.replaces));
if (typeof tic.replaces == 'undefined') {
log(LOG_ERROR, format('"%s" already exists in "%s", but has no matching Replaces line', tic.file, path));
return false;
} else if (!wildmatch(tic.file, tic.replaces)) {
log(LOG_ERROR, format('"%s" already exists in "%s", but TIC Replaces line is "%s"', tic.file, path, tic.replaces));
return false;
} else {
if (!do_move(path, tic)) return false;
......@@ -195,7 +212,7 @@ function process_tic(tic)
files_bbs[dir] += ld[i]+"\r\n";
}
}
log(LOG_DEBUG, "Deleting TIC file '"+tic.tic_filename+"'.");
log(LOG_INFO, "Deleting TIC file '"+tic.tic_filename+"'.");
file_remove(tic.tic_filename);
return true;
......@@ -209,7 +226,7 @@ function add_links(seenbys, links, list)
l = list.split(/,/);
for (i=0; i<l.length; i++) {
if (seenbys[l[i]] !== undefined) {
log(LOG_DEBUG, "Node "+l[i]+" has already seen this.");
log(LOG_INFO, "Node "+l[i]+" has already seen this file.");
continue;
}
links[l[i]]='';
......@@ -245,18 +262,16 @@ function forward_tic(tic)
var addrs = [];
var saddr;
log(LOG_INFO, "Forwarding...");
defzone = get_zone(system.fido_addr_list[0]);
if (defzone === undefined) {
log(LOG_ERROR, "Unable to detect fido_addr_listdefault zone!");
log(LOG_ERROR, "Unable to detect fido_addr_list default zone!");
return false;
}
for (saddr in system.fido_addr_list)
addrs.push(FIDO.parse_addr(system.fido_addr_list[saddr]));
// Add us to the path...
tic.path.push(system.fido_addr_list[0]);
// Populate seenbys from TIC file
for (i=0; i<tic.seenby.length; i++)
seenbys[tic.seenby[i]]='';
......@@ -283,10 +298,30 @@ function forward_tic(tic)
log(LOG_ERROR, "TickIT doesn't support non-FLO mailers.");
return false;
}
log(LOG_INFO, "... to "+link+".");
// let's get this link's ticpassword from the sbbsecho.ini file
// for now, we get to play with adding/removing the @domain part
// to find the link in our configs. this is because we can list
// them in echocfg with or without the @domain and the lookup
// routine sbbsecho.get_ticpwd() requires an exact address match
// - wk42
log(LOG_DEBUG, "Searching for "+link+"'s password...");
pw = sbbsecho.get_ticpw(link);
if (pw===undefined)
pw = '';
if (pw===undefined || pw === '') {
// if pw is undefined or empty, try looking up alink - wk42
var alink = FIDO.parse_addr(link).toString();
log(LOG_DEBUG, "Searching for password with domain this time: "+alink+"...");
pw = sbbsecho.get_ticpw(alink);
if (pw===undefined || pw === '') {
// if we get here and pw is undefined or empty, there really
// must not be one in sbbsecho.ini. log a warning about it. - wk42
log(LOG_WARNING, "No TIC password defined for linked system "+link+" or "+alink+".");
log(LOG_WARNING, "No Pw line will be written to this TIC file.");
} else
log(LOG_DEBUG, "Found "+alink+"'s password.");
} else
log(LOG_DEBUG, "Found "+link+"'s password.");
// Figure out the outbound dir...
addr = FIDO.parse_addr(link, defzone);
......@@ -318,15 +353,118 @@ function forward_tic(tic)
log(LOG_ERROR, "Unable to create TIC file for "+link+". They will not get file '"+tic.file+"'!");
continue;
}
// now let's figure out which address we're going to use in this
// new TIC we are creating. this address will be used in the From
// and Path lines, below.
//
// current selection order:
// 1. per area AKA Match
// 2. per area source address
// 3. global AKA Match
// 4. global source address
// 5. main FTN address
//
// NOTE: we're slicing off @domain for now... we should be able
// to use it since it is part of the definition of a FTN address
// and should be OK to use in TICs but to prevent possible
// problems with non-5D-aware TIC processors, we're slicing it
// off for now. - wk42
var whichaddress = "";
if (cfg !== undefined && cfg.akamatching === true) {
var dreks = [];
var drek;
for (drek in system.fido_addr_list)
dreks.push(FIDO.parse_addr(system.fido_addr_list[drek]));
drek = FIDO.parse_addr(link);
FIDO.distance_sort(dreks, drek);
whichaddress = dreks[0].toString();
if (whichaddress.indexOf("@") > -1)
whichaddress = whichaddress.slice(0,whichaddress.indexOf("@"));
log(LOG_INFO, "Using '"+tic.area.toUpperCase()+"' area AKA match: "+whichaddress);
} else if (cfg !== undefined && cfg.sourceaddress !== undefined) {
whichaddress = cfg.sourceaddress.toString();
if (whichaddress.indexOf("@") > -1)
whichaddress = whichaddress.slice(0,whichaddress.indexOf("@"));
log(LOG_INFO, "Using '"+tic.area.toUpperCase()+"' area source address: "+whichaddress);
} else if (tickit.gcfg.akamatching) {
var dreks = [];
var drek;
for (drek in system.fido_addr_list)
dreks.push(FIDO.parse_addr(system.fido_addr_list[drek]));
drek = FIDO.parse_addr(link);
FIDO.distance_sort(dreks, drek);
whichaddress = dreks[0].toString();
if (whichaddress.indexOf("@") > -1)
whichaddress = whichaddress.slice(0,whichaddress.indexOf("@"));
log(LOG_INFO, "Using global AKA match: "+whichaddress);
} else if (tickit.gcfg.sourceaddress) {
whichaddress = tickit.gcfg.sourceaddress.toString();
if (whichaddress.indexOf("@") > -1)
whichaddress = whichaddress.slice(0,whichaddress.indexOf("@"));
log(LOG_INFO, "Using global source address: "+whichaddress);
} else if (addrs[0]) {
whichaddress = addrs[0].toString();
if (whichaddress.indexOf("@") > -1)
whichaddress = whichaddress.slice(0,whichaddress.indexOf("@"));
log(LOG_INFO, "Using main FTN address: "+whichaddress);
} else {
// we should not end up here because there should always be at
// least one FTN address in the system.fido_addr_list if a
// system is processing TIC files which are a FTN thing.
// log it and get out. we've already deleted the TIC file we
// were working from so now we have an abandoned file with
// no TIC and we cannot create a proper TIC since we have no
// FTN addresses defined :( - wk42
log(LOG_ERROR, "No FTN system address defined!");
return false;
}
// the TIC "Created" keyword identifies the software that created
// this TIC file. there is no formal format for this optional
// keyword. when passing files to other systems, new TICs are
// created so we'll identify this tickit created one. we will
// always add this line first when creating the new TIC file. - wk42
tf.write("Created by "+tickitVersion+"\r\n");
tf.write(tic[' forward'].join("\r\n"));
tf.write('\r\n');
// TODO: Use BinkpSourceAddress?
FIDO.distance_sort(addrs, addr);
tf.write('From '+addrs[0]+'\r\n');
// DONE: global and per area source address overrides and AKA Matching - wk42
// source address override: SourceAddress=zone:net/node[.point][@domain] in tickit.ini
// AKA Matching on/off: AKAMatching=[true|false] in tickit.ini
// use the address selected above.
tf.write('From '+whichaddress+'\r\n');
tf.write('To '+link+'\r\n');
tf.write('Pw '+pw+'\r\n');
// put in the password line only if we have a password for this link - wk42
if (pw !== undefined && pw !== "") {
tf.write('Pw '+pw+'\r\n');
}
// write existing Path lines to the new TIC...
for (i=0; i<tic.path.length; i++)
tf.write('Path '+tic.path[i]+'\r\n');
// now generate our Path line with date/time stamp in UTC per
// http://ftsc.org/docs/fts-5006.001 and write it to the TIC - wk42
//
// this required keyword has a format.
// Path zone:net/node[.point][@domain] time [time string] [tic processor data]
// -----
// This specifies the node number and the date and time of a
// system that has processed the file.
// The time parameter is expressed as a unix style timestamp,
// optionally followed by the date and time in human readable
// form. Unix timestamp is UTC. Human readable format may be
// local time (including UTC offset) or UTC.
//
// File processors may add additional information. For example a
// signature identifying the software generating the path line.
//
// Example: Path 2:2/20 1415567298 Sun Nov 9 21:08:18 2014 UTC
// -----
//
var d = new Date();
var utstamp = Math.round(d.getTime()/1000);
log(LOG_DEBUG, "Path "+whichaddress+" "+utstamp+" "+d.toUTCString()+"; "+tickitVersion);
tf.write('Path '+whichaddress+' '+utstamp+' '+d.toUTCString()+'; '+tickitVersion+'\r\n');
for (i=0; i<tic.seenby.length; i++)
tf.write('Seenby '+tic.seenby[i]+'\r\n');
tf.close();
......@@ -337,7 +475,7 @@ function forward_tic(tic)
else
flobase = outb+format("%04x%04x", addr.net, addr.node);
bf = new File(flobase+'.bsy');
while (!bf.open('web+')) {
while (!bf.open('wxb+')) {
// TODO: This waits forever...
log(LOG_WARNING, "Waiting for BSY file '"+bf.name+"'...");
mswait(1000);
......@@ -401,6 +539,9 @@ function parse_ticfile(fname)
break;
case 'path':
// log the path lines for informational purposes before we apply
// the circular path detection. - wk42
log(LOG_INFO, "Path "+val);
// Circular path detection...
for (i=0; i<system.fido_addr_list.length; i++) {
if (val === system.fido_addr_list[i]) {
......@@ -411,6 +552,16 @@ function parse_ticfile(fname)
tic[key].push(val);
break;
case 'created':
// the TIC "Created" keyword identifies the software that created
// this TIC file. there is no formal format for this keyword.
// when passing files to other systems, new TICs are created so
// we'll log this one for informational purposes and throw it
// away so we can create our own later in forward_tic() with our
// tickit.js revision line. - wk42
log(LOG_INFO, "Created "+val);
break;
// All the rest are passed through unmodified
// Single value, single line...
case 'area':
......@@ -420,7 +571,6 @@ function parse_ticfile(fname)
case 'lfile':
case 'size':
case 'date':
case 'created':
case 'magic':
case 'replaces':
case 'crc':
......@@ -478,9 +628,25 @@ function parse_ticfile(fname)
}
}
if (!tickit.gcfg.ignorepassword) {
if (!sbbsecho.match_ticpw(tic.from, tic.pw))
return false;
if (tickit.gcfg.ignorepassword)
log(LOG_DEBUG, "Global ignore password enabled.");
else {
// there may or may not be @domain on the from line in the
// TIC file. look for both address forms. - wk42
log(LOG_INFO, "Verifying password for sender: "+tic.from);
if (!sbbsecho.match_ticpw(tic.from, tic.pw)) {
var alink = FIDO.parse_addr(tic.from).toString();
log(LOG_INFO, "Verifying password with domain this time: "+alink);
if (!sbbsecho.match_ticpw(alink, tic.pw)) {
// if we get here and there is no match, then we have
// defined the wrong password somewhere... - wk42
log(LOG_WARNING, "No password matched for sender "+tic.from+" or "+alink+".");
log(LOG_WARNING, "Please check the defined password for this sender.");
return false;
} else
log(LOG_INFO, "Matched "+alink+"'s password.");
} else
log(LOG_INFO, "Matched "+tic.from+"'s password.");
}
tic[' forward'] = outtic;
......@@ -488,11 +654,13 @@ function parse_ticfile(fname)
return tic;
}
function import_files()
// need the tic for some more processing
function import_files(tic)
{
log(LOG_INFO, "Importing...");
var i;
var cmd;
var f=new File(system.temp_dir+"/tickit-files.bbs");
var f=new File(system.temp_dir+"tickit-files.bbs");
for (i in files_bbs) {
if (file_area.dir[i] === undefined) {
......@@ -507,48 +675,123 @@ function import_files()
f.write(files_bbs[i]);
f.close();
// figure out the uploader name if there is an override in place
// globally or per area. - wk42
var uploader = "";
var cfg = tickit.acfg[tic.area.toLowerCase()];
if (cfg !== undefined && cfg.uploader !== undefined) {
uploader = cfg.uploader.toString();
log(LOG_INFO, "Using '"+tic.area.toUpperCase()+"' area uploader: "+uploader);
} else if (tickit.gcfg.uploader !== undefined) {
uploader = tickit.gcfg.uploader.toString();
log(LOG_INFO, "Using global uploader: "+uploader);
}
cmd = system.exec_dir+"addfiles "+i;
if (tickit.gcfg.uploader !== undefined)
cmd += ' -x "' + tickit.gcfg.uploader + '"';
if (uploader !== undefined && uploader !== "")
cmd += ' -x "' + uploader + '"';
cmd += " -zd +"+f.name+" 24 13";
log(LOG_DEBUG, "Executing: '"+cmd+"'.");
system.exec(cmd);
if (tickit.gcfg.addfileslogcap) {
// catch addfiles output only if global AddFilesLogCap is
// enabled. this is so we can try to determine what causes
// addfiles to abort early and not import some files for
// some reason. we're going to write this to the
// system.logs_dir because system.temp_dir is cleaned
// regularly and indiscriminately - wk42
if (system.platform === 'Win32')
cmd += " 1>>" + system.logs_dir + "addfiles.log 2>&1";
else
cmd += " >>" + system.logs_dir + "addfiles.log 2>&1";
}
log(LOG_INFO, "Executing: '"+cmd+"'.");
log(LOG_INFO, "addfiles returned: "+system.exec(cmd));
}
// clear the files_bbs array since we're now importing the files one
// file at a time as they are processed. this is a quick hack to
// enable per area uploader names and i didn't take the time to try
// to refactor this properly. it works for now - wk42
files_bbs = {};
}
function main() {
var i, j;
var ticfiles;
var tic;
var processed = 0;
for (i in argv)
if(argv[i] == "-force-replace")
force_replace = true;
// check source FTN address overrides and list for debugging purposes - wk42
//
// current selection order:
// 1. per area AKA Match
// 2. per area source address
// 3. global AKA Match
// 4. global source address
// 5. main FTN address
//
var addrs = [];
var saddr;
for (saddr in system.fido_addr_list)
addrs.push(FIDO.parse_addr(system.fido_addr_list[saddr]));
if (tickit.gcfg.akamatching) {
log(LOG_DEBUG, "Global address is nearest AKA match.");
} else if (tickit.gcfg.sourceaddress) {
saddr = tickit.gcfg.sourceaddress.toString();
if (saddr.indexOf("@") > -1)
saddr = saddr.slice(0,saddr.indexOf("@"));
log(LOG_DEBUG, "Global address is global source address: "+saddr);
} else if (addrs[0]) {
saddr = addrs[0].toString();
if (saddr.indexOf("@") > -1)
saddr = saddr.slice(0,saddr.indexOf("@"));
log(LOG_DEBUG, "Global address is main system address: "+saddr);
} else {
log(LOG_ERROR, "No FTN system address defined!");
}
var areas = Object.keys(tickit.acfg);
for (var i = 0; i < areas.length; i++) {
var cfg = tickit.acfg[areas[i]];
if (cfg !== undefined && cfg.akamatching === true) {
log(LOG_DEBUG, areas[i].toUpperCase()+" using area AKA match.");
} else if (cfg !== undefined && cfg.sourceaddress !== undefined) {
var aaddr = cfg.sourceaddress.toString();
if (aaddr.indexOf("@") > -1)
aaddr = aaddr.slice(0,aaddr.indexOf("@"));
log(LOG_DEBUG, areas[i].toUpperCase()+" using area source address: "+aaddr);
} else if (tickit.gcfg.akamatching) {
log(LOG_DEBUG, areas[i].toUpperCase()+" using global AKA match.");
} else if (tickit.gcfg.sourceaddress) {
log(LOG_DEBUG, areas[i].toUpperCase()+" using global source address "+saddr);
} else {
log(LOG_DEBUG, areas[i].toUpperCase()+" using main system address: "+saddr);
}
}
for (i=0; i<sbbsecho.inb.length; i++) {
if (tickit.gcfg.secureonly) {
if (sbbsecho.inb[i] != sbbsecho.secure_inbound)
continue;
}
if (system.platform === 'Win32')
ticfiles = directory(sbbsecho.inb[i]+'/*.tic');
ticfiles = directory(sbbsecho.inb[i]+'*.tic');
else
ticfiles = directory(sbbsecho.inb[i]+'/*.[Tt][Ii][Cc]');
ticfiles = directory(sbbsecho.inb[i]+'*.[Tt][Ii][Cc]');
for (j=0; j<ticfiles.length; j++) {
tic = parse_ticfile(ticfiles[j]);
if (tic !== false) {
if (process_tic(tic)) {
processed++;
forward_tic(tic);
// check if we actually were able to forward the file to the link -- wk42
if (!forward_tic(tic))
log(LOG_WARNING, tic.file+" has not been forwarded.");
import_files(tic);
} else {
log(LOG_WARNING, "Abandoning "+tic.tic_filename);
}
}
}
}
if (processed)
import_files();
}
main();
......@@ -97,6 +97,54 @@ function set_location(obj)
}
}
function set_akamatching(obj)
{
switch(uifc.list(WIN_MID, "AKA Matching", ["Yes", "No"])) {
case 0:
obj.akamatching = true;
break;
case 1:
obj.akamatching = false;
break;
}
}
function set_secureonly(obj)
{
switch(uifc.list(WIN_MID, "Secure Only", ["Yes", "No"])) {
case 0:
obj.secureonly = true;
break;
case 1:
obj.secureonly = false;
break;
}
}
function set_ignorepassword(obj)
{
switch(uifc.list(WIN_MID, "Ignore Password", ["Yes", "No"])) {
case 0:
obj.ignorepassword = true;
break;
case 1:
obj.ignorepassword = false;
break;
}
}
function set_forcereplace(obj)
{
switch(uifc.list(WIN_MID, "Force Replace", ["Yes", "No"])) {
case 0:
obj.forcereplace = true;
break;
case 1:
obj.forcereplace = false;
break;
}
}
function edit_links(links)
{
var tmp;
......@@ -123,12 +171,43 @@ function edit_links(links)
return links;
}
function edit_sourceaddress(obj)
{
var tmp;
tmp = null;
while(tmp !== undefined) {
tmp = uifc.input(WIN_SAV|WIN_MID, "Source Address", obj.sourceaddress === undefined ? '' : obj.sourceaddress, 32, K_EDIT);
if (tmp != undefined) {
obj.sourceaddress = tmp;
}
}
}
function edit_uploader(obj)
{
var tmp;
tmp = null;
while(tmp !== undefined) {
tmp = uifc.input(WIN_SAV|WIN_MID, "Uploader", obj.uploader === undefined ? '' : obj.uploader, 32, K_EDIT);
if (tmp != undefined) {
obj.uploader = tmp;
}
}
}
function edit_area(obj, name)
{
var cmd = 0;
var link = 0;
var links;
var menu = ["Location", "Links"];
var menu = ["AKA Matching : "+(obj.akamatching === true ? "Yes" : "No"),
"Force Replace : "+(obj.forcereplace === true ? "Yes" : "No"),
"Source Address : "+(obj.sourceaddress === undefined ? "" : obj.sourceaddress),
"Uploader Name : "+(obj.uploader === undefined ? "" : obj.uploader),
"Location : ",
"Links : "];
var tmp;
var tmp2;
var ctx = new uifc.list.CTX();
......@@ -137,9 +216,21 @@ function edit_area(obj, name)
cmd = uifc.list(WIN_SAV|WIN_ACT|WIN_BOT|WIN_RHT, name+" Options", menu, ctx);
switch(cmd) {
case 0:
set_location(obj);
set_akamatching(obj);
break;
case 1:
edit_sourceaddress(obj);
break;
case 2:
edit_uploader(obj);
break;
case 3:
set_forcereplace(obj);
break;
case 4:
set_location(obj);
break;
case 5:
if (obj.links === undefined)
links = [];
else
......@@ -231,7 +322,15 @@ function main()
var cmd = 0;
var link = 0;
var links;
var menu = ["Global Location", "Global Links", "Areas..."];
var menu = ["Global AKA Matching : "+(tickit.gcfg.akamatching === true ? "Yes" : "No"),
"Global Force Replace : "+(tickit.gcfg.forcereplace === true ? "Yes" : "No"),
"Global Ignore Password: "+(tickit.gcfg.ignorepassword === true ? "Yes" : "No"),
"Global Secure Only : "+(tickit.gcfg.secureonly === true ? "Yes" : "No"),
"Global Source Address : "+(tickit.gcfg.sourceaddress === undefined ? "" : tickit.gcfg.sourceaddress),
"Global Uploader Name : "+(tickit.gcfg.uploader === undefined ? "" : tickit.gcfg.uploader),
"Global Location : ",
"Global Links : ",
"Areas..."];
var tmp;
var tmp2;
var ctx = new uifc.list.CTX();
......@@ -240,9 +339,27 @@ function main()
cmd = uifc.list(WIN_ORG|WIN_ACT|WIN_MID, "Global Options", menu, ctx);
switch(cmd) {
case 0:
set_location(tickit.gcfg);
set_akamatching(tickit.gcfg);
break;
case 1:
set_forcereplace(tickit.gcfg);
break;
case 2:
set_ignorepassword(tickit.gcfg);
break;
case 3:
set_secureonly(tickit.gcfg);
break;
case 4:
edit_sourceaddress(tickit.gcfg);
break;
case 5:
edit_uploader(tickit.gcfg);
break;
case 6:
set_location(tickit.gcfg);
break;
case 7:
if (tickit.gcfg.links === undefined)
links = [];
else
......@@ -253,7 +370,7 @@ function main()
else
tickit.gcfg.links = tmp.join(',');
break;
case 2:
case 8:
edit_areas();
break;
case -1:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment