diff --git a/app/Model/User.php b/app/Model/User.php index 63d28e573..31bcbea6e 100755 --- a/app/Model/User.php +++ b/app/Model/User.php @@ -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 {