commit 9e422ec7a8af767683c1a6fb87d6749ab7b436a1 from: Mischa Peters date: Sun Aug 03 08:44:22 2014 UTC Initial Commit commit - /dev/null commit + 9e422ec7a8af767683c1a6fb87d6749ab7b436a1 blob - /dev/null blob + 14e4dd49773cb28ef3e779d5ccaab5654d0e6c84 (mode 644) --- /dev/null +++ CHANGELOG.md @@ -0,0 +1,31 @@ +# Minimalist Mailinglist Manager + +#### Version 0.6 -- 2011/03/06 +- Changed: eregi() to preg_match(). +- Changes: split() to preg_split(). + + +#### Version 0.5 -- 2007/11/14 +- Added: Charset iso-8859-1 header. (Suggested by Michael Baierl) +- Fixed: Security issue! Check input for l/$get_list. (Found by Michael Baierl) + + +### Version 0.4 -- 2005/10/22 +- Fixed: small list-writers bug. + + +#### Version 0.3 -- 2005/10/10 +- Added: Toggle for list-writers (default disabled). +- Added: "Back" button. +- Changed: $CONF['list'] changed to $CONF['list_name']. +- Changed: Moved most of $CONF to global config.inc. +- Changed: Function that read lists.lst. +- Fixed: Pesky variable error messages. + + +#### Version 0.2 -- 2005/08/10 +- Added: Write only option for list-writers. + + +#### Version 0.1 -- 2005/06/06 +- Initial release. blob - /dev/null blob + 158c429dfe2c33fd13beaa9ec7eb2118333c6635 (mode 644) --- /dev/null +++ README.md @@ -0,0 +1,38 @@ +# Minimalist Mailinglist Manager + + +#### REQUIRED!! +- You are using Minimalist +- You are using Apache/NGINX or any other webserver that understands PHP +- You are using PHP 4.1 or higher. + + +### 1. Unarchive Minimalist Manager + +Make sure that you are in your WWW directory and then unarchive the +Minimalist Manager archive (whatever the filename is): + +`tar -zxvf minimalist-manager-0.6.tgz` + + +### 2. Configure + +Check the `config.inc` file. There you can specify settings that are relevant to your setup. + + +### 3. Create list configuration + +The list information is taken from the lists.lst file from Minimalist. + +In the directory `/lists` you find 2 files. One .css file in which you can modify the appearance of the subscribe/unsubscribe window. And one config file, in which relevant information which describes the mailinglist. + +You have to create at least the config file per list. If there is no css file it will use the toplevel stylesheet located in the root of Minimalist Manager. + + +### 4. Done +This is all that is needed. Fire up your browser and go to the site that you specified to host Minimalist Manager. + + +### 5. More information +For more information you can go to the Minimalist website. +https://high5.nl/mirrors/minimalist/index.html blob - /dev/null blob + 44aab43a5e781bb1755e292d8ed65b60420215a0 (mode 644) --- /dev/null +++ config.inc @@ -0,0 +1,31 @@ +ERROR: The two email addresses don't match!\n"; +$CONF['error_email_notvalid'] = "ERROR: You have not entered a correct email address!\n"; +?> blob - /dev/null blob + 5bdbbfad088e72bab634fe415f2161227bc9c114 (mode 644) --- /dev/null +++ index.php @@ -0,0 +1,206 @@ +) +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// +// Minimalist Admin verion 0.6, Copyright (c) 2005-2014 High5! (Mischa Peters) +// Minimalist Admin comes with ABSOLUTELY NO WARRANTY. +// This is free software, and you are welcome to redistribute it +// under certain conditions. +// +// High5!, hereby disclaims all copyright interest in the program +// `Minimalist Admin' (which makes passes at Minimalist) written +// by Vladimir Litovka. +// +//error_reporting(E_NOTICE | E_ERROR | E_WARNING | E_PARSE); + +// Read global config file +include "config.inc"; + +// Minimalist Admin version +$version = "0.6"; + +// Set some variables. +$get_list = ""; +$email = ""; +$emailconfirm = ""; +$writeonly = ""; +$unsubscribe = ""; + +// _GET list to process +if (!empty($_GET['l'])) +{ + $get_list = $_GET['l']; + if (!preg_match('/^([a-z0-9-])+$/i', trim($get_list))) + { + header("Location: index.php"); + exit; + } + // Check if list config exists and include it + if (file_exists("lists/$get_list-config.inc")) include "lists/$get_list-config.inc"; +} + +// Set variables from config.inc and lists/$get_list-config.inc +$minimalist_lists = $CONF['minimalist_lists']; +$minimalist_email = $CONF['minimalist_email']; +$minimalist_title = $CONF['minimalist_title']; +$minimalist_list_title = $CONF['minimalist_list_title']; +$list_name = $CONF['list_name']; +$list_writers = $CONF['list_writers']; +$list_subscribe = $CONF['list_subscribe']; +$list_unsubscribe = $CONF['list_unsubscribe']; +$error_email_nomatch = $CONF['error_email_nomatch']; +$error_email_notvalid = $CONF['error_email_notvalid']; + +// Print the html header +print_header(); + +// Test if REQUEST_METHOD is a GET request +if ($_SERVER['REQUEST_METHOD'] == "GET") +{ + // If $get_list is not empty print list form + if (!empty($get_list)) + { + print_form(); + print_footer(); + } + // If $get_list is empty process the $minimalist_lists file. + else + { + if (file_exists("$minimalist_lists")) + { + $fh = file("$minimalist_lists"); + print "\n"; + for ($i = 0; $i < sizeof($fh); $i++) + { + list($list, $desc) = preg_split("/\t/", $fh[$i], 2); + if (!empty($list)) print "\n"; + } + print "
$list$desc
\n"; + } + else + { + print "Unable to find minimalists file at: $minimalist_lists\n"; + } + print_footer(); + } +} + +// Test if REQUEST_METHOD is a GET request +if ($_SERVER['REQUEST_METHOD'] == "POST") +{ + if (!empty($_POST['email'])) $email = $_POST['email']; + if (!empty($_POST['emailconfirm'])) $emailconfirm = $_POST['emailconfirm']; + if (!empty($_POST['writeonly'])) $writeonly = $_POST['writeonly']; + if (!empty($_POST['unsubscribe'])) $unsubscribe = $_POST['unsubscribe']; + + if ($email != $emailconfirm) + { + print "$error_email_nomatch\n"; + print_form(); + print_footer(); + exit; + } + + if (!preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_{|}~]+' . '@' . '([-0-9A-Z]+\.)+' . '([0-9A-Z]){2,4}$/i', trim($email))) + { + print "$error_email_notvalid\n"; + print_form(); + print_footer(); + exit; + } + + if (!empty($writeonly)) + { + $get_list = $get_list . "-writers"; + } + + if ($unsubscribe) + { + mail($minimalist_email, "unsubscribe $get_list $email", "", "From: $email"); + print "$list_unsubscribe\n"; + print_footer(); + exit; + } + else + { + mail($minimalist_email, "subscribe $get_list $email", "", "From: $email"); + print "$list_subscribe\n"; + print_footer(); + exit; + } +} + +function print_header() +{ + global $get_list; + global $minimalist_title; + global $minimalist_list_title; + global $list_name; + global $list_writers; + + // Set the title_list_name to $list_name if $get_list is empty. + $title_list_name = (empty($list_name)) ? $get_list : $list_name; + // Set the title to $minimalist_title if $get_list is empty. + $title = (empty($get_list)) ? $minimalist_title : "$minimalist_list_title $title_list_name"; + + print "\n"; + print "\n"; + print "\n"; + print "\n"; + if (file_exists(realpath("lists/$get_list-stylesheet.css"))) + { + print "\n"; + } + else + { + print "\n"; + } + print "$title\n"; + print "\n"; + print "\n"; + print "

$title

\n"; +} + +function print_form() +{ + global $list_writers; + print "
\n"; + print "\n"; + print "\n"; + print "\n"; + if (preg_match("/enable/", $list_writers)) { + print "\n"; + } + print "\n"; + print "\n"; + print "
Email:
Email (verification):
Post Only (don't receive):
Unsubscribe:
\n"; + print "
\n"; + print "
\n"; + print "Back\n"; +} + +function print_footer() +{ + global $version; + print "
\n"; + print "Copyright (c) 2005-2011 by High5! -- Minimalist Admin v$version\n"; + print "
\n"; + print "\n"; + print "\n"; +} +?> blob - /dev/null blob + 2d85810bce37e6165ccc8a4f2fc435228927da88 (mode 644) --- /dev/null +++ lists/example-config.inc @@ -0,0 +1,17 @@ +ERROR: The two email addresses don't match!\n"; +//$CONF['error_email_notvalid'] = "ERROR: You have not entered a correct email address!\n"; +?> blob - /dev/null blob + 6a2de364b6b403e5e73c32f5bb22b29e60ce7620 (mode 644) --- /dev/null +++ lists/example-stylesheet.css @@ -0,0 +1,73 @@ +body { + background: #ffffff; + color: #000000; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; + font-weight: normal; + text-align: center; + margin-right: auto; + margin-left: auto; + width: 750px; +} + +h2 { + background: #efefef; + color: #000000; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 20px; + font-weight: bold; + text-align: center; +} + +table { + background: #efefef; + color: #000000; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; + font-weight: normal; + text-align: left; + margin-top: 10px; + margin-right: auto; + margin-left: auto; +} + +table.list { + background: #ffffff; + color: #000000; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; + font-weight: normal; + text-align: left; + margin-top: 10px; + margin-right: auto; + margin-left: auto; +} + +.error { + background: #ffffff; + color: #d01313; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; + font-weight: normal; +} + +#footer { + background: #efefef; + border-top: 1px solid #bbbbbb; + color: #999999; + font-size: 9px; + line-height: 20px; + margin: 20px auto; + text-align: left; + width: 750px; +} + +#footer a { + color: #999999; + text-decoration: none; +} + +#footer a:hover { + color: #777777; + text-decoration: underline; +} blob - /dev/null blob + 168ce0c97177fb0a5430978d7af89ae76bc147de (mode 644) --- /dev/null +++ lists/index.php @@ -0,0 +1,3 @@ + blob - /dev/null blob + 6a2de364b6b403e5e73c32f5bb22b29e60ce7620 (mode 644) --- /dev/null +++ stylesheet.css @@ -0,0 +1,73 @@ +body { + background: #ffffff; + color: #000000; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; + font-weight: normal; + text-align: center; + margin-right: auto; + margin-left: auto; + width: 750px; +} + +h2 { + background: #efefef; + color: #000000; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 20px; + font-weight: bold; + text-align: center; +} + +table { + background: #efefef; + color: #000000; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; + font-weight: normal; + text-align: left; + margin-top: 10px; + margin-right: auto; + margin-left: auto; +} + +table.list { + background: #ffffff; + color: #000000; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; + font-weight: normal; + text-align: left; + margin-top: 10px; + margin-right: auto; + margin-left: auto; +} + +.error { + background: #ffffff; + color: #d01313; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; + font-weight: normal; +} + +#footer { + background: #efefef; + border-top: 1px solid #bbbbbb; + color: #999999; + font-size: 9px; + line-height: 20px; + margin: 20px auto; + text-align: left; + width: 750px; +} + +#footer a { + color: #999999; + text-decoration: none; +} + +#footer a:hover { + color: #777777; + text-decoration: underline; +}