diff --git a/lib/NGCP/Panel/Controller/Device.pm b/lib/NGCP/Panel/Controller/Device.pm index ce70df5c99..7b3dd2bb74 100644 --- a/lib/NGCP/Panel/Controller/Device.pm +++ b/lib/NGCP/Panel/Controller/Device.pm @@ -285,12 +285,20 @@ sub devmod_edit :Chained('devmod_base') :PathPart('edit') :Args(0) :Does(ACL) :A $r->{keys} = $keys; push @{ $params->{linerange} }, $r; } - + #TODO: TO inflate/deflate, I think foreach ( $c->model('DB')->resultset('autoprov_sync_parameters')->search_rs({ 'me.bootstrap_method' => $c->stash->{devmod}->bootstrap_method, })->all ){ $params->{'bootstrap_config_'.$c->stash->{devmod}->bootstrap_method.'_'.$_->parameter_name} = $_->parameter_value; } + my $credentials_rs = $c->model('DB')->resultset('autoprov_redirect_credentials')->search_rs({ + 'me.device_id' => $c->stash->{devmod}->id, + }); + if($credentials_rs->first){ + foreach ( qw/user password/ ){ + $params->{'bootstrap_config_'.$c->stash->{devmod}->bootstrap_method.'_'.$_} = $credentials_rs->first->get_column($_); + } + } $params->{reseller}{id} = delete $params->{reseller_id}; $params = $params->merge($c->session->{created_objects}); diff --git a/lib/NGCP/Panel/Form/Device/Model.pm b/lib/NGCP/Panel/Form/Device/Model.pm index 00312e799f..572f06fd11 100644 --- a/lib/NGCP/Panel/Form/Device/Model.pm +++ b/lib/NGCP/Panel/Form/Device/Model.pm @@ -254,7 +254,7 @@ has_field 'bootstrap_config_http_sync_params' => ( title => ['The parameters appended to the sync URI when setting the provisioning server, e.g. server.uri/$MA. The server.uri variable is automatically expanded during provisioning time.'], }, ); -has_field 'bootstrap_config_panasonic_user' => ( +has_field 'bootstrap_config_redirect_panasonic_user' => ( type => 'Text', required => 0, label => 'Panasonic username', @@ -265,7 +265,7 @@ has_field 'bootstrap_config_panasonic_user' => ( title => ['Username used to configure bootstrap url on Panasonic redirect server. Obtained from Panasonic.'], }, ); -has_field 'bootstrap_config_panasonic_password' => ( +has_field 'bootstrap_config_redirect_panasonic_password' => ( type => 'Text', required => 0, label => 'Panasonic password', @@ -288,7 +288,7 @@ has_field 'save' => ( has_block 'fields' => ( tag => 'div', class => [qw/modal-body/], - render_list => [qw/vendor model linerange linerange_add bootstrap_method bootstrap_config_http_sync_uri bootstrap_config_http_sync_method bootstrap_config_http_sync_params bootstrap_config_panasonic_user bootstrap_config_panasonic_password front_image mac_image/], + render_list => [qw/vendor model linerange linerange_add bootstrap_method bootstrap_config_http_sync_uri bootstrap_config_http_sync_method bootstrap_config_http_sync_params bootstrap_config_redirect_panasonic_user bootstrap_config_redirect_panasonic_password front_image mac_image/], ); has_block 'actions' => ( diff --git a/lib/NGCP/Panel/Form/Device/ModelAPI.pm b/lib/NGCP/Panel/Form/Device/ModelAPI.pm index 944dede332..3adceb5b9f 100644 --- a/lib/NGCP/Panel/Form/Device/ModelAPI.pm +++ b/lib/NGCP/Panel/Form/Device/ModelAPI.pm @@ -7,7 +7,7 @@ use Moose::Util::TypeConstraints; has_block 'fields' => ( tag => 'div', class => [qw/modal-body/], - render_list => [qw/reseller vendor model linerange bootstrap_method bootstrap_config_http_sync_uri bootstrap_config_http_sync_method bootstrap_config_http_sync_params bootstrap_config_panasonic_user bootstrap_config_panasonic_password/], + render_list => [qw/reseller vendor model linerange bootstrap_method bootstrap_config_http_sync_uri bootstrap_config_http_sync_method bootstrap_config_http_sync_params bootstrap_config_redirect_panasonic_user bootstrap_config_redirect_panasonic_password/], ); override 'field_list' => sub { diff --git a/lib/NGCP/Panel/Form/Device/ModelAdmin.pm b/lib/NGCP/Panel/Form/Device/ModelAdmin.pm index 763019bb49..dd67ca387b 100644 --- a/lib/NGCP/Panel/Form/Device/ModelAdmin.pm +++ b/lib/NGCP/Panel/Form/Device/ModelAdmin.pm @@ -26,7 +26,7 @@ has_field 'save' => ( has_block 'fields' => ( tag => 'div', class => [qw/modal-body/], - render_list => [qw/reseller vendor model linerange linerange_add bootstrap_method bootstrap_config_http_sync_uri bootstrap_config_http_sync_method bootstrap_config_http_sync_params bootstrap_config_panasonic_user bootstrap_config_panasonic_password front_image mac_image/], + render_list => [qw/reseller vendor model linerange linerange_add bootstrap_method bootstrap_config_http_sync_uri bootstrap_config_http_sync_method bootstrap_config_http_sync_params bootstrap_config_redirect_panasonic_user bootstrap_config_redirect_panasonic_password front_image mac_image/], ); has_block 'actions' => (