/** * Class UIPasswordWidget * UI wdiget for displaying and editing one-way encrypted passwords * * @copyright Copyright (C) 2010-2012 Combodo SARL * @license http://opensource.org/licenses/AGPL-3.0 */ require_once(APPROOT.'/application/webpage.class.inc.php'); require_once(APPROOT.'/application/displayblock.class.inc.php'); class UIPasswordWidget { protected static $iWidgetIndex = 0; protected $sAttCode; protected $sNameSuffix; protected $iId; public function __construct($sAttCode, $iInputId, $sNameSuffix = '') { self::$iWidgetIndex++; $this->sAttCode = $sAttCode; $this->sNameSuffix = $sNameSuffix; $this->iId = $iInputId; } /** * Get the HTML fragment corresponding to the linkset editing widget * @param WebPage $oP The web page used for all the output * @param Hash $aArgs Extra context arguments * @return string The HTML fragment to be inserted into the page */ public function Display(WebPage $oPage, $aArgs = array()) { $sCode = $this->sAttCode.$this->sNameSuffix; $iWidgetIndex = self::$iWidgetIndex; $aPasswordValues = utils::ReadPostedParam("attr_{$sCode}", null, 'raw_data'); $sPasswordValue = $aPasswordValues ? $aPasswordValues['value'] : '*****'; $sConfirmPasswordValue = $aPasswordValues ? $aPasswordValues['confirm'] : '*****'; $sChangedValue = (($sPasswordValue != '*****') || ($sConfirmPasswordValue != '*****')) ? 1 : 0; $sHtmlValue = ''; $sHtmlValue .= '