Initial commit for release of version 1.0

This commit is contained in:
2021-08-12 22:55:38 +02:00
parent b9a88906ce
commit 9db6477952
70 changed files with 415 additions and 2129 deletions

View File

@@ -3,29 +3,9 @@
<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;
@@ -42,12 +22,6 @@
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]) )
@@ -72,10 +46,10 @@
<body onload="switch_moderators_form()">
<div id="header">
<div id="header_left">
Manage your ECG mailing lists
{$headline}
</div>
<div id="header_right">
<a href="logout.php">Log out</a>
<a href="logout.php">Logout ({$username})</a>
</div>
</div>
<div id="breadcrumbs">
@@ -90,8 +64,7 @@
<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.
Please provide one email address per line.
</span>
</div>
</div>
@@ -103,45 +76,13 @@
<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.
The prefix will be added to the subject field of each message.
</span>
</div>
&nbsp;Prefix:
@@ -151,39 +92,6 @@
<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">
@@ -192,20 +100,26 @@
</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>
{if $moderators ne NULL}
<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>
<div id="moderators_body">
<textarea name="moderators" id="moderators">{$moderators}</textarea>
</div>
<div id="moderators_body">
<textarea name="moderators" id="moderators">{$moderators}</textarea>
</div>
{else}
<div id="moderators_header">
List not moderated.
</div>
{/if}
</div>
</div>
</form>

View File

@@ -3,7 +3,7 @@
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="header">Mailing lists service</div>
<div id="header">{$headline}</div>
<div id="error">
{if $error_code == 1}
Domain can contain only english letters, dots, hyphens and digits.
@@ -25,6 +25,8 @@
There is an incorrect email in the subscribers list.
{elseif $error_code == 10}
There is an incorrect email in the moderators list.
{elseif $error_code == 11}
You do not own this list.
{else}
Unknown error.
{/if}

View File

@@ -27,54 +27,85 @@
function confirm_delete()
{
return confirm("Are you really want to delete the mailing list?");
return confirm("Do you really want to delete the mailing list?");
}
</script>
</head>
<body>
<div id="header">
<div id="header_left">
Manage your ECG mailing lists
{$headline}
</div>
<div id="header_right">
<a href="logout.php">Log out</a>
<a href="logout.php">Logout ({$username})</a>
</div>
</div>
<div id="breadcrumbs">{$domain}</div>
<div id="index">
<div id="lists_header">
<b>All available mailing lists:</b>
<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.
To post a message into a mailing list send an email to example@{$domain}, where "example" is the lists name.
</span>
</div>
</div>
<table id="lists">
<tr>
<td>
&starf;
</td>
<td style="font-weight: bold;">
Lists you own (editable)
</td>
</tr>
{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>
{if $list == 1}
<tr>
<td>
&check;
</td>
<td>
<a href="edit_list.php?list_name={$list@key}">{$list@key}</a>
</td>
</tr>
{/if}
{/foreach}
<tr>
<td>
&nbsp;
</td>
<td>
&nbsp;
</td>
</tr>
<tr>
<td>
&starf;
</td>
<td style="font-weight: bold;">
All other lists (not editable)
</td>
</tr>
{foreach $lists as $list}
{if $list == 0}
<tr>
<td>
&cross;
</td>
<td>
{$list@key}
</td>
</tr>
{/if}
{/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

@@ -4,44 +4,40 @@
<script>
function validate_form()
{
var domain = document.getElementById('domain_input').value;
var username = document.getElementById('username_input').value;
var password = document.getElementById('password_input').value;
if (domain == "")
if (username == "")
{
alert("Enter domain.");
alert("Please enter your username.");
return false;
}
if (password == "")
{
alert("Enter password.");
alert("Please enter your password.");
return false;
}
if ( domain.match(/[^A-Za-z0-9\-\.]/) )
if (username.match(/[^A-Za-z\-\.]/))
{
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.");
alert("The username may only contain english letters, dots and hyphens.");
return false;
}
}
</script>
</head>
<body>
<div id="header">Mailing lists service</div>
<div id="header">{$headline}</div>
<div id="login">
<div id="login_form">
<p>Please enter the credentials of your ECG account (<strong>without</strong> @ecogood.org).</p>
<form method="post" action="login.php" onsubmit="return validate_form()">
<div id="domain">
<div id="domain_left">
Domain:
<div id="username">
<div id="username_left">
Username:
</div>
<div id="domain_right">
<input type="text" name="login_domain" id="domain_input">
<div id="username_right">
<input type="text" name="login_username" id="username_input">
</div>
</div>
<div id="password">
@@ -52,8 +48,9 @@
<input type="password" name="login_pass" id="password_input">
</div>
</div>
<a href="https://wiki.ecogood.org/display/PUBLIC/IT-Support" target="_blank"><p>Forgot your password?</p></a>
<div id="enter">
<input type="submit" name="submit" value="Enter">
<input type="submit" name="submit" value="Login">
</div>
</form>
</div>