diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-03-10 22:28:34 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-03-10 22:28:34 -0700 |
commit | 57c5cf47f41739b57c563ddac09d0bd49d6d67b4 (patch) | |
tree | 187f1fdd593bbaeea03dfb2bd473a4dfe502f775 /httemplate/edit | |
parent | f37b4c3e04f6dfc56ba967e270b5b49edafe81f6 (diff) |
hide svc_phone.sip_password like svc_acct._password unless showpasswords config is on, RT#20862
Diffstat (limited to 'httemplate/edit')
-rw-r--r-- | httemplate/edit/process/elements/process.html | 3 | ||||
-rw-r--r-- | httemplate/edit/process/svc_phone.html | 10 | ||||
-rw-r--r-- | httemplate/edit/svc_phone.cgi | 5 |
3 files changed, 16 insertions, 2 deletions
diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html index 2d39e9dce..fb1ee7a27 100644 --- a/httemplate/edit/process/elements/process.html +++ b/httemplate/edit/process/elements/process.html @@ -263,6 +263,9 @@ foreach my $value ( @values ) { if ( !$error ) { if ( $old_pkey ) { + + &{ $opt{'edit_callback'} }( $new, $old ) if $opt{'edit_callback'}; + $error = $new->replace($old, @args); } else { $error = $new->insert(@args); diff --git a/httemplate/edit/process/svc_phone.html b/httemplate/edit/process/svc_phone.html index 611b5142b..27e975568 100644 --- a/httemplate/edit/process/svc_phone.html +++ b/httemplate/edit/process/svc_phone.html @@ -2,6 +2,7 @@ 'table' => 'svc_phone', 'args_callback' => $args_callback, 'value_callback' => $value_callback, + 'edit_callback' => $edit_callback, %opt, &> <%init> @@ -51,8 +52,13 @@ my $args_callback = sub { }; my $value_callback = sub { - my ($field, $value) = @_; - ($field =~ /_date$/) ? parse_datetime($value) : $value; + my ($field, $value) = @_; + ($field =~ /_date$/) ? parse_datetime($value) : $value; +}; + +my $edit_callback = sub { + my( $new, $old ) = @_; + $new->sip_password( $old->sip_password ) if $new->sip_password eq '*HIDDEN*'; }; </%init> diff --git a/httemplate/edit/svc_phone.cgi b/httemplate/edit/svc_phone.cgi index 8ee71b82d..13bbe82a1 100644 --- a/httemplate/edit/svc_phone.cgi +++ b/httemplate/edit/svc_phone.cgi @@ -6,6 +6,11 @@ my( $cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt ) = @_; $svc_x->locationnum($cust_pkg->locationnum) if $cust_pkg; }, + 'svc_edit_callback' => sub { + my( $cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt) = @_; + my $conf = new FS::Conf; + $svc_x->sip_password('*HIDDEN*') unless $conf->exists('showpasswords'); + }, &> <%init> |