Merge branch 'master' of github.com:roundcube/roundcubemail

pull/5227/head
Aleksander Machniak 9 years ago
commit f0fa9324d8

@ -1,6 +1,8 @@
CHANGELOG Roundcube Webmail CHANGELOG Roundcube Webmail
=========================== ===========================
- Enigma: Added enigma_debug option
RELEASE 1.2-rc RELEASE 1.2-rc
-------------- --------------
- Managesieve: Refactored script parser to be 100x faster - Managesieve: Refactored script parser to be 100x faster

@ -22,7 +22,7 @@ REQUIREMENTS
- Net_IDNA2 0.1.1 or newer - Net_IDNA2 0.1.1 or newer
- Auth_SASL 1.0.6 or newer - Auth_SASL 1.0.6 or newer
- Net_Sieve 1.3.2 or newer (for managesieve plugin) - Net_Sieve 1.3.2 or newer (for managesieve plugin)
- Crypt_GPG 1.4.0 or newer (for enigma plugin) - Crypt_GPG 1.4.1 or newer (for enigma plugin)
* php.ini options (see .htaccess file): * php.ini options (see .htaccess file):
- error_reporting E_ALL & ~E_NOTICE (or lower) - error_reporting E_ALL & ~E_NOTICE (or lower)
- memory_limit > 16MB (increase as suitable to support large attachments) - memory_limit > 16MB (increase as suitable to support large attachments)

@ -28,7 +28,7 @@
"pear-pear.php.net/net_idna2": "~0.1.1", "pear-pear.php.net/net_idna2": "~0.1.1",
"pear-pear.php.net/mail_mime": "~1.10.0", "pear-pear.php.net/mail_mime": "~1.10.0",
"pear-pear.php.net/net_smtp": "~1.7.1", "pear-pear.php.net/net_smtp": "~1.7.1",
"pear-pear.php.net/crypt_gpg": "~1.4.0", "pear-pear.php.net/crypt_gpg": "~1.4.1",
"roundcube/net_sieve": "~1.5.0" "roundcube/net_sieve": "~1.5.0"
}, },
"require-dev": { "require-dev": {

@ -24,6 +24,6 @@
"require": { "require": {
"php": ">=5.3.0", "php": ">=5.3.0",
"roundcube/plugin-installer": "~0.1.6", "roundcube/plugin-installer": "~0.1.6",
"pear-pear.php.net/crypt_gpg": "~1.4.0" "pear-pear.php.net/crypt_gpg": "~1.4.1"
} }
} }

@ -9,6 +9,9 @@ $config['enigma_pgp_driver'] = 'gnupg';
// A driver to use for S/MIME. Default: "phpssl". // A driver to use for S/MIME. Default: "phpssl".
$config['enigma_smime_driver'] = 'phpssl'; $config['enigma_smime_driver'] = 'phpssl';
// Enables logging of enigma operations (including Crypt_GPG debug info)
$config['enigma_debug'] = false;
// Keys directory for all users. Default 'enigma/home'. // Keys directory for all users. Default 'enigma/home'.
// Must be writeable by PHP process // Must be writeable by PHP process
$config['enigma_pgp_homedir'] = null; $config['enigma_pgp_homedir'] = null;

@ -40,6 +40,7 @@ class enigma_driver_gnupg extends enigma_driver
function init() function init()
{ {
$homedir = $this->rc->config->get('enigma_pgp_homedir', INSTALL_PATH . 'plugins/enigma/home'); $homedir = $this->rc->config->get('enigma_pgp_homedir', INSTALL_PATH . 'plugins/enigma/home');
$debug = $this->rc->config->get('enigma_debug');
if (!$homedir) if (!$homedir)
return new enigma_error(enigma_error::INTERNAL, return new enigma_error(enigma_error::INTERNAL,
@ -73,7 +74,7 @@ class enigma_driver_gnupg extends enigma_driver
$this->gpg = new Crypt_GPG(array( $this->gpg = new Crypt_GPG(array(
'homedir' => $this->homedir, 'homedir' => $this->homedir,
// 'binary' => '/usr/bin/gpg2', // 'binary' => '/usr/bin/gpg2',
// 'debug' => true, 'debug' => $debug ? array($this, 'debug') : false,
)); ));
} }
catch (Exception $e) { catch (Exception $e) {
@ -257,10 +258,11 @@ class enigma_driver_gnupg extends enigma_driver
public function gen_key($data) public function gen_key($data)
{ {
try { try {
$debug = $this->rc->config->get('enigma_debug');
$keygen = new Crypt_GPG_KeyGenerator(array( $keygen = new Crypt_GPG_KeyGenerator(array(
'homedir' => $this->homedir, 'homedir' => $this->homedir,
// 'binary' => '/usr/bin/gpg2', // 'binary' => '/usr/bin/gpg2',
// 'debug' => true, 'debug' => $debug ? array($this, 'debug') : false,
)); ));
$key = $keygen $key = $keygen
@ -441,4 +443,12 @@ class enigma_driver_gnupg extends enigma_driver
return $ekey; return $ekey;
} }
/**
* Write debug info from Crypt_GPG to logs/enigma
*/
public function debug($line)
{
rcube::write_log('enigma', 'GPG: ' . $line);
}
} }

@ -130,10 +130,10 @@ abstract class rcube_addressbook
/** /**
* Get a specific contact record * Get a specific contact record
* *
* @param mixed record identifier(s) * @param mixed Record identifier(s)
* @param boolean True to return record as associative array, otherwise a result set is returned * @param boolean True to return record as associative array, otherwise a result set is returned
* *
* @return mixed Result object with all record fields or False if not found * @return rcube_result_set|array Result object with all record fields
*/ */
abstract function get_record($id, $assoc=false); abstract function get_record($id, $assoc=false);

@ -542,7 +542,7 @@ class rcube_contacts extends rcube_addressbook
* @param mixed $id Record identifier(s) * @param mixed $id Record identifier(s)
* @param bool $assoc Enables returning associative array * @param bool $assoc Enables returning associative array
* *
* @return mixed Result object with all record fields or False if not found * @return rcube_result_set|array Result object with all record fields
*/ */
function get_record($id, $assoc = false) function get_record($id, $assoc = false)
{ {
@ -560,6 +560,8 @@ class rcube_contacts extends rcube_addressbook
$this->user_id $this->user_id
); );
$this->result = null;
if ($sql_arr = $this->db->fetch_assoc()) { if ($sql_arr = $this->db->fetch_assoc()) {
$record = $this->convert_db_data($sql_arr); $record = $this->convert_db_data($sql_arr);
$this->result = new rcube_result_set(1); $this->result = new rcube_result_set(1);

Loading…
Cancel
Save