Adding cms_alert option

This commit is contained in:
ragu 2023-04-05 07:41:11 +02:00
parent cc82e0856a
commit b7e6c91efd
13 changed files with 106 additions and 54 deletions

View file

@ -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"`);
}