mirror of https://github.com/MISP/MISP
Compare commits
18 Commits
48dcaf31fc
...
e529024a52
Author | SHA1 | Date |
---|---|---|
Jakub Onderka | e529024a52 | |
iglocska | 3d3a207d4d | |
iglocska | 947dbe1085 | |
iglocska | 66532a095c | |
iglocska | 14106b811a | |
iglocska | ee196c1349 | |
Sami Mokaddem | 7416a9dd97 | |
iglocska | 89a6cbdfe6 | |
iglocska | b6a8d43bbd | |
Andras Iklody | d629922a7f | |
iglocska | 91e1c27746 | |
iglocska | cd25980da9 | |
iglocska | ed790e2ab7 | |
iglocska | 597977694d | |
iglocska | 4c75abbb70 | |
Jakub Onderka | 34c85cfe7e | |
Jeroen Pinoy | 2b3cd11142 | |
Bradley Logan | ee986fc2fc |
|
@ -4142,7 +4142,13 @@ class EventsController extends AppController
|
|||
}
|
||||
}
|
||||
$this->Event->Attribute->fetchRelated($this->Auth->user(), $resultArray);
|
||||
$typeCategoryMapping = array();
|
||||
$typeCategoryMapping = [
|
||||
'ip-src/ip-dst' => [
|
||||
'Network activity' => 'Network activity',
|
||||
'Payload delivery' => 'Payload delivery',
|
||||
'External analysis' => 'External analysis'
|
||||
],
|
||||
];
|
||||
foreach ($this->Event->Attribute->categoryDefinitions as $k => $cat) {
|
||||
foreach ($cat['types'] as $type) {
|
||||
$typeCategoryMapping[$type][$k] = $k;
|
||||
|
|
|
@ -59,6 +59,8 @@ class GalaxyClustersController extends AppController
|
|||
$contextConditions['GalaxyCluster.default'] = true;
|
||||
} elseif ($filters['context'] == 'custom') {
|
||||
$contextConditions['GalaxyCluster.default'] = false;
|
||||
} elseif ($filters['context'] == 'orgc') {
|
||||
$contextConditions['GalaxyCluster.orgc_id'] = $this->Auth->user('org_id');
|
||||
} elseif ($filters['context'] == 'org') {
|
||||
$contextConditions['GalaxyCluster.org_id'] = $this->Auth->user('org_id');
|
||||
} elseif ($filters['context'] == 'deleted') {
|
||||
|
|
|
@ -117,6 +117,9 @@ class LogsController extends AppController
|
|||
$this->paginate['conditions']['Log.action'] = $validFilters[$this->params['named']['filter']]['values'];
|
||||
}
|
||||
foreach ($filters as $key => $value) {
|
||||
if ($key == 'page' || $key == 'limit') { // These should not be part of the condition parameter
|
||||
continue;
|
||||
}
|
||||
if ($key === 'created') {
|
||||
$key = 'created >=';
|
||||
}
|
||||
|
|
|
@ -2603,6 +2603,7 @@ class UsersController extends AppController
|
|||
'org_name',
|
||||
'org_uuid',
|
||||
'message',
|
||||
'pgp',
|
||||
'custom_perms',
|
||||
'perm_sync',
|
||||
'perm_publish',
|
||||
|
|
|
@ -15,9 +15,6 @@ class BenchmarkTool
|
|||
/** @var retention */
|
||||
private $retention = 0;
|
||||
|
||||
/** @var start_time */
|
||||
public $start_timexxx;
|
||||
|
||||
const BENCHMARK_SCOPES = ['user', 'endpoint', 'user_agent'];
|
||||
const BENCHMARK_FIELDS = ['time', 'sql_time', 'sql_queries', 'memory'];
|
||||
const BENCHMARK_UNITS = [
|
||||
|
|
|
@ -152,7 +152,9 @@ class MysqlExtended extends Mysql
|
|||
public function execute($sql, $options = [], $params = [])
|
||||
{
|
||||
$log = $options['log'] ?? $this->fullDebug;
|
||||
|
||||
if (Configure::read('Plugin.Benchmarking_enable')) {
|
||||
$log = true;
|
||||
}
|
||||
if ($log) {
|
||||
$t = microtime(true);
|
||||
$this->_result = $this->_execute($sql, $params);
|
||||
|
|
|
@ -144,6 +144,9 @@ class MysqlObserverExtended extends Mysql
|
|||
public function execute($sql, $options = [], $params = [])
|
||||
{
|
||||
$log = $options['log'] ?? $this->fullDebug;
|
||||
if (Configure::read('Plugin.Benchmarking_enable')) {
|
||||
$log = true;
|
||||
}
|
||||
$comment = sprintf(
|
||||
'%s%s%s',
|
||||
empty(Configure::read('CurrentUserId')) ? '' : sprintf(
|
||||
|
|
|
@ -46,6 +46,8 @@ class UserLoginProfile extends AppModel
|
|||
private function browscapGetBrowser()
|
||||
{
|
||||
$logger = new \Monolog\Logger('name');
|
||||
$streamHandler = new \Monolog\Handler\StreamHandler('php://stderr', \Monolog\Logger::INFO);
|
||||
$logger->pushHandler($streamHandler);
|
||||
|
||||
if (function_exists('apcu_fetch')) {
|
||||
App::uses('ApcuCacheTool', 'Tools');
|
||||
|
|
|
@ -302,7 +302,7 @@ class Oidc
|
|||
$providerUrl = $this->getConfig('provider_url');
|
||||
$clientId = $this->getConfig('client_id');
|
||||
$clientSecret = $this->getConfig('client_secret');
|
||||
$issuer = $this->getConfig('issuer', $providerUrl);
|
||||
$issuer = $this->getConfig('issuer', null, false);
|
||||
|
||||
if (class_exists("\JakubOnderka\OpenIDConnectClient")) {
|
||||
$oidc = new \JakubOnderka\OpenIDConnectClient($providerUrl, $clientId, $clientSecret, $issuer);
|
||||
|
@ -503,13 +503,15 @@ class Oidc
|
|||
/**
|
||||
* @param string $config
|
||||
* @param mixed|null $default
|
||||
* @param bool $required When true and variable is not set, RuntimeException will be thrown
|
||||
* @return mixed
|
||||
* @throws RuntimeException when config option is not set
|
||||
*/
|
||||
private function getConfig($config, $default = null)
|
||||
private function getConfig($config, $default = null, $required = true)
|
||||
{
|
||||
$value = Configure::read("OidcAuth.$config");
|
||||
if ($value === null) {
|
||||
if ($default === null) {
|
||||
if ($default === null && $required) {
|
||||
throw new RuntimeException("Config option `OidcAuth.$config` is not set.");
|
||||
}
|
||||
return $default;
|
||||
|
|
|
@ -57,5 +57,5 @@
|
|||
'%s<a href="#" onclick="event.preventDefault(); %s">%s</a>',
|
||||
$form,
|
||||
$onclick,
|
||||
$text
|
||||
h($text)
|
||||
);
|
||||
|
|
|
@ -540,7 +540,7 @@ if (!empty($me)) {
|
|||
],
|
||||
array(
|
||||
'type' => 'root',
|
||||
'url' => $baseurl . '/dashboards',
|
||||
'url' => $baseurl . '/users/view/me',
|
||||
'html' => sprintf(
|
||||
'<span class="white" title="%s">%s%s %s</span>',
|
||||
h($me['email']),
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
'field' => 'threat_level_id',
|
||||
'class' => 'input',
|
||||
'options' => $threatLevels,
|
||||
'default' => Configure::check('MISP.default_event_threat_level') ? Configure::read('MISP.default_event_threat_level') : '4',
|
||||
'label' => __("Threat Level"),
|
||||
'stayInLine' => 1,
|
||||
'type' => 'dropdown'
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
),
|
||||
array(
|
||||
'active' => $context === 'org',
|
||||
'url' => sprintf('%s/galaxies/view/%s/context:org', $baseurl, $galaxy_id),
|
||||
'url' => sprintf('%s/galaxies/view/%s/context:orgc', $baseurl, $galaxy_id),
|
||||
'text' => __('My Clusters'),
|
||||
),
|
||||
array(
|
||||
|
|
Loading…
Reference in New Issue