blob: 489c869169bfa3c6a7f170be9e26f835c9d4e79e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
<% include( 'elements/svc_Common.html',
'table' => 'svc_dsl',
'precheck_callback' => $precheck_callback,
)
%>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
my $precheck_callback = sub {
my $cgi = shift;
my $svcnum = $cgi->param('svcnum');
my $error = '';
my $old;
my $part_svc;
if ( $svcnum ) {
$old = FS::svc_dsl->by_key($svcnum);
$part_svc = $old->part_svc;
} else {
my $svcpart = $cgi->param('svcpart') or die "svcpart required";
$part_svc = FS::part_svc->by_key($svcpart);
}
my $psc = $part_svc->part_svc_column('password');
if ( $psc->columnflag eq 'F' ) {
# enforce it here and skip password validation
$cgi->param('password', $psc->columnvalue);
} else {
my $newpass = $cgi->param('password');
if ( $old and $newpass ne $old->password ) {
$error ||= $old->is_password_allowed($newpass);
}
}
$error;
};
</%init>
|