summaryrefslogtreecommitdiffstats
path: root/etc/inc/voucher.inc
diff options
context:
space:
mode:
authorRenato Botelho <renato.botelho@bluepex.com>2010-08-30 20:36:30 -0300
committerRenato Botelho <renato.botelho@bluepex.com>2010-08-30 20:36:30 -0300
commit47f12397b3ec7f6fa860d21136a7deca9f6573e8 (patch)
tree2f63de6cc3229518d8704d641ab085d63bfd12da /etc/inc/voucher.inc
parent701a250b6ede4936d1dd677b8e1813a440e90c71 (diff)
downloadpfsense-47f12397b3ec7f6fa860d21136a7deca9f6573e8.zip
pfsense-47f12397b3ec7f6fa860d21136a7deca9f6573e8.tar.gz
Fix gettext calls with printf to permit change strings order
Diffstat (limited to 'etc/inc/voucher.inc')
-rw-r--r--etc/inc/voucher.inc12
1 files changed, 6 insertions, 6 deletions
diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc
index 978b1d2..e746d8a 100644
--- a/etc/inc/voucher.inc
+++ b/etc/inc/voucher.inc
@@ -89,7 +89,7 @@ function voucher_auth($voucher_received, $test = 0) {
list($timestamp,$minutes) = explode(",", $line);
// we have an already active voucher here.
$remaining = intval((($timestamp + 60*$minutes) - time())/60);
- $test_result[] = sprintf(gettext("%s (%s/%s) active and good for %d Minutes"), $voucher, $roll, $nr, $remaining);
+ $test_result[] = sprintf(gettext("%1$s (%2$s/%3$s) active and good for %4$d Minutes"), $voucher, $roll, $nr, $remaining);
$total_minutes += $remaining;
} else {
// voucher not used. Check if ticket Id is on the roll (not too high)
@@ -100,18 +100,18 @@ function voucher_auth($voucher_received, $test = 0) {
$pos = $nr >> 3; // divide by 8 -> octet
$mask = 1 << ($nr % 8);
if (ord($bitstring[$roll][$pos]) & $mask) {
- $test_result[] = sprintf(gettext("%s (%s/%s) already used and expired"), $voucher, $roll, $nr);
+ $test_result[] = sprintf(gettext("%1$s (%2$s/%3$s) already used and expired"), $voucher, $roll, $nr);
$total_minutes = -1; // voucher expired
$error++;
} else {
// mark bit for this voucher as used
$bitstring[$roll][$pos] = chr(ord($bitstring[$roll][$pos]) | $mask);
- $test_result[] = sprintf(gettext("%s (%s/%s) good for %d Minutes"), $voucher, $roll, $nr, $minutes_per_roll[$roll]);
+ $test_result[] = sprintf(gettext("%1$s (%2$s/%3$) good for %4$d Minutes"), $voucher, $roll, $nr, $minutes_per_roll[$roll]);
$total_minutes += $minutes_per_roll[$roll];
}
}
} else {
- $test_result[] = sprintf(gettext("%s (%s/%s): not found on any registererd Roll"), $voucher, $roll, $nr);
+ $test_result[] = sprintf(gettext("%1$s (%2$s/%3$s): not found on any registererd Roll"), $voucher, $roll, $nr);
}
} else {
// hmm, thats weird ... not what I expected
@@ -330,7 +330,7 @@ function voucher_write_used_db($roll, $vdb) {
fwrite($fd, $vdb . "\n");
fclose($fd);
} else {
- voucher_log(LOG_ERR, sprintf(gettext("cant write %s/voucher_used_%s.db"), $g['vardb_path'], $roll));
+ voucher_log(LOG_ERR, sprintf(gettext("cant write %1$s/voucher_used_%2$s.db"), $g['vardb_path'], $roll));
}
}
@@ -409,7 +409,7 @@ function voucher_read_used_db($roll) {
$vdb = trim(fgets($fd));
fclose($fd);
} else {
- voucher_log(LOG_ERR, sprintf(gettext("cant read %s/voucher_used_%s.db"), $g['vardb_path'], $roll));
+ voucher_log(LOG_ERR, sprintf(gettext("cant read %1$s/voucher_used_%2$s.db"), $g['vardb_path'], $roll));
}
}
return base64_decode($vdb);
OpenPOWER on IntegriCloud