Source for file DBMS_FIELD_PASSWORD.phpclass
Documentation is available at DBMS_FIELD_PASSWORD.phpclass
* Class file DBMS_FIELD_PASSWORD.phpclass
* @project Open CSP-Management
* @author Peter Krebs <p.krebs@lvus.at>
* @copyright (c) 2002-2005 by LVUS <http://opencsp.lvu.at>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
if (empty($GLOBALS['OCSP']['DBMSFLD_PATH'])) $GLOBALS['OCSP']['DBMSFLD_PATH']=
dirname(__FILE__
).
"/";
require_once dirname(__FILE__
).
"/DBMS_FIELD.phpclass";
* Class DBMS_FIELD_PASSWORD
* @project Open CSP-Management
* @author Peter Krebs <p.krebs@lvus.at>
* @copyright (c) 2002-2005 by LVUS <http://opencsp.lvu.at>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @todo editform no search
* @todo only mysql PASSWORD("...") is supported now add MD5
var $noMatchErrMsg =
"Die beiden Passworteingaben stimmen nicht überein.";
* @var int $pwdMinSize min required size
* @var int $pwdSizeErrMsg
var $pwdSizeErrMsg =
"Ihr Passwort ist muss mindestens \$*pwdMinSize\$ Zeichen haben";
* source file of the class
* @var string $classSrcFile
* @var string $sqlFunction the sql function to use creating the password
* @var array $sqlFunctLst a list of available sql functions to use
* @todo ensure each DB module can deal with it
'ASSIS' =>
"keine Umwandlung",
'PASSWORD' =>
"password('PASSWD')",
'ENCRYPT' =>
"encrypt('PASSWD')",
'OLD_PASSWORD' =>
"old_password('PASSWORD')",
* @var boolean $allowCryptInput the user can input the password in encrypted form no changes are made
// ###########################################################
// FIELD DEFINITION DATA METHODS
// ###########################################################
* returns an array of field to bie shown in the edit form
* by using editTbl_echoForm
* the array is in the form:
* [FLDLAB] (complete html code without <td></td>)
* [FLDVAL] (complete html code without <td></td>)
$a_ret=
parent::editTbl_getFieldEditArr($debug);
$this->allowCryptInput =
((isset
($_POST['allowCryptInput']) &&
intval($_POST['allowCryptInput'])) ?
TRUE :
FALSE);
* returns the html code for a editable formular element
* @param mixed $aValue the value to set
* @param string $nameAdd append something to name like "[VALUE]" for search forms
function getInputTag($aValue,$arrName=
"DBVAL",$nameAdd=
"",$debug=
FALSE) {
if ($debug) echo
"<p><b>DBMS_FIELD_PASSWORD::getInputTag(...)</b> (".
get_class($this).
"/".
$this->myName.
")</p>";
$tag .=
"name=\"".
$arrName.
"[".
$this->myName.
"][1]".
$nameAdd.
"\" ";
$tag .=
"size=\"".
$this->size.
"\" maxlength=\"".
$this->maxlength.
"\" ";
$tag .=
"type=\"password\" ";
$tag .=
"name=\"".
$arrName.
"[".
$this->myName.
"][2]".
$nameAdd.
"\" ";
$tag .=
"size=\"".
$this->size.
"\" maxlength=\"".
$this->maxlength.
"\" ";
$tag .=
"type=\"password\" ";
* returns the field value if the two fields matches
* NOTE this returns the clear text password you have
* to encrypt it before saving it to the database
* @param string $aValue the value
* @param array $err error array
* @param string $arrName name of the array to access fieldsarray gloabl ${$arrName}
function getValue($aValue,&$err,$arrName=
"DBVAL",$debug=
False) {
if (is_array($aValue)) { // <pk-05-06-17 removed && (!empty($aValue[1]))) {
if ($aValue[1] ==
$aValue[2]) {
$obj_db =
$this->myForm->getDBObj();
$str_query =
"SELECT " .
$this->sqlFunction .
"(" .
$obj_db->qs_getSlashedValue($aValue[1]) .
") FROM DUAL";
if ($str_ret =
$obj_db->getOne($str_query))
* make a database command to store encrypted password
* @param string $aValue the value
* @param array $err error array
* @param string $arrName name of the global array to access field gloabl ${$arrName}
* @todo currently mySQL only
if ((is_array($aValue)) &&
(!empty($aValue[1]))) {
if ($aValue[1] ==
$aValue[2]) {
if (empty($this->sqlFunction)) return "PASSWORD(\"".
addSlashes($aValue[1]).
"\")";
return $this->sqlFunction.
"(".
$GLOBALS['USRDB']->qs_getSlashedValue($aValue[1]).
")";
$err[$this->myName]['MSG']=
"PASSWORD_NO_MATCH";
if ((is_array($aValue)) &&
(!empty($aValue[1]))) {
} // end class DBMS_FIELD_PASSWORD
Documentation generated on Thu, 08 Jan 2009 17:42:36 +0100 by phpDocumentor 1.4.0a2