mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-11 22:37:27 +02:00
Adding cms_alert option
This commit is contained in:
parent
cc82e0856a
commit
b7e6c91efd
13 changed files with 106 additions and 54 deletions
|
@ -14,6 +14,7 @@ use POSIX;
|
|||
use CGI; # only for debugging
|
||||
use JSON;
|
||||
use Digest::MD5 qw(md5 md5_hex);
|
||||
use Digest::SHA qw(sha256_base64);
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
use DateTime;
|
||||
use DateTime::Format::Pg;
|
||||
|
@ -3059,7 +3060,9 @@ sub authorization(){
|
|||
my $pass_name = $q->escapeHTML($user_pw);
|
||||
$pass_name =~ s/\s//g;
|
||||
my $pwmd5=md5_hex($pass_name);
|
||||
my $pwsha256=sha256_base64($pass_name);
|
||||
$authref->{txt11} = "$pwmd5";
|
||||
#$authref->{txt04} = "$pwsha256";#enable after migration
|
||||
|
||||
#Servicetool, only users with users.int09=1
|
||||
#shareetool
|
||||
|
|
|
@ -23,7 +23,6 @@ use Mod::DBtank;
|
|||
use Mod::Basework;
|
||||
use Mod::Shareework;
|
||||
use Mod::APIfunc;
|
||||
use Digest::MD5 qw(md5 md5_hex);
|
||||
use Data::Dumper;
|
||||
use Sys::Hostname;
|
||||
my $hostname = hostname;
|
||||
|
|
|
@ -1799,7 +1799,7 @@ sub search_json(){
|
|||
my $table = shift;
|
||||
my $search = shift || "";
|
||||
my $template_id = shift || "";
|
||||
my $c_id = shift || "";
|
||||
my $c_id = shift || 0;
|
||||
my $catch_equal = shift || 0;
|
||||
|
||||
my $sel = "1=2";
|
||||
|
|
|
@ -16,7 +16,6 @@ use DBI;
|
|||
use Apache2::RequestUtil ();
|
||||
use Apache2::RequestIO ();
|
||||
use Apache2::Const -compile => qw(OK);
|
||||
use Digest::MD5 qw(md5 md5_hex);
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
|
||||
use Lib::Config;
|
||||
|
@ -386,6 +385,8 @@ sub handler {
|
|||
if($users_dms->{u_id} && $users_dms->{int08} == 2){
|
||||
if($R::rel_edit eq "save_ctuser" && $R::main_id && $R::main_id >= 200000){
|
||||
$return = $pl->save_service_desc($q,$R::c_id,$users_dms);
|
||||
}elsif($R::rel_edit eq "save_user"){
|
||||
$feedb = $pl->save_content($q,$users_dms,$node_meta,$R::c_id) if(looks_like_number($R::c_id));
|
||||
}elsif($R::base_edit eq "new_contentcms" && $R::main_id && $R::main_id >= 200000){
|
||||
$feedb = $pl->new_content($q,$users_dms);
|
||||
}elsif($R::base_edit eq "save_contentcms" && $R::main_id && $R::main_id >= 200000){
|
||||
|
@ -402,7 +403,7 @@ sub handler {
|
|||
}
|
||||
|
||||
#DMS Faktura
|
||||
if($R::ct_trans && $node_meta->{ct_table} eq "contenttrans"){
|
||||
if($node_meta->{ct_table} eq "contenttrans"){
|
||||
$bw->log("DMS action from $users_dms->{u_id} on $node_meta->{ct_table}",$q,"");
|
||||
my $dbh_primary = $dbt->dbconnect_extern($dbt->{primary}->{sharee_primary}->{database}->{dbname});
|
||||
my $users_dms_primary = { u_id => 0 };
|
||||
|
|
|
@ -577,23 +577,26 @@ sub preinit(){
|
|||
|
||||
#SET state alias Zahlung buchen
|
||||
if($R::set_state && !$R::close_time){
|
||||
my $state = $R::state || "";
|
||||
|
||||
my $sum_paid = "null";
|
||||
my $sum_operatorcredit = "null";
|
||||
my $state = $R::state || "";
|
||||
$update_ctt->{state} = "$state";
|
||||
$update_ctt->{int14} = 2;#set OPOS
|
||||
|
||||
if($R::set_state eq "buchen" && $R::sum_paid){
|
||||
$sum_paid = $R::sum_paid;
|
||||
$sum_paid =~ s/,/\./;
|
||||
$update_ctt->{int01} = $sum_paid;
|
||||
}
|
||||
|
||||
my $sum_operatorcredit = "null";
|
||||
if($R::set_state eq "buchen" && $R::sum_operatorcredit){
|
||||
$sum_operatorcredit = $R::sum_operatorcredit;
|
||||
$sum_operatorcredit =~ s/,/\./;
|
||||
$update_ctt->{int02} = $sum_operatorcredit;
|
||||
$update_ctt->{int14} = "null";
|
||||
}
|
||||
|
||||
$update_ctt->{state} = "$state";
|
||||
$update_ctt->{int14} = 2;#set OPOS
|
||||
$u_rows += $dbt->update_record($dbh,$update_ctt,$ctt);
|
||||
|
||||
if($state =~ /payone/){
|
||||
|
|
|
@ -15,13 +15,14 @@ use CGI; # only for debugging
|
|||
use LWP::UserAgent;
|
||||
use URI::Encode;
|
||||
use JSON;
|
||||
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
use Lib::Config;
|
||||
use Mod::DBtank;
|
||||
use Mod::Basework;
|
||||
use Data::Dumper;
|
||||
|
||||
my $q = new CGI;
|
||||
my $cf = new Config;
|
||||
my $dbt = new DBtank;
|
||||
my $bw = new Basework;
|
||||
|
||||
|
@ -104,9 +105,10 @@ sub sms_ack_digest {
|
|||
sub sms_message {
|
||||
my $self = shift;
|
||||
my $todo = shift;
|
||||
my $hotline = shift;
|
||||
my $contact_hotline = shift;
|
||||
my $sms_to = shift;
|
||||
my $bike = shift;
|
||||
my %varenv = $cf->envonline();
|
||||
|
||||
my $sms_from = "Mietradinfo";
|
||||
my $sms_message = "";
|
||||
|
@ -126,18 +128,24 @@ sub sms_message {
|
|||
|
||||
#todo locking_progress
|
||||
if($todo eq "locking_progress"){
|
||||
$sms_message .= "Ihre Miete von $bike wurde nicht beendet! Ihre kostenpflichtige Miete läuft weiter! Stellen Sie sicher, dass das Schloss geschlossen ist. $hotline";
|
||||
$sms_message .= "Ihre Miete von $bike wurde nicht beendet! Ihre kostenpflichtige Miete läuft weiter! Stellen Sie sicher, dass das Schloss geschlossen ist. $contact_hotline";
|
||||
}
|
||||
|
||||
#todo if > 24h rental
|
||||
if($todo eq "24h_occupied"){
|
||||
$sms_message .= "Zur Info! Sie haben $bike seit 24 Stunden kostenpflichtig gemietet!. $hotline";
|
||||
$sms_message .= "Zur Info! Sie haben $bike seit 24 Stunden kostenpflichtig gemietet!. $contact_hotline";
|
||||
}
|
||||
if($todo eq "48h_occupied"){
|
||||
$sms_message .= "Zur Info! Sie haben $bike seit 48 Stunden kostenpflichtig gemietet!. $hotline";
|
||||
$sms_message .= "Zur Info! Sie haben $bike seit 48 Stunden kostenpflichtig gemietet!. $contact_hotline";
|
||||
}
|
||||
if($todo eq "72h_occupied"){
|
||||
$sms_message .= "Zur Info! Sie haben $bike seit 72 Stunden kostenpflichtig gemietet!. $hotline";
|
||||
$sms_message .= "Zur Info! Sie haben $bike seit 72 Stunden kostenpflichtig gemietet!. $contact_hotline";
|
||||
}
|
||||
|
||||
#todo send_alarm2hotline
|
||||
if($todo eq "send_alarm2hotline"){
|
||||
$sms_from = "RadAlarm";
|
||||
$sms_message .= "Diebstahlalarm $bike. Öffne das Alarmjournal für weitere Informationen: $dbt->{operator}->{$varenv{dbname}}->{operatorDMS}/DMS/Alarmjournal";
|
||||
}
|
||||
|
||||
#todo fraud_rental
|
||||
|
|
|
@ -17,7 +17,7 @@ use Mod::Buttons;
|
|||
use Lib::Config;
|
||||
use Mod::APIfunc;
|
||||
use Digest::MD5 qw(md5 md5_hex);
|
||||
use Digest::SHA qw(sha1_base64);
|
||||
use Digest::SHA qw(sha1_base64 sha256_base64);
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
use URI::Encode;
|
||||
use Mod::Prelib;
|
||||
|
@ -217,7 +217,9 @@ sub save_account(){
|
|||
$pw_dummy = "1";
|
||||
}elsif($valxx){
|
||||
my $pwmd5 = md5_hex($valxx);
|
||||
my $pwsha256=sha256_base64($valxx);
|
||||
$u_rows = $dbt->update_one($dbh,$update_primary,"txt11='$pwmd5'");
|
||||
$u_rows = $dbt->update_one($dbh,$update_primary,"txt04='$pwsha256'");
|
||||
}
|
||||
}
|
||||
#operators, only if saved by operator DMS
|
||||
|
@ -840,9 +842,11 @@ sub send_password(){
|
|||
$bw->log("$varenv{basedir}/src/Mod/newsletter_tink.pl",$email,"");
|
||||
|
||||
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){
|
||||
$db->updater("contentadr","1","1","txt11","$pwmd5","$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"`);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue