mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 11:46:27 +01:00
pw encryption extended with sha. Minor freed-time changes
This commit is contained in:
parent
9b05eed19b
commit
d6292aa09d
12 changed files with 104 additions and 128 deletions
|
@ -18,7 +18,6 @@ use Digest::SHA qw(sha256_base64);
|
||||||
use Scalar::Util qw(looks_like_number);
|
use Scalar::Util qw(looks_like_number);
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use DateTime::Format::Pg;
|
use DateTime::Format::Pg;
|
||||||
use Date::Calc qw(Add_Delta_YMD);
|
|
||||||
use URI::Encode;
|
use URI::Encode;
|
||||||
use Config::General;
|
use Config::General;
|
||||||
|
|
||||||
|
@ -1003,66 +1002,6 @@ sub booking_request(){
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#for one freed rental
|
|
||||||
#depends on operator, only 1 rental get freed_time
|
|
||||||
sub count_freedrental {
|
|
||||||
my $self = shift;
|
|
||||||
my $q = shift || "";
|
|
||||||
my $varenv = shift;
|
|
||||||
my $auth = shift;
|
|
||||||
my $rental_minute_all = shift || 0;
|
|
||||||
my $pos = shift || {};
|
|
||||||
my $freed_count = 0;
|
|
||||||
my $dbh = "";
|
|
||||||
|
|
||||||
my $debug=1;
|
|
||||||
open(FILE,">>$varenv->{logdir}/count_freedrental.log") if($debug);
|
|
||||||
print FILE "\n*-->$now_dt $varenv->{dbname}\n" if($debug);
|
|
||||||
print FILE Dumper($q) if($debug);
|
|
||||||
print FILE "--> c_id:$pos->{c_id} rental_minute_all: $rental_minute_all > 0\n" if($debug);
|
|
||||||
|
|
||||||
#freed mangement will be only dony on accountable rental
|
|
||||||
if($rental_minute_all > 0){
|
|
||||||
my $pref_pos = {
|
|
||||||
table => "contenttranspos",
|
|
||||||
fetch => "all",
|
|
||||||
keyfield => "c_id",
|
|
||||||
ca_id => "$auth->{c_id}",
|
|
||||||
time02 => ">::00:00",
|
|
||||||
};
|
|
||||||
|
|
||||||
#one freed time with three parallel rentals
|
|
||||||
if($dbt->{operator}->{$varenv->{dbname}}->{project} eq "Konstanz"){
|
|
||||||
$pref_pos->{int10} = "3";
|
|
||||||
}
|
|
||||||
#one freed time per day
|
|
||||||
else{
|
|
||||||
my $day = strftime "%d", localtime;
|
|
||||||
my $mon = strftime "%m", localtime;
|
|
||||||
my $year = strftime "%Y", localtime;
|
|
||||||
my ($nyear,$nmon,$nday) = Add_Delta_YMD($year,$mon,$day, 0,0,1);
|
|
||||||
$pref_pos->{time_range} = "((start_time >= '$year-$mon-$day' and start_time < '$nyear-$nmon-$nday' and start_time != end_time) OR int10=3)";
|
|
||||||
}
|
|
||||||
my $record_pos = $dbt->fetch_tablerecord($dbh,$pref_pos);
|
|
||||||
|
|
||||||
foreach my $pid (sort { $record_pos->{$a}->{c_id} <=> $record_pos->{$b}->{c_id} } keys (%$record_pos)){
|
|
||||||
$freed_count++;
|
|
||||||
print FILE "if($freed_count > 1 && $pos->{c_id} != $record_pos->{$pid}->{c_id})\n" if($debug);
|
|
||||||
if($freed_count > 1 && $pos->{c_id} != $record_pos->{$pid}->{c_id}){
|
|
||||||
my $pos_ref = {
|
|
||||||
table => "contenttranspos",
|
|
||||||
c_id => $record_pos->{$pid}->{c_id},
|
|
||||||
};
|
|
||||||
$dbt->update_one($dbh,$pos_ref,"time02='00:00'");
|
|
||||||
print FILE "--> delete freed_time on c_id=$record_pos->{$pid}->{c_id} to time02=00:00\n" if($debug);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close(FILE) if($debug);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#int03=1 if sepa, 2=CC
|
#int03=1 if sepa, 2=CC
|
||||||
#int04==1 if email Ack
|
#int04==1 if email Ack
|
||||||
#int13==1 if sms Ack
|
#int13==1 if sms Ack
|
||||||
|
@ -1317,7 +1256,7 @@ sub booking_update(){
|
||||||
$update_cc->{txt13} = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}";
|
$update_cc->{txt13} = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}";
|
||||||
|
|
||||||
#return after booking_update
|
#return after booking_update
|
||||||
my ($pricing,$counting) = $pri->counting_rental(\%varenv,$record_pos,"");
|
my ($pricing,$counting) = $pri->counting_rental(\%varenv,$record_pos);
|
||||||
#int03 only used for tarif counting backwards compatibility
|
#int03 only used for tarif counting backwards compatibility
|
||||||
$update_pos->{int03} = "$pricing->{computed_hours}" if(looks_like_number($pricing->{computed_hours}));
|
$update_pos->{int03} = "$pricing->{computed_hours}" if(looks_like_number($pricing->{computed_hours}));
|
||||||
$update_pos->{int38} = "$counting->{int38}" if(looks_like_number($counting->{int38}));
|
$update_pos->{int38} = "$counting->{int38}" if(looks_like_number($counting->{int38}));
|
||||||
|
@ -1325,8 +1264,8 @@ sub booking_update(){
|
||||||
$update_pos->{int40} = "$counting->{int40}" if(looks_like_number($counting->{int40}));
|
$update_pos->{int40} = "$counting->{int40}" if(looks_like_number($counting->{int40}));
|
||||||
$update_pos->{int41} = "$counting->{int41}" if(looks_like_number($counting->{int41}));
|
$update_pos->{int41} = "$counting->{int41}" if(looks_like_number($counting->{int41}));
|
||||||
|
|
||||||
#in real, we can get only freed accountable rentals only on rental end's
|
#in real, we know freed accountable rentals only on rental end's
|
||||||
$self->count_freedrental($q,$varenv,$auth,$pricing->{rentalog}->{rental_minute_all},$update_pos);
|
$pri->count_freedrental($q,$varenv,$auth->{c_id},$update_pos);
|
||||||
$rows_end = $dbt->update_record($dbh,$update_pos,$record_pos);
|
$rows_end = $dbt->update_record($dbh,$update_pos,$record_pos);
|
||||||
|
|
||||||
if($rows_end > 0){
|
if($rows_end > 0){
|
||||||
|
@ -1353,7 +1292,7 @@ sub booking_update(){
|
||||||
$update_cc->{txt13} = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}";
|
$update_cc->{txt13} = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}";
|
||||||
|
|
||||||
#return after booking_update
|
#return after booking_update
|
||||||
my ($pricing,$counting) = $pri->counting_rental(\%varenv,$record_pos,"");
|
my ($pricing,$counting) = $pri->counting_rental(\%varenv,$record_pos);
|
||||||
#int03 only used for tarif counting backwards compatibility
|
#int03 only used for tarif counting backwards compatibility
|
||||||
$update_pos->{int03} = "$pricing->{computed_hours}" if(looks_like_number($pricing->{computed_hours}));
|
$update_pos->{int03} = "$pricing->{computed_hours}" if(looks_like_number($pricing->{computed_hours}));
|
||||||
$update_pos->{int38} = "$counting->{int38}" if(looks_like_number($counting->{int38}));
|
$update_pos->{int38} = "$counting->{int38}" if(looks_like_number($counting->{int38}));
|
||||||
|
@ -1809,18 +1748,16 @@ sub rentals(){
|
||||||
my $return = {};
|
my $return = {};
|
||||||
|
|
||||||
foreach my $id (sort { $record->{$a}->{end_time} cmp $record->{$b}->{end_time} } keys (%$record)){
|
foreach my $id (sort { $record->{$a}->{end_time} cmp $record->{$b}->{end_time} } keys (%$record)){
|
||||||
|
my $pricing->{$id} = {};
|
||||||
|
my $counting = {};
|
||||||
|
#adjusting freed time rental by called bikes_occupied
|
||||||
|
$pri->count_freedrental("rentals by user_bikes_occupied",\%varenv,$auth->{c_id},$record->{$id});
|
||||||
|
($pricing->{$id}, $counting) = $pri->counting_rental(\%varenv,$record->{$id});
|
||||||
|
|
||||||
#$pricing
|
#$bw->log("rentals-rentalog",$pricing->{$id}->{rentalog},"");
|
||||||
(my $return_counting->{$id}, my $counting) = $pri->counting_rental(\%varenv,$record->{$id},"");
|
$pricing->{$id}->{rentalog} = "";#just for debuggiog, removed to reduce data in json
|
||||||
#adjusting freed time rental by often called bikes_occupied
|
my $return_feed->{$id} = $pri->fetch_rentalfeed(\%varenv,$record->{$id},$pricing->{$id});
|
||||||
$self->count_freedrental("rentals by user_bikes_occupied",\%varenv,$auth,$return_counting->{$id}->{rentalog}->{rental_minute_all},$record->{$id});
|
$return->{$id} = { %{ $pricing->{$id} }, %{ $return_feed->{$id} } };
|
||||||
#yes once again to get the counted freedrental
|
|
||||||
(my $return_counting->{$id}, my $counting) = $pri->counting_rental(\%varenv,$record->{$id},"");
|
|
||||||
|
|
||||||
#$bw->log("rentals-rentalog",$return_counting->{$id}->{rentalog},"");
|
|
||||||
$return_counting->{$id}->{rentalog} = "";#just for debuggiog, removed to reduce data in json
|
|
||||||
my $return_feed->{$id} = $pri->fetch_rentalfeed(\%varenv,$record->{$id},$return_counting->{$id});
|
|
||||||
$return->{$id} = { %{ $return_counting->{$id} }, %{ $return_feed->{$id} } };
|
|
||||||
|
|
||||||
my $bike_id = $return->{$id}->{bike};
|
my $bike_id = $return->{$id}->{bike};
|
||||||
$bike_id = $1 if($bike_id =~ /(\d+)/);
|
$bike_id = $1 if($bike_id =~ /(\d+)/);
|
||||||
|
@ -3126,10 +3063,10 @@ sub authorization(){
|
||||||
|
|
||||||
my $pass_name = $q->escapeHTML($user_pw);
|
my $pass_name = $q->escapeHTML($user_pw);
|
||||||
$pass_name =~ s/\s//g;
|
$pass_name =~ s/\s//g;
|
||||||
my $pwmd5=md5_hex($pass_name);
|
my $pwmd5=md5_hex($pass_name) || "";
|
||||||
my $pwsha256=sha256_base64($pass_name);
|
my $pwsha256=sha256_base64($pwmd5) || "";
|
||||||
$authref->{txt11} = "$pwmd5";
|
#$authref->{txt11} = "$pwmd5";
|
||||||
#$authref->{txt04} = "$pwsha256";#enable after migration
|
$authref->{txt04} = "$pwsha256";
|
||||||
|
|
||||||
#Servicetool, only users with users.int09=1
|
#Servicetool, only users with users.int09=1
|
||||||
#shareetool
|
#shareetool
|
||||||
|
|
|
@ -168,7 +168,7 @@ sub update_operatorsloop {
|
||||||
|
|
||||||
$bw->log("UPDATE adr from record_primary to operator on loop $sharee_operator",$record_primary->{c_id},"");
|
$bw->log("UPDATE adr from record_primary to operator on loop $sharee_operator",$record_primary->{c_id},"");
|
||||||
$rows = $self->update_record($dbh_operator,$update,$record_primary);
|
$rows = $self->update_record($dbh_operator,$update,$record_primary);
|
||||||
if($rows != 1){
|
if($rows != 1 && $record_primary->{int04} && $record_primary->{int13} && $record_primary->{int14}){
|
||||||
$bw->log("INSERT adr from record_primary to operator on loop $sharee_operator",$record_primary->{c_id},"");
|
$bw->log("INSERT adr from record_primary to operator on loop $sharee_operator",$record_primary->{c_id},"");
|
||||||
my $insert = {
|
my $insert = {
|
||||||
%$record_primary,
|
%$record_primary,
|
||||||
|
@ -968,7 +968,7 @@ sub update_record(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($key =~ /(mtime|atime|pay_time|invoice_time|warn_time)$/){
|
if($key =~ /(mtime|atime|pay_time|invoice_time|warn_time)$/){
|
||||||
if($value && $value =~ /^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$|^\d{2}\.\d{2}\.\d{4}$/){
|
if($value && $value =~ /^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}|^\d{2}\.\d{2}\.\d{4}$/){
|
||||||
$set .= " $key='$value',";
|
$set .= " $key='$value',";
|
||||||
}elsif($key =~ /warn_time/ && $value eq "null"){
|
}elsif($key =~ /warn_time/ && $value eq "null"){
|
||||||
$set .= " $key=null,";
|
$set .= " $key=null,";
|
||||||
|
@ -983,7 +983,7 @@ sub update_record(){
|
||||||
my $sql = "UPDATE $update->{table} set $set $where";
|
my $sql = "UPDATE $update->{table} set $set $where";
|
||||||
my $sth = $dbh->prepare($sql);
|
my $sth = $dbh->prepare($sql);
|
||||||
$rows = $sth->execute();
|
$rows = $sth->execute();
|
||||||
$bw->log("DBtank update_record : $rows",$sql,"") if($debug);
|
#$bw->log("DBtank update_record : $rows",$sql,"") if($debug);
|
||||||
}
|
}
|
||||||
return $rows;
|
return $rows;
|
||||||
}#update_record
|
}#update_record
|
||||||
|
|
|
@ -464,7 +464,7 @@ sub save_contenttranspos {
|
||||||
$ctpos = $dbt->collect_post($dbh,$pref);
|
$ctpos = $dbt->collect_post($dbh,$pref);
|
||||||
|
|
||||||
#print "$R::start_date $s_hh:$s_mi | $R::start_date $e_hh:$e_mi xxxxxxxxx<br>";exit;
|
#print "$R::start_date $s_hh:$s_mi | $R::start_date $e_hh:$e_mi xxxxxxxxx<br>";exit;
|
||||||
($pricing,$counting) = $pri->counting_rental(\%varenv,$ctpos,"calc_price");
|
($pricing,$counting) = $pri->counting_rental(\%varenv,$ctpos);
|
||||||
$update_pos->{int38} = "$counting->{int38}" if(looks_like_number($counting->{int38}));
|
$update_pos->{int38} = "$counting->{int38}" if(looks_like_number($counting->{int38}));
|
||||||
$update_pos->{int39} = "$counting->{int39}" if(looks_like_number($counting->{int39}));
|
$update_pos->{int39} = "$counting->{int39}" if(looks_like_number($counting->{int39}));
|
||||||
$update_pos->{int40} = "$counting->{int40}" if(looks_like_number($counting->{int40}));
|
$update_pos->{int40} = "$counting->{int40}" if(looks_like_number($counting->{int40}));
|
||||||
|
|
|
@ -331,7 +331,7 @@ sub preinit(){
|
||||||
#again to get setted date-times
|
#again to get setted date-times
|
||||||
$record_pos = $dbt->collect_post($dbh,$pref);
|
$record_pos = $dbt->collect_post($dbh,$pref);
|
||||||
|
|
||||||
($pricing,$counting) = $pri->counting_rental(\%varenv,$record_pos,"calc_price");
|
($pricing,$counting) = $pri->counting_rental(\%varenv,$record_pos);
|
||||||
|
|
||||||
#int03 only used for tarif counting backwards compatibility
|
#int03 only used for tarif counting backwards compatibility
|
||||||
#$update_pos->{int03} = "$pricing->{computed_hours}" if(looks_like_number($pricing->{computed_hours}));
|
#$update_pos->{int03} = "$pricing->{computed_hours}" if(looks_like_number($pricing->{computed_hours}));
|
||||||
|
|
|
@ -15,6 +15,7 @@ use CGI; # only for debugging
|
||||||
use Scalar::Util qw(looks_like_number);
|
use Scalar::Util qw(looks_like_number);
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use DateTime::Format::Pg;
|
use DateTime::Format::Pg;
|
||||||
|
use Date::Calc qw(Add_Delta_YMD);
|
||||||
use Lib::Config;
|
use Lib::Config;
|
||||||
use Mod::Libenz;
|
use Mod::Libenz;
|
||||||
use Mod::DBtank;
|
use Mod::DBtank;
|
||||||
|
@ -43,29 +44,6 @@ sub round(){
|
||||||
return $rounded;
|
return $rounded;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub only_first_free(){
|
|
||||||
my $self = shift;
|
|
||||||
my $ctpos = shift;
|
|
||||||
my %varenv = $cf->envonline();
|
|
||||||
|
|
||||||
my $pref = {
|
|
||||||
table => "contenttrans",
|
|
||||||
table_pos => "contenttranspos",
|
|
||||||
fetch => "one",
|
|
||||||
ca_id => "=::$ctpos->{ca_id}",
|
|
||||||
ct_id => "=::$ctpos->{ct_id}",
|
|
||||||
c_id => "!=::$ctpos->{c_id}",
|
|
||||||
#txt10 => "IN::('available','canceled')",
|
|
||||||
int10 => "IN::(1,6)",
|
|
||||||
};
|
|
||||||
$pref = { %$pref, time_range => "cp.start_time >= '$ctpos->{start_time}' and cp.start_time < '$ctpos->{end_time}' and cp.start_time != cp.end_time" };
|
|
||||||
|
|
||||||
my $record = { c_id => 0 };
|
|
||||||
$record = $dbt->collect_post($dbh,$pref);
|
|
||||||
return $record;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#converts clock-time to minutes
|
#converts clock-time to minutes
|
||||||
sub clock_minutes {
|
sub clock_minutes {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
@ -83,12 +61,75 @@ sub clock_minutes {
|
||||||
return $minutes;
|
return $minutes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#for one freed rental
|
||||||
|
#depends on operator, only 1 rental get freed_time
|
||||||
|
sub count_freedrental {
|
||||||
|
my $self = shift;
|
||||||
|
my $q = shift || "";
|
||||||
|
my $varenv = shift;
|
||||||
|
my $ca_id = shift || 0;
|
||||||
|
my $pos = shift || {};
|
||||||
|
my $freed_count = 0;
|
||||||
|
my $dbh = "";
|
||||||
|
my $today4db = strftime("%Y-%m-%d %H:%M:%S",localtime(time));
|
||||||
|
|
||||||
|
my $pricing = {};
|
||||||
|
my $counting = {};
|
||||||
|
($pricing, $counting) = $self->counting_rental($varenv,$pos);
|
||||||
|
|
||||||
|
my $debug=1;
|
||||||
|
open(FILE,">>$varenv->{logdir}/count_freedrental.log") if($debug);
|
||||||
|
print FILE "\n*-->$today4db $varenv->{dbname}\n" if($debug);
|
||||||
|
print FILE Dumper($q) if($debug);
|
||||||
|
print FILE "--> c_id:$pos->{c_id} rental_minute_all: $pricing->{rentalog}->{rental_minute_all} > 0\n" if($debug);
|
||||||
|
|
||||||
|
#freed mangement will be only dony on accountable rental
|
||||||
|
if($pricing->{rentalog}->{rental_minute_all} > 0){
|
||||||
|
my $pref_pos = {
|
||||||
|
table => "contenttranspos",
|
||||||
|
fetch => "all",
|
||||||
|
keyfield => "c_id",
|
||||||
|
ca_id => "$ca_id",
|
||||||
|
time02 => ">::00:00",
|
||||||
|
};
|
||||||
|
|
||||||
|
#one freed time by parallel rentals
|
||||||
|
if($dbt->{operator}->{$varenv->{dbname}}->{project} eq "Konstanz"){
|
||||||
|
$pref_pos->{int10} = "3";
|
||||||
|
}
|
||||||
|
#one freed time per day
|
||||||
|
else{
|
||||||
|
my $day = strftime "%d", localtime;
|
||||||
|
my $mon = strftime "%m", localtime;
|
||||||
|
my $year = strftime "%Y", localtime;
|
||||||
|
my ($nyear,$nmon,$nday) = Add_Delta_YMD($year,$mon,$day, 0,0,1);
|
||||||
|
$pref_pos->{time_range} = "((start_time >= '$year-$mon-$day' and start_time < '$nyear-$nmon-$nday' and start_time != end_time) OR int10=3)";
|
||||||
|
}
|
||||||
|
my $record_pos = $dbt->fetch_tablerecord($dbh,$pref_pos);
|
||||||
|
foreach my $pid (sort { $record_pos->{$a}->{c_id} <=> $record_pos->{$b}->{c_id} } keys (%$record_pos)){
|
||||||
|
$freed_count++;
|
||||||
|
print FILE "if($freed_count > 1 && $pos->{c_id} != $record_pos->{$pid}->{c_id})\n" if($debug);
|
||||||
|
if($freed_count > 1 && $pos->{c_id} != $record_pos->{$pid}->{c_id}){
|
||||||
|
my $pos_ref = {
|
||||||
|
table => "contenttranspos",
|
||||||
|
c_id => $record_pos->{$pid}->{c_id},
|
||||||
|
};
|
||||||
|
$dbt->update_one($dbh,$pos_ref,"time02='00:00'");
|
||||||
|
print FILE "--> delete freed_time on c_id=$record_pos->{$pid}->{c_id} to time02=00:00\n" if($debug);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close(FILE) if($debug);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}#end count_freedrental
|
||||||
|
|
||||||
|
|
||||||
#new counting rental time in hours method (last sharee_pricing)
|
#new counting rental time in hours method (last sharee_pricing)
|
||||||
sub counting_rental {
|
sub counting_rental {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $varenv = shift;
|
my $varenv = shift;
|
||||||
my $ctpos = shift;
|
my $ctpos = shift;
|
||||||
my $todo = shift;
|
|
||||||
my $today4db = strftime("%Y-%m-%d %H:%M:%S",localtime(time));
|
my $today4db = strftime("%Y-%m-%d %H:%M:%S",localtime(time));
|
||||||
my $return = {};
|
my $return = {};
|
||||||
my $counting = { c_id => $ctpos->{c_id} };
|
my $counting = { c_id => $ctpos->{c_id} };
|
||||||
|
@ -128,8 +169,6 @@ sub counting_rental {
|
||||||
#freed_time depends on operator and will be set by rental end "count_freedrental"
|
#freed_time depends on operator and will be set by rental end "count_freedrental"
|
||||||
my $freed_time = "";
|
my $freed_time = "";
|
||||||
if($ctpos->{time02} && $ctpos->{time02} =~ /[1-9]/){
|
if($ctpos->{time02} && $ctpos->{time02} =~ /[1-9]/){
|
||||||
#$ctpos_freed = $self->only_first_free($ctpos);
|
|
||||||
#if(!$ctpos_freed->{c_id}){
|
|
||||||
my ($dhh,$dmm) = split(/:/,$ctpos->{time02});
|
my ($dhh,$dmm) = split(/:/,$ctpos->{time02});
|
||||||
$freed_time = "- $dhh:$dmm" if($dhh || $dmm);
|
$freed_time = "- $dhh:$dmm" if($dhh || $dmm);
|
||||||
#adding free minutes to start_time
|
#adding free minutes to start_time
|
||||||
|
@ -143,7 +182,6 @@ sub counting_rental {
|
||||||
$computed_clock = "$durdd day $durhh:$durmm" if($durdd);
|
$computed_clock = "$durdd day $durhh:$durmm" if($durdd);
|
||||||
$rental_minute = $self->clock_minutes($computed_clock);
|
$rental_minute = $self->clock_minutes($computed_clock);
|
||||||
#print "$computed_clock|$rental_minute";
|
#print "$computed_clock|$rental_minute";
|
||||||
#}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -227,7 +227,8 @@ td {
|
||||||
my $counting = {};
|
my $counting = {};
|
||||||
|
|
||||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||||
($pricing,$counting) = $pri->counting_rental(\%varenv,$cttpos->{$id},"calc_price");
|
$pri->count_freedrental("Printpreview",\%varenv,$ctt->{int10},$cttpos->{$id});
|
||||||
|
($pricing,$counting) = $pri->counting_rental(\%varenv,$cttpos->{$id});
|
||||||
$gesamt = $pri->round($pricing->{total_price});
|
$gesamt = $pri->round($pricing->{total_price});
|
||||||
$gesamt = sprintf('%.2f', $gesamt);
|
$gesamt = sprintf('%.2f', $gesamt);
|
||||||
}else{
|
}else{
|
||||||
|
@ -698,7 +699,8 @@ td {
|
||||||
my $rental_feed = {};
|
my $rental_feed = {};
|
||||||
|
|
||||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||||
($pricing,$counting) = $pri->counting_rental($varenv,$cttpos->{$id},"calc_price");
|
$pri->count_freedrental("Printpreview",\%varenv,$ctt->{int10},$cttpos->{$id});
|
||||||
|
($pricing,$counting) = $pri->counting_rental($varenv,$cttpos->{$id});
|
||||||
$rental_feed = $pri->fetch_rentalfeed($varenv,$cttpos->{$id},$counting);
|
$rental_feed = $pri->fetch_rentalfeed($varenv,$cttpos->{$id},$counting);
|
||||||
$rabatt = $pricing->{discount};
|
$rabatt = $pricing->{discount};
|
||||||
$sum_parts19 += $pricing->{total_price};
|
$sum_parts19 += $pricing->{total_price};
|
||||||
|
|
|
@ -215,11 +215,11 @@ sub save_account(){
|
||||||
if($_ =~ /^txt04/){
|
if($_ =~ /^txt04/){
|
||||||
if($valxx eq "xxxxxxxx"){
|
if($valxx eq "xxxxxxxx"){
|
||||||
$pw_dummy = "1";
|
$pw_dummy = "1";
|
||||||
}elsif($valxx){
|
}elsif(length($valxx) >= 8){
|
||||||
my $pwmd5 = md5_hex($valxx);
|
my $pwmd5 = md5_hex($valxx) || "";
|
||||||
my $pwsha256=sha256_base64($valxx);
|
$u_rows = $dbt->update_one($dbh,$update_primary,"txt11='$pwmd5'") if(length($pwmd5) > 20);
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"txt11='$pwmd5'");
|
my $pwsha256=sha256_base64($pwmd5) || "";
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"txt04='$pwsha256'");
|
$u_rows = $dbt->update_one($dbh,$update_primary,"txt04='$pwsha256'") if(length($pwsha256) > 20);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#operators, only if saved by operator DMS
|
#operators, only if saved by operator DMS
|
||||||
|
@ -489,7 +489,6 @@ sub save_account(){
|
||||||
$alphacount = () = $valxx =~ /[a-z]/gi;
|
$alphacount = () = $valxx =~ /[a-z]/gi;
|
||||||
$alphafail = length($valxx) - $alphacount;
|
$alphafail = length($valxx) - $alphacount;
|
||||||
if(!$valxx || length($valxx) < 8 || $alphafail < 2){
|
if(!$valxx || length($valxx) < 8 || $alphafail < 2){
|
||||||
#$ret = "failure::pwlazy_txt04#top";
|
|
||||||
$ret = "failure::$_#top";
|
$ret = "failure::$_#top";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -844,11 +843,11 @@ sub send_password(){
|
||||||
$email =~ s/\s//g;
|
$email =~ s/\s//g;
|
||||||
$bw->log("$varenv{basedir}/src/Mod/newsletter_tink.pl",$email,"");
|
$bw->log("$varenv{basedir}/src/Mod/newsletter_tink.pl",$email,"");
|
||||||
|
|
||||||
my $pwmd5 = md5_hex($coo);
|
my $pwmd5 = md5_hex($coo) || "";
|
||||||
my $pwsha256=sha256_base64($coo);#after migration, adjust length test
|
|
||||||
|
|
||||||
if($email && $email =~ /\w\@\w/ && $pwmd5 && length($pwmd5) > 20 && $email !~ /$dbt->{copri_conf}->{test_accounts}/i){
|
if($email && $email =~ /\w\@\w/ && $pwmd5 && length($pwmd5) > 20 && $email !~ /$dbt->{copri_conf}->{test_accounts}/i){
|
||||||
$db->updater("contentadr","1","1","txt11","$pwmd5","$owner","txt08","ilike","$email");
|
$db->updater("contentadr","1","1","txt11","$pwmd5","$owner","txt08","ilike","$email");
|
||||||
|
my $pwsha256=sha256_base64($pwmd5) || "";
|
||||||
$db->updater("contentadr","1","1","txt04","$pwsha256","$owner","txt08","ilike","$email");
|
$db->updater("contentadr","1","1","txt04","$pwsha256","$owner","txt08","ilike","$email");
|
||||||
system(`$varenv{basedir}/src/Mod/newsletter_tink.pl "$varenv{basedir}" "$varenv{wwwhost}" "send_password" "$email" "$coo"`);
|
system(`$varenv{basedir}/src/Mod/newsletter_tink.pl "$varenv{basedir}" "$varenv{wwwhost}" "send_password" "$email" "$coo"`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,7 +193,7 @@ sub tpl(){
|
||||||
|
|
||||||
if($cttpos->{int35} && $cttpos->{start_time} && $cttpos->{end_time}){
|
if($cttpos->{int35} && $cttpos->{start_time} && $cttpos->{end_time}){
|
||||||
$cttpos->{end_time} = $now_dt if($cttpos->{int10} == 3 && $cttpos->{int20} == 2);
|
$cttpos->{end_time} = $now_dt if($cttpos->{int10} == 3 && $cttpos->{int20} == 2);
|
||||||
($pricing,$counting) = $pri->counting_rental(\%varenv,$cttpos,"calc_price");
|
($pricing,$counting) = $pri->counting_rental(\%varenv,$cttpos);
|
||||||
$rental_feed = $pri->fetch_rentalfeed(\%varenv,$cttpos,$counting);
|
$rental_feed = $pri->fetch_rentalfeed(\%varenv,$cttpos,$counting);
|
||||||
$gesamt = $pri->round($pricing->{total_price});
|
$gesamt = $pri->round($pricing->{total_price});
|
||||||
$gesamt = sprintf('%.2f', $gesamt);
|
$gesamt = sprintf('%.2f', $gesamt);
|
||||||
|
|
|
@ -746,7 +746,7 @@ EOF
|
||||||
if($ct4rel->{$id}->{c_id} == $ct4rel_parts->{$cpid}->{ct_id}){
|
if($ct4rel->{$id}->{c_id} == $ct4rel_parts->{$cpid}->{ct_id}){
|
||||||
|
|
||||||
if($ct4rel_parts->{$cpid}->{int35} && $ct4rel_parts->{$cpid}->{start_time} && $ct4rel_parts->{$cpid}->{end_time}){
|
if($ct4rel_parts->{$cpid}->{int35} && $ct4rel_parts->{$cpid}->{start_time} && $ct4rel_parts->{$cpid}->{end_time}){
|
||||||
($pricing,$counting) = $pri->counting_rental(\%varenv,$ct4rel_parts->{$cpid},"calc_price");
|
($pricing,$counting) = $pri->counting_rental(\%varenv,$ct4rel_parts->{$cpid});
|
||||||
$sum_pos += $pricing->{total_price}
|
$sum_pos += $pricing->{total_price}
|
||||||
}elsif((looks_like_number($ct4rel_parts->{$cpid}->{int02}) && $ct4rel_parts->{$cpid}->{int02} != 0) && (looks_like_number($ct4rel_parts->{$cpid}->{int03}) && $ct4rel_parts->{$cpid}->{int03} != 0)){
|
}elsif((looks_like_number($ct4rel_parts->{$cpid}->{int02}) && $ct4rel_parts->{$cpid}->{int02} != 0) && (looks_like_number($ct4rel_parts->{$cpid}->{int03}) && $ct4rel_parts->{$cpid}->{int03} != 0)){
|
||||||
my ($gesamt,$rabatt) = $pri->price2calc($ct4rel_parts->{$cpid});
|
my ($gesamt,$rabatt) = $pri->price2calc($ct4rel_parts->{$cpid});
|
||||||
|
|
|
@ -176,8 +176,8 @@ EOF
|
||||||
|
|
||||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||||
$cttpos->{$id}->{end_time} = $now_dt if($cttpos->{$id}->{int10} == 3);
|
$cttpos->{$id}->{end_time} = $now_dt if($cttpos->{$id}->{int10} == 3);
|
||||||
($pricing,$counting) = $pri->counting_rental(\%varenv,$cttpos->{$id},"calc_price");
|
$pri->count_freedrental($q,\%varenv,$ctadr->{c_id},$cttpos->{$id});
|
||||||
$apif->count_freedrental($q,\%varenv,$ctadr,$pricing->{rentalog}->{rental_minute_all},$cttpos->{$id});
|
($pricing,$counting) = $pri->counting_rental(\%varenv,$cttpos->{$id});
|
||||||
$rental_feed = $pri->fetch_rentalfeed(\%varenv,$cttpos->{$id},$counting);
|
$rental_feed = $pri->fetch_rentalfeed(\%varenv,$cttpos->{$id},$counting);
|
||||||
$sum_parts19 += $pricing->{total_price};
|
$sum_parts19 += $pricing->{total_price};
|
||||||
$gesamt = $pri->round($pricing->{total_price});
|
$gesamt = $pri->round($pricing->{total_price});
|
||||||
|
|
|
@ -87,7 +87,7 @@ sub tpl(){
|
||||||
foreach my $id (keys(%$cttpos)){
|
foreach my $id (keys(%$cttpos)){
|
||||||
$cttpos_count++;
|
$cttpos_count++;
|
||||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||||
($pricing,$counting) = $pri->counting_rental($varenv,$cttpos->{$id},"calc_price");
|
($pricing,$counting) = $pri->counting_rental($varenv,$cttpos->{$id});
|
||||||
$sum += $pricing->{total_price};
|
$sum += $pricing->{total_price};
|
||||||
}else{
|
}else{
|
||||||
my ($gesamt,$rabatt) = $pri->price2calc($cttpos->{$id});
|
my ($gesamt,$rabatt) = $pri->price2calc($cttpos->{$id});
|
||||||
|
|
|
@ -362,7 +362,7 @@ Nach Abschluss der Registrierung erhalten Sie sowohl auf die von Ihnen hinterleg
|
||||||
my $pricing = {};
|
my $pricing = {};
|
||||||
my $counting = {};
|
my $counting = {};
|
||||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||||
($pricing,$counting) = $pri->counting_rental($varenv,$cttpos->{$id},"calc_price");
|
($pricing,$counting) = $pri->counting_rental($varenv,$cttpos->{$id});
|
||||||
}
|
}
|
||||||
|
|
||||||
print $q->Tr(),"\n";
|
print $q->Tr(),"\n";
|
||||||
|
|
Loading…
Add table
Reference in a new issue