RE: [PEAR-DEV] [patch] Auth: patch allowing usage of 'custom' form fieldnames for username & password
| From: | Herman Sinte Maartensdijk | Date: | Thu, 11 Mar 2004 09:16:39 +0000 |
| Subject: | RE: [PEAR-DEV] [patch] Auth: patch allowing usage of 'custom' form fieldnames for username & password | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-26289@lists.php.net to get a copy of this message | ||
Since a patch should be based on the latest version in CVS I modified my patch to work on top of the
1.73 version of Auth.php. Please ignore my previous patch
changes: Added setPostUsername & setPostPassword methods to set variable post-variable name
through a method rather than using $options in the constructor.
Herman
-----Original Message-----
From: Herman Sinte Maartensdijk
Sent: Thursday, March 11, 2004 09:39
To: Cipriano Groenendal; pear-dev@lists.php.net
Subject: RE: [PEAR-DEV] [patch] Auth: patch allowing usage of 'custom'
form fieldnames for username & password
Hmm it did not get through? I use Outlook (not express) but I guess that has
the same bug. I see the it is in CVS. I wonder how I missed it. I must have been fiddling with
too many different versions of Auth.php. I accidentally based my patch on the latest official
release of the Auth.php file. Oh well as long as a patch is in.
Looking at the patch from Michael Wallner I notice he sets the postUsername and postPassword
from the $options array. This ain't very friendly for wrapper classes that set different
default
values, which is why I implemented it with setters. Getters might be nice to for completeness
although I dont see any direct use for them.
I've re-attached my diff file to this mail with a .txt extension in case it did not arrive at
Yavor e.a.
Cheers,
Herman
-----Original Message-----
From: Cipriano Groenendal [mailto:cipri@cipri.com]
Sent: Wednesday, March 10, 2004 21:59
To: Herman Sinte Maartensdijk; pear-dev@lists.php.net
Subject: Re: [PEAR-DEV] [patch] Auth: patch allowing usage of 'custom'
form fieldnames for username & password
> I created a patch for the Auth package to support 'custom'
> form fieldnames for username & password instead of the
> fixed 'username' and 'password'
> Added 2 functions (setUsernameField and setPasswordField)
> to set the custom values if desired.
Hello :)
First of all, your patch didn't come through. Judging form your HTML mail,
you're using Outlook Express, which has a n asty little bug which means you
need to rename your patch file to .txt or it won't be accepted by the
mailing list.
Second, the change you have in your patch was recently added to the CVS
already after a patch from Michael Wallner mike@php.net, see the CVS[1] for
details of the file. This patch set those two options using the $options
array via the constructor, IIRC. However it might indeed also be a nice idea
to have setters/getters for these two fields. Thanks for your ideas and
wishing to contribute to PEAR however! I'm sure Yavor/The other Devs will
take a look at your patch and perhaps integrate the things it does better
then Mike's patch into the package :)
--
Cipriano
[1] http://cvs.php.net/diff.php/pear/Auth/Auth.php?r1=1.72&r2=1.73&ty=h
--- Auth.php.1.73 Thu Mar 11 10:08:56 2004 +++ Auth.php Thu Mar 11 10:10:52 2004 @@ -17,6 +17,7 @@ // +----------------------------------------------------------------------+ // // $Id: Auth.php,v 1.73 2004/03/03 23:15:06 yavo Exp $ +// Added setPostUsername & setPostPassword // require_once 'PEAR.php'; @@ -408,6 +409,36 @@ function setSessionname($name = 'PHPSESSID') { @session_name($name); + } + + // }}} + // {{{ setPostUsername() + + /** + * Set Username key in POST array + * + * @access public + * @param string New name for the Username key + * @return void + */ + function setPostUsername($field = 'username') + { + $this->_postUsername = $field; + } + + // }}} + // {{{ setPostPassword() + + /** + * Set Password key in POST array + * + * @access public + * @param string New name for the Password key + * @return void + */ + function setPostPassword($field = 'password') + { + $this->_postPassword = $field; } // }}}
--- Auth.php.1.73 Thu Mar 11 10:08:56 2004 +++ Auth.php Thu Mar 11 10:10:52 2004 @@ -17,6 +17,7 @@ // +----------------------------------------------------------------------+ // // $Id: Auth.php,v 1.73 2004/03/03 23:15:06 yavo Exp $ +// Added setPostUsername & setPostPassword // require_once 'PEAR.php'; @@ -408,6 +409,36 @@ function setSessionname($name = 'PHPSESSID') { @session_name($name); + } + + // }}} + // {{{ setPostUsername() + + /** + * Set Username key in POST array + * + * @access public + * @param string New name for the Username key + * @return void + */ + function setPostUsername($field = 'username') + { + $this->_postUsername = $field; + } + + // }}} + // {{{ setPostPassword() + + /** + * Set Password key in POST array + * + * @access public + * @param string New name for the Password key + * @return void + */ + function setPostPassword($field = 'password') + { + $this->_postPassword = $field; } // }}}