fixing some file links and creating standard dirs. Moving Service-Tour setup to DMS-Account

This commit is contained in:
ragu 2023-04-24 14:49:30 +02:00
parent d6292aa09d
commit bf83052322
51 changed files with 1275 additions and 436 deletions

View file

@ -217,7 +217,6 @@ sub save_account(){
$pw_dummy = "1";
}elsif(length($valxx) >= 8){
my $pwmd5 = md5_hex($valxx) || "";
$u_rows = $dbt->update_one($dbh,$update_primary,"txt11='$pwmd5'") if(length($pwmd5) > 20);
my $pwsha256=sha256_base64($pwmd5) || "";
$u_rows = $dbt->update_one($dbh,$update_primary,"txt04='$pwsha256'") if(length($pwsha256) > 20);
}
@ -244,12 +243,6 @@ sub save_account(){
elsif($_ =~ /int07|int16|int19|int23/){
$u_rows = $dbt->update_one("",$update_primary,"$_=$valxx");
}
#user_tour
elsif($_ =~ /txt18/){
my @txt18 = $q->param('txt18');
@txt18 = grep {!/null/} @txt18;
$u_rows = $dbt->update_one("",$update_primary,"$_='@txt18'");
}
#Text Sonstiges
elsif($_ =~ /txt29/){
$u_rows = $dbt->update_one("",$update_primary,"$_='$valxx'");
@ -580,76 +573,6 @@ sub save_account(){
return ($ret,$feedb);
}#end save_account
#insert/save/delete DMS users
sub manage_dmsusers {
my $self = shift;
my $q = shift;
my $varenv = shift;
my $base_edit = shift;
my $u_id = shift;
my $users_dms = shift || {};
my $owner = $users_dms->{u_id} || 0;
my $table = "users";
$q->import_names('R');
my @keywords = $q->param;
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
my $feedb = { message => "", i_rows => 0, u_rows => 0, d_rows => 0 };
$bw->log("manage_dmsusers",$q,"");
my $dbh = "";
my $adref = {
table => "contentadr",
fetch => "one",
template_id => "202",
c_id => "$u_id",
};
my $ctadr = $dbt->fetch_record($dbh,$adref);
#users have to be exist only if DMS activated
my $uref = {
table => "users",
fetch => "one",
u_id => "$u_id",
};
my $users = $dbt->fetch_tablerecord($dbh,$uref);
#datahash on update
my $dmsusers = {
table => "users",
mtime => "now()",
owner => "$owner",
u_id => "$u_id",
};
if(ref($users) eq "HASH" && $users->{u_id} && (!$ctadr->{c_id} || $base_edit eq "delete_dmsusers")){
$bw->log("delete DMS user from $varenv->{dbname}",$ctadr->{c_id},"");
$feedb->{d_rows} = $dbt->delete_content($dbh,"users",$u_id);
$dbt->update_one($dbh,$adref,"int07=null");
}elsif(ref($users) eq "HASH" && $users->{u_id} && $ctadr->{c_id} && $ctadr->{c_id} == $users->{u_id} && $base_edit eq "save_dmsusers"){
$bw->log("update DMS user to $varenv->{dbname}",$ctadr->{c_id},"");
foreach(@keywords){
my $val = $q->param($_);
my $valxx = $q->escapeHTML("$val");
$valxx =~ s/^\s+//; $valxx =~ s/\s+$//;
if($_ =~ /^int\d+/){
$valxx =~ s/,/./g;
#$valxx = "null" if(!looks_like_number($valxx));#empty
$valxx = 0 if(!looks_like_number($valxx));# set to 0 for using == operator
$feedb->{u_rows} = $dbt->update_one($dbh,$dmsusers,"$_=$valxx");
}
}
}elsif($ctadr->{c_id} && !$users->{u_id} && $base_edit eq "new_dmsusers"){
$bw->log("insert DMS user to $varenv->{dbname}",$ctadr->{c_id},"");
$feedb->{i_rows} = $dbt->insert_users($dbh,$ctadr->{c_id},$owner);
$dbt->update_one($dbh,$adref,"int07=100");
}
return $feedb;
}
#coupon alias Gutschein
sub save_transact(){
my $self = shift;
@ -846,7 +769,6 @@ sub send_password(){
my $pwmd5 = md5_hex($coo) || "";
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");
my $pwsha256=sha256_base64($pwmd5) || "";
$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"`);