MT#9177 inflate sync credentials values in Controller from DB.

changes/52/552/1
Irina Peshinskaya 11 years ago
parent bcd8c30efd
commit 715a39ffd0

@ -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});

@ -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' => (

@ -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 {

@ -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' => (

Loading…
Cancel
Save