loop_sharees by merchant project

This commit is contained in:
Rainer Gümpelein 2022-01-18 07:04:04 +01:00
parent f7c3ed7b05
commit 235b788024
5 changed files with 32 additions and 23 deletions

View file

@ -62,12 +62,13 @@ sub fetch_merchant {
my $aowner = 0;
while ((my $merchant_conf, my $value) = each %{ $dbt->{merchant_ids}}) {
$bw->log("---> trying merchant select by session-cookie OR authcookie OR merchant_id: if($merchant_conf && (($req_coo && $req_coo =~ /$merchant_conf/) || ($req_merchant_id && $req_merchant_id eq $merchant_conf))){",$merchant_conf,"");
#$bw->log("---> trying merchant select by session-cookie OR authcookie OR merchant_id: if($merchant_conf && (($req_coo && $req_coo =~ /$merchant_conf/) || ($req_merchant_id && $req_merchant_id eq $merchant_conf))){",$merchant_conf,"");
if($merchant_conf && (($req_coo && $req_coo =~ /$merchant_conf$/) || ($req_merchant_id && $req_merchant_id eq $merchant_conf))){
$aowner = $value->{id};
$merchanized = 1;
$return->{merchant_id} = $merchant_conf;
$return->{project_id} = $value->{project};
my $lat = "";
my $lng = "";
$value->{initMap} =~ s/\s//g;
@ -77,7 +78,7 @@ sub fetch_merchant {
$return->{init_map}->{center}->{longitude} = $lng;
$return->{init_map}->{radius} = "2.9";
}
$bw->log("===> merchant select by session-cookie OR authcookie OR merchant_id: if($merchant_conf && (($req_coo && $req_coo =~ /$merchant_conf/) || ($req_merchant_id && $req_merchant_id eq $merchant_conf))){",$return->{merchant_id},"");
$bw->log("===> merchant select by $return->{project_id} session-cookie OR authcookie OR merchant_id: if($merchant_conf && (($req_coo && $req_coo =~ /$merchant_conf/) || ($req_merchant_id && $req_merchant_id eq $merchant_conf))){",$return->{merchant_id},"");
#last;
}
}
@ -85,20 +86,23 @@ sub fetch_merchant {
if($varenv->{syshost} eq "shareeapp-primary" || $varenv->{syshost} eq "shareedms-primary"){
$aowner = $dbt->{primary}->{sharee_primary}->{owner};
$return->{merchant_id} = $dbt->{primary}->{sharee_primary}->{merchant_id};
$return->{project_id} = $dbt->{primary}->{sharee_primary}->{project};
$merchanized = 1;
$bw->log("merchant select by primary dbname: sharee_primary:",$return->{merchant_id},"");
$bw->log("===> merchant select by $return->{project_id} primary dbname: sharee_primary:",$return->{merchant_id},"");
}
elsif($varenv->{syshost} =~ /shareeapp-(\w+)/ || $varenv->{syshost} =~ /shareedms-(\w+)/){
$aowner = $dbt->{operator}->{$varenv->{dbname}}->{owner};
$return->{merchant_id} = $dbt->{operator}->{$varenv->{dbname}}->{merchant_id};
$return->{project_id} = $dbt->{operator}->{$varenv->{dbname}}->{project};
$merchanized = 1;
$bw->log("merchant select by operator dbname=$varenv->{dbname}:",$return->{merchant_id},"");
$bw->log("===> merchant select by $return->{project_id} operator dbname=$varenv->{dbname}:",$return->{merchant_id},"");
}
elsif($varenv->{syshost} =~ /shareeweb-/){
$aowner = $dbt->{website}->{$varenv->{syshost}}->{owner};
$return->{merchant_id} = $dbt->{website}->{$varenv->{syshost}}->{merchant_id};
$return->{project_id} = $dbt->{website}->{$varenv->{syshost}}->{project};
$merchanized = 1;
$bw->log("===> merchant select by website syshost=$varenv->{syshost}:",$return->{merchant_id},"");
$bw->log("===> merchant select by $return->{project_id} website syshost=$varenv->{syshost}:",$return->{merchant_id},"");
}
}