Changelog for HylaFAX 4.2.0
+* add admin option and dialstring alteration to faxalter (20 Jun 2004)
* add -end option for xferfaxstats and recvstats (17 Jun 2004)
* add DynamicLocalID config option (17 Jun 2004)
* prevent CID values from acquiring data when unset (1 Jun 2004)
time_t now = Sys::now();
struct tm tts = *localtime(&now);
struct tm when;
+ bool useadmin = false;
int c;
- while ((c = getopt(argc, argv, "a:h:k:m:n:P:t:DQRgpv")) != -1)
+ while ((c = getopt(argc, argv, "a:d:h:k:m:n:P:t:ADQRgpv")) != -1)
switch (c) {
+ case 'A': // connect with administrative privileges
+ useadmin = true;
+ break;
case 'D': // set notification to when done
script.append(groups ? "JGPARM " : "JPARM ");
script.append("NOTIFY DONE\n");
script.append("SENDTIME NOW\n");
}
break;
+ case 'd': // destination number
+ script.append(groups ? "JGPARM " : "JPARM ");
+ script.append("EXTERNAL ");
+ script.append(optarg);
+ script.append("\n");
+ script.append(groups ? "JGPARM " : "JPARM ");
+ script.append("DIALSTRING ");
+ script.append(optarg);
+ script.append("\n");
+ break;
case 'g': // apply to groups, not jobs
groups = true;
break;
if (script == "")
fxFatal("No job parameters specified for alteration.");
if (callServer(emsg)) {
- if (login(NULL, emsg)) {
+ if (login(NULL, emsg) &&
+ (!useadmin || admin(NULL, emsg))) {
for (; optind < argc; optind++) {
const char* jobid = argv[optind];
if (setCurrentJob(jobid) && jobSuspend(jobid)) {
fxFatal("usage: faxalter"
" [-h server-host]"
" [-a time]"
+ " [-d number]"
" [-k time]"
" [-m modem]"
" [-n notify]"
" [-P priority]"
" [-t tries]"
+ " [-A]"
" [-p]"
" [-g]"
" [-DQR]"
when jobs are queued for transmission and can also be displayed with
.IR faxstat (1).
Unprivileged users can alter the parameters of jobs that they own; clients
-with administrative privileges on a server can manipulate any job.
+with administrative privileges on a server can manipulate any job (see the
+.B \-A
+option below).
The user may be specified by the
.B FAXUSER
environment variable. By default,
(and
.IR at (1)).
.TP 10
+.BI \-d " destination"
+Change the destination number to
+.IR destination .
+.TP 10
.BI \-h " host"
Force the server to be contacted on a specific
.IR host .
.I faxalter
attempts to contact a server on the machine where it is run.
.TP 10
+.BI \-A
+Use administrative privileges;
+.I faxalter
+will prompt for the password to set administrative privileges.
+.TP 10
.BI \-k " time"
Specify a new time to kill a job;
the syntax is the same as used for the