Commit 48069a22 authored by fettesvieh's avatar fettesvieh

- some changes to the newsletter l10n files

- added the captcha to the newsletter
- renamed the offline.html and associated files to maintenance.* to clarify the meaning of this file
parent ca03fde4
<fieldset class="captcha">
<legend>{lang values="captcha|captcha"}</legend>
<img src="{uri args="captcha/image/hash_`$hash`"}" alt="" />
<div>
<input type="text" name="form[captcha]" id="captcha" value="" maxlength="5" style="width:auto;display:inline" />
<input type="hidden" name="form[hash]" value="{$hash}" class="checkbox" />
</div>
</fieldset>
<dl style="text-align:center">
<dt><img src="{uri args="captcha/image/hash_`$captcha.hash`"}" alt="" /></dt>
<dd>
<input type="text" name="form[captcha]" id="captcha" value="" maxlength="{$captcha.length}" style="width:auto;display:inline" />
<input type="hidden" name="form[hash]" value="{$captcha.hash}" class="checkbox" />
</dd>
</dl>
</fieldset>
\ No newline at end of file
/* Allgemeines */
* {
margin: 0;
padding: 0;
}
html, body {
line-height: 1.166;
}
body {
background: #fff;
font: 62.5% 'Lucida Grande', 'Trebuchet MS', Arial, sans-serif;
color: #333;
}
#maintenance {
width: 70%;
height: 40px;
margin: -20px auto;
padding: 0 20px;
background: #ffc;
border: 1px dotted #f00;
font-weight: bold;
font-size: 1.3em;
line-height: 40px;
text-align: center;
position: absolute;
top: 50%;
left: 15%;
}
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$lang}" lang="{$lang}">
<head>
<title>{$page_title}</title>
<meta name="description" content="{$description}" />
<meta name="keywords" content="{$keywords}" />
<link rel="stylesheet" type="text/css" href="{$design_path}maintenance.css" />
</head>
<body>
<div id="maintenance">
{$maintenance_msg}
</div>
</body>
</html>
\ No newline at end of file
......@@ -5,15 +5,14 @@
<dt><label for="mail">{lang values="common|email"}</label></dt>
<dd><input type="text" name="form[mail]" id="mail" maxlength="120" value="{$form.mail}" /></dd>
</dl>
{$captcha}
</fieldset>
<div>
{foreach from=$actions item="row"}
<label for="{$row.value}">
<input type="radio" name="action" id="{$row.value}" value="{$row.value}"{$row.checked} class="radio" />
<input type="radio" name="action" id="{$row.value}" value="{$row.value}"{$row.checked} class="checkbox" />
{$row.lang}
</label>
{/foreach}
</div>
<div class="form-bottom">
<input type="submit" name="submit" value="{lang values="common|submit"}" class="form" />
</div>
......
......@@ -116,7 +116,7 @@ fieldset fieldset {
margin-top: 5px;
}
fieldset fieldset.captcha {
width: 45%;
width: 35%;
}
.no-border {
border: 0;
......
......@@ -16,7 +16,9 @@ function captcha($captcha_length = 5)
{
global $tpl;
$tpl->assign('hash', base64_encode(salt($captcha_length)));
$captcha['hash'] = base64_encode(salt($captcha_length));
$captcha['length'] = $captcha_length;
$tpl->assign('captcha', $captcha);
return $tpl->fetch('common/captcha.html');
}
/**
......
......@@ -19,7 +19,7 @@ $tpl->assign('description', CONFIG_META_DESCRIPTION);
if (CONFIG_MAINTENANCE == '1' && defined('IN_ACP3')) {
$tpl->assign('maintenance_msg', CONFIG_MAINTENANCE_MSG);
$tpl->display('offline.html');
$tpl->display('maintenance.html');
} else {
$auth = new auth;
......
<?xml version="1.0" encoding="UTF-8"?>
<language>
<item>
<name>account_exists</name>
<message>Für die angegebene E-Mail-Adresse existiert bereits ein Newsletter-Konto</message>
</item>
<item>
<name>account_not_exists</name>
<message>Für die angegebene E-Mail-Adresse konnte kein Newsletter-Konto gefunden werden</message>
</item>
<item>
<name>activate</name>
<message>Newsletterkonto aktivieren</message>
......@@ -8,6 +16,14 @@
<name>activate_account</name>
<message>Newsletterkonto aktivieren</message>
</item>
<item>
<name>activate_error</name>
<message>Beim Aktivieren des Newsletter-Kontos ist ein Fehler aufgetreten.</message>
</item>
<item>
<name>activate_success</name>
<message>Das Newsletter-Konto wurde erfolgreich aktiviert und kann nun verwendet werden.</message>
</item>
<item>
<name>adm_activate</name>
<message>Newsletterkonto löschen</message>
......@@ -73,65 +89,37 @@
<message>Newsletterkonten</message>
</item>
<item>
<name>nl_account_exists</name>
<message>Für die angegebene E-Mail-Adresse existiert bereits ein Newsletter-Konto</message>
<name>settings</name>
<message>Newsletter Einstellungen</message>
</item>
<item>
<name>nl_account_not_exists</name>
<message>Für die angegebene E-Mail-Adresse konnte kein Newsletter-Konto gefunden werden</message>
<name>subject</name>
<message>Betreff</message>
</item>
<item>
<name>nl_activate_error</name>
<message>Beim Aktivieren des Newsletter-Kontos ist ein Fehler aufgetreten.</message>
<name>subject_to_short</name>
<message>Der Betreff sollte mindestens 3 Zeichen lang sein</message>
</item>
<item>
<name>nl_activate_success</name>
<message>Das Newsletter-Konto wurde erfolgreich aktiviert und kann nun verwendet werden.</message>
<name>subscribe</name>
<message>Eintragen</message>
</item>
<item>
<name>nl_subscribe_body</name>
<message>Sie haben sich mit der E-Mail-Adresse %1\$s auf %2\$s erfolgreich beim Newsletter angemeldet.\nUm die Registrierung abzuschließen, klicken Sie bitte auf den untenstehenden Link.\nWenn es sich um einen Irrtum handelt, dann ignorieren/löschen Sie diese E-Mail einfach.\n\n</message>
<name>subscribe_error</name>
<message>Entweder ist ein Fehler beim Eintragen der E-Mail-Adresse in die Datenbank oder beim Versenden der Aktivierungs-E-Mail aufgetreten.</message>
</item>
<item>
<name>nl_subscribe_error</name>
<message>Entweder ist ein Fehler beim Eintragen der E-Mail-Adresse in die Datenbank oder beim Versenden der Aktivierungs-E-Mail aufgetreten.</message>
<name>subscribe_mail_body</name>
<message>Sie haben sich mit der E-Mail-Adresse %1\$s auf %2\$s erfolgreich beim Newsletter angemeldet.\nUm die Registrierung abzuschließen, klicken Sie bitte auf den untenstehenden Link.\nWenn es sich um einen Irrtum handelt, dann ignorieren/löschen Sie diese E-Mail einfach.\n\n</message>
</item>
<item>
<name>nl_subscribe_subject</name>
<name>subscribe_mail_subject</name>
<message>Newsletter auf %s</message>
</item>
<item>
<name>nl_subscribe_success</name>
<name>subscribe_success</name>
<message>Die E-Mail-Adresse wurde der Datenbank erfolgreich hinzugefügt.\nEs wurde eine E-Mail mit einem Aktivierungslink an Ihre E-Mail-Adresse geschickt.</message>
</item>
<item>
<name>nl_un_subscribe</name>
<message>In Newsletter eintragen/austragen</message>
</item>
<item>
<name>nl_unsubscribe_error</name>
<message>Beim Löschen des Newsletterkontos ist ein Fehler aufgetreten.</message>
</item>
<item>
<name>nl_unsubscribe_success</name>
<message>Das Newsletterkonto wurde erfolgreich gelöscht.</message>
</item>
<item>
<name>settings</name>
<message>Newsletter Einstellungen</message>
</item>
<item>
<name>subject</name>
<message>Betreff</message>
</item>
<item>
<name>subject_to_short</name>
<message>Der Betreff sollte mindestens 3 Zeichen lang sein</message>
</item>
<item>
<name>subscribe</name>
<message>Eintragen</message>
</item>
<item>
<name>test_newsletter</name>
<message>Testnewsletter</message>
......@@ -152,4 +140,12 @@
<name>unsubscribe</name>
<message>Austragen</message>
</item>
<item>
<name>unsubscribe_error</name>
<message>Beim Löschen des Newsletterkontos ist ein Fehler aufgetreten.</message>
</item>
<item>
<name>unsubscribe_success</name>
<message>Das Newsletterkonto wurde erfolgreich gelöscht.</message>
</item>
</language>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<language>
<item>
<name>account_exists</name>
<message>There is already an newsletter account with the same E-Mail address registered</message>
</item>
<item>
<name>account_not_exists</name>
<message>For the stated E-mail address is no newsletter account registered</message>
</item>
<item>
<name>activate</name>
<message>Activate newsletter account</message>
......@@ -8,6 +16,14 @@
<name>activate_account</name>
<message>Active newsletter account</message>
</item>
<item>
<name>activate_error</name>
<message>While activating the newsletter account an error has occured.</message>
</item>
<item>
<name>activate_success</name>
<message>The newsletter account was successfully activated and can now be used.</message>
</item>
<item>
<name>adm_activate</name>
<message>Activate newsletter account</message>
......@@ -73,65 +89,37 @@
<message>Newsletter accounts</message>
</item>
<item>
<name>nl_account_exists</name>
<message>There is already an newsletter account with the same E-Mail address registered</message>
<name>settings</name>
<message>Newsletter settings</message>
</item>
<item>
<name>nl_account_not_exists</name>
<message>For the stated E-mail address is no newsletter account registered</message>
<name>subject</name>
<message>Subject</message>
</item>
<item>
<name>nl_activate_error</name>
<message>While activating the newsletter account an error has occured.</message>
<name>subject_to_short</name>
<message>The subject should be at least 3 characters long</message>
</item>
<item>
<name>nl_activate_success</name>
<message>The newsletter account was successfully activated and can now be used.</message>
<name>subscribe</name>
<message>Subscribe</message>
</item>
<item>
<name>nl_subscribe_body</name>
<message>You successfully subscribed with your E-mail address %1\$s to the newsletter of %2\$s.\nTo complete the registration process, please click on the hyperlink below.\nIf you haven\'t subscribed this newsletter, please ignore or delete this E-mail.\n\n</message>
<name>subscribe_error</name>
<message>Either there has error occured while adding the E-mail address to the database or while sending the activation E-mail.</message>
</item>
<item>
<name>nl_subscribe_error</name>
<message>Either there has error occured while adding the E-mail address to the database or while sending the activation E-mail.</message>
<name>subscribe_mail_body</name>
<message>You successfully subscribed with your E-mail address %1\$s to the newsletter of %2\$s.\nTo complete the registration process, please click on the hyperlink below.\nIf you haven\'t subscribed this newsletter, please ignore or delete this E-mail.\n\n</message>
</item>
<item>
<name>nl_subscribe_subject</name>
<name>nl_subscribe_mail_subject</name>
<message>Newsletter at %s</message>
</item>
<item>
<name>nl_subscribe_success</name>
<name>subscribe_success</name>
<message>The E-mail address was successfully added to the database.\nWe sent an E-mail with an activationlink to your E-mail address.</message>
</item>
<item>
<name>nl_un_subscribe</name>
<message>Subscribe/Unsubscribe the newsletter</message>
</item>
<item>
<name>nl_unsubscribe_error</name>
<message>While deleting the newsletter account an error has occured.</message>
</item>
<item>
<name>nl_unsubscribe_success</name>
<message>The newsletter account was successfully deleted.</message>
</item>
<item>
<name>settings</name>
<message>Newsletter settings</message>
</item>
<item>
<name>subject</name>
<message>Subject</message>
</item>
<item>
<name>subject_to_short</name>
<message>The subject should be at least 3 characters long</message>
</item>
<item>
<name>subscribe</name>
<message>Subscribe</message>
</item>
<item>
<name>test_newsletter</name>
<message>Test newsletter</message>
......@@ -152,4 +140,12 @@
<name>unsubscribe</name>
<message>Unsubsribe</message>
</item>
<item>
<name>unsubscribe_error</name>
<message>While deleting the newsletter account an error has occured.</message>
</item>
<item>
<name>unsubscribe_success</name>
<message>The newsletter account was successfully deleted.</message>
</item>
</language>
\ No newline at end of file
......@@ -12,7 +12,7 @@
<address></address>
<telephone></telephone>
<fax></fax>
<disclaimer><![CDATA[<p>Trotz sorgf&#228;ltiger inhaltlicher Kontrolle &#252;bernehmen wir keine Haftung f&#252;r die Inhalte externer Links. F&#252;r den Inhalt der verlinkten Seiten sind ausschlie&#223;lich deren Betreiber verantwortlich.</p>]]></disclaimer>
<disclaimer><![CDATA[Trotz sorgf&#228;ltiger inhaltlicher Kontrolle &#252;bernehmen wir keine Haftung f&#252;r die Inhalte externer Links. F&#252;r den Inhalt der verlinkten Seiten sind ausschlie&#223;lich deren Betreiber verantwortlich.]]></disclaimer>
<miscellaneous></miscellaneous>
</settings>
<access>
......
......@@ -18,13 +18,13 @@ if (isset($modules->gen['mail']) && $validate->email($modules->gen['mail']) && i
}
if ($db->select('id', 'nl_accounts', 'mail = \'' . $mail . '\' AND hash = \'' . $db->escape($hash, 2) . '\'', 0, 0, 0, 1) != 1)
$errors[] = lang('newsletter', 'nl_account_not_exists');
$errors[] = lang('newsletter', 'account_not_exists');
if (isset($errors)) {
$tpl->assign('error_msg', combo_box($errors));
} else {
$bool = $db->update('nl_accounts', array('hash', ''), 'mail = \'' . $mail . '\' AND hash = \'' . $db->escape($hash, 2) . '\'');
$content = combo_box($bool ? lang('newsletter', 'nl_activate_success') : lang('newsletter', 'nl_activate_error'), ROOT_DIR);
$content = combo_box($bool ? lang('newsletter', 'activate_success') : lang('newsletter', 'activate_error'), ROOT_DIR);
}
?>
\ No newline at end of file
......@@ -12,5 +12,5 @@ if (!defined('IN_ADM'))
$bool = !empty($modules->id) ? $db->update('nl_accounts', array('hash', ''), 'id = \'' . $modules->id . '\'') : false;
$content = combo_box($bool ? lang('newsletter', 'nl_activate_success') : lang('newsletter', 'nl_activate_error'), uri('acp/newsletter'));
$content = combo_box($bool ? lang('newsletter', 'activate_success') : lang('newsletter', 'activate_error'), uri('acp/newsletter'));
?>
\ No newline at end of file
<?php
<?php
/**
* Newsletter
*
* @author Goratsch Webdesign
* @package ACP3
* @subpackage Modules
*/
if (!defined('IN_ACP3'))
exit;
if (isset($_POST['submit'])) {
switch ($modules->action) {
case 'subscribe':
$form = $_POST['form'];
if (!$validate->email($form['mail']))
$errors[] = lang('common', 'wrong_email_format');
if ($validate->email($form['mail']) && $db->select('id', 'nl_accounts', 'mail = \'' . $form['mail'] . '\'', 0, 0, 0, 1) == 1)
$errors[] = lang('newsletter', 'nl_account_exists');
if (isset($errors)) {
$tpl->assign('error_msg', combo_box($errors));
} else {
$time = explode(' ', microtime());
$hash = md5(mt_rand(0, $time['1']));
$text = sprintf(lang('newsletter', 'nl_subscribe_body'), $form['mail'], $_SERVER['HTTP_HOST']);
$text.= 'http://' . $_SERVER['HTTP_HOST'] . uri('newsletter/activate/hash_' . $hash . '/mail_' . $form['mail']);
$insert_values = array(
'id' => '',
'mail' => $form['mail'],
'hash' => $hash,
);
$bool = $db->insert('nl_accounts', $insert_values);
$nl_mail = $config->output('newsletter');
$bool2 = @mail($form['mail'], sprintf(lang('newsletter', 'nl_subscribe_subject'), $_SERVER['HTTP_HOST']), $text, 'FROM:' . $nl_mail['mail']);
$content = combo_box($bool && $bool2 ? lang('newsletter', 'nl_subscribe_success') : lang('newsletter', 'nl_subscribe_error'), ROOT_DIR);
}
break;
case 'unsubscribe':
$form = $_POST['form'];
if (!$validate->email($form['mail']))
$errors[] = lang('common', 'wrong_email_format');
if ($validate->email($form['mail']) && $db->select('id', 'nl_accounts', 'mail = \'' . $form['mail'] . '\'', 0, 0, 0, 1) != 1)
$errors[] = lang('newsletter', 'nl_account_not_exists');
if (isset($errors)) {
$tpl->assign('error_msg', combo_box($errors));
} else {
$bool = $db->delete('nl_accounts', 'mail = \'' . $form['mail'] . '\'');
$content = combo_box($bool ? lang('newsletter', 'nl_unsubscribe_success') : lang('newsletter', 'nl_unsubscribe_error'), ROOT_DIR);
}
break;
}
}
if (!isset($_POST['submit']) || isset($errors) && is_array($errors)) {
$tpl->assign('form', isset($form) ? $form : '');
$field_value = isset($_POST['action']) ? $_POST['action'] : 'subscribe';
$actions[0]['value'] = 'subscribe';
$actions[0]['checked'] = select_entry('action', 'subscribe', $field_value, 'checked');
$actions[0]['lang'] = lang('newsletter', 'subscribe');
$actions[1]['value'] = 'unsubscribe';
$actions[1]['checked'] = select_entry('action', 'unsubscribe', $field_value, 'checked');
$actions[1]['lang'] = lang('newsletter', 'unsubscribe');
$tpl->assign('actions', $actions);
$content = $tpl->fetch('newsletter/create.html');
}
*/
if (!defined('IN_ACP3'))
exit();
if (isset($_POST['submit'])) {
switch ($modules->action) {
case 'subscribe' :
$form = $_POST['form'];
if (!$validate->email($form['mail']))
$errors[] = lang('common', 'wrong_email_format');
if ($validate->email($form['mail']) && $db->select('id', 'nl_accounts', 'mail = \'' . $form['mail'] . '\'', 0, 0, 0, 1) == 1)
$errors[] = lang('newsletter', 'account_exists');
if (!$validate->captcha($form['captcha'], $form['hash']))
$errors[] = lang('captcha', 'invalid_captcha_entered');
if (isset($errors)) {
$tpl->assign('error_msg', combo_box($errors));
} else {
$time = explode(' ', microtime());
$hash = md5(mt_rand(0, $time['1']));
$text = sprintf(lang('newsletter', 'subscribe_mail_body'), $form['mail'], $_SERVER['HTTP_HOST']);
$text .= 'http://' . $_SERVER['HTTP_HOST'] . uri('newsletter/activate/hash_' . $hash . '/mail_' . $form['mail']);
$insert_values = array('id' => '', 'mail' => $form['mail'], 'hash' => $hash);
$bool = $db->insert('nl_accounts', $insert_values);
$nl_mail = $config->output('newsletter');
$bool2 = @mail($form['mail'], sprintf(lang('newsletter', 'subscribe_mail_subject'), $_SERVER['HTTP_HOST']), $text, 'FROM:' . $nl_mail['mail']);
$content = combo_box($bool && $bool2 ? lang('newsletter', 'subscribe_success') : lang('newsletter', 'subscribe_error'), ROOT_DIR);
}
break;
case 'unsubscribe' :
$form = $_POST['form'];
if (!$validate->email($form['mail']))
$errors[] = lang('common', 'wrong_email_format');
if ($validate->email($form['mail']) && $db->select('id', 'nl_accounts', 'mail = \'' . $form['mail'] . '\'', 0, 0, 0, 1) != 1)
$errors[] = lang('newsletter', 'account_not_exists');
if (!$validate->captcha($form['captcha'], $form['hash']))
$errors[] = lang('captcha', 'invalid_captcha_entered');
if (isset($errors)) {
$tpl->assign('error_msg', combo_box($errors));
} else {
$bool = $db->delete('nl_accounts', 'mail = \'' . $form['mail'] . '\'');
$content = combo_box($bool ? lang('newsletter', 'unsubscribe_success') : lang('newsletter', 'unsubscribe_error'), ROOT_DIR);
}
break;
}
}
if (!isset($_POST['submit']) || isset($errors) && is_array($errors)) {
$tpl->assign('form', isset($form) ? $form : '');
$field_value = isset($_POST['action']) ? $_POST['action'] : 'subscribe';
$actions[0]['value'] = 'subscribe';
$actions[0]['checked'] = select_entry('action', 'subscribe', $field_value, 'checked');
$actions[0]['lang'] = lang('newsletter', 'subscribe');
$actions[1]['value'] = 'unsubscribe';
$actions[1]['checked'] = select_entry('action', 'unsubscribe', $field_value, 'checked');
$actions[1]['lang'] = lang('newsletter', 'unsubscribe');
$tpl->assign('actions', $actions);
$tpl->assign('captcha', captcha());
$content = $tpl->fetch('newsletter/create.html');
}
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment