[dev] Re: [cvs] commit: horde/templates/admin/user add.inc approve.inc horde/admin user.php horde/lib Signup.php

John Morrissey jwm at horde.net
Mon Jul 21 08:36:44 PDT 2003


On Fri, Jul 18, 2003 at 02:47:56PM -0400, Chuck Hagenbuch wrote:
% > * The $addForm->clearVars($vars) call in admin/user.php doesn't work, so
% >   the form still displays the approved user's information after the user
% >   is added. Could someone give me some pointers on this? I tried going
% >   through the Horde_Form code, but quickly got confused.
% 
% Could have been the &$vars in the function call, which I just removed
% (well, fixed to just $vars). Call-time pass by reference isn't valid.

I tried that in desperation; it wasn't working as expected when passing by
value. I'll have another look and see if I can figure out what's going on.

% (also, you might want to take a quick swing through CODING_STANDARDS;
% there were a few misplaced braces and other minor stuff in other pieces of
% this code).

A couple questions:

  if ((condition1) || (condition2) || (condition3) ||
      (condition4)) {
      action1;
  }

is the appropriate way to brace multi-line if statements?


Also, I see you added a couple newlines before the closing class brace,
i.e.:

class Foo
{
  function()
  {

  }
  // <-- this newline
}

I didn't see this in CODING_STANDARDS - should I add it?


Next, I saw you changed:

-$addForm = new Horde_Form($vars, _("Add a new user:"), 'adduser');
+$addForm = &new Horde_Form($vars, _("Add a new user:"), 'adduser');

How do you tell when the reference should be taken when instantiating a
class?


Lastly, I have a question about PEAR_Error handling. The PEAR::isError I
have checks whether the passed object is_subclass_of(, 'PEAR_Error'). Why
use is_a()?

thanks,
john
-- 
John Morrissey          _o            /\         ----  __o
jwm at horde.net        _-< \_          /  \       ----  <  \,
www.horde.net/    __(_)/_(_)________/    \_______(_) /_(_)__


More information about the dev mailing list