mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-14 07:36:29 +02:00
merchant_message. trigger mail by alarm
This commit is contained in:
parent
a61920988c
commit
b63e00e982
10 changed files with 65 additions and 39 deletions
|
@ -2145,7 +2145,7 @@ sub bikes_all(){
|
|||
#shareetool
|
||||
if($q->param('authcookie') && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} == 187 && scalar(@{$user_tour} >= 1)){
|
||||
my @service_code = split(/\s/,$record->{$id}->{txt23});
|
||||
#2023-01-16 temporär deaktiviert
|
||||
#2023-01-18 temporär deaktiviert
|
||||
#$return->{$id}->{service_code} = [@service_code];
|
||||
}
|
||||
}elsif($record->{$id}->{int11} eq "3"){
|
||||
|
|
|
@ -139,8 +139,10 @@ foreach(@keywords){
|
|||
|
||||
#RESTful bikeAPP ------------------------------------------------------------------
|
||||
|
||||
if($q->param('user_device_manufaturer') || $q->param('user_device_model') || $q->param('user_device_platform') || $q->param('user_device_version') || $q->param('user_device_id')){
|
||||
my $user_device = $q->param('user_device_manufaturer') . ";" . $q->param('user_device_model') . ";" . $q->param('user_device_platform') . ";" . $q->param('user_device_version') . ";" . $q->param('user_device_id');
|
||||
if($q->param('user_device_manufacturer') || $q->param('user_device_manufaturer') || $q->param('user_device_model') || $q->param('user_device_platform') || $q->param('user_device_version') || $q->param('user_device_id')){
|
||||
#tipo fix
|
||||
my $user_device_manufacturer = $q->param('user_device_manufacturer') || $q->param('user_device_manufaturer') || "";
|
||||
my $user_device = $user_device_manufacturer . ";" . $q->param('user_device_model') . ";" . $q->param('user_device_platform') . ";" . $q->param('user_device_version') . ";" . $q->param('user_device_id');
|
||||
$q->param(-name=>'user_device',-value=>"$user_device");
|
||||
$bw->log("user_device",$q->param('user_device'),"");
|
||||
}
|
||||
|
@ -658,11 +660,24 @@ elsif($q->param('request') eq "stations_available"){
|
|||
$response = { %$response, %$return_merchant };
|
||||
|
||||
my ($auth,$authraw) = $apif->auth_verify($q);
|
||||
#Mein konrad App
|
||||
#if($dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} eq "176")
|
||||
#if($aowner && $aowner eq "176")
|
||||
#$response->{merchant_message} = "Herzlich Willkommen bei der neuen konrad App! Die App ist zwar schon installierbar, bis zur vollständigen Umstellung des Systems sind aber noch keine Räder ausleihbar. Das ist erst voraussichtlich Ende Januar der Fall und wird den Nutzern noch mitgeteilt. Danke für Ihr Verständnis! Ihr konrad-Team";
|
||||
#}
|
||||
|
||||
my $user_agent_subversion = 1000;
|
||||
$user_agent_subversion = $3 if($user_agent =~ /3\.0\.(\d+)/);
|
||||
|
||||
#for tests only contributors with service-tour defined
|
||||
if($user_agent_subversion <= 348 && $authraw->{txt18} && $authraw->{c_id} =~ /$dbt->{copri_conf}->{contributors}/){
|
||||
my $pref_ctu = {
|
||||
table => "contentuser",
|
||||
fetch => "one",
|
||||
ct_name => "App-update-message",
|
||||
};
|
||||
my $uadr = { c_id => 0 };
|
||||
$uadr = $dbt->fetch_tablerecord($dbh,$pref_ctu);
|
||||
$response->{merchant_message} = $uadr->{txt01};
|
||||
$response->{merchant_message} = $uadr->{txt02} if($q->param('lang') eq "en");
|
||||
#$response->{merchant_message} .= " ($user_agent)";
|
||||
}
|
||||
|
||||
$response = { %$response, %$auth };
|
||||
($response->{stations},$response->{uri_operator_array},$response->{user_group},$response->{user_tour}) = $jsc->loop_sharees($q,$authraw,$return_merchant);
|
||||
}else{
|
||||
|
|
|
@ -54,6 +54,8 @@ sub dbconnect {
|
|||
sub dbconnect_extern {
|
||||
my $self = shift;
|
||||
my $dbname = shift;
|
||||
my $client_encoding = shift || "";
|
||||
|
||||
my $instance_type = "operator";
|
||||
$instance_type = "primary" if($dbname eq $self->{primary}->{sharee_primary}->{database}->{dbname});
|
||||
|
||||
|
@ -72,6 +74,7 @@ sub dbconnect_extern {
|
|||
$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,"");
|
||||
$dbh->do("set CLIENT_ENCODING TO 'iso-8859-1'") if($client_encoding && $client_encoding eq "iso-8859-1");
|
||||
return $dbh if($dbh);
|
||||
}
|
||||
}
|
||||
|
@ -189,6 +192,7 @@ sub update_operatorsloop {
|
|||
# 2 = "public"
|
||||
# 3 = "private"
|
||||
# 4 = "hidden-lv"
|
||||
# 5 = "public-bonus"
|
||||
#</sharing_type>
|
||||
my $update_op = {
|
||||
table => "contentadr",
|
||||
|
|
|
@ -45,7 +45,7 @@ sub mail_connect {
|
|||
Port => 465,
|
||||
Hello => 'sharee.bike',
|
||||
Timeout => 30,
|
||||
Debug => 0,
|
||||
Debug => 1,
|
||||
SSL => 1,
|
||||
);
|
||||
|
||||
|
@ -61,10 +61,9 @@ sub mail_transport(){
|
|||
my $mailxconf = shift;
|
||||
my $sendref = shift;
|
||||
|
||||
#print Dumper($smtp);
|
||||
my $ret = 1;
|
||||
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
|
||||
open(EMA, ">> $dbt->{copri_conf}->{logdir}/mailtransport.log");
|
||||
open(EMA, ">> $dbt->{copri_conf}->{logdir}/mailTransport.log");
|
||||
|
||||
my $mail_from = $sendref->{mail_from} || $mailxconf->{$sendref->{mailxcfg}}->{mail_from};
|
||||
my $mail_to = $sendref->{mail_to} || $mailxconf->{$sendref->{mailxcfg}}->{mail_to};
|
||||
|
@ -96,6 +95,7 @@ sub mail_transport(){
|
|||
|
||||
|
||||
$bw->log("Trying send_mail by $0",$mail_to,"");
|
||||
print EMA Dumper($sendref);
|
||||
|
||||
if(ref($sendref) eq "HASH"){
|
||||
|
||||
|
|
|
@ -246,8 +246,8 @@ sub counting_rental {
|
|||
}
|
||||
}
|
||||
|
||||
$total_price = sprintf('%.2f', $total_price);
|
||||
$total_price = $total_price * $ctpos->{int01} if($ctpos->{int01});
|
||||
$total_price = sprintf('%.2f', $total_price);
|
||||
|
||||
$return->{start_time} = "$computed_start_time";
|
||||
$return->{end_time} = "$computed_end_time";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue