diff --git a/copri4/main/img/konrad-Briefpapier.jpg b/copri4/main/img/konrad-Briefpapier.jpg new file mode 100644 index 0000000..807b47d Binary files /dev/null and b/copri4/main/img/konrad-Briefpapier.jpg differ diff --git a/copri4/main/img/payment-creditcard2.png b/copri4/main/img/payment-creditcard2.png new file mode 100644 index 0000000..dc9a6a5 Binary files /dev/null and b/copri4/main/img/payment-creditcard2.png differ diff --git a/copri4/main/img/payment-incasso2.png b/copri4/main/img/payment-incasso2.png new file mode 100644 index 0000000..3da279f Binary files /dev/null and b/copri4/main/img/payment-incasso2.png differ diff --git a/copri4/main/src/Lib/Config.pm b/copri4/main/src/Lib/Config.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Lib/Mlogic.pm b/copri4/main/src/Lib/Mlogic.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Mod/APIfunc.pm b/copri4/main/src/Mod/APIfunc.pm old mode 100644 new mode 100755 index 922c555..002562f --- a/copri4/main/src/Mod/APIfunc.pm +++ b/copri4/main/src/Mod/APIfunc.pm @@ -1396,7 +1396,7 @@ sub rentals(){ #generate always new keys. keep in mind, keys saved in contenttranspos are overwritten if($withkey && $record->{$id}->{int11} && $record->{$id}->{int11} eq "2"){ my @K_select = (); - @K_select = `cd /var/www/copri4/$varenv{syshost}/src/scripts && export CLASSPATH='.:/usr/share/java:/usr/share/java/postgresql.jar' && java Ilockauth $varenv{dbname} $bike_id`; + @K_select = `cd /var/www/copri4/main/src/scripts && export CLASSPATH='.:/usr/share/java:/usr/share/java/postgresql.jar' && java Ilockauth $varenv{dbname} $bike_id`; $bw->log("rentals java Ilockauth $bike_id | syshost:$varenv{syshost}",\@K_select,""); foreach(@K_select){ @@ -1417,8 +1417,8 @@ sub rentals(){ sub bikes_available(){ my $self = shift; my $q = shift; + my $varenv = shift; my $auth = shift; - my %varenv = $cf->envonline(); my $authed = 0; #my $users_serviceapp = $dbt->select_users($dbh,$auth->{c_id},"and int09=1"); @@ -1454,15 +1454,17 @@ sub bikes_available(){ my $op_return = {}; my @adr_tariff = (); - @adr_tariff = ("$auth->{txt30}"); - @adr_tariff = split(/\s+/,$auth->{txt30}) if($auth->{txt30} =~ /\w\s+\w/); + if(@adr_tariff){ + @adr_tariff = ("$auth->{txt30}"); + @adr_tariff = split(/\s+/,$auth->{txt30}) if($auth->{txt30} =~ /\w\s+\w/); + } foreach my $id (sort { $record->{$a}->{barcode} <=> $record->{$b}->{barcode} } keys (%$record)){ $return->{$id}->{authed} = "$authed"; - $return->{$id}->{station} = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}$record->{$id}->{int04}"; - $return->{$id}->{uri_operator} = "$varenv{wwwhost}"; + $return->{$id}->{station} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{int04}"; + $return->{$id}->{uri_operator} = "$varenv->{wwwhost}"; ($return->{$id}->{gps}->{latitude},$return->{$id}->{gps}->{longitude}) = split(/,/,$record->{$id}->{txt06}); - $return->{$id}->{bike} = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}$record->{$id}->{barcode}"; + $return->{$id}->{bike} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{barcode}"; #$return->{$id}->{description} = "$record->{$id}->{txt01}"; $return->{$id}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1', $record->{$id}->{txt01})); $return->{$id}->{state} = "$dbt->{copri_conf}->{bike_state}->{$record->{$id}->{int10}}"; @@ -1474,10 +1476,10 @@ sub bikes_available(){ $return->{$id}->{lock_state} = "locking" if($record->{$id}->{int20} == 3); $return->{$id}->{Ilockit_GUID} = "$record->{$id}->{txt17}"; $return->{$id}->{Ilockit_ID} = "$record->{$id}->{txt18}"; - $return->{$id}->{bike_group} = ["$dbt->{operator}->{$varenv{dbname}}->{oprefix}$record->{$id}->{main_id}"]; + $return->{$id}->{bike_group} = ["$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{main_id}"]; #if($users_serviceapp->{int09}){ #shareetool - if($q->param('authcookie') && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} == 187 && $q->param('authcookie') =~ /$dbt->{merchant_ids}->{$varenv{merchant_id}}/ && scalar(@{$user_tour} >= 1)){ + 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}); $return->{$id}->{service_code} = [@service_code]; } @@ -1495,12 +1497,12 @@ sub bikes_available(){ $return->{$id}->{tariff_description}->{max_eur_per_day} = "$tariff_content->{$tid}->{int17}" if($tariff_content->{$tid}->{int17}); $return->{$id}->{tariff_description}->{free_hours} = "$tariff_content->{$tid}->{int16}" if($tariff_content->{$tid}->{int16}); $return->{$id}->{tariff_description}->{abo_eur_per_month} = "$tariff_content->{$tid}->{int15}" if($tariff_content->{$tid}->{int15}); - $return->{$id}->{tariff_description}->{$id}->{operator_agb} = "Mit der Mietrad Anmietung wird folgender Betreiber AGB zugestimmt (als Demo sharee AGB)." if($auth->{c_id} == 1842 || $auth->{c_id} == 5781); + $return->{$id}->{tariff_description}->{$id}->{operator_agb} = "Mit der Mietrad Anmietung wird folgender Betreiber AGB zugestimmt (als Demo sharee AGB)." if($auth->{c_id} == 1842 || $auth->{c_id} == 5781); } } } } - $op_return->{$dbt->{operator}->{$varenv{dbname}}->{oprefix} . $id} = $return->{$id}; + $op_return->{$dbt->{operator}->{$varenv->{dbname}}->{oprefix} . $id} = $return->{$id}; } return $op_return; }#end bikes_available @@ -1509,9 +1511,9 @@ sub bikes_available(){ sub bikes_all(){ my $self = shift; my $q = shift; + my $varenv = shift; my $auth = shift || {}; my $stations_allraw = shift || ""; - my %varenv = $cf->envonline(); #my $users_serviceapp = $dbt->select_users($dbh,$auth->{c_id},"and int09=1"); my $return={}; @@ -1527,8 +1529,10 @@ sub bikes_all(){ $main_ids =~ s/[a-z_]+//ig; $pref = { %$pref, main_id => "IN::($main_ids)" }; - my $station_id = $1 if($q->param('station') =~ /(\d+)/); - my $bike_id = $1 if($q->param('bike') =~ /(\d+)/); + my $station_id = ""; + my $bike_id = ""; + $station_id = $1 if($q->param('station') && $q->param('station') =~ /(\d+)/); + $bike_id = $1 if($q->param('bike') && $q->param('bike') =~ /(\d+)/); $pref = { %$pref, int04 => "=::" . $q->escapeHTML($station_id) } if(looks_like_number($station_id)); $pref = { %$pref, barcode => "=::" . $q->escapeHTML($bike_id) } if(looks_like_number($bike_id)); @@ -1538,7 +1542,7 @@ sub bikes_all(){ my @stations_service_tour = (); #shareetool - if($q->param('authcookie') && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} == 187 && $q->param('authcookie') =~ /$dbt->{merchant_ids}->{$varenv{merchant_id}}/){ + if($q->param('authcookie') && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} == 187){ my $stations = ""; if(ref($stations_allraw) eq "HASH" && scalar(@{$user_tour} >= 1)){ foreach my $id (sort { $stations_allraw->{$a}->{int04} <=> $stations_allraw->{$b}->{int04} } keys (%$stations_allraw)){ @@ -1563,10 +1567,10 @@ sub bikes_all(){ foreach my $id (sort { $record->{$a}->{barcode} <=> $record->{$b}->{barcode} } keys (%$record)){ if(1==1){ $bikes_on_station->{$record->{$id}->{int04}}->{bike_ist} += 1; - $return->{$id}->{uri_operator} = "$varenv{wwwhost}"; - $return->{$id}->{station} = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}$record->{$id}->{int04}"; + $return->{$id}->{uri_operator} = "$varenv->{wwwhost}"; + $return->{$id}->{station} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{int04}"; ($return->{$id}->{gps}->{latitude},$return->{$id}->{gps}->{longitude}) = split(/,/,$record->{$id}->{txt06}); - $return->{$id}->{bike} = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}$record->{$id}->{barcode}"; + $return->{$id}->{bike} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{barcode}"; #$return->{$id}->{description} = "$record->{$id}->{txt01}"; $return->{$id}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1', $record->{$id}->{txt01})); @@ -1579,15 +1583,15 @@ sub bikes_all(){ $return->{$id}->{lock_state} = "locking" if($record->{$id}->{int20} == 3); $return->{$id}->{Ilockit_GUID} = "$record->{$id}->{txt17}"; $return->{$id}->{Ilockit_ID} = "$record->{$id}->{txt18}"; - $return->{$id}->{bike_group} = ["$dbt->{operator}->{$varenv{dbname}}->{oprefix}$record->{$id}->{main_id}"]; + $return->{$id}->{bike_group} = ["$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{main_id}"]; #if($users_serviceapp->{int09}){ #shareetool - if($q->param('authcookie') && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} == 187 && $q->param('authcookie') =~ /$dbt->{merchant_ids}->{$varenv{merchant_id}}/ && scalar(@{$user_tour} >= 1)){ + 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}); $return->{$id}->{service_code} = [@service_code]; } } - $op_return->{$dbt->{operator}->{$varenv{dbname}}->{oprefix} . $id} = $return->{$id}; + $op_return->{$dbt->{operator}->{$varenv->{dbname}}->{oprefix} . $id} = $return->{$id}; } } @@ -1598,8 +1602,8 @@ sub bikes_all(){ sub stations_available(){ my $self = shift; my $q = shift || ""; + my $varenv = shift; my $auth = shift || ""; - my %varenv = $cf->envonline(); my $authed = 0; $authed = 1 if(ref($auth) eq "HASH" && $auth->{c_id}); @@ -1628,7 +1632,7 @@ sub stations_available(){ my $record = {}; #on servicetool only stations on user_tour #shareetool - if($q->param('authcookie') && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} == 187 && $q->param('authcookie') =~ /$dbt->{merchant_ids}->{$varenv{merchant_id}}/){ + if($q->param('authcookie') && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} == 187){ if(scalar(@{$user_tour}) >= 1){ $pref_sql .= " AND ("; foreach(@{$user_tour}){ @@ -1648,13 +1652,13 @@ sub stations_available(){ foreach my $id (sort { $record->{$a}->{barcode} <=> $record->{$b}->{barcode} } keys (%$record)){ $return->{$id}->{authed} = "$authed"; - $return->{$id}->{station} = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}$record->{$id}->{int04}"; + $return->{$id}->{station} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{int04}"; if($record->{$id}->{int07}){ - $return->{$id}->{service_tour} = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}$record->{$id}->{int07}"; + $return->{$id}->{service_tour} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{int07}"; }else{ $return->{$id}->{service_tour} = ""; } - $return->{$id}->{uri_operator} = "$varenv{wwwhost}"; + $return->{$id}->{uri_operator} = "$varenv->{wwwhost}"; ($return->{$id}->{gps}->{latitude},$return->{$id}->{gps}->{longitude}) = split(/,/,$record->{$id}->{txt06}); #$return->{$id}->{description} = "$record->{$id}->{txt01}"; $return->{$id}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1', $record->{$id}->{txt01})); @@ -1662,7 +1666,7 @@ sub stations_available(){ $return->{$id}->{station_group} = ""; if($record->{$id}->{txt24}){#Ilockit with new station_group logic $return->{$id}->{gps_radius} = "$record->{$id}->{int06}"; - $record->{$id}->{txt24} =~ s/(\d+)/$dbt->{operator}->{$varenv{dbname}}->{oprefix}$1/g; + $record->{$id}->{txt24} =~ s/(\d+)/$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$1/g; my @station_group = split(/\s/,$record->{$id}->{txt24}); $return->{$id}->{station_group} = [@station_group]; } @@ -1690,7 +1694,7 @@ sub stations_available(){ $return->{$id}->{operator_data}->{operator_phone} = $hotline_data->{txt07} if($hotline_data->{txt07}); $return->{$id}->{operator_data}->{operator_email} = $hotline_data->{txt08} if($hotline_data->{txt08}); - $op_return->{$dbt->{operator}->{$varenv{dbname}}->{oprefix} . $id} = $return->{$id}; + $op_return->{$dbt->{operator}->{$varenv->{dbname}}->{oprefix} . $id} = $return->{$id}; } return ($op_return, $record); }#end stations_available @@ -1700,9 +1704,9 @@ sub stations_available(){ sub stations_all(){ my $self = shift; my $q = shift || ""; + my $varenv = shift; my $bikes_on_station = shift || {}; my $auth = shift || ""; - my %varenv = $cf->envonline(); my $authed = 0; $authed = 1 if(ref($auth) eq "HASH" && $auth->{c_id}); @@ -1716,15 +1720,17 @@ sub stations_all(){ template_id => "225",#Station_liste }; - my $station_id = $1 if($q->param('station') =~ /(\d+)/); - my $work_val_id = $1 if($q->param('work_val') =~ /(\d+)/); + my $station_id = ""; + my $work_val_id = ""; + $station_id = $1 if($q->param('station') && $q->param('station') =~ /(\d+)/); + $work_val_id = $1 if($q->param('work_val') && $q->param('work_val') =~ /(\d+)/); if(looks_like_number($station_id)){ $pref->{int04} = $station_id; - }elsif($q->param('work_id') eq "int04" && $work_val_id){ + }elsif($q->param('work_id') && $q->param('work_id') eq "int04" && $work_val_id){ $pref->{int04} = $work_val_id; } - #shareetool werktatt - $pref->{int10} = 1 if($q->param('authcookie') && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} == 187 && $q->param('authcookie') =~ /$dbt->{merchant_ids}->{$varenv{merchant_id}}/); + #if not shareetool then only available stations + $pref->{int10} = 1 if(!$q->param('authcookie') || !$varenv->{merchant_id} || !$dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} || $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} != 187); my $pref_sql = ""; $pref_sql .= " and ("; @@ -1740,7 +1746,9 @@ sub stations_all(){ my $record = {}; #on servicetool only stations on user_tour #shareetool - if($q->param('authcookie') && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} == 187 && $q->param('authcookie') =~ /$dbt->{merchant_ids}->{$varenv{merchant_id}}/){ + $bw->log("stations user_tour by merchant id $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} on $varenv->{dbname}",$user_tour,""); + + if($q->param('authcookie') && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} == 187){ if(scalar(@{$user_tour}) >= 1){ $pref_sql .= " AND ("; foreach(@{$user_tour}){ @@ -1768,13 +1776,13 @@ sub stations_all(){ #$bike_soll = $lb->round_half($bike_soll); #$bike_soll =~ s/\.\d+//;#rounded integer $return->{$id}->{authed} = "$authed"; - $return->{$id}->{station} = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}$record->{$id}->{int04}"; + $return->{$id}->{station} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{int04}"; if($record->{$id}->{int07}){ - $return->{$id}->{service_tour} = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}$record->{$id}->{int07}"; + $return->{$id}->{service_tour} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{int07}"; }else{ $return->{$id}->{service_tour} = ""; } - $return->{$id}->{uri_operator} = "$varenv{wwwhost}"; + $return->{$id}->{uri_operator} = "$varenv->{wwwhost}"; ($return->{$id}->{gps}->{latitude},$return->{$id}->{gps}->{longitude}) = split(/,/,$record->{$id}->{txt06}); #$return->{$id}->{description} = "$record->{$id}->{txt01}"; $return->{$id}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1', $record->{$id}->{txt01})); @@ -1784,11 +1792,11 @@ sub stations_all(){ $return->{$id}->{station_group} = ""; if($record->{$id}->{txt24}){#sharee Ilockit with new station_group logic $return->{$id}->{gps_radius} = "$record->{$id}->{int06}"; - $record->{$id}->{txt24} =~ s/(\d+)/$dbt->{operator}->{$varenv{dbname}}->{oprefix}$1/g; + $record->{$id}->{txt24} =~ s/(\d+)/$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$1/g; my @station_group = split(/\s/,$record->{$id}->{txt24}); $return->{$id}->{station_group} = [@station_group]; } - $op_return->{$dbt->{operator}->{$varenv{dbname}}->{oprefix} . $id} = $return->{$id}; + $op_return->{$dbt->{operator}->{$varenv->{dbname}}->{oprefix} . $id} = $return->{$id}; } return ($op_return,$record); }#end stations_all @@ -1828,6 +1836,8 @@ sub fetch_tariff(){ my $adr = shift || {}; my $authcookie = shift || ""; + my $merchant_id = ""; + $merchant_id = $1 if($authcookie && $authcookie =~ /\w+_(\w+)$/); my $tariff_content = {}; my @user_tour = (); my %varenv = $cf->envonline(); @@ -1851,8 +1861,10 @@ sub fetch_tariff(){ if((ref($adr) ne "HASH" || !$adr->{c_id}) && ($varenv{dbname} ne "sharee_lv")){ $tariff->{int18} = 2; $tariff_content = $dbt->fetch_record($dbh,$tariff); + $bw->log("1. Tariff type $tariff->{int18} select on",$varenv{dbname},""); }elsif(ref($adr) eq "HASH" && $adr->{c_id}){ #select operators address to get users tarifnr array in txt30 + delete $tariff->{int18} if($tariff->{int18}); my $authref = { table => "contentadr", fetch => "one", @@ -1862,7 +1874,7 @@ sub fetch_tariff(){ $auth_operator = $dbt->fetch_record($dbh,$authref); #shareetool - if($authcookie && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} == 187 && $authcookie =~ /$dbt->{merchant_ids}->{$varenv{merchant_id}}/){ + if($merchant_id && $dbt->{merchant_ids}->{$merchant_id}->{id} && $dbt->{merchant_ids}->{$merchant_id}->{id} == 187){ my $users_serviceapp = $dbt->select_users($dbh,$auth_operator->{c_id},"and int09=1"); if($users_serviceapp->{int09}){ $auth_operator->{txt18} =~ s/(\d+)/$dbt->{operator}->{$varenv{dbname}}->{oprefix}$1/g; @@ -1876,9 +1888,10 @@ sub fetch_tariff(){ #FIXME user tarif select have to be fetched like in net_booking #$tariff_content must contain tariff_description in App bikes_available listing $tariff_content = $dbt->fetch_record($dbh,$tariff); + $bw->log("2. Tariff type $tariff->{int18} select on",$varenv{dbname},""); # }else{ - $bw->log("NO tariff_content on",$varenv{dbname},""); + $bw->log("3. NO tariff_content on",$varenv{dbname},""); } my $oprefix = ""; @@ -1888,14 +1901,16 @@ sub fetch_tariff(){ my @user_group = (); my @bike_group = (); my @adr_tariff = (); - @adr_tariff = ("$auth_operator->{txt30}"); - @adr_tariff = split(/\s+/,$auth_operator->{txt30}) if($auth_operator->{txt30} =~ /\w\s+\w/); + if($auth_operator->{txt30}){ + @adr_tariff = ("$auth_operator->{txt30}"); + @adr_tariff = split(/\s+/,$auth_operator->{txt30}) if($auth_operator->{txt30} =~ /\w\s+\w/); + } foreach my $id (keys (%$tariff_content)){ $bw->log("Tarif searching for authorized user-id $auth_operator->{c_id} by: if($auth_operator->{txt30} && $auth_operator->{txt30} =~ /$tariff_content->{$id}->{barcode}/ && $tariff_content->{$id}->{int12}) (s-type:$tariff_content->{$id}->{int18})","",""); foreach(@adr_tariff){ if($_ == $tariff_content->{$id}->{barcode} && $tariff_content->{$id}->{int12}){ - $bw->log("Tarif FOUND for authorized user-id $auth_operator->{c_id} if($tariff_content->{$id}->{int12}) (s-type:$tariff_content->{$id}->{int18})",$tariff_content->{$id}->{barcode},""); + $bw->log("Tarif FOUND with merchant $merchant_id for authorized user-id $auth_operator->{c_id} if($tariff_content->{$id}->{int12}) (s-type:$tariff_content->{$id}->{int18})",$tariff_content->{$id}->{barcode},""); push(@tarifnr, "$tariff_content->{$id}->{barcode}"); push(@user_group, "$oprefix$tariff_content->{$id}->{int12}");#sharee bike_node.main_id push(@bike_group, "$oprefix$tariff_content->{$id}->{int12}");#sharee bike_node.main_id @@ -1905,10 +1920,10 @@ sub fetch_tariff(){ #fallback to public tarif if no user tariff defined and not servicetool app request #shareetool - if(!@tarifnr && (!$dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} || $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} != 187)){ + if(!@tarifnr && (!$dbt->{merchant_ids}->{$merchant_id}->{id} || $dbt->{merchant_ids}->{$merchant_id}->{id} != 187)){ foreach my $id (keys (%$tariff_content)){ if($tariff_content->{$id}->{int18} eq 2){ - $bw->log("Tarif FOUND FALLBACK for No Tarif users if($tariff_content->{$id}->{int12} && $varenv{dbname}) (s-type:$tariff_content->{$id}->{int18})",$id,""); + $bw->log("Tarif FOUND FALLBACK for No Tarif users with merchant $merchant_id if($tariff_content->{$id}->{int12} && $varenv{dbname}) (s-type:$tariff_content->{$id}->{int18})",$id,""); push(@tarifnr, "$tariff_content->{$id}->{barcode}"); push(@user_group, "$oprefix$tariff_content->{$id}->{int12}");#sharee bike_node.main_id push(@bike_group, "$oprefix$tariff_content->{$id}->{int12}");#sharee bike_node.main_id @@ -1916,7 +1931,7 @@ sub fetch_tariff(){ } } #$bw->log("FETCHED_Tarif by dbname:$varenv{dbname} | user_group:@user_group | bike_group:@bike_group | user_tour:@user_tour | tarifnr: @tarifnr",$tariff_content,""); - $bw->log("FETCHED_Tarif by dbname:$varenv{dbname} | user_group:@user_group | bike_group:@bike_group | user_tour:@user_tour | tarifnr: @tarifnr",\@tarifnr,""); + $bw->log("FETCHED_Tarif by dbname:$varenv{dbname} with merchant $merchant_id | user_group:@user_group | bike_group:@bike_group | user_tour:@user_tour | tarifnr: @tarifnr",\@tarifnr,""); return (\@bike_group,\@user_group,$tariff_content,\@user_tour); } @@ -1999,13 +2014,15 @@ sub auth_verify(){ %varenv = $cf->envonline(); my $record = { c_id => 0 };#if fails - my $return = { authcookie => "" }; + my $return = { authcookie => "", + merchant_id => "" + }; my $user_group = ""; my $bike_group = ""; my $tariff_content = ""; my $user_tour = ""; - #my $source = $dbt->get_dbname();#TODO, maybe substitude varenv{dbname} by $source!? + $return->{merchant_id} = $1 if($cgi_authcookie && $cgi_authcookie =~ /\w+_(\w+)$/); my $netloc = $q->url(-base=>1); $bw->log("--> auth_verify on dbname $varenv{dbname},\n Starting with authcookie: $cgi_authcookie",$netloc,""); if($cgi_authcookie && length($cgi_authcookie) > 30){ @@ -2027,7 +2044,7 @@ sub auth_verify(){ my $auth_primary = { c_id => 0 }; $auth_primary = $dbt->fetch_record($dbh_primary,$authref); - if($auth_primary->{c_id} > 0){ + if($auth_primary->{c_id} && $auth_primary->{c_id} > 0){ $bw->log("auth_verified on primary anchor 2 by dbname $varenv{dbname}",$auth_primary->{c_id},""); #On booking_request, user must be authenticated and addr must exist @@ -2220,7 +2237,7 @@ sub auth_verify(){ #Servicetool only users with users.int09=1 #shareetool - if($varenv{dbname} ne "sharee_primary" && $q->param('authcookie') && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} == 187 && $q->param('authcookie') =~ /$dbt->{merchant_ids}->{$varenv{merchant_id}}/){ + if($varenv{dbname} ne "sharee_primary" && $q->param('authcookie') && $dbt->{merchant_ids}->{$return->{merchant_id}}->{id} && $dbt->{merchant_ids}->{$return->{merchant_id}}->{id} == 187){ my $users_serviceapp = { u_id => 0 }; $users_serviceapp = $dbt->select_users($dbh,$record->{c_id},"and int09=1"); if(!$users_serviceapp->{u_id} || $users_serviceapp->{u_id} == 0){ @@ -2271,7 +2288,7 @@ sub authorization(){ #Servicetool, only users with users.int09=1 #shareetool - if($aowner && $aowner eq "187"){ + if($varenv{dbname} ne "sharee_primary" && $aowner && $aowner eq "187"){ my $users_serviceapp = { u_id => 0 }; $users_serviceapp = $dbt->select_users($dbh,$record->{c_id},"and int09=1"); $record = { c_id => 0 } if(!$users_serviceapp->{u_id}); diff --git a/copri4/main/src/Mod/APIjsonclient.pm b/copri4/main/src/Mod/APIjsonclient.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Mod/APIjsonserver.pm b/copri4/main/src/Mod/APIjsonserver.pm old mode 100644 new mode 100755 index be3c84e..e96526f --- a/copri4/main/src/Mod/APIjsonserver.pm +++ b/copri4/main/src/Mod/APIjsonserver.pm @@ -424,7 +424,7 @@ elsif($q->param('request') eq "bikes_available"){ my ($auth,$authraw) = $apif->auth_verify($q);#on operator loop select, operator adr must be select to get user_group $response = { %$response, %$auth }; $bw->log("Y bikes_available by c_id $authraw->{c_id}, Tarif:",$authraw->{txt30},""); - $response->{bikes} = $apif->bikes_available($q,$authraw); + $response->{bikes} = $apif->bikes_available($q,\%varenv,$authraw); } if(ref($response->{bikes}) ne "HASH"){ $response->{response_state} = "Failure 5003: cannot find any user defined bike tariff"; @@ -444,15 +444,18 @@ elsif($q->param('request') eq "bikes_all"){ $response = { %$response, %$auth }; ($response->{bikes},$response->{uri_operator_array},$response->{user_group},$response->{user_tour}) = $jsc->loop_sharees($q,$auth,$aowner); }else{ + ($aowner,my $return_merchant) = $apif->fetch_merchant($q,\%varenv,$coo,$q->param('merchant_id')); + $varenv{merchant_id} = $return_merchant->{merchant_id}; + my ($auth,$authraw) = $apif->auth_verify($q); $response = { %$response, %$auth }; $response->{response_text} = "Vorsicht, das ist die Liste aller Leihräder unabhängig von der Verfügbarkeit"; #on servicetool only stations on user_tour my $stations_allraw = {}; - (my $stations_not_used,$stations_allraw) = $apif->stations_all($q,"",$authraw) if($aowner && $aowner eq "187");#shareetool + (my $stations_not_used,$stations_allraw) = $apif->stations_all($q,\%varenv,$authraw) if($aowner && $aowner eq "187");#shareetool - my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,$authraw,$stations_allraw); + my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,\%varenv,$authraw,$stations_allraw); my $bike = "all"; my $interval = $q->param('interval') || "31"; @@ -592,10 +595,13 @@ elsif($q->param('request') eq "stations_all"){ $response = { %$response, %$auth }; ($response->{stations},$response->{uri_operator_array},$response->{user_group},$response->{user_tour}) = $jsc->loop_sharees($q,$auth,$aowner); }else{ + ($aowner,my $return_merchant) = $apif->fetch_merchant($q,\%varenv,$coo,$q->param('merchant_id')); + $varenv{merchant_id} = $return_merchant->{merchant_id}; + my ($auth,$authraw) = $apif->auth_verify($q); $response = { %$response, %$auth }; - my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,$authraw,""); - ($response->{stations},my $stations_allraw) = $apif->stations_all($q,$bikes_on_station,$authraw); + my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,\%varenv,$authraw,""); + ($response->{stations},my $stations_allraw) = $apif->stations_all($q,\%varenv,$bikes_on_station,$authraw); } } @@ -617,7 +623,7 @@ elsif($q->param('request') eq "stations_available"){ }else{ my ($auth,$authraw) = $apif->auth_verify($q); $response = { %$response, %$auth }; - ($response->{stations}, my $response_raw) = $apif->stations_available($q,$authraw); + ($response->{stations}, my $response_raw) = $apif->stations_available($q,\%varenv,$authraw); } } @@ -728,14 +734,14 @@ elsif($q->param('request') eq "service_done"){ if(($q->param('work_id') eq "int04" || $q->param('work_id') eq "station") && looks_like_number($bike_id) && ($q->param('work_val') || looks_like_number($q->param('work_val')))){ $q->param(-name=>'work_id',-value=>"int04") if($q->param('work_id') eq "station");#station db-field is int04 my $to_station_id = $1 if($q->param('work_val') =~ /(\d+)/); - my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,$authraw,""); + my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,\%varenv,$authraw,""); #add-on to log redistribute#TODO dedicated db-fieled my $action = "txt10=" . $oprefix . $bikes_allraw->{$bike_id}->{int04} . " - " . $q->param('work_val'); $apif->service_update($q,$authraw,$node_template,$service_id,$action); - my ($stations_all,$stations_allraw) = $apif->stations_all($q,$bikes_on_station,$authraw); + my ($stations_all,$stations_allraw) = $apif->stations_all($q,\%varenv,$bikes_on_station,$authraw); if(looks_like_number($stations_allraw->{$to_station_id}->{int04})){ ($xresponse->{$article}, $responseraw, $node_template, $crecord) = $apif->service_select($q,$authraw,"","1"); my $update_hash = { int04 => "$to_station_id" }; @@ -766,14 +772,14 @@ elsif($q->param('request') eq "service_done"){ my $response_work = {}; my $node = {}; - my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,$authraw,""); + my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,\%varenv,$authraw,""); if(looks_like_number($bike_id)){ (my $xresponse, my $pos_record, my $node_template, my $crecord) = $apif->service_select($q,$authraw,"","100");#check interval ($response_work, $node) = $apif->service_work($pos_record,$bikes_allraw,"",$node_template); } elsif(looks_like_number($station_id)){ - my ($stations_all,$stations_allraw) = $apif->stations_all($q,$bikes_on_station,$authraw); + my ($stations_all,$stations_allraw) = $apif->stations_all($q,\%varenv,$bikes_on_station,$authraw); (my $xresponse, my $pos_record, my $node_template, my $crecord) = $apif->service_select($q,$authraw,"","100");#check interval ($response_work, $node) = $apif->service_work($pos_record,$stations_allraw,"",$node_template); @@ -814,7 +820,7 @@ elsif($q->param('request') eq "service_work"){ $history = $q->param('history') if(looks_like_number($q->param('history'))); if(ref($auth) eq "HASH" && $auth->{authcookie}){ if(looks_like_number($bike_id)){ - my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,$authraw,""); + my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,\%varenv,$authraw,""); (my $xresponse, my $pos_record, my $node_template, my $crecord) = $apif->service_select($q,$authraw,"",$history); #$bw->log("service_work bike_id $bike_id pos_record",$pos_record,""); @@ -829,7 +835,7 @@ elsif($q->param('request') eq "service_work"){ } $response = { %$response, %$op_response_work, %$auth }; }elsif($q->param('bike') && $q->param('bike') eq "all"){ - my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,$authraw,""); + my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,\%varenv,$authraw,""); my $bike = $q->param('bike'); (my $xresponse, my $pos_record, my $node_template, my $crecord) = $apif->service_select($q,$authraw,"",$history); (my $response_work, $node) = $apif->service_work($pos_record,$bikes_allraw,$history,$node_template); @@ -842,8 +848,8 @@ elsif($q->param('request') eq "service_work"){ } $response = { %$response, %$op_response_work, %$auth }; }elsif(looks_like_number($station_id)){ - my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,$authraw,""); - my ($stations_all,$stations_allraw) = $apif->stations_all($q,$bikes_on_station,$authraw); + my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,\%varenv,$authraw,""); + my ($stations_all,$stations_allraw) = $apif->stations_all($q,\%varenv,$bikes_on_station,$authraw); (my $xresponse, my $pos_record, my $node_template, my $crecord) = $apif->service_select($q,$authraw,"",$history); (my $response_work, $node) = $apif->service_work($pos_record,$stations_allraw,$history,$node_template); if(ref($response_work) ne "HASH"){#if fails @@ -855,8 +861,8 @@ elsif($q->param('request') eq "service_work"){ } $response = { %$response, %$op_response_work, %$auth }; }elsif($q->param('station') && $q->param('station') eq "all"){ - my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,$authraw,""); - my ($stations_all,$stations_allraw) = $apif->stations_all($q,$bikes_on_station,$authraw); + my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,\%varenv,$authraw,""); + my ($stations_all,$stations_allraw) = $apif->stations_all($q,\%varenv,$bikes_on_station,$authraw); my $station = $q->param('station'); (my $xresponse, my $pos_record, my $node_template, my $crecord) = $apif->service_select($q,$authraw,"",$history); (my $response_work, $node) = $apif->service_work($pos_record,$stations_allraw,$history,$node_template); diff --git a/copri4/main/src/Mod/APIvelo.pm b/copri4/main/src/Mod/APIvelo.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Mod/APIxmlserver.pm b/copri4/main/src/Mod/APIxmlserver.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Mod/Basework.pm b/copri4/main/src/Mod/Basework.pm old mode 100644 new mode 100755 index e3f2c80..ea2684c --- a/copri4/main/src/Mod/Basework.pm +++ b/copri4/main/src/Mod/Basework.pm @@ -37,7 +37,8 @@ sub log { $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime; my $logfile = "/var/log/copri4/$varenv{syshost}-process.log"; - if($varenv{debug}){ + #if($varenv{debug}){ + if(1==1){ warn "$what" . "\n" . Dumper($message) . "\n";#to apache2/error.log #2021-07-21 disabled. error.log is enough diff --git a/copri4/main/src/Mod/Buttons.pm b/copri4/main/src/Mod/Buttons.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Mod/Callib.pm b/copri4/main/src/Mod/Callib.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Mod/DBtank.pm b/copri4/main/src/Mod/DBtank.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Mod/Failure.pm b/copri4/main/src/Mod/Failure.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Mod/FileOut.pm b/copri4/main/src/Mod/FileOut.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Mod/Indexsharee.pm b/copri4/main/src/Mod/Indexsharee.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Mod/KMLout.pm b/copri4/main/src/Mod/KMLout.pm old mode 100644 new mode 100755 index 176b411..10d9bfc --- a/copri4/main/src/Mod/KMLout.pm +++ b/copri4/main/src/Mod/KMLout.pm @@ -62,6 +62,7 @@ sub kmlGenerator { my $authcookie = shift || { authcookie => '' }; my $varenv = shift; my $users_sharee = shift || { c_id => 0 }; + $users_sharee->{c_id} = "0" if(!$users_sharee->{c_id}); my $q = new CGI; my $dbt = new DBtank; @@ -76,6 +77,7 @@ sub kmlGenerator { my $project = "all"; $project = $dbt->{website}->{$varenv->{syshost}}->{project} if($dbt->{website}->{$varenv->{syshost}}->{project}); $project = $dbt->{operator}->{$varenv->{dbname}}->{project} if($dbt->{operator}->{$varenv->{dbname}}->{project}); + #print "$project | $varenv->{syshost} | $users_sharee->{c_id} | $authcookie->{authcookie}"; my $timestamp = strftime "%Y%m%d%H%M%S", localtime; my $kmlfile = "sharee-$timestamp-$users_sharee->{c_id}.kml"; diff --git a/copri4/main/src/Mod/Libenz.pm b/copri4/main/src/Mod/Libenz.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Mod/Libenzdb.pm b/copri4/main/src/Mod/Libenzdb.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Mod/MailTransport.pm b/copri4/main/src/Mod/MailTransport.pm old mode 100644 new mode 100755 index ad5db61..7af31be --- a/copri4/main/src/Mod/MailTransport.pm +++ b/copri4/main/src/Mod/MailTransport.pm @@ -81,7 +81,7 @@ sub send_mail(){ port => 465, sasl_username => "$mailxconf{mailx}->{sasl_username}", sasl_password => "$mailxconf{mailx}->{sasl_password}", - helo => "$dbt->{primary}->{sharee_primary}->{live_hostname}", + helo => "$dbt->{copri_conf}->{stage}", debug => 0, ); diff --git a/copri4/main/src/Mod/Modalbox.pm b/copri4/main/src/Mod/Modalbox.pm old mode 100644 new mode 100755 index b5e6858..3ea3dd7 --- a/copri4/main/src/Mod/Modalbox.pm +++ b/copri4/main/src/Mod/Modalbox.pm @@ -78,7 +78,7 @@ print<updater("contentadr","1","1","txt11","$pwmd5","$owner","txt08","ilike","$email"); + $bw->log("$varenv{basedir}/src/Mod/newsletter_tink.pl",$email,""); system(`$varenv{basedir}/src/Mod/newsletter_tink.pl "$varenv{basedir}" "$varenv{wwwhost}" "send_password" "$email" "$coo"`); } diff --git a/copri4/main/src/Mod/ajax_json.pm b/copri4/main/src/Mod/ajax_json.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Mod/ajax_post.pm b/copri4/main/src/Mod/ajax_post.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Mod/newsletter_tink.pl b/copri4/main/src/Mod/newsletter_tink.pl old mode 100644 new mode 100755 index 2415e25..a15d1d6 --- a/copri4/main/src/Mod/newsletter_tink.pl +++ b/copri4/main/src/Mod/newsletter_tink.pl @@ -197,8 +197,8 @@ sub esender_success { #Ack digest my $ack_digest = $q->unescapeHTML($ctadr->{txt34}) || ""; - my $email_ack_digest = $1 if($ack_digest =~ /^(\w{5})/); - my $sms_ack_digest = $1 if($ack_digest =~ /(\w{5})$/); + my $email_ack_digest = $1 if($ack_digest =~ /^(.{5})/); + my $sms_ack_digest = $1 if($ack_digest =~ /(.{5})$/); #disabled because of payone payment #my $iban = $q->unescapeHTML($ctadr->{txt22}); @@ -267,7 +267,7 @@ EOF my $subject = "$varenv{title} Anmeldebestätigung"; - if($hostname ne "$varenv{live_hostname}"){ + if($hostname ne "ginger"){ $email = $mailxconf{mailx}->{mail_testto}; $subject .= "* offline Test *"; } @@ -365,7 +365,7 @@ EOF my $subject = "$varenv{title} Passwort vergessen"; - if($hostname ne "$varenv{live_hostname}"){ + if($hostname ne "ginger"){ $email = $mailxconf{mailx}->{mail_testto}; $subject .= "* offline Test *"; } @@ -531,7 +531,7 @@ $body =~ s/\n/
/g; #----------------------------------------------------------------- - if($hostname ne "$varenv{live_hostname}"){ + if($hostname ne "ginger"){ $email = $mailxconf{mailx}->{mail_testto}; $subject .= "* offline Test *"; } diff --git a/copri4/main/src/Tpl/APIdialog.pm b/copri4/main/src/Tpl/APIdialog.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Tpl/Address3.pm b/copri4/main/src/Tpl/Address3.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Tpl/AttributEdit.pm b/copri4/main/src/Tpl/AttributEdit.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Tpl/AttributMatrix.pm b/copri4/main/src/Tpl/AttributMatrix.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Tpl/BaseEdit.pm b/copri4/main/src/Tpl/BaseEdit.pm old mode 100644 new mode 100755 index bad5018..4c0b4a9 --- a/copri4/main/src/Tpl/BaseEdit.pm +++ b/copri4/main/src/Tpl/BaseEdit.pm @@ -600,8 +600,8 @@ EOF print $q->div($but->singlesubmit7("$edit","$save_key","$ib{$save_key}","margin:10px 20px;")),"\n"; my $debug = ""; - #$debug = "(ct_table: $node_meta->{ct_table} | main_id: $node_meta->{main_id} | c_id: $ctrel->{c_id} | tpl_id: $tpl->{tpl_id} | rel_id: $ctrel->{rel_id})"; - print $q->div({-style=>'z-index:10;font-size:13px;'},"$debug"),"\n" if($users_dms->{u_id} eq $varenv{superu_id}); + $debug = "(ct_table: $node_meta->{ct_table} | main_id: $node_meta->{main_id} | c_id: $ctrel->{c_id} | tpl_id: $tpl->{tpl_id} | rel_id: $ctrel->{rel_id})"; + print $q->div({-style=>'z-index:10;font-size:13px;'},"$debug"),"\n" if($users_dms->{u_id} == $dbt->{copri_conf}->{superu_id}); print ""; } diff --git a/copri4/main/src/Tpl/Calorin.pm b/copri4/main/src/Tpl/Calorin.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Tpl/Karte.pm b/copri4/main/src/Tpl/Karte.pm old mode 100644 new mode 100755 index 6a3b9fb..e7005f5 --- a/copri4/main/src/Tpl/Karte.pm +++ b/copri4/main/src/Tpl/Karte.pm @@ -36,20 +36,30 @@ sub tpl(){ my %apikeyconf = $aconf->getall; #print $apikeyconf{googlemap}->{google_key}; - my $initMap = $dbt->{website}->{$varenv->{syshost}}->{initMap}; - $initMap = $dbt->{operator}->{$varenv->{dbname}}->{initMap} if($dbt->{operator}->{$varenv->{dbname}}->{initMap}); - $initMap = $dbt->{primary}->{$varenv->{dbname}}->{initMap} if($dbt->{primary}->{$varenv->{dbname}}->{initMap}); - $initMap =~ s/\s//g; - my ($lat,$lng) = split(/,/,$initMap); - my $api_return = { authcookie => '' }; my $coo = $q->cookie(-name=>'domcookie') || $R::sessionid; ($api_return,$users_sharee) = $apif->auth_verify($q,$coo,""); + my $initMap = $dbt->{website}->{$varenv->{syshost}}->{initMap}; + + if($dbt->{website}->{$varenv->{syshost}}->{merchant_id}){ + $api_return->{authcookie} = $dbt->{website}->{$varenv->{syshost}}->{merchant_id} if(!$api_return->{authcookie}); + }elsif($dbt->{operator}->{$varenv->{dbname}}->{merchant_id}){ + $api_return->{authcookie} = $dbt->{operator}->{$varenv->{dbname}}->{merchant_id} if(!$api_return->{authcookie}); + $initMap = $dbt->{operator}->{$varenv->{dbname}}->{initMap}; + }elsif($dbt->{primary}->{$varenv->{dbname}}->{merchant_id}){ + $api_return->{authcookie} = $dbt->{primary}->{$varenv->{dbname}}->{merchant_id} if(!$api_return->{authcookie}); + $initMap = $dbt->{primary}->{$varenv->{dbname}}->{initMap}; + } + + $users_sharee->{c_id} = "0" if(!$users_sharee->{c_id}); + $initMap =~ s/\s//g; + my ($lat,$lng) = split(/,/,$initMap); + require "Mod/KMLout.pm"; my $kmlfile = Mod::KMLout::kmlGenerator($api_return,$varenv,$users_sharee); - print "
\n"; + print "$initMap|$varenv->{dbname}|$api_return->{authcookie}|$users_sharee->{c_id}|$kmlfile" if($users_dms->{u_id} == $dbt->{copri_conf}->{superu_id}); print "
\n"; diff --git a/copri4/main/src/Tpl/Liste3.pm b/copri4/main/src/Tpl/Liste3.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Tpl/MandantConf.pm b/copri4/main/src/Tpl/MandantConf.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Tpl/SubListe.pm b/copri4/main/src/Tpl/SubListe.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/Tpl/TransPositionen.pm b/copri4/main/src/Tpl/TransPositionen.pm old mode 100644 new mode 100755 diff --git a/copri4/main/src/scripts/Ilockauth.class b/copri4/main/src/scripts/Ilockauth.class old mode 100644 new mode 100755 diff --git a/copri4/main/src/scripts/Ilockauth.java b/copri4/main/src/scripts/Ilockauth.java old mode 100644 new mode 100755 diff --git a/copri4/main/src/scripts/Ilockit_cloud.pl b/copri4/main/src/scripts/Ilockit_cloud.pl index d77bfa2..abedaed 100755 --- a/copri4/main/src/scripts/Ilockit_cloud.pl +++ b/copri4/main/src/scripts/Ilockit_cloud.pl @@ -21,7 +21,7 @@ BEGIN { $syshost = $ARGV[0] || die; } -use lib "/var/www/copri4/$syshost/src"; +use lib "/var/www/copri-bike/$syshost/src"; use strict; use warnings; use POSIX; diff --git a/copri4/main/src/scripts/Ilockit_trackingcloud.pl b/copri4/main/src/scripts/Ilockit_trackingcloud.pl index 6978f27..36061ab 100755 --- a/copri4/main/src/scripts/Ilockit_trackingcloud.pl +++ b/copri4/main/src/scripts/Ilockit_trackingcloud.pl @@ -23,7 +23,7 @@ BEGIN { $syshost = $ARGV[0] || die; } -use lib "/var/www/copri4/$syshost/src"; +use lib "/var/www/copri-bike/$syshost/src"; use strict; use warnings; use POSIX; diff --git a/copri4/main/src/scripts/Ilockkeygen.class b/copri4/main/src/scripts/Ilockkeygen.class old mode 100644 new mode 100755 diff --git a/copri4/main/src/scripts/Ilockkeygen.java b/copri4/main/src/scripts/Ilockkeygen.java old mode 100644 new mode 100755 diff --git a/copri4/main/src/scripts/newsletter_post.pl b/copri4/main/src/scripts/newsletter_post.pl index 45185cb..ac343e4 100755 --- a/copri4/main/src/scripts/newsletter_post.pl +++ b/copri4/main/src/scripts/newsletter_post.pl @@ -13,7 +13,7 @@ use vars qw($syshost); BEGIN { $syshost = $ARGV[0] || exit 1; } -use lib "/var/www/copri4/$syshost/src"; +use lib "/var/www/copri-bike/$syshost/src"; use strict; @@ -105,7 +105,7 @@ sub transport { $smtp->auth($varenv->{sasl_username},$varenv->{sasl_password}); $smtp->mail($varenv->{mail_from}); - if($hostname ne "$varenv->{live_hostname}"){ + if($hostname ne "ginger"){ $mail_to = $varenv->{mail_testto}; $subject .= "* offline Test *"; } diff --git a/copri4/main/src/scripts/payone_post_Payment.pl b/copri4/main/src/scripts/payone_post_Payment.pl index e520a6d..165b9b0 100755 --- a/copri4/main/src/scripts/payone_post_Payment.pl +++ b/copri4/main/src/scripts/payone_post_Payment.pl @@ -16,7 +16,7 @@ BEGIN { $syshost = $ARGV[0] || die 'syshost not defined'; } -use lib "/var/www/copri4/$syshost/src"; +use lib "/var/www/copri-bike/$syshost/src"; use strict; use warnings; diff --git a/copri4/main/src/scripts/requested_timeout.pl b/copri4/main/src/scripts/requested_timeout.pl index 8207c0b..17991d1 100755 --- a/copri4/main/src/scripts/requested_timeout.pl +++ b/copri4/main/src/scripts/requested_timeout.pl @@ -13,7 +13,7 @@ BEGIN { $syshost = $ARGV[0] || die; } -use lib "/var/www/copri4/$syshost/src"; +use lib "/var/www/copri-bike/$syshost/src"; use strict; use warnings; diff --git a/copri4/main/src/scripts/velofaktur_client.pl b/copri4/main/src/scripts/velofaktur_client.pl index 0cb5d4b..0165585 100755 --- a/copri4/main/src/scripts/velofaktur_client.pl +++ b/copri4/main/src/scripts/velofaktur_client.pl @@ -19,7 +19,7 @@ BEGIN { $syshost = $ARGV[0] || die; } -use lib "/var/www/copri4/$syshost/src"; +use lib "/var/www/copri-bike/$syshost/src"; use strict; use warnings; use POSIX; diff --git a/copri4/mkaccess.sh b/copri4/mkaccess.sh index 1332c96..3d21c46 100755 --- a/copri4/mkaccess.sh +++ b/copri4/mkaccess.sh @@ -18,6 +18,7 @@ for i in $(find . -type d -and -name apk); do chmod -R ug+rwx $i;done for i in $(find . -type d -and -name sql); do chmod -R go-rwx $i;done for i in $(find . -type d -and -name src); do chmod -R go-w $i;done +for i in $(find . -type d -and -name src); do chmod -R ug+x $i;done for i in $(find . -type d -and -name img); do chmod -R go-w $i;done for i in $(find . -type d -and -name apache); do chmod -R go-w $i;done for i in $(find . -type d -and -name css); do chmod -R go-w $i;done diff --git a/copri4/shareeapp-operator/src/Lib/Config.pm b/copri4/shareeapp-operator/src/Lib/Config.pm old mode 100644 new mode 100755 index 2672b85..8ca8cb3 --- a/copri4/shareeapp-operator/src/Lib/Config.pm +++ b/copri4/shareeapp-operator/src/Lib/Config.pm @@ -67,8 +67,8 @@ sub envonline(){ pdfinvoice => "$basedir/pdfinvoice", data => "$basedir/data", xmlfile => "$basedir/xml", - ftp_getfile => "ftp/SWK_codes/got_last.csv", - ftp_putfile => "ftp/SWK_return/konrad_code_protokoll.csv", + Anrede => "Anrede,Frau,Herr,Firma", + Einheit => "Stück,Paar,Satz,Meter,Liter", head_logo => "", barcode => "", printer => "PDF" diff --git a/copri4/shareeapp-operator/src/Lib/Mlogic.pm b/copri4/shareeapp-operator/src/Lib/Mlogic.pm old mode 100644 new mode 100755 diff --git a/copri4/shareeapp-operator/src/Tpl/AccountSubmenu.pm b/copri4/shareeapp-operator/src/Tpl/AccountSubmenu.pm old mode 100644 new mode 100755 diff --git a/copri4/shareeapp-operator/src/Tpl/Anmelden.pm b/copri4/shareeapp-operator/src/Tpl/Anmelden.pm old mode 100644 new mode 100755 index 389629c..5e28ac8 --- a/copri4/shareeapp-operator/src/Tpl/Anmelden.pm +++ b/copri4/shareeapp-operator/src/Tpl/Anmelden.pm @@ -130,11 +130,11 @@ sub tpl(){ }elsif(!$R::password_forgotten){ if($R::conflict_failure){ print $q->div({-class=>'content2',-style=>'color:#c83434'},"Registrierungsfehler!"),"\n"; - print $q->div({-class=>'content2'}, "Die Registrierung wurde abgebrochen weil bereits ein Account mit Ihrer e-Mail oder Telefonnr. existiert. Bitte kontaktieren Sie uns falls hier ein Missbrauch vorliegt. Falls Sie ein neues Passwort benötigen drücken Sie bitte:"),"\n"; - print $q->div({-style=>'margin-top:1em;'},$q->a({-class=>"", -style=>"color:#$bgcolor1;font-size:1.1em;text-decoration:underline;", -role=>"button", -href=>"$varenv->{wwwhost}/$varenv->{mandant}/Account"}, "Passwort vergessen?")),"\n"; + print $q->div({-class=>'content2'}, "Die Registrierung wurde abgebrochen. Melden Sie sich mit ihrer E-Mail und Passwort erneut an, wenn Sie das Registrierungsformular vervollständigen oder korrigieren wollen. Falls Sie ein neues Passwort benötigen, fordern Sie diesen hier an:"),"\n"; + print $q->div({-style=>'margin-top:1em;'},$q->a({-class=>"", -style=>"color:#$bgcolor1;font-size:1.1em;text-decoration:underline;", -role=>"button", -href=>"$varenv->{wwwhost}/$varenv->{mandant}/Account"}, "Neues Passwort anfordern")),"\n"; } print $q->div({-class=>'content2'}, "Dein Zugang zum Lastenradmietsystem"),"\n"; - print $q->div({-style=>'color:#c83434'},"Login verweigert. ",$q->a({-class=>"", -style=>"color:gray;", -role=>"button", -href=>"$varenv->{wwwhost}/$varenv->{mandant}/Account"}, "Passwort vergessen?")),"\n" if($R::failure); + print $q->div({-style=>'color:#c83434'},"Login verweigert. ",$q->a({-class=>"", -style=>"color:gray;", -role=>"button", -href=>"$varenv->{wwwhost}/$varenv->{mandant}/Account"}, "Neues Passwort anfordern")),"\n" if($R::failure); print $q->div({-style=>'color:#c83434'},"Login verweigert. "),"\n" if($R::basicauthfailure); print $q->label({-for=>'Email'},""),"\n"; print $q->textfield(-class=>'form-control', -name=>'user_id', -value=>'', -override=>1, -type=>'email',-class=>'form-control', -id=>'Email', -placeholder=>'E-Mail Adresse', -required=>1, -autofocus=>1),"\n"; @@ -151,7 +151,7 @@ sub tpl(){ print $q->div({-style=>'margin-top:1em;'},$q->a({-class=>"btn btn-default btn-lg btn-block", -style=>"color:#$bgcolor1;", -role=>"button", -href=>"$varenv->{wwwhost}/$varenv->{mandant}/Account/$varenv->{accounting_1}"}, "Registrieren")),"\n"; print $q->div({-class=>'content2'}, "Zur Information! Falls Sie bereits einen \"konrad\" oder \"TINK\" Account besitzen, können Sie mit Ihren bestehendem Account die Nutzung beider Mietradsysteme einstellen! Einfach dazu die entsprechende AGB bestätigen."),"\n" if($varenv->{wwwhost} =~ /tink|konrad/); - print $q->div({-style=>'margin-top:1em;'},$q->a({-class=>"", -style=>"color:#$bgcolor1;font-size:1.1em;text-decoration:underline;", -role=>"button", -href=>"$varenv->{wwwhost}/$varenv->{mandant}/Account"}, "Passwort vergessen?")),"\n"; + print $q->div({-style=>'margin-top:1em;'},$q->a({-class=>"", -style=>"color:#$bgcolor1;font-size:1.1em;text-decoration:underline;", -role=>"button", -href=>"$varenv->{wwwhost}/$varenv->{mandant}/Account"}, "Neues Passwort anfordern")),"\n"; } print "
\n"; diff --git a/copri4/shareeapp-operator/src/Tpl/Contact.pm b/copri4/shareeapp-operator/src/Tpl/Contact.pm old mode 100644 new mode 100755 diff --git a/copri4/shareeapp-operator/src/Tpl/FormEdit.pm b/copri4/shareeapp-operator/src/Tpl/FormEdit.pm old mode 100644 new mode 100755 index 52864e5..c861753 --- a/copri4/shareeapp-operator/src/Tpl/FormEdit.pm +++ b/copri4/shareeapp-operator/src/Tpl/FormEdit.pm @@ -68,8 +68,6 @@ sub tpl(){ } my $bgcolor1 = "009899";#sharee - #my $bgcolor1 = "e2001a"; - $bgcolor1 = $dbt->{website}->{$varenv->{syshost}}->{bgcolor1} if($dbt->{website}->{$varenv->{syshost}}->{bgcolor1}); $bgcolor1 = $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{bgcolor1} if($dbt->{merchant_ids}->{$varenv->{merchant_id}}->{bgcolor1}); @@ -199,7 +197,7 @@ EOF }elsif((!$ctrel->{int04} || !$ctrel->{int13}) && ($tpl_id =~ /^2$|302004/) && ($path =~ /$varenv->{accounting_3}/)){ if(1==1){ $debug_message = "(!$ctrel->{int04} || !$ctrel->{int13}) && $tpl_id" if($debug); - print $q->div({-class=>'content_title3',-style=>'clear:both;'}, "Fasst geschafft $debug_message"),"\n"; + print $q->div({-class=>'content_title3',-style=>'clear:both;'}, "Fast geschafft $debug_message"),"\n"; print $q->div({-class=>'content2'}, "Es wurden Bestätigungs-Codes an Ihre e-Mail Adresse und per SMS an Ihre Telefonnr. versandt. Nach erfolgreicher Bestätigung können Sie unsere Mieträder nutzen. Bitte beachten Sie die Anweisungen."),"\n"; #}else{ #print $q->div({-class=>'content1',-style=>'padding-top:1em;clear:both;'}, "E-Mail Bestätigung"),"\n"; @@ -500,7 +498,7 @@ Weitere Personen aus Ihrem Haushalt profitieren jedoch ebenfalls, falls Sie weit $autofocus = "autofocus"; $label_des = "Bitte \"$des\" Angabe korrigieren"; $label_des = "Für das \"$des\" liegt ein Fehler vor." if($key eq "txt04"); - $label_des = "Bitte SMS Telefon Nr. mit Ländercode, Beispiel: +49 170 12345678" if($key eq "txt07"); + $label_des = "Bitte mobile Telefon Nr. mit Ländervorwahl, Beispiel: +49 170 12345678" if($key eq "txt07"); $label_des = "Die Bonusnummer ist leider nicht vorhanden. Bei nicht vorhandener Nummer das Feld bitte leer lassen." if($key =~ /txt15/); } #if($R::success eq $key){ @@ -575,13 +573,10 @@ Weitere Personen aus Ihrem Haushalt profitieren jedoch ebenfalls, falls Sie weit if($key =~ /int03/){ - print $q->div({-class=>'content2'}, " - Es werden die Kreditkartendaten von VISA und MasterCard akzeptiert.
- Die Beträge für die Leihvorgänge werden gesammelt und i.d.R. wöchentlich eingezogen. D.h. der Belastungszeitpunkt bei Bankeinzeig oder via Karte findet in den darauffolgenden Tagen statt.
- Gutschriften werden verrechnet und Ihrem Konto gutgeschrieben.
- Die Datenübetragung findet per SSL-Verschlüsselung statt.
- Nach erfolgreicher Anmeldung können Sie unter Ihren Verleihdaten die Leihrad Buchungen und Rechnungen jederzeit einsehen. - + print $q->div({-class=>'content2'}, " + Wählen Sie Ihre Zahlungsart aus.
+ Das Abbuchungsverfahren (Erteilung eines SEPA Mandats) kann nur mit einem Girokonto in Deutschland erfolgen (IBAN beginnt mit DE). Es werden nur folgende Kreditkarten akzeptiert: VISA und MasterCard.
+ Die Nutzungsgebühren werden gesammelt i.d.R. wöchentlich mit dem Verwendungszweck „Mietrad“ von unserem Zahlungsdienstleister payone eingezogen. "),"\n"; my $incasso="1"; @@ -590,8 +585,8 @@ Weitere Personen aus Ihrem Haushalt profitieren jedoch ebenfalls, falls Sie weit my $checked_creditcard; $checked_incasso=1 if($ctrel->{$key} == 1 || $ctrel->{$key} == 3); $checked_creditcard=2 if($ctrel->{$key} == 2); - print $q->div({ -class=>'radio', -style=>'padding-top:20px;' },$but->radiobox_vertical("$key","$incasso","$checked_incasso",$q->img({-id=>"pic-payment" ,-style=>'height:50px;',-src=>"$varenv->{metahost}/img/payment-incasso2.png"}))),"\n"; - print $q->div({ -class=>'radio', -style=>'padding-bottom:20px;' },$but->radiobox_vertical("$key","$creditcard","$checked_creditcard",$q->img({-id=>"pic-payment" ,-style=>'height:30px;', -src=>"$varenv->{metahost}/img/payment-creditcard2.png"}))),"\n"; + print $q->div({ -class=>'radio', -style=>'padding-top:20px;' },$but->radiobox_vertical("$key","$incasso","$checked_incasso",$q->img({-id=>"pic-payment" ,-style=>'height:50px;', -title=>'Abbuchung',-src=>"$varenv->{metahost}/img/payment-incasso2.png"}))),"\n"; + print $q->div({ -class=>'radio', -style=>'padding-bottom:20px;' },$but->radiobox_vertical("$key","$creditcard","$checked_creditcard",$q->img({-id=>"pic-payment" ,-style=>'height:30px;', -title=>'Kreditkarte', -src=>"$varenv->{metahost}/img/payment-creditcard2.png"}))),"\n"; print $q->hidden(-name=>"$key",-override=>1,-value=>"null"); } } diff --git a/copri4/shareeapp-operator/src/Tpl/Listing.pm b/copri4/shareeapp-operator/src/Tpl/Listing.pm old mode 100644 new mode 100755 diff --git a/copri4/shareeapp-operator/src/Tpl/ModalboxDialog.pm b/copri4/shareeapp-operator/src/Tpl/ModalboxDialog.pm old mode 100644 new mode 100755 diff --git a/copri4/shareeapp-operator/src/Tpl/PayoneCCclient.pm b/copri4/shareeapp-operator/src/Tpl/PayoneCCclient.pm old mode 100644 new mode 100755 diff --git a/copri4/shareeapp-operator/src/Tpl/PayoneSEPA.pm b/copri4/shareeapp-operator/src/Tpl/PayoneSEPA.pm old mode 100644 new mode 100755 index 351a8f1..c420ec1 --- a/copri4/shareeapp-operator/src/Tpl/PayoneSEPA.pm +++ b/copri4/shareeapp-operator/src/Tpl/PayoneSEPA.pm @@ -50,13 +50,17 @@ sub tpl(){ $path = "$script" . "$path_info"; $script=""; } + my $dbh = ""; my $now_dt = strftime "%Y-%m-%d %H:%M", localtime; my @viewsel = split /\//,$1 if($path =~ /^\/(.*)/); + my $bgcolor1 = "009899";#sharee + $bgcolor1 = $dbt->{website}->{$varenv->{syshost}}->{bgcolor1} if($dbt->{website}->{$varenv->{syshost}}->{bgcolor1}); + $bgcolor1 = $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{bgcolor1} if($dbt->{merchant_ids}->{$varenv->{merchant_id}}->{bgcolor1}); my $coo = $q->cookie(-name=>'domcookie') || $R::sessionid; my $ctadr = $users_sharee if(ref($users_sharee) eq "HASH" && $users_sharee->{c_id}); - my $tpl = $dbt->get_tpl($tpl_id); + my $tpl = $dbt->get_tpl($dbh,$tpl_id); my @tpl_order = split /,/,$tpl->{tpl_order}; print $q->start_form(),"\n"; @@ -157,7 +161,7 @@ sub tpl(){ #-------------------- } - print $q->div({-style=>'margin-top:1em;'},""),"\n"; + print $q->div({-style=>'margin-top:1em;'},""),"\n"; print "\n"; diff --git a/copri4/shareeapp-operator/src/Tpl/PayoneSelect.pm b/copri4/shareeapp-operator/src/Tpl/PayoneSelect.pm old mode 100644 new mode 100755 index 23da31f..f187b21 --- a/copri4/shareeapp-operator/src/Tpl/PayoneSelect.pm +++ b/copri4/shareeapp-operator/src/Tpl/PayoneSelect.pm @@ -59,7 +59,6 @@ sub tpl(){ my @viewsel = split /\//,$1 if($path =~ /^\/(.*)/); my $ctrel = $users_sharee if(ref($users_sharee) eq "HASH" && $users_sharee->{c_id}); - my $ctt = $db->collect_content2("contenttrans","int10",$ctrel->{c_id}); my $tpl = $db->get_tpl($node_meta->{tpl_id}); print "
\n"; diff --git a/copri4/shareedms-operator/src/Lib/Config.pm b/copri4/shareedms-operator/src/Lib/Config.pm old mode 100644 new mode 100755 index a04a8e8..5d4b2f8 --- a/copri4/shareedms-operator/src/Lib/Config.pm +++ b/copri4/shareedms-operator/src/Lib/Config.pm @@ -63,8 +63,8 @@ sub envonline(){ pdf => "$basedir/pdf", data => "$basedir/data", xmlfile => "$basedir/xml", - ftp_getfile => "ftp/SWK_codes/got_last.csv", - ftp_putfile => "ftp/SWK_return/konrad_code_protokoll.csv", + Anrede => "Anrede,Frau,Herr,Firma", + Einheit => "Stück,Paar,Satz,Meter,Liter", map_activ => "", min_width => "1100", head_logo => "$metahost/img/sharee_bike_Logo.jpg", diff --git a/copri4/shareedms-operator/src/Lib/Mlogic.pm b/copri4/shareedms-operator/src/Lib/Mlogic.pm old mode 100644 new mode 100755 diff --git a/copri4/shareeweb-project/src/Lib/Config.pm b/copri4/shareeweb-project/src/Lib/Config.pm old mode 100644 new mode 100755 diff --git a/copri4/shareeweb-project/src/Lib/Mlogic.pm b/copri4/shareeweb-project/src/Lib/Mlogic.pm old mode 100644 new mode 100755