TT#129162 Admins fix password field transformation

* password field is virtual and needs to be transformed
  into saltedpass, restored the removed logic that does that
  in process_form_resource()

Change-Id: I8baabbef2bdb46db850e12b6e0c638ca5c3deddf
(cherry picked from commit 992c9f1e48)
mr9.5.4
Kirill Solomko 4 years ago
parent 9838121715
commit d1e119445b

@ -83,6 +83,13 @@ sub process_form_resource{
NGCP::Panel::Utils::API::apply_resource_reseller_id($c, $resource);
my $pass = $resource->{password};
delete $resource->{password};
if (defined $pass) {
$resource->{md5pass} = undef;
$resource->{saltedpass} = NGCP::Panel::Utils::Auth::generate_salted_hash($pass);
}
foreach my $f(qw/billing_data call_data is_active is_master is_superuser is_ccare lawful_intercept read_only show_passwords/) {
$resource->{$f} = (ref $resource->{$f} eq 'JSON::true' || ( defined $resource->{$f} && ( $resource->{$f} eq 'true' || $resource->{$f} eq '1' ) ) ) ? 1 : 0;
}

Loading…
Cancel
Save