mirror of https://github.com/MISP/MISP
chg: [dashboard] show owner email of template to site owners and the owner themselves
parent
bf2694c490
commit
bebc70a012
|
@ -368,6 +368,9 @@ class DashboardsController extends AppController
|
|||
$this->response->type()
|
||||
);
|
||||
} else {
|
||||
$this->paginate['contain'] = array(
|
||||
'User.id', 'User.email'
|
||||
);
|
||||
$data = $this->paginate();
|
||||
foreach ($data as &$element) {
|
||||
$element['Dashboard']['value'] = json_decode($element['Dashboard']['value'], true);
|
||||
|
@ -377,6 +380,9 @@ class DashboardsController extends AppController
|
|||
}
|
||||
$element['Dashboard']['widgets'] = array_keys($widgets);
|
||||
sort($element['Dashboard']['widgets']);
|
||||
if ($element['Dashboard']['user_id'] != $this->Auth->user('id')) {
|
||||
$element['User']['email'] = '';
|
||||
}
|
||||
}
|
||||
$this->set('passedArgs', $this->passedArgs);
|
||||
$this->set('data', $data);
|
||||
|
|
|
@ -23,7 +23,10 @@ class Dashboard extends AppModel
|
|||
public $belongsTo = array(
|
||||
'User',
|
||||
'Role',
|
||||
'Organisation',
|
||||
'Organisation' => array(
|
||||
'className' => 'Organisation',
|
||||
'foreignKey' => 'org_id'
|
||||
)
|
||||
);
|
||||
|
||||
public function loadWidget($user, $name, $returnOnException = false)
|
||||
|
|
|
@ -27,6 +27,12 @@
|
|||
'class' => 'short',
|
||||
'data_path' => 'Dashboard.uuid',
|
||||
),
|
||||
array(
|
||||
'name' => __('Owner'),
|
||||
'sort' => 'User.email',
|
||||
'class' => 'short',
|
||||
'data_path' => 'User.email',
|
||||
),
|
||||
array(
|
||||
'name' => __('Name'),
|
||||
'sort' => 'name',
|
||||
|
|
Loading…
Reference in New Issue