#contact plug in for the pe_pplog, 16.05.13 by efia #bugfix and added security question feature 23.11.13 if (r('process')eq 'contact'){ my $title = r('title'); my $author = r('name'); my $email = r('email'); my $message = r('content'); my $do = 1; if($title eq '' || $author eq '' || $message eq ''|| $email eq '') { print '
'.$locale{$lang}->{necessary}; $do = 0; } #check captcha if indicated if($config_commentsSecurityCode == 1) { my $code = r('code'); my $originalCode = r('originalCode'); unless($code eq $originalCode) { print '
'.$locale{$lang}->{captcha}; $do = 0; } } #check security question if indicated if($config_securityQuestionOnComments == 1) { my $question = r('question'); unless(lc($question) eq lc($config_commentsSecurityAnswer)) { print '
'.$locale{$lang}->{question}; $do = 0; } } if ($do ==1) { if ($config_sendMailWithNewCommentMail[0] eq "local"){ my $date = getdate($config_gmt); my @files = getFiles($config_DatabaseFolder."/emails"); my @lastOne = split(/¬/, $files[0]); my $i = 0; if($lastOne[4] eq '') { $i = sprintf("%05d",0); } else { $i = sprintf("%05d",$lastOne[4]+1); } open(FILE, ">$config_DatabaseFolder/emails/$i.$config_dbFilesExtension"); print FILE "$title¬$message¬$date¬$author'$email¬$i"; close FILE; print "
$locale{$lang}->{message} $author!"; } else{ open (MAIL,"|$config_sendMailWithNewCommentMail[0]") or die $locale{$lang}->{sendmail}; print MAIL "To: $config_sendMailWithNewCommentMail[1]\n"; print MAIL "From: $email, \t $author \n"; print MAIL "Subject: $title\n\n"; print MAIL "$message "; close(MAIL); print "
$locale{$lang}->{message} $author."; } } } print '

'.$locale{$lang}->{contactinfo}.'

'.$config_contactAddress.'

'.$locale{$lang}->{contactform}.'

'; if($config_commentsSecurityCode == 1) { my $code = ''; $code = uc(substr(crypt(rand(999999), $config_randomString),1,8)); $code =~ s/\.//; $code =~ s/\///; print ''; } print '' if $config_securityQuestionOnComments == 1; print'
'.$locale{$lang}->{csubject}.'
'.$locale{$lang}->{name}.'
'.$locale{$lang}->{email}.'
'.$locale{$lang}->{cmessage}.'
'.$locale{$lang}->{code}.' '.$code.'
'.$config_commentsSecurityQuestion.'
';