X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fsvc_acct.cgi;h=d81eaecb9773d5a7ca42f2f4920583b61fdd917e;hb=6f471946b3ae36061cb595ba0657a5b43e7bfd5d;hp=ca614cbd8487866f8e605843571d6cbe5f2530f5;hpb=f1a024ad18faf7246176f7679f0443e0377785b6;p=freeside.git diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi index ca614cbd8..d81eaecb9 100755 --- a/httemplate/edit/process/svc_acct.cgi +++ b/httemplate/edit/process/svc_acct.cgi @@ -76,12 +76,30 @@ if ( $cgi->param('captcha_response') ) { } } -$new->_password($old->_password) if $old; -if ( $cgi->param('clear_password') eq '*HIDDEN*' - || $cgi->param('clear_password') =~ /^\(.* encrypted\)$/ ) { - die "fatal: no previous account to recall hidden password from!" unless $old; +# check whether the password is set as "fixed" in the service def. if so, +# ignore the password that was submitted and use the fixed value. + +my $psc = $part_svc->part_svc_column('_password'); +if ( $psc->columnflag eq 'F' ) { + + $new->set('_password', $psc->columnvalue); + } else { - $error ||= $new->set_password($cgi->param('clear_password')); + + $new->_password($old->_password) if $old; + if ( $cgi->param('clear_password') eq '*HIDDEN*' + || $cgi->param('clear_password') =~ /^\(.* encrypted\)$/ ) { + die "fatal: no previous account to recall hidden password from!" + unless $old; + } else { + my $newpass = $cgi->param('clear_password'); + if ( !$old or ! $old->check_password($newpass) ) { + # then the password is being changed + $error ||= $new->is_password_allowed($newpass) + || $new->set_password($newpass); + } + } + } if ( ! $error ) { @@ -102,10 +120,14 @@ if ( ! $error ) { map { $_ => $cgi->param("router_$_") } qw( routernum routername blocknum ) }); - if (length($router->routername == 0)) { + if (length($router->routername) == 0) { #sensible default $router->set('routername', $new->label); } + if (length($router->blocknum) == 0) { + #unset it + $router->set('blocknum', 0); + } push @child_objects, $router; }