Copyright 1999-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Chuck Hagenbuch (chuck@horde.org)
Author: Michael Slusarz (slusarz@horde.org)
示例#1
0
文件: Smtp.php 项目: jubinpatel/horde
 /**
  * Sets a configuration parameter value.
  *
  * @param string $key  The param key.
  * @param mixed $val   The param value.
  */
 public function setParam($key, $val)
 {
     switch ($key) {
         case 'password':
             if ($val instanceof Horde_Smtp_Password) {
                 break;
             }
             // Encrypt password. DEPRECATED
             try {
                 $encrypt_key = $this->_getEncryptKey();
                 if (strlen($encrypt_key)) {
                     $secret = new Horde_Secret();
                     $val = $secret->write($encrypt_key, $val);
                     $this->_params['_passencrypt'] = true;
                 }
             } catch (Exception $e) {
             }
             break;
     }
     $this->_params[$key] = $val;
 }
示例#2
0
 /**
  * Sets a configuration parameter value.
  *
  * @param string $key   The param key.
  * @param mixed $value  The param value.
  */
 public function setParam($key, $val)
 {
     switch ($key) {
         case 'password':
             // Encrypt password.
             try {
                 $encrypt_key = $this->_getEncryptKey();
                 if (strlen($encrypt_key)) {
                     $secret = new Horde_Secret();
                     $val = $secret->write($encrypt_key, $val);
                     $this->_params['_passencrypt'] = true;
                 }
             } catch (Exception $e) {
                 $this->_params['_passencrypt'] = false;
             }
             break;
     }
     $this->_params[$key] = $val;
     $this->changed = true;
 }
示例#3
0
文件: Secret.php 项目: horde/horde
 /**
  */
 public function clearKey($keyname = self::DEFAULT_KEY)
 {
     return parent::clearKey(self::HORDE_KEYNAME);
 }
示例#4
0
 public function testShortKeyWrite()
 {
     $secret = new Horde_Secret();
     $this->assertEquals('', $secret->write('', ""));
 }