Changed README, disabled unneded features, Hiding some features from the GUI

This commit is contained in:
mlmmj mailinglist daemon and simple webinterface
2021-07-23 15:29:31 +02:00
parent 1e0a17e6cf
commit 81d0c6e6ef
66 changed files with 2143 additions and 34 deletions

View File

@@ -0,0 +1,122 @@
<?php
/* Smarty version 3.1.31, created on 2021-07-23 15:23:28
from "/home/pacs/ecg00/users/mlmmj/doms/list.ecogood.org/htdocs-ssl/mlmmj-light-web-ecg/misc/smarty/templates_en/index.tpl" */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '3.1.31',
'unifunc' => 'content_60fac2d08b3df8_25701302',
'has_nocache_code' => false,
'file_dependency' =>
array (
'0dee7916f2ab5d00e5d3cc848d789a3c9c535c34' =>
array (
0 => '/home/pacs/ecg00/users/mlmmj/doms/list.ecogood.org/htdocs-ssl/mlmmj-light-web-ecg/misc/smarty/templates_en/index.tpl',
1 => 1627046606,
2 => 'file',
),
),
'includes' =>
array (
),
),false)) {
function content_60fac2d08b3df8_25701302 (Smarty_Internal_Template $_smarty_tpl) {
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<?php echo '<script'; ?>
>
function validate_form()
{
var name = document.getElementById('add_list_input').value;
var name = name.toLowerCase();
if (name == "")
{
return false;
}
if (name.length > 30)
{
alert("Mailing list name must not be longer than 30 characters.");
return false;
}
if ( name.match(/[^a-z0-9_]/) )
{
alert("Mailing list name must contain only english letters, digits and undercores.");
return false;
}
}
function confirm_delete()
{
return confirm("Are you really want to delete the mailing list?");
}
<?php echo '</script'; ?>
>
</head>
<body>
<div id="header">
<div id="header_left">
Manage your ECG mailing lists
</div>
<div id="header_right">
<a href="logout.php">Log out</a>
</div>
</div>
<div id="breadcrumbs"><?php echo $_smarty_tpl->tpl_vars['domain']->value;?>
</div>
<div id="index">
<div id="lists_header">
<b>All available mailing lists:</b>
&nbsp;
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_add_list">
You can edit mailing lists on this page. Just click on its name.
To post a message into a mailing list send an email to example@<?php echo $_smarty_tpl->tpl_vars['domain']->value;?>
, where "example" is the list name.
</span>
</div>
</div>
<table id="lists">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['lists']->value, 'list');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['list']->value) {
?>
<tr>
<td>
&bull;
</td>
<td>
<a href="edit_list.php?list_name=<?php echo $_smarty_tpl->tpl_vars['list']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['list']->value;?>
</a>
</td>
<!--<td>
<a href="del_list.php?list_name=<?php echo $_smarty_tpl->tpl_vars['list']->value;?>
" onclick="return confirm_delete()"><img src="delete.svg" width=15></a>
</td>-->
</tr>
<?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);
?>
</table>
<!--<form method="post" action="add_list.php" onsubmit="return validate_form()">
<div id="add_list">
<input type="text" name="list_name" id="add_list_input">
&nbsp;
<input type="submit" name="submit" value="Add" id="add_list_button">
</div>
</form>-->
</div>
</body>
</html>
<?php }
}

View File

@@ -0,0 +1,59 @@
<?php
/* Smarty version 3.1.31, created on 2021-07-23 15:20:28
from "/home/pacs/ecg00/users/mlmmj/doms/list.ecogood.org/htdocs-ssl/mlmmj-light-web-ecg/misc/smarty/templates_en/error.tpl" */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '3.1.31',
'unifunc' => 'content_60fac21cabbde3_88848843',
'has_nocache_code' => false,
'file_dependency' =>
array (
'87eadf281c71f110fa4c4ea961640eb703d16d4a' =>
array (
0 => '/home/pacs/ecg00/users/mlmmj/doms/list.ecogood.org/htdocs-ssl/mlmmj-light-web-ecg/misc/smarty/templates_en/error.tpl',
1 => 1485891660,
2 => 'file',
),
),
'includes' =>
array (
),
),false)) {
function content_60fac21cabbde3_88848843 (Smarty_Internal_Template $_smarty_tpl) {
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="header">Mailing lists service</div>
<div id="error">
<?php if ($_smarty_tpl->tpl_vars['error_code']->value == 1) {?>
Domain can contain only english letters, dots, hyphens and digits.
<?php } elseif ($_smarty_tpl->tpl_vars['error_code']->value == 2) {?>
Password can contain only english letters and digits.
<?php } elseif ($_smarty_tpl->tpl_vars['error_code']->value == 3) {?>
Incorrect password.
<?php } elseif ($_smarty_tpl->tpl_vars['error_code']->value == 4) {?>
There is no such domain.
<?php } elseif ($_smarty_tpl->tpl_vars['error_code']->value == 5) {?>
Mailing list name can contain only english letters, digits and undercores.
<?php } elseif ($_smarty_tpl->tpl_vars['error_code']->value == 6) {?>
The length of a list name can not exceed 30 characters.
<?php } elseif ($_smarty_tpl->tpl_vars['error_code']->value == 7) {?>
The length of a prefix can not exceed 128 characters.
<?php } elseif ($_smarty_tpl->tpl_vars['error_code']->value == 8) {?>
The length of a footer can not exceed 1024 characters.
<?php } elseif ($_smarty_tpl->tpl_vars['error_code']->value == 9) {?>
There is an incorrect email in the subscribers list.
<?php } elseif ($_smarty_tpl->tpl_vars['error_code']->value == 10) {?>
There is an incorrect email in the moderators list.
<?php } else { ?>
Unknown error.
<?php }?>
</div>
</body>
</html>
<?php }
}

View File

@@ -0,0 +1,90 @@
<?php
/* Smarty version 3.1.31, created on 2021-07-23 15:15:40
from "/home/pacs/ecg00/users/mlmmj/doms/list.ecogood.org/htdocs-ssl/mlmmj-light-web-ecg/misc/smarty/templates_en/login.tpl" */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '3.1.31',
'unifunc' => 'content_60fac0fc392119_19400816',
'has_nocache_code' => false,
'file_dependency' =>
array (
'bebbc40e386876d1f34a8c037161406e34f7e878' =>
array (
0 => '/home/pacs/ecg00/users/mlmmj/doms/list.ecogood.org/htdocs-ssl/mlmmj-light-web-ecg/misc/smarty/templates_en/login.tpl',
1 => 1485892620,
2 => 'file',
),
),
'includes' =>
array (
),
),false)) {
function content_60fac0fc392119_19400816 (Smarty_Internal_Template $_smarty_tpl) {
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<?php echo '<script'; ?>
>
function validate_form()
{
var domain = document.getElementById('domain_input').value;
var password = document.getElementById('password_input').value;
if (domain == "")
{
alert("Enter domain.");
return false;
}
if (password == "")
{
alert("Enter password.");
return false;
}
if ( domain.match(/[^A-Za-z0-9\-\.]/) )
{
alert("Domain can contain only english letters, dots, hyphens and digits.");
return false;
}
if ( password.match(/[^A-Za-z0-9]/) )
{
alert("Password can contain only english letters and digits.");
return false;
}
}
<?php echo '</script'; ?>
>
</head>
<body>
<div id="header">Mailing lists service</div>
<div id="login">
<div id="login_form">
<form method="post" action="login.php" onsubmit="return validate_form()">
<div id="domain">
<div id="domain_left">
Domain:
</div>
<div id="domain_right">
<input type="text" name="login_domain" id="domain_input">
</div>
</div>
<div id="password">
<div id="password_left">
Password:
</div>
<div id="password_right">
<input type="password" name="login_pass" id="password_input">
</div>
</div>
<div id="enter">
<input type="submit" name="submit" value="Enter">
</div>
</form>
</div>
</div>
</body>
</html>
<?php }
}

View File

@@ -0,0 +1,254 @@
<?php
/* Smarty version 3.1.31, created on 2021-07-23 15:27:15
from "/home/pacs/ecg00/users/mlmmj/doms/list.ecogood.org/htdocs-ssl/mlmmj-light-web-ecg/misc/smarty/templates_en/edit_list.tpl" */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '3.1.31',
'unifunc' => 'content_60fac3b35e71a9_13035792',
'has_nocache_code' => false,
'file_dependency' =>
array (
'd26886be440fe5530a216e22cdbebb3e8d3eb432' =>
array (
0 => '/home/pacs/ecg00/users/mlmmj/doms/list.ecogood.org/htdocs-ssl/mlmmj-light-web-ecg/misc/smarty/templates_en/edit_list.tpl',
1 => 1627046833,
2 => 'file',
),
),
'includes' =>
array (
),
),false)) {
function content_60fac3b35e71a9_13035792 (Smarty_Internal_Template $_smarty_tpl) {
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<?php echo '<script'; ?>
>
// Do not use Smarty here
function switch_moderators_form()
{
// Get a selected value
var select = document.getElementById("list_type");
var selected_value = select.options[select.selectedIndex].value;
// If selected conference list type, then disable moderators form
if (selected_value == "2")
{
document.getElementById("moderators").disabled = true;
document.getElementById("moderators_header").style.color = "#777777";
}
else
{
document.getElementById("moderators").disabled = false;
document.getElementById("moderators_header").style.color = "#222222";
}
}
function validate_form()
{
var prefix = document.getElementById('prefix').value;
var footer = document.getElementById('footer').value;
var subscribers = document.getElementById('subscribers').value;
var moderators = document.getElementById('moderators').value;
// Regex for a valid e-mail
var re_email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
// Transform subscribers and moderators into array
subscribers = subscribers.split("\n");
moderators = moderators.split("\n");
if (prefix.length > 128)
{
alert("A prefix length can not be longer than 128 characters.");
return false;
}
if (footer.length > 1024)
{
alert("A footer length can not be longer than 1024 characters.");
return false;
}
for(var i in subscribers)
{
if ( subscribers[i] != "" && !re_email.test(subscribers[i]) )
{
alert('Subscriber "' + subscribers[i] + '" (line #' + (parseFloat(i)+1) + ') have incorrect email.');
return false;
}
}
for(var i in moderators)
{
if ( moderators[i] != "" && !re_email.test(moderators[i]) )
{
alert('Moderator "' + moderators[i] + '" (line #' + (parseFloat(i)+1) + ') have incorrect email.');
return false;
}
}
}
//
<?php echo '</script'; ?>
>
</head>
<body onload="switch_moderators_form()">
<div id="header">
<div id="header_left">
Manage your ECG mailing lists
</div>
<div id="header_right">
<a href="logout.php">Log out</a>
</div>
</div>
<div id="breadcrumbs">
<a href="index.php"><?php echo $_smarty_tpl->tpl_vars['domain']->value;?>
</a>&nbsp;/&nbsp;<?php echo $_smarty_tpl->tpl_vars['list_name']->value;?>
</div>
<form method="post" action="save_list.php" id="save_list" onsubmit="return validate_form()">
<div id="edit_page">
<input type="hidden" name="list_name" value="<?php echo $_smarty_tpl->tpl_vars['list_name']->value;?>
">
<div id="column_left">
<div id="subscribers_header">
Subscribers:&nbsp;
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_sub">
Please, provide one email per line. Do not forget to add moderators if you
want them able to post into the mailing list.
</span>
</div>
</div>
<div id="subscribers_body">
<textarea name="subscribers" id="subscribers"><?php echo $_smarty_tpl->tpl_vars['subscribers']->value;?>
</textarea>
</div>
</div>
<div id="column_middle">
<div id="column_middle_inner">
<div id="table_div">
<table id="table_middle">
<!--<tr>
<td>
<div id="list_type_header">
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_list_type">
<b>Moderated list:</b> you assign subscribers and moderators. Messages will be
moderated before publishing.<br><br>
<b>News list:</b> everybody can subscribe without moderator confirmation by sending
an empty email to <?php echo $_smarty_tpl->tpl_vars['list_name']->value;?>
+subscribe@<?php echo $_smarty_tpl->tpl_vars['domain']->value;?>
. Messages into mailing list can
post only moderators.<br><br>
<b>Conference:</b> IRC channel analogue. You assign subscribers, every subscriber
can send messages without moderation.
</span>
</div>
&nbsp;List type:
</div>
</td>
<td>
<select name="list_type" id="list_type" onChange="switch_moderators_form()">
<option value="0" <?php echo $_smarty_tpl->tpl_vars['list_type_selected']->value[0];?>
>
Moderated list
</option>
<option value="1" <?php echo $_smarty_tpl->tpl_vars['list_type_selected']->value[1];?>
>
News list
</option>
<option value="2" <?php echo $_smarty_tpl->tpl_vars['list_type_selected']->value[2];?>
>
Conference
</option>
</select>
</td>
</tr>-->
<tr>
<td>
<div id="prefix_header">
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_prefix">
Prefix added to the subject field of each message.
</span>
</div>
&nbsp;Prefix:
</div>
</td>
<td>
<input type="text" name="prefix" value="<?php echo mb_convert_encoding(htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8', true), "HTML-ENTITIES", 'UTF-8');?>
" id="prefix">
</td>
</tr>
<!--<tr>
<td>
<div id="footer_header">
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_footer">
Footer added to the body of each message.
</span>
</div>
&nbsp;Footer:
</div>
</td>
<td>
<textarea name="footer" id="footer"><?php echo $_smarty_tpl->tpl_vars['footer']->value;?>
</textarea>
</td>
</tr>
<tr>
<td colspan="2">
<div id="notmetoo">
<div id="notmetoo_header">
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_notmetoo">
Sender of a post will be excluded from the distribution list for
that post so people don't receive copies of their own posts.
</span>
</div>
<input type="checkbox" id="notmetoo_checkbox" name="notmetoo" value="checked" <?php echo $_smarty_tpl->tpl_vars['notmetoo_checked']->value;?>
>
Do not send mails to yourself.
</div>
</div>
</td>
</tr>-->
</table>
</div>
<div id="save_btn">
<input type="submit" name="submit" value="Save">
</div>
</div>
</div>
<div id="column_right">
<div id="moderators_header">
Moderators:&nbsp;
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_mod">
In case of a moderated list the messages will be send to these
emails before publishing. In case of a news list only moderators can post to the mailing list.
In case of conference there are no moderators.
</span>
</div>
</div>
<div id="moderators_body">
<textarea name="moderators" id="moderators"><?php echo $_smarty_tpl->tpl_vars['moderators']->value;?>
</textarea>
</div>
</div>
</div>
</form>
</body>
</html>
<?php }
}

View File

@@ -0,0 +1,213 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<script>
//{literal} Do not use Smarty here
function switch_moderators_form()
{
// Get a selected value
var select = document.getElementById("list_type");
var selected_value = select.options[select.selectedIndex].value;
// If selected conference list type, then disable moderators form
if (selected_value == "2")
{
document.getElementById("moderators").disabled = true;
document.getElementById("moderators_header").style.color = "#777777";
}
else
{
document.getElementById("moderators").disabled = false;
document.getElementById("moderators_header").style.color = "#222222";
}
}
function validate_form()
{
var prefix = document.getElementById('prefix').value;
var footer = document.getElementById('footer').value;
var subscribers = document.getElementById('subscribers').value;
var moderators = document.getElementById('moderators').value;
// Regex for a valid e-mail
var re_email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
// Transform subscribers and moderators into array
subscribers = subscribers.split("\n");
moderators = moderators.split("\n");
if (prefix.length > 128)
{
alert("A prefix length can not be longer than 128 characters.");
return false;
}
if (footer.length > 1024)
{
alert("A footer length can not be longer than 1024 characters.");
return false;
}
for(var i in subscribers)
{
if ( subscribers[i] != "" && !re_email.test(subscribers[i]) )
{
alert('Subscriber "' + subscribers[i] + '" (line #' + (parseFloat(i)+1) + ') have incorrect email.');
return false;
}
}
for(var i in moderators)
{
if ( moderators[i] != "" && !re_email.test(moderators[i]) )
{
alert('Moderator "' + moderators[i] + '" (line #' + (parseFloat(i)+1) + ') have incorrect email.');
return false;
}
}
}
//{/literal}
</script>
</head>
<body onload="switch_moderators_form()">
<div id="header">
<div id="header_left">
Manage your ECG mailing lists
</div>
<div id="header_right">
<a href="logout.php">Log out</a>
</div>
</div>
<div id="breadcrumbs">
<a href="index.php">{$domain}</a>&nbsp;/&nbsp;{$list_name}
</div>
<form method="post" action="save_list.php" id="save_list" onsubmit="return validate_form()">
<div id="edit_page">
<input type="hidden" name="list_name" value="{$list_name}">
<div id="column_left">
<div id="subscribers_header">
Subscribers:&nbsp;
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_sub">
Please, provide one email per line. Do not forget to add moderators if you
want them able to post into the mailing list.
</span>
</div>
</div>
<div id="subscribers_body">
<textarea name="subscribers" id="subscribers">{$subscribers}</textarea>
</div>
</div>
<div id="column_middle">
<div id="column_middle_inner">
<div id="table_div">
<table id="table_middle">
<!--<tr>
<td>
<div id="list_type_header">
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_list_type">
<b>Moderated list:</b> you assign subscribers and moderators. Messages will be
moderated before publishing.<br><br>
<b>News list:</b> everybody can subscribe without moderator confirmation by sending
an empty email to {$list_name}+subscribe@{$domain}. Messages into mailing list can
post only moderators.<br><br>
<b>Conference:</b> IRC channel analogue. You assign subscribers, every subscriber
can send messages without moderation.
</span>
</div>
&nbsp;List type:
</div>
</td>
<td>
<select name="list_type" id="list_type" onChange="switch_moderators_form()">
<option value="0" {$list_type_selected[0]}>
Moderated list
</option>
<option value="1" {$list_type_selected[1]}>
News list
</option>
<option value="2" {$list_type_selected[2]}>
Conference
</option>
</select>
</td>
</tr>-->
<tr>
<td>
<div id="prefix_header">
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_prefix">
Prefix added to the subject field of each message.
</span>
</div>
&nbsp;Prefix:
</div>
</td>
<td>
<input type="text" name="prefix" value="{$prefix|escape:'htmlall'}" id="prefix">
</td>
</tr>
<!--<tr>
<td>
<div id="footer_header">
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_footer">
Footer added to the body of each message.
</span>
</div>
&nbsp;Footer:
</div>
</td>
<td>
<textarea name="footer" id="footer">{$footer}</textarea>
</td>
</tr>
<tr>
<td colspan="2">
<div id="notmetoo">
<div id="notmetoo_header">
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_notmetoo">
Sender of a post will be excluded from the distribution list for
that post so people don't receive copies of their own posts.
</span>
</div>
<input type="checkbox" id="notmetoo_checkbox" name="notmetoo" value="checked" {$notmetoo_checked}>
Do not send mails to yourself.
</div>
</div>
</td>
</tr>-->
</table>
</div>
<div id="save_btn">
<input type="submit" name="submit" value="Save">
</div>
</div>
</div>
<div id="column_right">
<div id="moderators_header">
Moderators:&nbsp;
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_mod">
In case of a moderated list the messages will be send to these
emails before publishing. In case of a news list only moderators can post to the mailing list.
In case of conference there are no moderators.
</span>
</div>
</div>
<div id="moderators_body">
<textarea name="moderators" id="moderators">{$moderators}</textarea>
</div>
</div>
</div>
</form>
</body>
</html>

View File

@@ -0,0 +1,33 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="header">Mailing lists service</div>
<div id="error">
{if $error_code == 1}
Domain can contain only english letters, dots, hyphens and digits.
{elseif $error_code == 2}
Password can contain only english letters and digits.
{elseif $error_code == 3}
Incorrect password.
{elseif $error_code == 4}
There is no such domain.
{elseif $error_code == 5}
Mailing list name can contain only english letters, digits and undercores.
{elseif $error_code == 6}
The length of a list name can not exceed 30 characters.
{elseif $error_code == 7}
The length of a prefix can not exceed 128 characters.
{elseif $error_code == 8}
The length of a footer can not exceed 1024 characters.
{elseif $error_code == 9}
There is an incorrect email in the subscribers list.
{elseif $error_code == 10}
There is an incorrect email in the moderators list.
{else}
Unknown error.
{/if}
</div>
</body>
</html>

View File

@@ -0,0 +1,80 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<script>
function validate_form()
{
var name = document.getElementById('add_list_input').value;
var name = name.toLowerCase();
if (name == "")
{
return false;
}
if (name.length > 30)
{
alert("Mailing list name must not be longer than 30 characters.");
return false;
}
if ( name.match(/[^a-z0-9_]/) )
{
alert("Mailing list name must contain only english letters, digits and undercores.");
return false;
}
}
function confirm_delete()
{
return confirm("Are you really want to delete the mailing list?");
}
</script>
</head>
<body>
<div id="header">
<div id="header_left">
Manage your ECG mailing lists
</div>
<div id="header_right">
<a href="logout.php">Log out</a>
</div>
</div>
<div id="breadcrumbs">{$domain}</div>
<div id="index">
<div id="lists_header">
<b>All available mailing lists:</b>
&nbsp;
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_add_list">
You can edit mailing lists on this page. Just click on its name.
To post a message into a mailing list send an email to example@{$domain}, where "example" is the list name.
</span>
</div>
</div>
<table id="lists">
{foreach $lists as $list}
<tr>
<td>
&bull;
</td>
<td>
<a href="edit_list.php?list_name={$list}">{$list}</a>
</td>
<!--<td>
<a href="del_list.php?list_name={$list}" onclick="return confirm_delete()"><img src="delete.svg" width=15></a>
</td>-->
</tr>
{/foreach}
</table>
<!--<form method="post" action="add_list.php" onsubmit="return validate_form()">
<div id="add_list">
<input type="text" name="list_name" id="add_list_input">
&nbsp;
<input type="submit" name="submit" value="Add" id="add_list_button">
</div>
</form>-->
</div>
</body>
</html>

View File

@@ -0,0 +1,62 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<script>
function validate_form()
{
var domain = document.getElementById('domain_input').value;
var password = document.getElementById('password_input').value;
if (domain == "")
{
alert("Enter domain.");
return false;
}
if (password == "")
{
alert("Enter password.");
return false;
}
if ( domain.match(/[^A-Za-z0-9\-\.]/) )
{
alert("Domain can contain only english letters, dots, hyphens and digits.");
return false;
}
if ( password.match(/[^A-Za-z0-9]/) )
{
alert("Password can contain only english letters and digits.");
return false;
}
}
</script>
</head>
<body>
<div id="header">Mailing lists service</div>
<div id="login">
<div id="login_form">
<form method="post" action="login.php" onsubmit="return validate_form()">
<div id="domain">
<div id="domain_left">
Domain:
</div>
<div id="domain_right">
<input type="text" name="login_domain" id="domain_input">
</div>
</div>
<div id="password">
<div id="password_left">
Password:
</div>
<div id="password_right">
<input type="password" name="login_pass" id="password_input">
</div>
</div>
<div id="enter">
<input type="submit" name="submit" value="Enter">
</div>
</form>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,213 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<script>
//{literal} Do not use Smarty here
function switch_moderators_form()
{
// Get a selected value
var select = document.getElementById("list_type");
var selected_value = select.options[select.selectedIndex].value;
// If selected conference list type, then disable moderators form
if (selected_value == "2")
{
document.getElementById("moderators").disabled = true;
document.getElementById("moderators_header").style.color = "#777777";
}
else
{
document.getElementById("moderators").disabled = false;
document.getElementById("moderators_header").style.color = "#222222";
}
}
function validate_form()
{
var prefix = document.getElementById('prefix').value;
var footer = document.getElementById('footer').value;
var subscribers = document.getElementById('subscribers').value;
var moderators = document.getElementById('moderators').value;
// Regex for a valid e-mail
var re_email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
// Transform subscribers and moderators into array
subscribers = subscribers.split("\n");
moderators = moderators.split("\n");
if (prefix.length > 128)
{
alert("Длина префикса не должна превышать 128-ми символов.");
return false;
}
if (footer.length > 1024)
{
alert("Длина подписи не должна превышать 1024-ёх символов.");
return false;
}
for(var i in subscribers)
{
if ( subscribers[i] != "" && !re_email.test(subscribers[i]) )
{
alert('Подписчик "' + subscribers[i] + '" (строка №' + (parseFloat(i)+1) + ') является невалидным адресом электронной почты.');
return false;
}
}
for(var i in moderators)
{
if ( moderators[i] != "" && !re_email.test(moderators[i]) )
{
alert('Модератор "' + moderators[i] + '" (строка №' + (parseFloat(i)+1) + ') является невалидным адресом электронной почты.');
return false;
}
}
}
//{/literal}
</script>
</head>
<body onload="switch_moderators_form()">
<div id="header">
<div id="header_left">
Сервис рассылок
</div>
<div id="header_right">
<a href="logout.php">Выйти</a>
</div>
</div>
<div id="breadcrumbs">
<a href="index.php">{$domain}</a>&nbsp;/&nbsp;{$list_name}
</div>
<form method="post" action="save_list.php" id="save_list" onsubmit="return validate_form()">
<div id="edit_page">
<input type="hidden" name="list_name" value="{$list_name}">
<div id="column_left">
<div id="subscribers_header">
Список подписчиков:&nbsp;
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_sub">
Добавляйте по одному почтовому адресу в каждой строке. Не забудьте добавить
модераторов, если хотите, чтобы они также могли писать в рассылку.
</span>
</div>
</div>
<div id="subscribers_body">
<textarea name="subscribers" id="subscribers">{$subscribers}</textarea>
</div>
</div>
<div id="column_middle">
<div id="column_middle_inner">
<div id="table_div">
<table id="table_middle">
<tr>
<td>
<div id="list_type_header">
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_list_type">
<b>Модерируемая рассылка:</b> подписчиков устанавливаете Вы, сообщения
от обычных участников проходят модерацию.<br><br>
<b>Новостная рассылка:</b> подписаться может кто угодно, отправив пустое письмо
на {$list_name}+subscribe@{$domain}, при этом подтверждение модератора не требуется.
Письма в рассылку могут отправлять только модераторы.<br><br>
<b>Конференция:</b> аналог канала в IRC. Подписчиков устанавливаете Вы,
сообщения может отправлять любой подписчик без модерации.
</span>
</div>
&nbsp;Тип рассылки:
</div>
</td>
<td>
<select name="list_type" id="list_type" onChange="switch_moderators_form()">
<option value="0" {$list_type_selected[0]}>
Модерируемая рассылка
</option>
<option value="1" {$list_type_selected[1]}>
Новостная рассылка
</option>
<option value="2" {$list_type_selected[2]}>
Конференция
</option>
</select>
</td>
</tr>
<tr>
<td>
<div id="prefix_header">
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_prefix">
Текст, добавляемый в начало заголовка каждого сообщения рассылки.
</span>
</div>
&nbsp;Префикс:
</div>
</td>
<td>
<input type="text" name="prefix" value="{$prefix|escape:'htmlall'}" id="prefix">
</td>
</tr>
<tr>
<td>
<div id="footer_header">
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_footer">
Текст, добавляемый в конец тела каждого сообщения рассылки.
</span>
</div>
&nbsp;Подпись:
</div>
</td>
<td>
<textarea name="footer" id="footer">{$footer}</textarea>
</td>
</tr>
<tr>
<td colspan="2">
<div id="notmetoo">
<div id="notmetoo_header">
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_notmetoo">
Отправитель будет исключён из списка рассылки для своего сообщения.
Это означает, что ему не будут приходить копии своих сообщений.
</span>
</div>
<input type="checkbox" id="notmetoo_checkbox" name="notmetoo" value="checked" {$notmetoo_checked}>
Не отправлять копию своих сообщений.
</div>
</div>
</td>
</tr>
</table>
</div>
<div id="save_btn">
<input type="submit" name="submit" value="Сохранить">
</div>
</div>
</div>
<div id="column_right">
<div id="moderators_header">
Список модераторов:&nbsp;
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_mod">
Для модерируемой рассылки на эти email будут отправляться письма перед их
опубликованием в рассылку. Для новостной рассылки только эти адреса могут
могут писать в рассылку. Для конференции модераторы не предумотрены.
</span>
</div>
</div>
<div id="moderators_body">
<textarea name="moderators" id="moderators">{$moderators}</textarea>
</div>
</div>
</div>
</form>
</body>
</html>

View File

@@ -0,0 +1,33 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="header">Сервис рассылок</div>
<div id="error">
{if $error_code == 1}
Домен может содержать только латинские буквы, точки, дефисы и цифры.
{elseif $error_code == 2}
Пароль может содержать только латинские буквы и цифры.
{elseif $error_code == 3}
Неверный пароль.
{elseif $error_code == 4}
Такой домен не зарегистрирован.
{elseif $error_code == 5}
Название рассылки может содержать только латинские буквы, цифры и символы нижнего подчёркивания.
{elseif $error_code == 6}
Длина названия рассылки не может превышать 30-ти символов.
{elseif $error_code == 7}
Длина префикса не может превышать 128-ти символов.
{elseif $error_code == 8}
Длина подписи не может превышать 1024-ти символов.
{elseif $error_code == 9}
Среди подписчиков есть некорректный e-mail.
{elseif $error_code == 10}
Среди модераторов есть некорректный e-mail.
{else}
Неизвестная ошибка.
{/if}
</div>
</body>
</html>

View File

@@ -0,0 +1,80 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<script>
function validate_form()
{
var name = document.getElementById('add_list_input').value;
var name = name.toLowerCase();
if (name == "")
{
return false;
}
if (name.length > 30)
{
alert("Название списка рассылки должно содержать не более 30-ти символов.");
return false;
}
if ( name.match(/[^a-z0-9_]/) )
{
alert("Название списка рассылки может содержать только латинские буквы, цифры и символы нижнего подчёркивания.");
return false;
}
}
function confirm_delete()
{
return confirm("Вы действительно хотите удалить список рассылки?");
}
</script>
</head>
<body>
<div id="header">
<div id="header_left">
Сервис рассылок
</div>
<div id="header_right">
<a href="logout.php">Выйти</a>
</div>
</div>
<div id="breadcrumbs">{$domain}</div>
<div id="index">
<div id="lists_header">
<b>Все листы рассылок:</b>
&nbsp;
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_add_list">
Добавляйте и удаляйте списки рассылки с помощью данной формы. Вы можете редактировать список, кликнув по его названию.
Письмо в рассылку отправляется на адрес example@{$domain}, где example имя рассылки.
</span>
</div>
</div>
<table id="lists">
{foreach $lists as $list}
<tr>
<td>
&bull;
</td>
<td>
<a href="edit_list.php?list_name={$list}">{$list}</a>
</td>
<td>
<a href="del_list.php?list_name={$list}" onclick="return confirm_delete()"><img src="delete.svg" width=15></a>
</td>
</tr>
{/foreach}
</table>
<form method="post" action="add_list.php" onsubmit="return validate_form()">
<div id="add_list">
<input type="text" name="list_name" id="add_list_input">
&nbsp;
<input type="submit" name="submit" value="Добавить" id="add_list_button">
</div>
</form>
</div>
</body>
</html>

View File

@@ -0,0 +1,62 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<script>
function validate_form()
{
var domain = document.getElementById('domain_input').value;
var password = document.getElementById('password_input').value;
if (domain == "")
{
alert("Введите домен.");
return false;
}
if (password == "")
{
alert("Введите пароль.");
return false;
}
if ( domain.match(/[^A-Za-z0-9\-\.]/) )
{
alert("Домен может содержать только латинские буквы, цифры, точки и дефисы.");
return false;
}
if ( password.match(/[^A-Za-z0-9]/) )
{
alert("Пароль может содержать только латинские буквы и цифры.");
return false;
}
}
</script>
</head>
<body>
<div id="header">Сервис рассылок</div>
<div id="login">
<div id="login_form">
<form method="post" action="login.php" onsubmit="return validate_form()">
<div id="domain">
<div id="domain_left">
Домен:
</div>
<div id="domain_right">
<input type="text" name="login_domain" id="domain_input">
</div>
</div>
<div id="password">
<div id="password_left">
Пароль:
</div>
<div id="password_right">
<input type="password" name="login_pass" id="password_input">
</div>
</div>
<div id="enter">
<input type="submit" name="submit" value="Войти">
</div>
</form>
</div>
</div>
</body>
</html>