mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-14 07:36:29 +02:00
change site parameter
This commit is contained in:
parent
38a72a3eed
commit
7ce6cb6230
10 changed files with 47 additions and 46 deletions
|
@ -42,7 +42,6 @@ sub loop_sharees {
|
|||
my $authraw = shift;
|
||||
my $return_merchant = shift || "";
|
||||
my @keywords = $q->param;
|
||||
#my $project = $return_merchant->{project_id} || "all";
|
||||
|
||||
#only request keys which initated by sharee primary requests to operator
|
||||
my $rest_hash = {};
|
||||
|
@ -67,25 +66,28 @@ sub loop_sharees {
|
|||
my @user_group = ();
|
||||
my @user_tour = ();
|
||||
my $fetch_hash = {};
|
||||
while (my ($key, $value) = each %{ $globalconf{operator} }) {
|
||||
while (my ($key, $op_name) = each %{ $globalconf{operator} }) {
|
||||
my $ret_json = "";
|
||||
|
||||
#shareetool, to loop only operators who is the shareetool by usersconf enabled
|
||||
my $users_serviceapp = { u_id => 0 };
|
||||
if($return_merchant->{aowner} && $return_merchant->{aowner} == 187 && $value->{database}->{dbname} && $authraw->{txt17} =~ /$value->{database}->{dbname}/){
|
||||
my $dbh_operator = $dbt->dbconnect_extern($value->{database}->{dbname});
|
||||
if($return_merchant->{aowner} && $return_merchant->{aowner} == 187 && $op_name->{database}->{dbname} && $authraw->{txt17} =~ /$op_name->{database}->{dbname}/){
|
||||
my $dbh_operator = $dbt->dbconnect_extern($op_name->{database}->{dbname});
|
||||
$users_serviceapp = $dbt->select_users($dbh_operator,$authraw->{c_id},"and int09=1");
|
||||
$bw->log("shareetool select_users $return_merchant->{aowner} on $value->{database}->{dbname} $authraw->{c_id} $authraw->{txt17}",$users_serviceapp->{u_id},"");
|
||||
$bw->log("shareetool select_users $return_merchant->{aowner} on $op_name->{database}->{dbname} $authraw->{c_id} $authraw->{txt17}",$users_serviceapp->{u_id},"");
|
||||
}
|
||||
#every sharee client must have a merchant_id which associate a project
|
||||
if($value->{operatorApp} && ($users_serviceapp->{u_id} || ($return_merchant->{project_id} eq $value->{project}))){
|
||||
#if($op_name->{operatorApp} && ($users_serviceapp->{u_id} || ($return_merchant->{project_id} eq $op_name->{project}))){
|
||||
|
||||
#$bw->log("--> LOOP-start ($return_merchant->{merchant_id}) jsonclient loop_sharees $key by operatorApp: $value->{operatorApp}, netloc: $netloc if($return_merchant->{project_id} eq $value->{project} || $users_serviceapp->{u_id} > 0)\n","","");
|
||||
$ret_json = $self->fetch_operator_json("$value->{operatorApp}/APIjsonserver",$rest);
|
||||
#TODO, to reduce request time by ($return_merchant->{project_id} eq "Freiburg") do it only for shareeweb-sharee.copri.eu
|
||||
if($op_name->{operatorApp} && ($users_serviceapp->{u_id} || $return_merchant->{project_id} eq "Freiburg" || ($return_merchant->{project_id} eq $op_name->{project}))){
|
||||
|
||||
#$bw->log("--> LOOP-start ($return_merchant->{merchant_id}) jsonclient loop_sharees $key by operatorApp: $op_name->{operatorApp}, netloc: $netloc if($return_merchant->{project_id} eq $op_name->{project} || $users_serviceapp->{u_id} > 0)\n","","");
|
||||
$ret_json = $self->fetch_operator_json("$op_name->{operatorApp}/APIjsonserver",$rest);
|
||||
#print Dumper($ret_json);
|
||||
|
||||
if($ret_json){
|
||||
push(@uri_operator_array, $value->{operatorApp});
|
||||
push(@uri_operator_array, $op_name->{operatorApp});
|
||||
eval {
|
||||
my $response_in = "";
|
||||
$response_in = decode_json($ret_json);
|
||||
|
@ -121,7 +123,7 @@ sub loop_sharees {
|
|||
warn $@;
|
||||
}
|
||||
}else{
|
||||
$bw->log("NO json from Operator:",$value->{operatorApp},"");
|
||||
$bw->log("NO json from Operator:",$op_name->{operatorApp},"");
|
||||
}
|
||||
#$bw->log("--> LOOP-end jsonclient loop_sharees user_group:\n",\@user_group,"");
|
||||
}
|
||||
|
|
|
@ -76,11 +76,11 @@ my $response = {
|
|||
user_group => [],
|
||||
user_tour => [],
|
||||
response_state => "OK, nothing todo",
|
||||
agb_html => "site/agb_sharee_2.html",
|
||||
privacy_html => "site/privacy_sharee_2.html",
|
||||
impress_html => "site/impress_1.html",
|
||||
tariff_info_html => "site/tariff_info.html",
|
||||
bike_info_html => "site/bike_info_sharee_1.html",
|
||||
agb_html => "$dbt->{project_conf}->{Freiburg}->{agb_html}",
|
||||
privacy_html => "$dbt->{project_conf}->{Freiburg}->{privacy_html}",
|
||||
impress_html => "$dbt->{project_conf}->{Freiburg}->{impress_html}",
|
||||
tariff_info_html => "$dbt->{project_conf}->{Freiburg}->{tariff_info_html}",
|
||||
bike_info_html => "$dbt->{project_conf}->{Freiburg}->{bike_info_html}",
|
||||
lang => "de",
|
||||
last_used_operator => {
|
||||
operator_name => "sharee.bike | TeilRad GmbH",
|
||||
|
@ -110,14 +110,14 @@ if(!$coo && !$q->param('merchant_id')){
|
|||
($aowner, $return_merchant) = $apif->fetch_merchant($q,\%varenv,$coo,$q->param('merchant_id'));
|
||||
#if($aowner && ($aowner == 195 || $aowner == 185 || $aowner == 176)){
|
||||
if($return_merchant->{project_id} eq "Konstanz"){
|
||||
$response->{agb_html} = "site/agb_konrad_1.html";
|
||||
$response->{bike_info_html} = "site/bike_info_konrad_1.html";
|
||||
$response->{agb_html} = "$dbt->{project_conf}->{Konstanz}->{agb_html}";
|
||||
$response->{bike_info_html} = "$dbt->{project_conf}->{Konstanz}->{bike_info_html}";
|
||||
}
|
||||
if($return_merchant->{project_id} eq "Bayern"){
|
||||
$response->{agb_html} = "site/agb_lastenradbayern_220804.html";
|
||||
$response->{bike_info_html} = "site/bike_info_bayern.html";
|
||||
$response->{privacy_html} = "site/privacy_lastenradbayern.html";
|
||||
$response->{tariff_info_html} = "site/tarif_info_lastenradbayern_220804.html";
|
||||
$response->{agb_html} = "$dbt->{project_conf}->{Bayern}->{agb_html}";
|
||||
$response->{privacy_html} = "$dbt->{project_conf}->{Bayern}->{privacy_html}";
|
||||
$response->{tariff_info_html} = "$dbt->{project_conf}->{Bayern}->{tariff_info_html}";
|
||||
$response->{bike_info_html} = "$dbt->{project_conf}->{Bayern}->{bike_info_html}";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -568,7 +568,7 @@ sub singlesubmit7(){
|
|||
$b_img = "Delete" if("$b_name" =~ /delete_media/);
|
||||
$b_img = "Save" if("$b_name" =~ /save|service_done|_contenttverpos/);
|
||||
$a_key = "y" if("$b_name" =~ /save/);
|
||||
$b_img = "Text Save" if("$b_name" =~ /save_text/);
|
||||
$b_img = "Text & State Save" if("$b_name" =~ /save_text/);
|
||||
$b_img = "Delete All" if("$b_name" =~ /delete_all/);
|
||||
$b_img = "Search" if("$b_name" =~ /search/);
|
||||
$b_img = "New" if("$b_name" =~ /^new/);
|
||||
|
|
|
@ -73,7 +73,7 @@ sub dbconnect_extern {
|
|||
my $database = "dbi:Pg:dbname=$value->{database}->{dbname};host=$value->{database}->{host};port=$value->{database}->{port};options='$value->{database}->{options}'";
|
||||
$database .= ";sslmode=$value->{database}->{sslmode}" if($value->{database}->{sslmode} && $value->{database}->{host} ne "localhost");
|
||||
my $dbh = DBI->connect($database, $value->{database}->{user}, $value->{database}->{passwd},{ RaiseError => 0, AutoCommit => 1 });
|
||||
$bw->log("--> dbconnect_extern success --> $database, $value->{database}->{user}, $value->{database}->{passwd}",$database,"");
|
||||
#$bw->log("--> dbconnect_extern success --> $database, $value->{database}->{user}, $value->{database}->{passwd}",$database,"");
|
||||
$dbh->do("set CLIENT_ENCODING TO 'iso-8859-1'") if($client_encoding && $client_encoding eq "iso-8859-1");
|
||||
return $dbh if($dbh);
|
||||
}
|
||||
|
|
|
@ -804,7 +804,7 @@ sub handler {
|
|||
#feedb will be the new hashed return. todo refactoring
|
||||
if(ref($return) eq "HASH"){
|
||||
$feedb = $return;
|
||||
}else{
|
||||
}elsif($return =~ /failure::/){
|
||||
$feedb->{message} = $return;
|
||||
}
|
||||
$ml->tpl($node_meta,$users_dms,$mode,\%varenv,$users_sharee,$feedb);
|
||||
|
|
|
@ -45,7 +45,7 @@ sub mail_connect {
|
|||
Port => 465,
|
||||
Hello => 'sharee.bike',
|
||||
Timeout => 30,
|
||||
Debug => 1,
|
||||
Debug => 0,
|
||||
SSL => 1,
|
||||
);
|
||||
|
||||
|
@ -152,7 +152,7 @@ sub mail_transport(){
|
|||
print EMA "\n\n";
|
||||
close EMA;
|
||||
|
||||
$bw->log("Success send_mail","","");
|
||||
$bw->log("done mailing with state:","$ret","");
|
||||
return $ret;
|
||||
}#end mail_send
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue