public inbox for mlmmj@mlmmj.org
 help / color / mirror / Atom feed
From: Ben Schmidt <mail_ben_schmidt@yahoo.com.au>
To: mlmmj@mlmmj.org
Subject: Re: [mlmmj] Subscribers management in php-admin
Date: Sun, 11 Mar 2012 13:06:49 +0000	[thread overview]
Message-ID: <4F5CA369.70005@yahoo.com.au> (raw)
In-Reply-To: <4F4BFAA7.4060702@pub.positon.org>

Committed. Thank you, Marc.

If you're able to extend it one day to handle digesters and nomailers, just send 
the patch my way.

Smiles,

Ben.



On 5/03/12 11:02 PM, Marc MAURICE wrote:
> Hello Ben,
>
> Here is the new patch.
>
>> - You have added new files; could they have headers clarifying their
>> license, please?
> license added to subscribers.php
>> - /var/spool/mlmmj should not be hardcoded; you should use $topdir.
> done
>> - You need to unset($out) before calling exec(...,$out,...); see the PHP
>> documentation for exec().
> done
>> - Please don't ini_set display_errors to true; that could expose details
>> that the server administrator does not want to expose; admins should
>> have their PHP logging set up adequately to give them what they need,
>> or can change ini settings themselves if they need to.
> deleted
>> - Could you concatenate strings and use \n for linebreaks, please,
>> maintaining the indent in the PHP script, instead of having string
>> literals that span multiple lines?
> done in index.php
>> - Could you consider extending this slightly to allow subscription of
>> digesters and nomailers? (Update the README, too, to get permissions
>> set correctly on all relevant directories.) This could be a separate
>> patch, or omitted, but it would be nice.
> Yes, it would be better in a new patch.
> I will try to find some time to work on it next days.
>
> Ho I have on question : what is the main purpose of nomailers ?
> I understand that those people do not get any list mail.
> Is it to be able to post to a list without receiving mail with subonlypost ?
>
> I did not find anything about it in the doc.
>
> Thanks in advance,
>
> Marc
>
>
>
>>
>>
>>
>>
>> On 2/03/12 11:59 PM, Marc MAURICE wrote:
>>> Here is the new patch version.
>>>
>>> The email should be displayed, otherwise the user will have no clue about which
>>> email is wrong if his email list is very long.
>>>
>>> I put htmlspecialchars everywhere and errors are now enclosed in <pre> tags.
>>> no need for ln2br in <pre> tags no ?
>>>
>>> Marc
>>>
>>>
>>> Le 01/03/2012 16:07, Thomas Goirand a écrit :
>>>> On 03/01/2012 09:08 PM, Marc MAURICE wrote:
>>>>> +if (isset($_POST["tosubscribe"])) {
>>>>> +
>>>>> + foreach (preg_split('/\r\n|\n|\r/', $_POST["tosubscribe"]) as $line) {
>>>>> + $email = trim($line);
>>>>> + if ($email != "") {
>>>>> + if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
>>>>> + $cmd = "/usr/bin/mlmmj-sub -L '/var/spool/mlmmj/".escapeshellarg($list)."' -a
>>>>> '".escapeshellarg($email)."' 2>&1";
>>>>> + exec($cmd, $out, $ret);
>>>>> + if ($ret != 0) {
>>>>> + $message.= "Subscribe error for $email<!--cmd=$cmd out=".implode($out)."
>>>>> ret=$ret--> <br/>";
>>>>> + }
>>>>> + } else {
>>>>> + $message.= "Email address not valid: $email<br/>";
>>>> If $email isn't valid, then it's even more a reason not to display it
>>>> (eg: unless you want to shoot yourself in the foot with issues like
>>>> cross site scripting...).
>>>>
>>>> Also, I'm not sure what you are attempting with "displaying" the output
>>>> of the subscribing command in a HTML comment. Why not displaying it for
>>>> real, using htmlspecialchars() (which by the way, you didn't use, which
>>>> is dangerous) and ln2br() in a<pre> tag?
>>>>
>>>> Thomas
>>>>
>>>>


  parent reply	other threads:[~2012-03-11 13:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-27 21:50 [mlmmj] Subscribers management in php-admin Marc MAURICE
2012-02-28  9:25 ` Thomas Goirand
2012-02-28  9:47 ` Marc MAURICE
2012-02-28 14:29 ` Ben Schmidt
2012-02-29  3:09 ` Thomas Goirand
2012-02-29  3:57 ` Ben Schmidt
2012-03-01 13:08 ` Marc MAURICE
2012-03-01 15:07 ` Thomas Goirand
2012-03-02 12:59 ` Marc MAURICE
2012-03-04 14:05 ` Ben Schmidt
2012-03-05 12:02 ` Marc MAURICE
2012-03-06  8:45 ` Mads Martin Jørgensen
2012-03-11 13:06 ` Ben Schmidt [this message]
2012-03-11 13:46 ` Ben Schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F5CA369.70005@yahoo.com.au \
    --to=mail_ben_schmidt@yahoo.com.au \
    --cc=mlmmj@mlmmj.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox