Small fix to avoid repeated incorrect invalid messages after the first failed check

2.2
iglocska 2014-09-08 13:34:14 +02:00
parent 2bb806d780
commit 4c6ea92ba3
1 changed files with 1 additions and 1 deletions

View File

@ -382,13 +382,13 @@ class User extends AppModel {
require_once 'Crypt/GPG.php';
$this->Behaviors->detach('Trim');
$results = array();
$gpg = new Crypt_GPG(array('homedir' => Configure::read('GnuPG.homedir')));
$users = $this->find('all', array(
'conditions' => array('not' => array('gpgkey' => '')),
//'fields' => array('id', 'email', 'gpgkey'),
'recursive' => -1,
));
foreach ($users as $k => $user) {
$gpg = new Crypt_GPG(array('homedir' => Configure::read('GnuPG.homedir')));
$key = $gpg->importKey($user['User']['gpgkey']);
$gpg->addEncryptKey($key['fingerprint']); // use the key that was given in the import
try {