merchant_message and some cad fixes

This commit is contained in:
ragu 2023-02-16 19:52:49 +01:00
parent cf476a2154
commit 76afd28578
8 changed files with 47 additions and 26 deletions

View file

@ -18,7 +18,7 @@ use Apache2::Const -compile => qw(OK );
use JSON;
use Scalar::Util qw(looks_like_number);
use Config::General;
use Time::Piece;
use Lib::Config;
use Mod::DBtank;
use Mod::Basework;
@ -665,7 +665,7 @@ elsif($q->param('request') eq "stations_available"){
$user_agent_subversion = $3 if($user_agent =~ /3\.0\.(\d+)/);
#for tests only contributors with service-tour defined
if($user_agent_subversion <= 398 && $authraw->{txt18} && $authraw->{c_id} =~ /$dbt->{copri_conf}->{contributors}/){
if(1==2 && $user_agent_subversion <= 398 && $authraw->{txt18} && $authraw->{c_id} =~ /$dbt->{copri_conf}->{contributors}/){
my $pref_ctu = {
table => "contentuser",
fetch => "one",
@ -675,8 +675,24 @@ elsif($q->param('request') eq "stations_available"){
$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} .= "\n\nWill be disabled --> debug contributor App version ($user_agent)";
$response->{merchant_message} .= "\n\nWill be disabled --> debug contributor user_device (" . $q->param('user_device') . ")";
}
#bayern-maintanance-message
my $lnow = strftime("%Y-%m-%d %H:%M:%S", localtime(time));
my $localtime = Time::Piece->strptime($lnow, "%Y-%m-%d %H:%M:%S");
my $epoch_now = $localtime->epoch;
my $maintanance_start = Time::Piece->strptime("2023-02-16 21:00:00", "%Y-%m-%d %H:%M:%S");
my $maintanance_end = Time::Piece->strptime("2023-02-17 03:00:00", "%Y-%m-%d %H:%M:%S");
my $epoch_start = $maintanance_start->epoch;
my $epoch_end = $maintanance_end->epoch;
if(1==1 && $return_merchant->{merchant_id} eq $dbt->{appsframe}->{LastenradBayern}->{merchant_id} && $epoch_now >= $epoch_start && $epoch_now <= $epoch_end){
my $pref_ctu = {
table => "contentuser",
fetch => "one",
ct_name => "bayern-maintanance-message",
};
my $uadr = { c_id => 0 };
$uadr = $dbt->fetch_tablerecord($dbh,$pref_ctu);
$response->{merchant_message} = $uadr->{txt01};
}
$response = { %$response, %$auth };