summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-08-04 11:16:41 -0700
committerMark Wells <mark@freeside.biz>2015-08-04 11:52:57 -0700
commitce1a26f5033acf26ccf0c922b2fc43cc2baa2bb9 (patch)
treee146ac70e272749658fe146e522931ad83a79269 /httemplate
parent908d425750365b7a2bf59334ccfc41adc9d61a17 (diff)
de-randomization fixes for testing, #37340
Conflicts: FS/FS/Conf.pm
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/elements/bill.html2
-rw-r--r--httemplate/elements/columnstart.html2
-rw-r--r--httemplate/elements/create_uri_query2
-rw-r--r--httemplate/elements/input-fcc_options.html2
-rw-r--r--httemplate/elements/pickcolor.html2
-rw-r--r--httemplate/elements/popup_link_onclick.html2
-rw-r--r--httemplate/elements/progress-init.html2
-rw-r--r--httemplate/elements/tr-input-mask.html2
-rw-r--r--httemplate/graph/elements/report.html2
9 files changed, 9 insertions, 9 deletions
diff --git a/httemplate/elements/bill.html b/httemplate/elements/bill.html
index 64a1a6d2c..420a7489b 100644
--- a/httemplate/elements/bill.html
+++ b/httemplate/elements/bill.html
@@ -45,7 +45,7 @@ my $label = $opt{'label'};
# formname no longer needs to be passed from outside, but we still
# need one and it needs to be unique
my $formname = $opt{'formname'} ||
- 'bill'.sprintf('%04d',int(rand(10000))).$custnum;
+ 'bill'.sprintf('%04d',random_id(4)).$custnum;
my $url = $opt{'url'} || '';
my $message = $opt{'message'} || 'Finished!';
my $bill_opts = $opt{'bill_opts'} || {};
diff --git a/httemplate/elements/columnstart.html b/httemplate/elements/columnstart.html
index 1ffbcb9e8..245c308a7 100644
--- a/httemplate/elements/columnstart.html
+++ b/httemplate/elements/columnstart.html
@@ -10,7 +10,7 @@
Pass 'aligned' => 1 to have corresponding rows in the columns line up.
</%doc>
-% my $id = sprintf('table%08d', rand(100000000));
+% my $id = sprintf('table%08d', random_id(8));
<TR>
<TD CLASS="background" COLSPAN=99>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 id="<%$id%>">
diff --git a/httemplate/elements/create_uri_query b/httemplate/elements/create_uri_query
index ce6249e0e..414d53ba4 100644
--- a/httemplate/elements/create_uri_query
+++ b/httemplate/elements/create_uri_query
@@ -18,7 +18,7 @@ my $query = $cgi->query_string;
if ( length($query) > 1920 || $opt{secure} ) { #stupid IE 2083 URL limit
- my $session = int(rand(4294967296)); #XXX
+ my $session = random_id(9);
my $pref = new FS::access_user_pref({
'usernum' => $FS::CurrentUser::CurrentUser->usernum,
'prefname' => "redirect$session",
diff --git a/httemplate/elements/input-fcc_options.html b/httemplate/elements/input-fcc_options.html
index 064c647fc..080b40f88 100644
--- a/httemplate/elements/input-fcc_options.html
+++ b/httemplate/elements/input-fcc_options.html
@@ -9,7 +9,7 @@
% }
% unless ($opt{html_only}) {
% my $popup = $fsurl.'misc/part_pkg_fcc_options.html?id=';
-% my $popup_name = 'popup-'.time. "-$$-". rand() * 2**32;
+% my $popup_name = 'popup-'.random_id();
<SCRIPT TYPE="text/javascript">
function edit_fcc_options() {
var id = this.dataset['target'];
diff --git a/httemplate/elements/pickcolor.html b/httemplate/elements/pickcolor.html
index d410ebfc7..2b0647fbf 100644
--- a/httemplate/elements/pickcolor.html
+++ b/httemplate/elements/pickcolor.html
@@ -38,7 +38,7 @@ my %opt = @_;
my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value};
-my $unum = int(rand(100000));
+my $unum = random_id(5);
my $id = $opt{'id'} || $opt{'field'}.$unum;
diff --git a/httemplate/elements/popup_link_onclick.html b/httemplate/elements/popup_link_onclick.html
index 0690dc812..612de7520 100644
--- a/httemplate/elements/popup_link_onclick.html
+++ b/httemplate/elements/popup_link_onclick.html
@@ -62,7 +62,7 @@ $scrolling = $params->{'scrolling'} if exists $params->{'scrolling'};
#stupid safari is caching the "location" of popup iframs, and submitting them
#instead of displaying them. this should prevent that.
-my $popup_name = 'popup-'.time. "-$$-". rand() * 2**32;
+my $popup_name = 'popup-'.random_id();
my $onclick =
"overlib( OLiframeContent($action, $width, $height, '$popup_name', 0, '$scrolling' ), ".
diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html
index 5b42aa1a8..2728240ef 100644
--- a/httemplate/elements/progress-init.html
+++ b/httemplate/elements/progress-init.html
@@ -170,6 +170,6 @@ $progress_url->query_form(
#stupid safari is caching the "location" of popup iframs, and submitting them
#instead of displaying them. this should prevent that.
-my $popup_name = 'popup-'.time. "-$$-". rand() * 2**32;
+my $popup_name = 'popup-'.random_id();
</%init>
diff --git a/httemplate/elements/tr-input-mask.html b/httemplate/elements/tr-input-mask.html
index fdd20962d..93e322c6c 100644
--- a/httemplate/elements/tr-input-mask.html
+++ b/httemplate/elements/tr-input-mask.html
@@ -68,7 +68,7 @@ my $init = 0;
<%init>
my %opt = @_;
# must have a DOM id
-my $id = $opt{id} || sprintf('input%04d',int(rand(10000)));
+my $id = $opt{id} || sprintf('input%04d',random_id(4));
my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value} || '';
my $clipboard_hack = $FS::CurrentUser::CurrentUser->option('enable_mask_clipboard_hack');
diff --git a/httemplate/graph/elements/report.html b/httemplate/graph/elements/report.html
index cffc82816..f1b0d166d 100644
--- a/httemplate/graph/elements/report.html
+++ b/httemplate/graph/elements/report.html
@@ -331,7 +331,7 @@ if ( $cgi->param('session') =~ /^(\d+)$/ ) {
%opt = %{ $m->cache->get($session) };
}
else {
- $session = sprintf("%010d%06d", time, int(rand(1000000)));
+ $session = sprintf("%010d", random_id(10));
$m->cache->set($session, \%opt, '1h');
}