missing files, #20687
authorMark Wells <mark@freeside.biz>
Tue, 16 Jul 2013 17:49:51 +0000 (10:49 -0700)
committerMark Wells <mark@freeside.biz>
Tue, 16 Jul 2013 17:49:51 +0000 (10:49 -0700)
httemplate/misc/change_pkg_now.cgi [new file with mode: 0644]
httemplate/misc/do_not_change_pkg.cgi [new file with mode: 0644]

diff --git a/httemplate/misc/change_pkg_now.cgi b/httemplate/misc/change_pkg_now.cgi
new file mode 100644 (file)
index 0000000..73ee740
--- /dev/null
@@ -0,0 +1,22 @@
+%if ( $error ) {
+%  errorpage($error);
+%} else {
+<% $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')) %>
+%}
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Change customer package');
+
+#untaint pkgnum
+my ($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ || die "Illegal pkgnum";
+my $pkgnum = $1;
+
+my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+my $change_to = FS::cust_pkg->by_key($cust_pkg->change_to_pkgnum);
+
+my $err_or_pkg = $cust_pkg->change({ 'cust_pkg' => $change_to });
+my $error = $err_or_pkg unless ref($err_or_pkg);
+
+</%init>
diff --git a/httemplate/misc/do_not_change_pkg.cgi b/httemplate/misc/do_not_change_pkg.cgi
new file mode 100644 (file)
index 0000000..c164c5c
--- /dev/null
@@ -0,0 +1,20 @@
+%if ( $error ) {
+%  errorpage($error);
+%} else {
+<% $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')) %>
+%}
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Change customer package');
+
+#untaint pkgnum
+my ($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ || die "Illegal pkgnum";
+my $pkgnum = $1;
+
+my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+
+my $error = $cust_pkg->abort_change;
+
+</%init>