mirror of https://github.com/MISP/MISP
Small fix to avoid repeated incorrect invalid messages after the first failed check
parent
2bb806d780
commit
4c6ea92ba3
|
@ -382,13 +382,13 @@ class User extends AppModel {
|
||||||
require_once 'Crypt/GPG.php';
|
require_once 'Crypt/GPG.php';
|
||||||
$this->Behaviors->detach('Trim');
|
$this->Behaviors->detach('Trim');
|
||||||
$results = array();
|
$results = array();
|
||||||
$gpg = new Crypt_GPG(array('homedir' => Configure::read('GnuPG.homedir')));
|
|
||||||
$users = $this->find('all', array(
|
$users = $this->find('all', array(
|
||||||
'conditions' => array('not' => array('gpgkey' => '')),
|
'conditions' => array('not' => array('gpgkey' => '')),
|
||||||
//'fields' => array('id', 'email', 'gpgkey'),
|
//'fields' => array('id', 'email', 'gpgkey'),
|
||||||
'recursive' => -1,
|
'recursive' => -1,
|
||||||
));
|
));
|
||||||
foreach ($users as $k => $user) {
|
foreach ($users as $k => $user) {
|
||||||
|
$gpg = new Crypt_GPG(array('homedir' => Configure::read('GnuPG.homedir')));
|
||||||
$key = $gpg->importKey($user['User']['gpgkey']);
|
$key = $gpg->importKey($user['User']['gpgkey']);
|
||||||
$gpg->addEncryptKey($key['fingerprint']); // use the key that was given in the import
|
$gpg->addEncryptKey($key['fingerprint']); // use the key that was given in the import
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue