mirror of https://github.com/MISP/MISP
new: [UI] Further refactoring to use the modern meta table UI
parent
5be753022e
commit
4c59cd5978
|
@ -8,6 +8,7 @@
|
|||
'key_title' => 'title for hover-descriptions',
|
||||
'value' => 'raw value to use',
|
||||
'html' => 'raw html to echo - needs to be pre-sanitised',
|
||||
'boolean' => 'pass a value to evaluate as empty() and subsequently use a simple yes/no boolean field'
|
||||
'element' => 'element name to use as value',
|
||||
'element_params' => array(parameters to be passed to the element),
|
||||
'class' => 'classes appended to both the key and value',
|
||||
|
@ -26,22 +27,28 @@
|
|||
$rows[] = sprintf(
|
||||
'<tr><td class="%s" title="%s">%s</td><td class="%s">%s</td></tr>',
|
||||
sprintf(
|
||||
'meta_table_key %s %s',
|
||||
empty($row['class']) ? '' : h($row['class']),
|
||||
empty($row['key_class']) ? '' : h($row['key_class'])
|
||||
'meta_table_key %s %s',
|
||||
empty($row['class']) ? '' : h($row['class']),
|
||||
empty($row['key_class']) ? '' : h($row['key_class'])
|
||||
),
|
||||
empty($row['key_title']) ? '' : h($row['key_title']),
|
||||
empty($row['key']) ? 'Undefined' : h($row['key']),
|
||||
sprintf(
|
||||
'meta_table_value %s %s',
|
||||
empty($row['class']) ? '' : h($row['class']),
|
||||
empty($row['value_class']) ? '' : h($row['value_class'])
|
||||
'meta_table_value %s %s',
|
||||
empty($row['class']) ? '' : h($row['class']),
|
||||
empty($row['value_class']) ? '' : h($row['value_class'])
|
||||
),
|
||||
sprintf(
|
||||
'%s%s%s',
|
||||
empty($row['value']) ? '' : h($row['value']),
|
||||
empty($row['html']) ? '' : $row['html'],
|
||||
empty($element) ? '' : $element
|
||||
'%s%s%s%s',
|
||||
!isset($row['boolean']) ? '' : sprintf(
|
||||
'<span class="%s">%s</span>',
|
||||
(empty($row['class']) && empty($row['value_class'])) ?
|
||||
(empty($row['boolean']) ? 'bold red' : 'bold green') : '',
|
||||
empty($row['boolean']) ? 'No' : 'Yes'
|
||||
),
|
||||
empty($row['value']) ? '' : h($row['value']),
|
||||
empty($row['html']) ? '' : $row['html'],
|
||||
empty($element) ? '' : $element
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -2,38 +2,43 @@
|
|||
App::uses('AppHelper', 'View/Helper');
|
||||
|
||||
// Helper to retrieve org images with the given parameters
|
||||
class OrgImgHelper extends AppHelper {
|
||||
public function getOrgImg($options) {
|
||||
$imgPath = APP . WEBROOT_DIR . DS . 'img' . DS . 'orgs' . DS;
|
||||
$imgOptions = array();
|
||||
$possibleFields = array('id', 'name');
|
||||
$size = !empty($options['size']) ? $options['size'] : 48;
|
||||
foreach ($possibleFields as $field) {
|
||||
if (isset($options[$field]) && file_exists($imgPath . $options[$field] . '.png')) {
|
||||
$imgOptions[$field] = $options[$field] . '.png';
|
||||
break;
|
||||
class OrgImgHelper extends AppHelper {
|
||||
public function getOrgImg($options, $returnData = false) {
|
||||
$imgPath = APP . WEBROOT_DIR . DS . 'img' . DS . 'orgs' . DS;
|
||||
$imgOptions = array();
|
||||
$possibleFields = array('id', 'name');
|
||||
$size = !empty($options['size']) ? $options['size'] : 48;
|
||||
foreach ($possibleFields as $field) {
|
||||
if (isset($options[$field]) && file_exists($imgPath . $options[$field] . '.png')) {
|
||||
$imgOptions[$field] = $options[$field] . '.png';
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!empty($imgOptions)) {
|
||||
foreach ($imgOptions as $field => $imgOption) {
|
||||
$result = sprintf(
|
||||
'<a href="/organisations/view/%s"><img src="/img/orgs/%s" title = "%s" style = "width: %spx; height: %spx;"/>
|
||||
</a>',
|
||||
(empty($options['id']) ? h($options['name']) : h($options['id'])),
|
||||
$imgOption,
|
||||
isset($options['name']) ? h($options['name']) : h($options['id']),
|
||||
h($size),
|
||||
h($size)
|
||||
);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$result = sprintf(
|
||||
'<a href="/organisations/view/%s">\<span class="welcome" style="float:left">%s</span></a>',
|
||||
(empty($options['id']) ? h($options['name']) : h($options['id'])),
|
||||
h($options['name'])
|
||||
);
|
||||
}
|
||||
if ($returnData) {
|
||||
return $result;
|
||||
} else {
|
||||
echo $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($imgOptions)) {
|
||||
foreach ($imgOptions as $field => $imgOption) {
|
||||
?>
|
||||
<a href="/organisations/view/<?php echo empty($options['id']) ? h($options['name']) : h($options['id']); ?>">
|
||||
<img
|
||||
src="/img/orgs/<?php echo $imgOption; ?>"
|
||||
title = "<?php echo isset($options['name']) ? h($options['name']) : h($options['id']); ?>"
|
||||
style = "<?php echo 'width:' . h($size) . 'px; height:' . h($size) . 'px'; ?>"
|
||||
/>
|
||||
</a>
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<a href="/organisations/view/<?php echo empty($options['id']) ? h($options['name']) : h($options['id']); ?>">
|
||||
<span class="welcome" style="float:left"><?php echo h($options['name']); ?></span>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -1,47 +1,43 @@
|
|||
<?php
|
||||
echo $this->element('side_menu', array('menuList' => 'objectTemplates', 'menuItem' => 'view'));
|
||||
$table_data = array();
|
||||
$table_data[] = array('key' => __('Id'), 'value' => $template['ObjectTemplate']['id']);
|
||||
$table_data[] = array('key' => __('Name'), 'value' => $template['ObjectTemplate']['name'] ? $template['ObjectTemplate']['name'] : $template['ObjectTemplate']['type']);
|
||||
$table_data[] = array('key' => __('Organisation'), 'value' => $template['Organisation']['name']);
|
||||
$table_data[] = array('key' => __('UUID'), 'value' => $template['ObjectTemplate']['uuid']);
|
||||
$table_data[] = array('key' => __('Version'), 'value' => $template['ObjectTemplate']['version']);
|
||||
$table_data[] = array('key' => __('Meta-category'), 'value' => $template['ObjectTemplate']['meta-category']);
|
||||
$table_data[] = array('key' => __('Description'), 'value' => $template['ObjectTemplate']['description']);
|
||||
if (!empty($template['ObjectTemplate']['requirements'])) {
|
||||
$requirements_contents = array();
|
||||
foreach ($template['ObjectTemplate']['requirements'] as $group => $requirements) {
|
||||
$requirements_contents[] = sprintf(
|
||||
'<span class="bold">%s</span>',
|
||||
h($group)
|
||||
);
|
||||
foreach ($requirements as $requirement) {
|
||||
sprintf(
|
||||
$requirements_contents[] = sprintf(
|
||||
'<span> %s</span>',
|
||||
h($requirement)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
$table_data[] = array('key' => __('Requirements'), 'html' => implode('<br />', $requirements_contents));
|
||||
}
|
||||
echo sprintf(
|
||||
'<div class="roles view"><div class="row-fluid"><div class="span8" style="margin:0px;">%s</div></div>%s</div>%s',
|
||||
sprintf(
|
||||
'<h2>%s %s</h2>%s',
|
||||
h(ucfirst($template['ObjectTemplate']['name'])),
|
||||
__(' Object Template'),
|
||||
$this->element('genericElements/viewMetaTable', array('table_data' => $table_data))
|
||||
),
|
||||
'<div id="ajaxContent" style="width:100%;"></div>',
|
||||
$this->element('side_menu', array('menuList' => 'objectTemplates', 'menuItem' => 'view'))
|
||||
);
|
||||
|
||||
?>
|
||||
<div class="object_template view">
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<h2><?php echo h(ucfirst($template['ObjectTemplate']['name'])); ?><?php echo __(' Object Template');?></h2>
|
||||
<dl>
|
||||
<dt><?php echo __('Object Template ID');?></dt>
|
||||
<dd><?php echo h($template['ObjectTemplate']['id']); ?></dd>
|
||||
<dt><?php echo __('Name');?></dt>
|
||||
<dd><?php echo $template['ObjectTemplate']['name'] ? h($template['ObjectTemplate']['name']) : h($template['ObjectTemplate']['type']); ?></dd>
|
||||
<dt><?php echo __('Organisation');?></dt>
|
||||
<dd><?php echo h($template['Organisation']['name']); ?></dd>
|
||||
<dt><?php echo __('Uuid');?></dt>
|
||||
<dd><?php echo h($template['ObjectTemplate']['uuid']); ?></dd>
|
||||
<dt><?php echo __('Version');?></dt>
|
||||
<dd><?php echo h($template['ObjectTemplate']['version']); ?></dd>
|
||||
<dt><?php echo __('Meta-category');?></dt>
|
||||
<dd><?php echo h($template['ObjectTemplate']['meta-category']); ?></dd>
|
||||
<dt><?php echo __('Description');?></dt>
|
||||
<dd><?php echo h($template['ObjectTemplate']['description']); ?></dd>
|
||||
<dt><?php echo __('Requirements');?></dt>
|
||||
<dd>
|
||||
<?php
|
||||
if (!empty($template['ObjectTemplate']['requirements'])):
|
||||
foreach ($template['ObjectTemplate']['requirements'] as $group => $requirements):
|
||||
?>
|
||||
<span class="bold"><?php echo h($group); ?></span><br />
|
||||
<?php
|
||||
foreach ($requirements as $requirement):
|
||||
?>
|
||||
<span> <?php echo h($requirement); ?></span><br />
|
||||
<?php
|
||||
endforeach;
|
||||
endforeach;
|
||||
endif;
|
||||
?>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ajaxContent" style="width:100%;"></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
<?php
|
||||
$startingTab = 'all';
|
||||
|
|
|
@ -1,60 +1,57 @@
|
|||
<div class="organisations view">
|
||||
<div class="row-fluid">
|
||||
<div class="span10"><h2><?php echo __('Organisation ') . h($org['Organisation']['name']);?></h2></div>
|
||||
<div class="span2"><div style="float:right;"><?php echo $this->OrgImg->getOrgImg(array('name' => $org['Organisation']['name'], 'id' => $org['Organisation']['id'], 'size' => 48)); ?></div></div>
|
||||
</div>
|
||||
<div>
|
||||
<dl style="width:600px;">
|
||||
<dt><?php echo __('Id'); ?></dt>
|
||||
<dd><?php echo h($org['Organisation']['id']); ?> </dd>
|
||||
<dt><?php echo 'Organisation name'; ?></dt>
|
||||
<dd><?php echo h($org['Organisation']['name']); ?> </dd>
|
||||
<dt><?php echo __('Local or remote'); ?></dt>
|
||||
<?php
|
||||
echo sprintf(
|
||||
<div class="row-fluid">
|
||||
<?php
|
||||
$table_data = array();
|
||||
$table_data[] = array('key' => __('Id'), 'value' => $org['Organisation']['id']);
|
||||
$table_data[] = array('key' => __('Organisation name'), 'value' => $org['Organisation']['name']);
|
||||
$table_data[] = array(
|
||||
'key' => __('Local or remote'),
|
||||
'html' => sprintf(
|
||||
'<dd><span class="%s bold">%s</span></dd>',
|
||||
$org['Organisation']['local'] ? 'green' : 'red',
|
||||
$org['Organisation']['local'] ? __('Local') : __('Remote')
|
||||
);
|
||||
?>
|
||||
<dt><?php echo __('Description'); ?></dt>
|
||||
<dd><?php echo h($org['Organisation']['description']); ?> </dd>
|
||||
<?php
|
||||
if (!empty($org['Organisation']['restricted_to_domain'])) {
|
||||
$domains = $org['Organisation']['restricted_to_domain'];
|
||||
foreach ($domains as $k => $domain) {
|
||||
$domains[$k] = h($domain);
|
||||
}
|
||||
$domains = implode("<br />", $domains);
|
||||
echo sprintf(
|
||||
'<dt>%s</dt><dd>%s</dd>',
|
||||
__('Domain restrictions'),
|
||||
$domains
|
||||
);
|
||||
)
|
||||
);
|
||||
$table_data[] = array('key' => __('Description'), 'value' => $org['Organisation']['description']);
|
||||
if (!empty($org['Organisation']['restricted_to_domain'])) {
|
||||
$domains = $org['Organisation']['restricted_to_domain'];
|
||||
foreach ($domains as $k => $domain) {
|
||||
$domains[$k] = h($domain);
|
||||
}
|
||||
?>
|
||||
<dt><?php echo __('UUID'); ?></dt>
|
||||
<dd><?php echo !empty(trim($org['Organisation']['uuid'])) ? h($org['Organisation']['uuid']) : " "; ?></dd>
|
||||
<?php if ($isSiteAdmin): ?>
|
||||
<dt><?php echo __('Created by'); ?></dt>
|
||||
<dd><?php echo isset($org['Organisation']['created_by_email']) ? h($org['Organisation']['created_by_email']) : __("Unknown"); ?></dd>
|
||||
<dt><?php echo __('Creation time'); ?></dt>
|
||||
<dd><?php echo h($org['Organisation']['date_created']); ?></dd>
|
||||
<dt><?php echo __('Last modified'); ?></dt>
|
||||
<dd><?php echo h($org['Organisation']['date_modified']); ?></dd>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
$optionalFields = array('sector' => 'Sector', 'nationality' => 'Nationality', 'type' => 'Organisation type', 'contacts' => 'Contact information');
|
||||
foreach ($optionalFields as $k => $field):
|
||||
if (!empty(trim($org['Organisation'][$k]))):
|
||||
?>
|
||||
<dt><?php echo $field; ?></dt>
|
||||
<dd><?php echo trim(h($org['Organisation'][$k])); ?></dd>
|
||||
<?php
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
</dl>
|
||||
$domains = implode("<br />", $domains);
|
||||
$table_data[] = array('key' => __('Domain restrictions'), 'value' => $domains);
|
||||
}
|
||||
$table_data[] = array('key' => __('UUID'), 'value' => !empty(trim($org['Organisation']['uuid'])) ? $org['Organisation']['uuid'] : '');
|
||||
if ($isSiteAdmin) {
|
||||
$table_data[] = array('key' => __('Created by'), 'value' => isset($org['Organisation']['created_by_email']) ? $org['Organisation']['created_by_email'] : __("Unknown"));
|
||||
$table_data[] = array('key' => __('Creation time'), 'value' => $org['Organisation']['date_created']);
|
||||
$table_data[] = array('key' => __('Last modified'), 'value' => $org['Organisation']['date_modified']);
|
||||
}
|
||||
foreach (array('sector' => 'Sector', 'nationality' => 'Nationality', 'type' => 'Organisation type', 'contacts' => 'Contact information') as $k => $field) {
|
||||
if (!empty(trim($org['Organisation'][$k]))) {
|
||||
$table_data[] = array('key' => $field, 'value' => trim(h($org['Organisation'][$k])));
|
||||
}
|
||||
}
|
||||
echo sprintf(
|
||||
'<div class="span8" style="margin:0px;">%s</div><div class="span4" style="horizontal-align:right;">%s</div>',
|
||||
sprintf(
|
||||
'<h2>%s</h2>%s',
|
||||
__('Organisation ') . h($org['Organisation']['name']),
|
||||
$this->element('genericElements/viewMetaTable', array('table_data' => $table_data))
|
||||
),
|
||||
sprintf(
|
||||
'<div style="float:right;">%s</div>',
|
||||
$this->OrgImg->getOrgImg(
|
||||
array(
|
||||
'name' => $org['Organisation']['name'],
|
||||
'id' => $org['Organisation']['id'],
|
||||
'size' => 48
|
||||
),
|
||||
true
|
||||
)
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
<br />
|
||||
<?php if ($local): ?>
|
||||
|
|
|
@ -1,44 +1,29 @@
|
|||
<div class="roles view">
|
||||
<h2><?php echo __('Role');?></h2>
|
||||
<dl>
|
||||
<dt><?php echo __('Id'); ?></dt>
|
||||
<dd>
|
||||
<?php echo $role['Role']['id']; ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Name'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h($role['Role']['name']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Permission level'); ?></dt>
|
||||
<dd>
|
||||
<?php
|
||||
echo h($premissionLevelName[$role['Role']['permission']]);
|
||||
?>
|
||||
|
||||
</dd>
|
||||
<?php
|
||||
foreach ($role['Role'] as $k => $item):
|
||||
if (substr($k, 0, 5) === 'perm_' && !in_array($k, array('perm_add', 'perm_modify', 'perm_modify_org', 'perm_publish', 'perm_full'))):
|
||||
$nameParts = explode('_', $k);
|
||||
unset($nameParts[0]);
|
||||
foreach ($nameParts as &$p) $p = ucfirst($p);
|
||||
$name = implode(' ', $nameParts);
|
||||
?>
|
||||
<dt><?php echo $name; ?></dt>
|
||||
<dd class="<?php echo $role['Role'][$k] ? 'green' : 'red';?>">
|
||||
<?php echo $role['Role'][$k] ? 'Yes' : 'No'; ?>
|
||||
|
||||
</dd>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
endforeach;
|
||||
|
||||
?>
|
||||
</dl>
|
||||
</div>
|
||||
<?php
|
||||
echo $this->element('side_menu', array('menuList' => 'globalActions', 'menuItem' => 'roles'));
|
||||
$table_data = array();
|
||||
$table_data[] = array('key' => __('Id'), 'value' => $role['Role']['id']);
|
||||
$table_data[] = array('key' => __('Name'), 'value' => $role['Role']['name']);
|
||||
$table_data[] = array('key' => __('Permission level'), 'value' => $premissionLevelName[$role['Role']['permission']]);
|
||||
foreach ($role['Role'] as $k => $item) {
|
||||
if (substr($k, 0, 5) === 'perm_' && !in_array($k, array('perm_add', 'perm_modify', 'perm_modify_org', 'perm_publish', 'perm_full'))) {
|
||||
$name = substr($k, 5);
|
||||
if (in_array($name, array('add', 'modify', 'modify_org', 'publish', 'full'))) {
|
||||
continue;
|
||||
}
|
||||
$table_data[] = array(
|
||||
'key' => Inflector::humanize(h($name)),
|
||||
'value_class' => $role['Role'][$k] ? 'green' : 'red',
|
||||
'value' => $role['Role'][$k] ? 'Granted' : 'Denied'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
echo sprintf(
|
||||
'<div class="roles view row-fluid"><div class="span8" style="margin:0px;">%s</div></div>%s',
|
||||
sprintf(
|
||||
'<h2>%s</h2>%s',
|
||||
__('Role'),
|
||||
$this->element('genericElements/viewMetaTable', array('table_data' => $table_data))
|
||||
),
|
||||
$this->element('side_menu', array('menuList' => 'globalActions', 'menuItem' => 'roles'))
|
||||
);
|
||||
?>
|
||||
|
|
|
@ -2,139 +2,109 @@
|
|||
$buttonAddStatus = $isAclAdd ? 'button_on':'button_off';
|
||||
$mayModify = ($isSiteAdmin || ($isAdmin && ($user['User']['org_id'] == $me['org_id'])));
|
||||
$buttonModifyStatus = $mayModify ? 'button_on':'button_off';
|
||||
?>
|
||||
<div class="users view">
|
||||
<h2><?php echo __('User');?></h2>
|
||||
<dl style="width:800px;">
|
||||
<dt><?php echo __('Id'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h($user['User']['id']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Org'); ?></dt>
|
||||
<dd>
|
||||
<a href="<?php echo $baseurl?>/organisations/view/<?php echo h($user['Organisation']['id']); ?>"><?php echo h($user['Organisation']['name']); ?></a>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Role'); ?></dt>
|
||||
<dd>
|
||||
<?php echo $this->Html->link($user['Role']['name'], array('controller' => 'roles', 'action' => 'view', $user['Role']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Email'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h($user['User']['email']); ?> <a class="icon-envelope" href="<?php echo $baseurl; ?>/admin/users/quickEmail/<?php echo h($user['User']['id']); ?>"></a>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Autoalert'); ?></dt>
|
||||
<dd>
|
||||
<?php
|
||||
echo (h($user['User']['autoalert']) == 0)? __('No') : __('Yes'); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Contactalert'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h(0 == ($user['User']['contactalert'])) ? __('No') : __('Yes'); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Authkey'); ?></dt>
|
||||
<dd>
|
||||
<span class="quickSelect"><?php echo h($user['User']['authkey']); ?></span>
|
||||
(<?php echo $this->Html->link('reset', array('controller' => 'users', 'action' => 'resetauthkey', $user['User']['id']));?>)
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Invited By'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h($user2['User']['email']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Org admin');?></dt>
|
||||
<dd>
|
||||
<?php
|
||||
|
||||
foreach ($user['User']['orgAdmins'] as $orgAdminId => $orgAdminEmail):
|
||||
?>
|
||||
<a href="<?php echo $baseurl; ?>/admin/users/view/<?php echo h($orgAdminId); ?>"><?php echo h($orgAdminEmail); ?></a>
|
||||
<a class="icon-envelope" href="<?php echo $baseurl; ?>/admin/users/quickEmail/<?php echo h($orgAdminId); ?>"></a>
|
||||
<?php
|
||||
if ($orgAdminEmail !== end($user['User']['orgAdmins'])) {
|
||||
echo '<br />';
|
||||
}
|
||||
endforeach;
|
||||
?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('GnuPG key'); ?></dt>
|
||||
<dd class="quickSelect <?php echo $user['User']['gpgkey'] ? 'green' : 'bold red'; ?>">
|
||||
<?php echo $user['User']['gpgkey'] ? nl2br(h($user['User']['gpgkey'])) : "N/A"; ?>
|
||||
</dd>
|
||||
<?php
|
||||
if (!empty($user['User']['gpgkey'])):
|
||||
?>
|
||||
<dt><?php echo __('GnuPG fingerprint');?></dt>
|
||||
<dd class="quickSelect bold <?php echo $user['User']['fingerprint'] ? 'green': 'red'; ?>">
|
||||
<?php
|
||||
echo $user['User']['fingerprint'] ? chunk_split(h($user['User']['fingerprint']), 4, ' ') : 'N/A';
|
||||
?>
|
||||
</dd>
|
||||
<dt><?php echo __('GnuPG status');?></dt>
|
||||
<dd class="bold <?php echo (empty($user['User']['pgp_status']) || $user['User']['pgp_status'] != __('OK')) ? 'red': 'green'; ?>">
|
||||
<?php
|
||||
echo !empty($user['User']['pgp_status']) ? h($user['User']['pgp_status']) : __('N/A');
|
||||
?>
|
||||
</dd>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
<?php if (Configure::read('SMIME.enabled')): ?>
|
||||
<dt><?php echo __('SMIME Public certificate'); ?></dt>
|
||||
<dd class="quickSelect red">
|
||||
<?php echo (h($user['User']['certif_public'])) ? $this->Utility->space2nbsp(nl2br(h($user['User']['certif_public']))) : __("N/A"); ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<dt><?php echo __('Nids Sid'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h($user['User']['nids_sid']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Termsaccepted'); ?></dt>
|
||||
<dd>
|
||||
<?php
|
||||
if (h($user['User']['termsaccepted']) == 1) {
|
||||
echo __("Yes");
|
||||
} else {
|
||||
echo __("No");
|
||||
}?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Password change'); ?></dt>
|
||||
<dd>
|
||||
<?php
|
||||
if (h($user['User']['change_pw']) == 1) {
|
||||
echo __("Yes");
|
||||
} else {
|
||||
echo __("No");
|
||||
}?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Newsread'); ?></dt>
|
||||
<dd>
|
||||
<?php echo $user['User']['newsread'] ? date('Y/m/d H:i:s', h($user['User']['newsread'])) : __('N/A'); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Disabled'); ?></dt>
|
||||
<dd <?php if ($user['User']['disabled']) echo 'class="visibleDL notPublished"';?>>
|
||||
<?php echo $user['User']['disabled'] ? __('Yes') : __('No'); ?>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<br />
|
||||
<a href="<?php echo $baseurl . '/admin/users/view/' . h($user['User']['id']) . '.json'; ?>" class="btn btn-inverse" download>Download user profile for data portability</a>
|
||||
<br />
|
||||
<div id="userEvents"></div>
|
||||
</div>
|
||||
<?php
|
||||
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'viewUser'));
|
||||
$table_data = array();
|
||||
$table_data[] = array('key' => __('Id'), 'value' => $user['User']['id']);
|
||||
$table_data[] = array(
|
||||
'key' => __('Email'),
|
||||
'html' => sprintf(
|
||||
'%s <a class="icon-envelope" href="%s/admin/users/quickEmail/%s"></a>',
|
||||
h($user['User']['email']),
|
||||
$baseurl,
|
||||
h($user['User']['id'])
|
||||
)
|
||||
);
|
||||
$table_data[] = array(
|
||||
'key' => __('Organisation'),
|
||||
'html' => sprintf(
|
||||
'<a href="%s/organisations/view/%s">%s</a>',
|
||||
$baseurl,
|
||||
h($user['Organisation']['id']),
|
||||
h($user['Organisation']['name'])
|
||||
)
|
||||
);
|
||||
$table_data[] = array('key' => __('Role'), 'html' => $this->Html->link($user['Role']['name'], array('controller' => 'roles', 'action' => 'view', $user['Role']['id'])));
|
||||
$table_data[] = array('key' => __('Autoalert'), 'boolean' => $user['User']['autoalert']);
|
||||
$table_data[] = array('key' => __('Contactalert'), 'boolean' => $user['User']['contactalert']);
|
||||
$authkey_data = sprintf(
|
||||
'<a onclick="requestAPIAccess();" style="cursor:pointer;"></a>',
|
||||
__('Request API access')
|
||||
);
|
||||
$authkey_data = sprintf(
|
||||
'<span class="quickSelect">%s</span>%s',
|
||||
h($user['User']['authkey']),
|
||||
sprintf(
|
||||
' (%s)',
|
||||
$this->Html->link('reset', array('controller' => 'users', 'action' => 'resetauthkey', $user['User']['id']))
|
||||
)
|
||||
);
|
||||
$table_data[] = array(
|
||||
'key' => __('Authkey'),
|
||||
'html' => $authkey_data
|
||||
);
|
||||
$table_data[] = array('key' => __('Invited By'), 'value' => $user2['User']['email']);
|
||||
$org_admin_data = array();
|
||||
foreach ($user['User']['orgAdmins'] as $orgAdminId => $orgAdminEmail) {
|
||||
$org_admin_data[] = sprintf(
|
||||
'<a href="%s/admin/users/view/%s">%s</a><a class="icon-envelope" href="%s/admin/users/quickEmail/%s"></a><br />',
|
||||
$baseurl,
|
||||
h($orgAdminId),
|
||||
h($orgAdminEmail),
|
||||
$baseurl,
|
||||
h($orgAdminId)
|
||||
);
|
||||
}
|
||||
$table_data[] = array('key' => __('Org_admin'), 'html' => implode('<br />', $org_admin_data));
|
||||
$table_data[] = array('key' => __('NIDS Start SID'), 'value' => $user['User']['nids_sid']);
|
||||
$table_data[] = array('key' => __('Terms accepted'), 'boolean' => $user['User']['termsaccepted']);
|
||||
$table_data[] = array('key' => __('Password change'), 'boolean' => $user['User']['change_pw']);
|
||||
$table_data[] = array(
|
||||
'key' => __('GnuPG key'),
|
||||
'class_value' => "quickSelect " . $user['User']['gpgkey'] ? 'green' : 'bold red',
|
||||
'html' => $user['User']['gpgkey'] ? nl2br(h($user['User']['gpgkey'])) : __("N/A")
|
||||
);
|
||||
if (!empty($user['User']['gpgkey'])) {
|
||||
$table_data[] = array(
|
||||
'key' => __('GnuPG fingerprint'),
|
||||
'class_value' => "quickSelect bold " . $user['User']['gpgkey'] ? 'green' : 'bold red',
|
||||
'html' => $user['User']['fingerprint'] ? chunk_split(h($user['User']['fingerprint']), 4, ' ') : 'N/A'
|
||||
);
|
||||
$table_data[] = array(
|
||||
'key' => __('GnuPG status'),
|
||||
'class_value' => "bold" . (empty($user['User']['pgp_status']) || $user['User']['pgp_status'] != 'OK') ? 'red': 'green',
|
||||
'html' => !empty($user['User']['pgp_status']) ? h($user['User']['pgp_status']) : 'N/A'
|
||||
);
|
||||
}
|
||||
if (Configure::read('SMIME.enabled')) {
|
||||
$table_data[] = array(
|
||||
'key' => __('SMIME Public certificate'),
|
||||
'class_value' => "red quickSelect",
|
||||
'html' => (h($user['User']['certif_public'])) ? $this->Utility->space2nbsp(nl2br(h($user['User']['certif_public']))) : "N/A"
|
||||
);
|
||||
}
|
||||
$table_data[] = array('key' => __('Newsread'), 'html' => $user['User']['newsread'] ? date('Y/m/d H:i:s', h($user['User']['newsread'])) : __('N/A'));
|
||||
$table_data[] = array(
|
||||
'key' => __('Disabled'),
|
||||
'class' => empty($user['User']['disabled']) ? '' : 'background-red',
|
||||
'boolean' => $user['User']['disabled']
|
||||
);
|
||||
echo sprintf(
|
||||
'<div class="users view row-fluid"><div class="span8" style="margin:0px;">%s%s</div>%s</div>%s',
|
||||
sprintf(
|
||||
'<h2>%s</h2>%s',
|
||||
__('User'),
|
||||
$this->element('genericElements/viewMetaTable', array('table_data' => $table_data))
|
||||
),
|
||||
sprintf(
|
||||
'<br /><a href="%s" class="btn btn-inverse" download>Download user profile for data portability</a>',
|
||||
sprintf(
|
||||
'%s/users/view/%s.json',
|
||||
$baseurl,
|
||||
h($user['User']['id'])
|
||||
)
|
||||
),
|
||||
'<div id="userEvents"></div>',
|
||||
$this->element('side_menu', array('menuList' => 'globalActions', 'menuItem' => 'view'))
|
||||
);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
|
|
|
@ -1,94 +1,67 @@
|
|||
<div class="users view">
|
||||
<h2><?php echo __('User');?></h2>
|
||||
<dl style="width:700px;">
|
||||
<dt><?php echo __('Id'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h($user['User']['id']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Email'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h($user['User']['email']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Org'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h($user['Organisation']['name']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Role'); ?></dt>
|
||||
<dd>
|
||||
<?php echo $this->Html->link($user['Role']['name'], array('controller' => 'roles', 'action' => 'view', $user['Role']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Autoalert'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h(0 == ($user['User']['autoalert'])) ? 'No' : 'Yes'; ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Contactalert'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h(0 == ($user['User']['contactalert'])) ? 'No' : 'Yes'; ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Authkey'); ?></dt>
|
||||
<dd>
|
||||
<?php
|
||||
if ($user['Role']['perm_auth']):
|
||||
?>
|
||||
<span class="quickSelect"><?php echo h($user['User']['authkey']); ?></span>
|
||||
<?php
|
||||
if (!Configure::read('MISP.disableUserSelfManagement') || $isAdmin):
|
||||
echo ' (' . $this->Html->link('reset', array('controller' => 'users', 'action' => 'resetauthkey', $user['User']['id'])) . ')';
|
||||
endif;
|
||||
else:
|
||||
echo "<a onclick=\"requestAPIAccess();\" style=\"cursor:pointer;\">". __('Request API access') . "</a>";
|
||||
endif;
|
||||
?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('NIDS Start SID'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h($user['User']['nids_sid']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Termsaccepted'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h((0 == $user['User']['termsaccepted'])? __('No') : __('Yes')); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('GnuPG key'); ?></dt>
|
||||
<dd class="quickSelect <?php echo $user['User']['gpgkey'] ? 'green' : 'bold red'; ?>">
|
||||
<?php echo $user['User']['gpgkey'] ? nl2br(h($user['User']['gpgkey'])) : __("N/A"); ?>
|
||||
</dd>
|
||||
<?php
|
||||
if (!empty($user['User']['gpgkey'])):
|
||||
?>
|
||||
<dt><?php echo __('GnuPG fingerprint');?></dt>
|
||||
<dd class="quickSelect bold <?php echo $user['User']['fingerprint'] ? 'green': 'red'; ?>">
|
||||
<?php
|
||||
echo $user['User']['fingerprint'] ? chunk_split(h($user['User']['fingerprint']), 4, ' ') : 'N/A';
|
||||
?>
|
||||
</dd>
|
||||
<dt><?php echo __('GnuPG status');?></dt>
|
||||
<dd class="bold <?php echo (empty($user['User']['pgp_status']) || $user['User']['pgp_status'] != 'OK') ? 'red': 'green'; ?>">
|
||||
<?php
|
||||
echo !empty($user['User']['pgp_status']) ? h($user['User']['pgp_status']) : 'N/A';
|
||||
?>
|
||||
</dd>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
<?php if (Configure::read('SMIME.enabled')): ?>
|
||||
<dt><?php echo __('SMIME Public certificate'); ?></dt>
|
||||
<dd class="red quickSelect">
|
||||
<?php echo (h($user['User']['certif_public'])) ? $this->Utility->space2nbsp(nl2br(h($user['User']['certif_public']))) : "N/A"; ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
</dl>
|
||||
<br />
|
||||
<a href="<?php echo $baseurl . '/users/view/me.json'; ?>" class="btn btn-inverse" download>Download user profile for data portability</a>
|
||||
</div>
|
||||
<?php
|
||||
echo $this->element('side_menu', array('menuList' => 'globalActions', 'menuItem' => 'view'));
|
||||
$table_data = array();
|
||||
$table_data[] = array('key' => __('Id'), 'value' => $user['User']['id']);
|
||||
$table_data[] = array('key' => __('Email'), 'value' => $user['User']['email']);
|
||||
$table_data[] = array('key' => __('Organisation'), 'value' => $user['Organisation']['name']);
|
||||
$table_data[] = array('key' => __('Role'), 'html' => $this->Html->link($user['Role']['name'], array('controller' => 'roles', 'action' => 'view', $user['Role']['id'])));
|
||||
$table_data[] = array('key' => __('Autoalert'), 'boolean' => $user['User']['autoalert']);
|
||||
$table_data[] = array('key' => __('Contactalert'), 'boolean' => $user['User']['contactalert']);
|
||||
$authkey_data = sprintf(
|
||||
'<a onclick="requestAPIAccess();" style="cursor:pointer;"></a>',
|
||||
__('Request API access')
|
||||
);
|
||||
if ($user['Role']['perm_auth']) {
|
||||
$authkey_data = sprintf(
|
||||
'<span class="quickSelect">%s</span>%s',
|
||||
h($user['User']['authkey']),
|
||||
(Configure::read('MISP.disableUserSelfManagement') && !$isAdmin) ? '' :
|
||||
sprintf(
|
||||
' (%s)',
|
||||
$this->Html->link('reset', array('controller' => 'users', 'action' => 'resetauthkey', $user['User']['id']))
|
||||
)
|
||||
);
|
||||
}
|
||||
$table_data[] = array(
|
||||
'key' => __('Authkey'),
|
||||
'html' => $authkey_data
|
||||
);
|
||||
$table_data[] = array('key' => __('NIDS Start SID'), 'value' => $user['User']['nids_sid']);
|
||||
$table_data[] = array('key' => __('Terms accepted'), 'boolean' => $user['User']['termsaccepted']);
|
||||
$table_data[] = array(
|
||||
'key' => __('GnuPG key'),
|
||||
'class_value' => "quickSelect " . $user['User']['gpgkey'] ? 'green' : 'bold red',
|
||||
'html' => $user['User']['gpgkey'] ? nl2br(h($user['User']['gpgkey'])) : __("N/A")
|
||||
);
|
||||
if (!empty($user['User']['gpgkey'])) {
|
||||
$table_data[] = array(
|
||||
'key' => __('GnuPG fingerprint'),
|
||||
'class_value' => "quickSelect bold " . $user['User']['gpgkey'] ? 'green' : 'bold red',
|
||||
'html' => $user['User']['fingerprint'] ? chunk_split(h($user['User']['fingerprint']), 4, ' ') : 'N/A'
|
||||
);
|
||||
$table_data[] = array(
|
||||
'key' => __('GnuPG status'),
|
||||
'class_value' => "bold" . (empty($user['User']['pgp_status']) || $user['User']['pgp_status'] != 'OK') ? 'red': 'green',
|
||||
'html' => !empty($user['User']['pgp_status']) ? h($user['User']['pgp_status']) : 'N/A'
|
||||
);
|
||||
}
|
||||
if (Configure::read('SMIME.enabled')) {
|
||||
$table_data[] = array(
|
||||
'key' => __('SMIME Public certificate'),
|
||||
'class_value' => "red quickSelect",
|
||||
'html' => (h($user['User']['certif_public'])) ? $this->Utility->space2nbsp(nl2br(h($user['User']['certif_public']))) : "N/A"
|
||||
);
|
||||
}
|
||||
echo sprintf(
|
||||
'<div class="users view row-fluid"><div class="span8" style="margin:0px;">%s</div>%s</div>%s',
|
||||
sprintf(
|
||||
'<h2>%s</h2>%s',
|
||||
__('User'),
|
||||
$this->element('genericElements/viewMetaTable', array('table_data' => $table_data))
|
||||
),
|
||||
sprintf(
|
||||
'<br /><a href="%s" class="btn btn-inverse" download>Download user profile for data portability</a>',
|
||||
$baseurl . '/users/view/me.json'
|
||||
),
|
||||
$this->element('side_menu', array('menuList' => 'globalActions', 'menuItem' => 'view'))
|
||||
);
|
||||
?>
|
||||
|
|
|
@ -1,61 +1,43 @@
|
|||
<div class="warninglist view">
|
||||
<h2><?php echo h(strtoupper($warninglist['Warninglist']['name'])); ?></h2>
|
||||
<dl>
|
||||
<dt><?php echo __('Id');?></dt>
|
||||
<dd>
|
||||
<?php echo h($warninglist['Warninglist']['id']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Name');?></dt>
|
||||
<dd>
|
||||
<?php echo h($warninglist['Warninglist']['name']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Description');?></dt>
|
||||
<dd>
|
||||
<?php echo h($warninglist['Warninglist']['description']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Version');?></dt>
|
||||
<dd>
|
||||
<?php echo h($warninglist['Warninglist']['version']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Type');?></dt>
|
||||
<dd>
|
||||
<?php echo h($warninglist['Warninglist']['type']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Accepted attribute types');?></dt>
|
||||
<dd>
|
||||
<?php
|
||||
$text = array();
|
||||
foreach ($warninglist['WarninglistType'] as $temp) $text[] = $temp['type'];
|
||||
$text = implode(', ', $text);
|
||||
echo h($text);
|
||||
?>
|
||||
</dd>
|
||||
<dt><?php echo __('Enabled');?></dt>
|
||||
<dd>
|
||||
<?php echo $warninglist['Warninglist']['enabled'] ? '<span class="green">Yes</span> ' : '<span class="red">No</span> ';
|
||||
if ($isSiteAdmin) {
|
||||
if ($warninglist['Warninglist']['enabled']) {
|
||||
echo $this->Form->postLink('(disable)', array('action' => 'enableWarninglist', h($warninglist['Warninglist']['id'])), array('title' => 'Disable'));
|
||||
} else {
|
||||
echo $this->Form->postLink('(enable)', array('action' => 'enableWarninglist', h($warninglist['Warninglist']['id']), 'true') ,array('title' => 'Enable'));
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$data = $warninglist['Warninglist'];
|
||||
$text = array();
|
||||
foreach ($warninglist['WarninglistType'] as $temp) {
|
||||
$text[] = $temp['type'];
|
||||
}
|
||||
$text = implode(', ', $text);
|
||||
$table_data = array(
|
||||
array('key' => __('Id'), 'value' => $data['id']),
|
||||
array('key' => __('Name'), 'value' => $data['name']),
|
||||
array('key' => __('Description'), 'value' => $data['description']),
|
||||
array('key' => __('Version'), 'value' => $data['version']),
|
||||
array('key' => __('Type'), 'value' => $data['type']),
|
||||
array('key' => __('Accepted attribute types'), 'value' => $text),
|
||||
array(
|
||||
'key' => __('Accepted attribute types'),
|
||||
'boolean' => $data['enabled'],
|
||||
'html' => sprintf(
|
||||
'(<a href="%s/warninglists/enableWarninglist/%s%s" title="%s">%s</a>)',
|
||||
$baseurl,
|
||||
h($warninglist['Warninglist']['id']),
|
||||
$data['enabled'] ? '' : '/1',
|
||||
$data['enabled'] ? __('Disable') : __('Enable'),
|
||||
$data['enabled'] ? __('disable') : __('enable')
|
||||
)
|
||||
),
|
||||
);
|
||||
echo sprintf(
|
||||
'<div class="warninglist view"><div class="row-fluid"><div class="span8" style="margin:0px;">%s</div></div><h4>%s</h4>%s</div>%s',
|
||||
sprintf(
|
||||
'<h2>%s</h2>%s',
|
||||
h(strtoupper($warninglist['Warninglist']['name'])),
|
||||
$this->element('genericElements/viewMetaTable', array('table_data' => $table_data))
|
||||
),
|
||||
__('Values'),
|
||||
implode('<br />', array_column($warninglist['WarninglistEntry'], 'value')),
|
||||
$this->element('side_menu', array('menuList' => 'warninglist', 'menuItem' => 'view'))
|
||||
);
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<br />
|
||||
<h3><?php echo __('Values');?></h3>
|
||||
<div><?php
|
||||
foreach ($warninglist['WarninglistEntry'] as $entry) echo h($entry['value']) . '<br />';
|
||||
?></div>
|
||||
</div>
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('input:checkbox').removeAttr('checked');
|
||||
|
@ -65,6 +47,3 @@
|
|||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
echo $this->element('side_menu', array('menuList' => 'warninglist', 'menuItem' => 'view'));
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue