phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [phpGroupWare-developers] [patch] Fix for NOTICEs in preferences/cha


From: Johan Gunnarsson
Subject: Re: [phpGroupWare-developers] [patch] Fix for NOTICEs in preferences/changepassword.php
Date: Mon, 11 Jun 2007 15:02:53 +0200

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

On 6/11/07, Dave Hall <address@hidden> 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 address@hidden
w phpgroupware.org
j address@hidden
sip address@hidden
       _            ____                    __        __
 _ __ | |__  _ __  / ___|_ __ ___  _   _ _ _\ \      / /_ _ _ __ ___
| '_ \| '_ \| '_ \| |  _| '__/ _ \| | | | '_ \ \ /\ / / _` | '__/ _ \
| |_) | | | | |_) | |_| | | | (_) | |_| | |_) \ V  V / (_| | | |  __/
| .__/|_| |_| .__/ \____|_|  \___/ \__,_| .__/ \_/\_/ \__,_|_|  \___|
|_|         |_|                         |_|Web based collaboration platform




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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]