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)
Example #1
0
 /**
  * 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;
 }
Example #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;
 }
Example #3
0
 /**
  */
 public function clearKey($keyname = self::DEFAULT_KEY)
 {
     return parent::clearKey(self::HORDE_KEYNAME);
 }
Example #4
0
 public function testShortKeyWrite()
 {
     $secret = new Horde_Secret();
     $this->assertEquals('', $secret->write('', ""));
 }