Sicherheitscode für E-Mail


german 5474
Schütze dein E-Mailformular vor unnötigem Missbrauch.
Finde in der contact_us.php Datei
  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
      $error = false;

Ersetze mit:

  $error = false;
  if (isset($_GET['action']) && ($_GET['action'] == 'send') && isset($_POST['formid']) && ($_POST['formid'] == $sessiontoken)) {

    // safetycode check
        $t = trim($_POST['verify']);
        if ($t == '') {
                $captcha_error = ENTER_THE_SAFETY_CODE;
                $error = true;
                $messageStack->add('create_account', $captcha_error);
        } else if (trim($_SESSION['thecode']) == '') {
                $captcha_error = NO_SAFETY_CODE;
                $error = true;
                $messageStack->add('create_account', $captcha_error);
        } else if ($_SESSION['thecode'] != strtoupper($t)) {
                $captcha_error = INVALID_SAFETY_CODE;
                $error = true;
                $messageStack->add('create_account', $captcha_error);
        }
        else
        { // safetycode -->

Finde:

      tep_redirect(tep_href_link('contact_us.php', 'action=success'));
    }
  }

Unterhalb einfügen:

} // --> safetycode end

Finde:

  <div class="buttonSet">
    <span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', null, 'primary'); ?></span>
  </div>

Ersetze mit:
Code for BS:

<div class="buttonSet">
<div class="col-sm-12" style="margin:12px;">
<label for="inputFromEmail" class="control-label col-sm-3"><?php echo SAFETY_CODE; ?>&nbsp;<?php echo '<font color="#990000" size="1px"><b><i class="fas fa-asterisk"></i></b></font>'; ?></label>
<span class="pull-right"><img class="pls_safety" src="image.php" width="70" height="32" alt="Please enter the values from this image" />&nbsp;
<input type="text" name="verify" size="7" maxlength="8" />&nbsp;<?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-send', null, 'primary', null, 'btn-success'); ?>
</span>
</div>
</div>

Code for: 2.3.4

<div class="buttonSet">
<div class="col-sm-12" style="margin:12px;">
<label for="inputFromEmail" class="control-label col-sm-3"><?php echo SAFETY_CODE; ?>&nbsp;<?php echo '<font color="#990000" size="1px"><b><i class="fas fa-asterisk"></i></b></font>'; ?></label>
<span class="pull-right"><img class="pls_safety" src="image.php" width="70" height="32" alt="Please enter the values from this image" />&nbsp;
<input type="text" name="verify" size="7" maxlength="8" />&nbsp;<?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', null, 'primary'); ?>
</span>
</div>
</div>

Füge hinzu in catalog/includes/languages/german.php

define('SAFETY_CODE', 'Bestätigungscode:');
define('ENTER_THE_SAFETY_CODE', 'Bitte geben Sie den Bestätigungscode ein!');
define('NO_SAFETY_CODE', 'Es wurde kein Bestätigungscode generiert!<br>Bitte geben Sie den Bestätigungscode noch einmal ein.');
define('INVALID_SAFETY_CODE', 'Ungültiger Bestätigungscode!');

Erstelle eine neue Datei mit dem Namen image.php und übertrage diese in dein Hauptverzeichnis.

<?php
include_once('includes/application_top.php');
function generate_verification() {
        srand((double)microtime()*1000000);
        $rand = rand(0,999999999);
        $thecode = substr(strtoupper(md5($rand)), 2, 5);
        $thecode = str_replace("O", "A", $thecode);
        $thecode = str_replace("0", "B", $thecode);
        $_SESSION['thecode'] = $thecode;
}

generate_verification();
header("Content-type: image/png");
$image = imagecreate(60,20);
$background_color = imagecolorallocate ($image, 255, 255, 255);
$textcolor = imagecolorallocate($image, 221, 0, 0);
imagestring($image,5,8,2,$_SESSION['thecode'],$textcolor);
imagepng($image);
imagedestroy($image);
tep_session_register('thecode');
?>
Warum Ihre E-Mailadresse ?
Bei Bedarf werde ich Sie kontaktieren um Ihnen mit der Umsetzung zu helfen.
Ihre E-Mailadresse wird nicht öffentlich gemacht.
Ist dieser Beitrag für Sie hilfreich ?
Es liegen noch keine Bewertungen vor.
Informationen(2)
Allgemeine Infos
 Kostenloser Werbeeintrag
 Lazy Loading
Beitragszähler
Momentaner Informationsstand:
Kategorien gesamt: 8
Beiträge gesamt: 104
Supportseiten gesamt: 54
Downloads für Mitglieder: 104
Download Zähler: 646
Bewertungen gesamt58
Firmenbewertungen: 26
Supportbewertungen: 25
Beitragswertungen: 7