Alright then, I've posted the patch including your comments on the
patch manager.

On 6/11/07, Dave Hall <[EMAIL PROTECTED]> wrote:
Hi Johan,

Thanks for the patch.  In future please post them on the patch manager
savannah - https://savannah.gnu.org/patch/?group=phpgroupware  That way
they don't get lost.

On Sun, 2007-06-10 at 12:35 +0200, Johan Gunnarsson wrote:

> Hi,
> I stumbled upon some NOTICE errors while hacking on a hook on password
> changes. See attachment.
>
> (This is my first phpgw patch - yay!)

<snip />

> -       $n_passwd   = $_POST['n_passwd'];
> -       $n_passwd_2 = $_POST['n_passwd_2'];
> +       $n_passwd   = @$_POST['n_passwd'];
> +       $n_passwd_2 = @$_POST['n_passwd_2'];

For these I would suggest

$n_passwd   = isset($_POST['n_passwd']) && $_POST['n_passwd'] ? 
$_POST['n_passwd'] : '';

>
-       if (! $GLOBALS['phpgw']->acl->check('changepassword', 1) || 
$_POST['cancel'])
+       if (! $GLOBALS['phpgw']->acl->check('changepassword', 1) || 
isset($_POST['cancel']))
        {
As pointed out by Sigurd, these should check more than just isset, try
something like

if (! $GLOBALS['phpgw']->acl->check('changepassword', 1)
        || (isset($_POST['cancel']) && $_POST['cancel']) )

I understand your point about isset and a value check evaluating to
false, but our form buttons should have a value which doesn't evaluate
to false.

Cheers

Dave

--
Dave Hall (aka skwashd)
API Coordinator
phpGroupWare
e [EMAIL PROTECTED]
w phpgroupware.org
j [EMAIL PROTECTED]
sip [EMAIL PROTECTED]
       _            ____                    __        __
 _ __ | |__  _ __  / ___|_ __ ___  _   _ _ _\ \      / /_ _ _ __ ___
| '_ \| '_ \| '_ \| |  _| '__/ _ \| | | | '_ \ \ /\ / / _` | '__/ _ \
| |_) | | | | |_) | |_| | | | (_) | |_| | |_) \ V  V / (_| | | |  __/
| .__/|_| |_| .__/ \____|_|  \___/ \__,_| .__/ \_/\_/ \__,_|_|  \___|
|_|         |_|                         |_|Web based collaboration platform




_______________________________________________
phpGroupWare-developers mailing list
phpGroupWare-developers@gnu.org
http://lists.gnu.org/mailman/listinfo/phpgroupware-developers



_______________________________________________
phpGroupWare-developers mailing list
phpGroupWare-developers@gnu.org
http://lists.gnu.org/mailman/listinfo/phpgroupware-developers

Reply via email to