shareetool operator fix

This commit is contained in:
Rainer Gümpelein 2022-01-31 14:55:05 +01:00
parent fe9ae91ff8
commit c7c9e0e699
5 changed files with 80 additions and 34 deletions

View file

@ -57,7 +57,11 @@ sub fetch_merchant {
my $req_coo = shift || "";
my $req_merchant_id = shift || "";
my $return = { merchant_id => "" };
my $return = {
aowner => "",
merchant_id => "",
project_id => ""
};
my $merchanized = 0;
my $aowner = 0;
@ -65,8 +69,9 @@ sub fetch_merchant {
#$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;
$aowner = $value->{id};
$return->{aowner} = $value->{id};
$return->{merchant_id} = $merchant_conf;
$return->{project_id} = $value->{project};
my $lat = "";
@ -87,6 +92,7 @@ sub fetch_merchant {
if(!$merchanized){
if($varenv->{syshost} eq "shareeapp-primary" || $varenv->{syshost} eq "shareedms-primary"){
$aowner = $dbt->{primary}->{sharee_primary}->{owner};
$return->{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;
@ -94,6 +100,7 @@ sub fetch_merchant {
}
elsif($varenv->{syshost} =~ /shareeapp-(\w+)/ || $varenv->{syshost} =~ /shareedms-(\w+)/){
$aowner = $dbt->{operator}->{$varenv->{dbname}}->{owner};
$return->{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;
@ -101,6 +108,7 @@ sub fetch_merchant {
}
elsif($varenv->{syshost} =~ /shareeweb-/){
$aowner = $dbt->{website}->{$varenv->{syshost}}->{owner};
$return->{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;