mirror of https://github.com/MISP/MISP
When adding/editing a sync user, the choice to limit a user by instance settings shows empty lines for instances without a name
- use the URL in those cases insteadpull/796/head
parent
000449ee81
commit
d769942a15
|
@ -389,9 +389,10 @@ class UsersController extends AppController {
|
|||
$conditions = array();
|
||||
if (!$this->_isSiteAdmin()) $conditions['Server.org_id LIKE'] = $this->Auth->user('org_id');
|
||||
$temp = $this->Server->find('all', array('conditions' => $conditions, 'recursive' => -1, 'fields' => array('id', 'name')));
|
||||
$servers = array(0 => 'Nothing');
|
||||
$servers = array(0 => 'Not bound to a server');
|
||||
if (!empty($temp)) foreach ($temp as $t) {
|
||||
$servers[$t['Server']['id']] = $t['Server']['name'];
|
||||
if (!empty($t['Server']['name'])) $servers[$t['Server']['id']] = $t['Server']['name'];
|
||||
else $servers[$t['Server']['id']] = $t['Server']['url'];
|
||||
}
|
||||
$this->set('servers', $servers);
|
||||
$this->set(compact('roles'));
|
||||
|
@ -518,10 +519,11 @@ class UsersController extends AppController {
|
|||
$this->loadModel('Server');
|
||||
$conditions = array();
|
||||
if (!$this->_isSiteAdmin()) $conditions['Server.org_id LIKE'] = $this->Auth->user('org_id');
|
||||
$temp = $this->Server->find('all', array('conditions' => $conditions, 'recursive' => -1, 'fields' => array('id', 'name')));
|
||||
$servers = array(0 => 'Nothing');
|
||||
$temp = $this->Server->find('all', array('conditions' => $conditions, 'recursive' => -1, 'fields' => array('id', 'name', 'url')));
|
||||
$servers = array(0 => 'Not bound to a server');
|
||||
foreach ($temp as $t) {
|
||||
$servers[$t['Server']['id']] = $t['Server']['name'];
|
||||
if (!empty($t['Server']['name'])) $servers[$t['Server']['id']] = $t['Server']['name'];
|
||||
else $servers[$t['Server']['id']] = $t['Server']['url'];
|
||||
}
|
||||
$this->set('servers', $servers);
|
||||
$this->set('orgs', $orgs);
|
||||
|
|
Loading…
Reference in New Issue