Hi,

This looks nice, but you need to detect suffixes, so checking the
complete name won't work.

Also 'a = ("join" || "leave")' won't work, you need to use the full
'a == "join" || a == "leave"'.

I think you can use "php -l" to check syntax.

-- 
Sylvain

On Fri, Aug 29, 2008 at 05:29:04PM +0300, Yavor Doganov wrote:
> I'm not sure, but judging by sr #106481 and the similar case with
> Vivek, it seems to me that mailing lists with such names should not be
> created at all, warning the user appropriately.
> 
> I tried to "implement" this and I'm ashamed to post the "patch"; this
> is the first PHP file I edit in my life :(
> 
> Please don't laugh too loud...
> 
> 
> From d34a9e66b30569bf5a5b3b5aa57bbfcc34885c99 Mon Sep 17 00:00:00 2001
> From: Yavor Doganov <[EMAIL PROTECTED]>
> Date: Fri, 29 Aug 2008 17:14:55 +0300
> Subject: [PATCH] Prevent creation of mailing lists with names reserved by 
> Mailman.
> 
> ---
>  frontend/php/mail/admin/index.php |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/frontend/php/mail/admin/index.php 
> b/frontend/php/mail/admin/index.php
> index 5a81569..8e3ace1 100644
> --- a/frontend/php/mail/admin/index.php
> +++ b/frontend/php/mail/admin/index.php
> @@ -125,6 +125,14 @@ if ($post_changes)
>           continue;
>         }
>       
> +     // Check if the user specified a name reserved by Mailman.
> +     if ($list_name['new'] == ("join" || "leave" || "owner" 
> +                               || "request" || "admin"))
> +          {
> +         fb(sprintf(_("List name %s is reserved by Mailman."), 
> $list_name['new']), 1);
> +         continue;
> +       }
> +
>       // Check if the list does not exists already
>       $result = db_execute("SELECT group_id FROM mail_group_list WHERE 
> lower(list_name)=?", array($new_list_name));
>       
> -- 
> 1.5.6.3
> 


Reply via email to