Source for file passwdfield.php
Documentation is available at passwdfield.php
* a text field that is designed to hold passwords
* @author Stuart Prescott
* @copyright Copyright Stuart Prescott
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @subpackage FormsLibrary
/** Load ancillary functions */
require_once 'inc/typeinfo.php';
require_once 'textfield.php';
/** username and password checks */
require_once 'inc/passwords.php';
* a text field that is designed to hold passwords
* @subpackage FormsLibrary
* @todo //TODO: js to check double entry passwd is the same
/** @var string algorithm used to encrypt the data */
* Create a new password field object
* @param string $name the name of the field (db name, and html field name
* @param string $longname long name to be used in the label of the field in display
* @param string $description used in the html title or longdesc for the field
function PasswdField($name, $longname=
'', $description=
'') {
parent::TextField($name, $longname, $description);
$t =
'<input type="password" name="'.
$this->namebase.
$this->name.
'" ';
$t .=
(isset
($this->attr['size']) ?
'size="'.
$this->attr['size'].
'" ' :
'');
$t .=
(isset
($this->attr['maxlength']) ?
'maxlength="'.
$this->attr['maxlength'].
'" ' :
'');
* We shouldn't give up our data too easily.
* Update the value of the field from user-supplied data, but only if the field was filled in
* Empty values don't count -- that way an unfilled passwd field will never count as changed
* @param array $data list of field_name => value pairs
if (parent::update($data)) {
* return a SQL-injection-cleansed string that can be used in an SQL
* UPDATE or INSERT statement. i.e. "name='Stuart'".
* @param string $name the field name to be used
* @return string in SQL assignable form
return $name .
"='$pass'";
Documentation generated on Tue, 06 Mar 2007 10:01:48 +0000 by phpDocumentor 1.3.0