Merge branch 'feature/discussion' into develop

pull/217/head
iglocska 2013-11-06 10:13:47 +01:00
commit be723fc821
86 changed files with 2079 additions and 1097 deletions

27
INSTALL/ROLECHANGE.sql Normal file
View File

@ -0,0 +1,27 @@
ALTER TABLE `roles` ADD `perm_site_admin` TINYINT( 1 ) NOT NULL DEFAULT '0',
ADD `perm_regexp_access` TINYINT( 1 ) NOT NULL DEFAULT '0';
CREATE TABLE IF NOT EXISTS `threads` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date_created` datetime NOT NULL,
`date_modified` datetime NOT NULL,
`distribution` tinyint(4) NOT NULL,
`user_id` int(11) NOT NULL,
`post_count` int(11) NOT NULL,
`event_id` int(11) NOT NULL,
`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`org` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ;
CREATE TABLE IF NOT EXISTS `posts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date_created` datetime NOT NULL,
`date_modified` datetime NOT NULL,
`user_id` int(11) NOT NULL,
`contents` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`post_id` int(11) NOT NULL DEFAULT '0',
`thread_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ;

28
INSTALL/upgrade_2.2.sql Normal file
View File

@ -0,0 +1,28 @@
ALTER TABLE `roles` ADD `perm_site_admin` TINYINT( 1 ) NOT NULL DEFAULT '0',
ADD `perm_regexp_access` TINYINT( 1 ) NOT NULL DEFAULT '0';
CREATE TABLE IF NOT EXISTS `threads` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date_created` datetime NOT NULL,
`date_modified` datetime NOT NULL,
`distribution` tinyint(4) NOT NULL,
`user_id` int(11) NOT NULL,
`post_count` int(11) NOT NULL,
`event_id` int(11) NOT NULL,
`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`org` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ;
CREATE TABLE IF NOT EXISTS `posts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date_created` datetime NOT NULL,
`date_modified` datetime NOT NULL,
`user_id` int(11) NOT NULL,
`contents` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`post_id` int(11) NOT NULL DEFAULT '0',
`thread_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ;
ALTER TABLE `attributes` ADD `comment` TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;

View File

@ -107,7 +107,7 @@ class AppController extends Controller {
$role = $this->getActions();
$this->set('me', $this->Auth->user());
$this->set('isAdmin', $role['perm_admin']);
$this->set('isSiteAdmin', $this->_isSiteAdmin());
$this->set('isSiteAdmin', $role['perm_site_admin']);
$this->set('isAclAdd', $role['perm_add']);
$this->set('isAclModify', $role['perm_modify']);
$this->set('isAclModifyOrg', $role['perm_modify_org']);
@ -116,6 +116,7 @@ class AppController extends Controller {
$this->set('isAclAdmin', $role['perm_admin']);
$this->set('isAclAudit', $role['perm_audit']);
$this->set('isAclAuth', $role['perm_auth']);
$this->set('isAclRegexp', $role['perm_regexp_access']);
$this->userRole = $role;
} else {
$this->set('me', false);
@ -129,6 +130,7 @@ class AppController extends Controller {
$this->set('isAclAdmin', false);
$this->set('isAclAudit', false);
$this->set('isAclAuth', false);
$this->set('isAclRegexp', false);
}
if (Configure::read('debug') > 0) {
$this->debugMode = 'debugOn';
@ -165,7 +167,7 @@ class AppController extends Controller {
*/
protected function _isAdmin() {
$org = $this->Auth->user('org');
if ((isset($org) && $org === 'ADMIN') || $this->userRole['perm_admin']) {
if ($this->userRole['perm_site_admin'] || $this->userRole['perm_admin']) {
return true;
}
return false;
@ -175,11 +177,7 @@ class AppController extends Controller {
* checks if the currently logged user is a site administrator (an admin that can manage any user or event on the instance and create / edit the roles).
*/
protected function _isSiteAdmin() {
$org = $this->Auth->user('org');
if (isset($org) && $org === 'ADMIN') {
return true;
}
return false;
return $this->userRole['perm_site_admin'];
}
protected function _checkOrg() {
@ -296,7 +294,7 @@ class AppController extends Controller {
$this->Role->recursive = -1;
$role = $this->Role->findById($user['User']['role_id']);
$user['User']['siteAdmin'] = false;
if ($role['Role']['perm_admin'] && $user['User']['org'] == 'ADMIN') $user['User']['siteAdmin'] = true;
if ($role['Role']['perm_site_admin']) $user['User']['siteAdmin'] = true;
if ($role['Role']['perm_auth']) {
return $user;
}

View File

@ -402,12 +402,12 @@ class AttributesController extends AppController {
$temp['Attribute']['type'] = 'filename|sha256';
$temp['Attribute']['value'] = $filename . '|' .$sha256;
$temp['Attribute']['uuid'] = String::uuid();
$this->Attribute->save($temp, array('fieldlist' => array('value', 'type', 'category', 'event_id', 'distribution', 'to_ids')));
$this->Attribute->save($temp, array('fieldlist' => array('value', 'type', 'category', 'event_id', 'distribution', 'to_ids', 'comment')));
$this->Attribute->create();
$temp['Attribute']['type'] = 'filename|sha1';
$temp['Attribute']['value'] = $filename . '|' .$sha1;
$temp['Attribute']['uuid'] = String::uuid();
$this->Attribute->save($temp, array('fieldlist' => array('value', 'type', 'category', 'event_id', 'distribution', 'to_ids')));
$this->Attribute->save($temp, array('fieldlist' => array('value', 'type', 'category', 'event_id', 'distribution', 'to_ids', 'comment')));
}
@ -494,7 +494,6 @@ class AttributesController extends AppController {
}
// parse uploaded csv file
$filename = '/Users/chri/Downloads/ThreatConnectExport2.csv';
$filename = $tmpfile->path;
$header = NULL;
$entries = array();
@ -526,12 +525,15 @@ class AttributesController extends AppController {
$attribute['event_id'] = $this->request->data['Attribute']['event_id'];
$attribute['value'] = $entry['Value'];
$attribute['to_ids'] = ($entry['Confidence'] > 51) ? 1 : 0; // To IDS if high confidence
$attribute['distribution'] = 3; // 'All communities'
if (Configure::read('MISP.default_attribute_distribution') === 'event') {
$attribute['distribution'] = $this->Event->data['Event']['distribution'];
} else {
$attribute['distribution'] = Configure::read('MISP.default_attribute_distribution');
}
$attribute['comment'] = 'ThreatConnect: ' . $entry['Description'];
$attribute['distribution'] = '3'; // 'All communities'
if (Configure::read('MISP.default_attribute_distribution') != null) {
if (Configure::read('MISP.default_attribute_distribution') === 'event') {
$attribute['distribution'] = $this->Event->data['Event']['distribution'];
} else {
$attribute['distribution'] = Configure::read('MISP.default_attribute_distribution');
}
}
switch($entry['Type']) {
case 'Address':
$attribute['category'] = 'Network activity';
@ -689,7 +691,7 @@ class AttributesController extends AppController {
} else {
$this->request->data['Attribute']['timestamp'] = $date->getTimestamp();
}
$fieldList = array('category', 'type', 'value1', 'value2', 'to_ids', 'distribution', 'value', 'timestamp');
$fieldList = array('category', 'type', 'value1', 'value2', 'to_ids', 'distribution', 'value', 'timestamp', 'comment');
$this->loadModel('Event');
$this->Event->id = $eventId;
@ -726,6 +728,7 @@ class AttributesController extends AppController {
$this->loadModel('Event');
$this->Event->id = $eventId;
$this->Event->read();
$this->set('published', $this->Event->data['Event']['published']);
// needed for RBAC
// combobox for types
$types = array_keys($this->Attribute->typeDefinitions);

View File

@ -39,7 +39,6 @@ class IOCExportComponent extends Component {
// This method will turn each eligible attribute into an indicator
private function __buildAttribute($attribute) {
// Hop over attributes that don't have the to ids flag turned on and check whether the attribute is sent for IOC export based on category/type
if (!$this->__checkValidTypeForIOC($attribute) || $attribute['to_ids'] == 0) return;
@ -69,6 +68,10 @@ class IOCExportComponent extends Component {
$this->final[] = ' <Context document="TaskItem" search="TaskItem/sha1sum" type="mir" />';
$this->final[] = ' <Content type="string">' . h($attribute['value']) . '</Content>';
break;
case 'sha256':
$this->final[] = ' <Context document="TaskItem" search="TaskItem/sha256sum" type="mir" />';
$this->final[] = ' <Content type="string">' . h($attribute['value']) . '</Content>';
break;
case 'filename':
$this->final[] = ' <Context document="FileItem" search="FileItem/FileName" type="mir" />';
$this->final[] = ' <Content type="string">' . h($attribute['value']) . '</Content>';
@ -81,6 +84,10 @@ class IOCExportComponent extends Component {
$this->final[] = ' <Context document="TaskItem" search="TaskItem/sha1sum" type="mir" />';
$this->final[] = ' <Content type="string">' . h($attribute['value2']) . '</Content>';
break;
case 'filename|sha256':
$this->final[] = ' <Context document="TaskItem" search="TaskItem/sha256sum" type="mir" />';
$this->final[] = ' <Content type="string">' . h($attribute['value2']) . '</Content>';
break;
case 'ip-src':
$this->final[] = ' <Context document="PortItem" search="PortItem/remoteIP" type="mir" />';
$this->final[] = ' <Content type="IP">' . h($attribute['value']) . '</Content>';
@ -140,6 +147,7 @@ class IOCExportComponent extends Component {
case 'link':
$this->final[] = ' <Context document="URL" search="UrlHistoryItem/URL" type="mir" />';
$this->final[] = ' <Content type="md5">' . h($attribute['value2']) . '</Content>';
break;
}
// since regkey|value is enclosed by an AND indicator, it was closed differently in its branch
if ($attribute['type'] != 'regkey|value') {

View File

@ -107,7 +107,7 @@ class IOCImportComponent extends Component {
// Add a special attribute that captures the basic data about the .ioc such as the ioc-s uuid, info, long info, author, etc.
// Define the fields used in the global iocinfo variable.
foreach ($this->iocinfo as $k => $v) {
$event['Attribute'][] = array('uuid' => String::uuid(), 'category' => 'Other', 'type' => 'comment', 'event_id' => $id, 'value' => $v . ': ' . $event[$v], 'to_ids' => false, 'distribution' => $this->distribution);
$event['Attribute'][] = array('uuid' => String::uuid(), 'category' => 'Other', 'type' => 'comment', 'event_id' => $id, 'value' => $v . ': ' . $event[$v], 'to_ids' => false, 'distribution' => $this->distribution, 'comment' => 'OpenIOC import');
}
// attach the graph to the event
@ -165,6 +165,7 @@ class IOCImportComponent extends Component {
if ($temp[0] == 'Other' && $temp[1] == 'other') {
$attribute['value'] = $attribute['search'] . ': ' . $attribute['value'];
}
$attribute['comment'] = 'OpenIOC import';
return $attribute;
}

View File

@ -1,7 +1,6 @@
<?php
App::uses('AppController', 'Controller');
App::uses('Xml', 'Utility');
/**
* Events Controller
*
@ -248,6 +247,54 @@ class EventsController extends AppController {
$this->set('pivot', $pivot);
$this->set('currentEvent', $id);
}
$this->set('allPivots', $this->Session->read('pivot_thread'));
// Show the discussion
$this->loadModel('Thread');
$params = array('conditions' => array('event_id' => $id),
'recursive' => -1,
'fields' => array('id', 'event_id', 'distribution', 'title')
);
$thread = $this->Thread->find('first', $params);
if (empty($thread)) {
$newThread = array(
'date_created' => date('Y/m/d H:i:s'),
'date_modified' => date('Y/m/d H:i:s'),
'user_id' => $this->Auth->user('id'),
'event_id' => $id,
'title' => 'Discussion about Event #' . $result['Event']['id'] . ' (' . $result['Event']['info'] . ')',
'distribution' => $result['Event']['distribution'],
'post_count' => 0,
'org' => $result['Event']['orgc']
);
$this->Thread->save($newThread);
$thread = ($this->Thread->read());
} else {
if ($thread['Thread']['distribution'] != $result['Event']['distribution']) {
$this->Thread->saveField('distribution', $result['Event']['distribution']);
}
}
$this->loadModel('Post');
$this->paginate['Post'] = array(
'limit' => 5,
'conditions' => array('Post.thread_id' => $thread['Thread']['id']),
'contain' => 'User'
);
$posts = $this->paginate('Post');
// Show the discussion
$this->set('posts', $posts);
$this->set('thread_id', $thread['Thread']['id']);
$this->set('myuserid', $this->Auth->user('id'));
$this->set('thread_title', $thread['Thread']['title']);
if ($this->request->is('ajax')) {
$this->disableCache();
$this->layout = 'ajax';
$this->render('/Elements/eventdiscussion');
}
$pivot = $this->Session->read('pivot_thread');
$this->__arrangePivotVertical($pivot);
$this->__setDeletable($pivot, $id, true);
$this->set('pivot', $pivot);
$this->set('currentEvent', $id);
}
private function __startPivoting($id, $info, $date){
@ -461,38 +508,42 @@ class EventsController extends AppController {
}
}
}
// combobox for distribution
$distributions = array_keys($this->Event->distributionDescriptions);
$distributions = $this->_arrayToValuesIndexArray($distributions);
$this->set('distributions', $distributions);
// tooltip for distribution
$this->set('distributionDescriptions', $this->Event->distributionDescriptions);
$this->set('distributionLevels', $this->Event->distributionLevels);
// combobox for risks
$risks = $this->Event->validate['risk']['rule'][1];
$risks = $this->_arrayToValuesIndexArray($risks);
$this->set('risks',$risks);
// set the id
$this->set('id', $id);
// set whether it is published or not
$this->set('published', $this->Event->data['Event']['published']);
// tooltip for risk
$this->set('riskDescriptions', $this->Event->riskDescriptions);
// combobox for analysis
$analysiss = $this->Event->validate['analysis']['rule'][1];
$analysiss = $this->_arrayToValuesIndexArray($analysiss);
$this->set('analysiss',$analysiss);
// tooltip for analysis
$this->set('analysisDescriptions', $this->Event->analysisDescriptions);
$this->set('analysisLevels', $this->Event->analysisLevels);
$this->set('eventDescriptions', $this->Event->fieldDescriptions);
}
public function add_xml() {
if (!$this->userRole['perm_modify']) {
throw new UnauthorizedException('You do not have permission to do that.');
}
if ($this->request->is('post')) {
if (!empty($this->data)) {
$ext = '';
if (isset($this->data['Event']['submittedxml'])) {
App::uses('File', 'Utility');
$file = new File($this->data['Event']['submittedxml']['name']);
$ext = $file->ext();
}
if (isset($this->data['Event']['submittedxml']) && ($ext != 'xml') && $this->data['Event']['submittedxml']['size'] > 0 &&
is_uploaded_file($this->data['Event']['submittedxml']['tmp_name'])) {
$this->Session->setFlash(__('You may only upload OpenIOC ioc files.'));
}
if (isset($this->data['Event']['submittedxml'])) $this->_addXMLFile();
// redirect to the view of the newly created event
if (!CakeSession::read('Message.flash')) {
$this->Session->setFlash(__('The event has been saved'));
} else {
$existingFlash = CakeSession::read('Message.flash');
$this->Session->setFlash(__('The event has been saved. ' . $existingFlash['message']));
}
}
}
}
/**
* Low level function to add an Event based on an Event $data array
*
@ -519,7 +570,6 @@ class EventsController extends AppController {
unset($this->Event->Attribute->validate['event_id']);
unset($this->Event->Attribute->validate['value']['unique']); // otherwise gives bugs because event_id is not set
}
unset ($data['Event']['id']);
if (isset($data['Event']['uuid'])) {
// check if the uuid already exists
@ -628,7 +678,6 @@ class EventsController extends AppController {
$this->redirect(array('controller' => 'events', 'action' => 'index'));
}
}
if ($this->request->is('post') || $this->request->is('put')) {
if ($this->_isRest()) {
$saveEvent = false;
@ -767,6 +816,8 @@ class EventsController extends AppController {
$this->set('analysisLevels', $this->Event->analysisLevels);
$this->set('eventDescriptions', $this->Event->fieldDescriptions);
$this->set('event', $this->Event->data);
}
/**
@ -1008,7 +1059,7 @@ class EventsController extends AppController {
$body .= 'Analysis : ' . $this->Event->analysisLevels[$event['Event']['analysis']] . "\n";
$body .= 'Info : ' . "\n";
$body .= $event['Event']['info'] . "\n";
$relatedEvents = $this->Event->getRelatedEvents($this->Auth->user());
$relatedEvents = $this->Event->getRelatedEvents($this->Auth->user(), $this->_isSiteAdmin());
if (!empty($relatedEvents)) {
$body .= '----------------------------------------------' . "\n";
$body .= 'Related to : '. "\n";
@ -1223,7 +1274,7 @@ class EventsController extends AppController {
}
$body .= 'Risk : ' . $event['Event']['risk'] . "\n";
$body .= 'Analysis : ' . $event['Event']['analysis'] . "\n";
$relatedEvents = $this->Event->getRelatedEvents($this->Auth->user());
$relatedEvents = $this->Event->getRelatedEvents($this->Auth->user(), $this->_isSiteAdmin());
if (!empty($relatedEvents)) {
foreach ($relatedEvents as &$relatedEvent) {
$body .= 'Related to : ' . Configure::read('CyDefSIG.baseurl') . '/events/view/' . $relatedEvent['Event']['id'] . ' (' . $relatedEvent['Event']['date'] . ')' . "\n";
@ -1335,7 +1386,7 @@ class EventsController extends AppController {
}
public function xml($key, $eventid=null) {
public function xml($key, $eventid=null, $withAttachment = false) {
if ($key != 'download') {
// check if the key is valid -> search for users based on key
$user = $this->checkAuthUser($key);
@ -1360,6 +1411,15 @@ class EventsController extends AppController {
}
}
$results = $this->__fetchEvent($eventid);
if ($withAttachment) {
$this->loadModel('Attribute');
foreach ($results[0]['Attribute'] as &$attribute) {
if ($this->Attribute->typeIsAttachment($attribute['type'])) {
$encodedFile = $this->Attribute->base64EncodeAttachment($attribute);
$attribute['data'] = $encodedFile;
}
}
}
// Whitelist check
$this->loadModel('Whitelist');
$results = $this->Whitelist->removeWhitelistedFromArray($results, false);
@ -1368,7 +1428,7 @@ class EventsController extends AppController {
// Grab an event or a list of events for the event view or any of the XML exports. The returned object includes an array of events (or an array that only includes a single event if an ID was given)
// Included with the event are the attached attributes, shadow attributes, related events, related attribute information for the event view and the creating user's email address where appropriate
private function __fetchEvent($eventid = null, $idList = null, $orgFromFetch = null) {
private function __fetchEvent($eventid = null, $idList = null, $orgFromFetch = null, $isSiteAdmin = false) {
if (isset($eventid)) {
$this->Event->id = $eventid;
if (!$this->Event->exists()) {
@ -1381,8 +1441,6 @@ class EventsController extends AppController {
// if we come from automation, we may not be logged in - instead we used an auth key in the URL.
if (!empty($orgFromFetch)) {
$org = $orgFromFetch;
if ($orgFromFetch == 'ADMIN') $isSiteAdmin = true;
else $isSiteAdmin = false;
} else {
$org = $this->_checkOrg();
$isSiteAdmin = $this->_isSiteAdmin();
@ -1422,7 +1480,7 @@ class EventsController extends AppController {
// do not expose all the data ...
$fields = array('Event.id', 'Event.org', 'Event.date', 'Event.risk', 'Event.info', 'Event.published', 'Event.uuid', 'Event.attribute_count', 'Event.analysis', 'Event.timestamp', 'Event.distribution', 'Event.proposal_email_lock', 'Event.orgc', 'Event.user_id', 'Event.locked');
$fieldsAtt = array('Attribute.id', 'Attribute.type', 'Attribute.category', 'Attribute.value', 'Attribute.to_ids', 'Attribute.uuid', 'Attribute.event_id', 'Attribute.distribution', 'Attribute.timestamp');
$fieldsAtt = array('Attribute.id', 'Attribute.type', 'Attribute.category', 'Attribute.value', 'Attribute.to_ids', 'Attribute.uuid', 'Attribute.event_id', 'Attribute.distribution', 'Attribute.timestamp', 'Attribute.comment');
$fieldsShadowAtt = array('ShadowAttribute.id', 'ShadowAttribute.type', 'ShadowAttribute.category', 'ShadowAttribute.value', 'ShadowAttribute.to_ids', 'ShadowAttribute.uuid', 'ShadowAttribute.event_id', 'ShadowAttribute.old_id');
$params = array('conditions' => $conditions,
@ -1444,9 +1502,9 @@ class EventsController extends AppController {
// Do some refactoring with the event
foreach ($results as $eventKey => &$event) {
// Let's find all the related events and attach it to the event itself
$results[$eventKey]['RelatedEvent'] = $this->Event->getRelatedEvents($this->Auth->user(), $event['Event']['id']);
$results[$eventKey]['RelatedEvent'] = $this->Event->getRelatedEvents($this->Auth->user(), $this->_isSiteAdmin(), $event['Event']['id']);
// Let's also find all the relations for the attributes - this won't be in the xml export though
$results[$eventKey]['RelatedAttribute'] = $this->Event->getRelatedAttributes($this->Auth->user(), $event['Event']['id']);
$results[$eventKey]['RelatedAttribute'] = $this->Event->getRelatedAttributes($this->Auth->user(), $this->_isSiteAdmin(), $event['Event']['id']);
foreach ($event['Attribute'] as $key => &$attribute) {
$attribute['ShadowAttribute'] = array();
// If a shadowattribute can be linked to an attribute, link it to it then remove it from the event
@ -1861,7 +1919,7 @@ class EventsController extends AppController {
$this->Event->read(null, $id);
$saveEvent['Event'] = $this->Event->data['Event'];
$saveEvent['Event']['published'] = false;
$dist = 3;
$dist = '3';
if (Configure::read('MISP.default_attribute_distribution') != null) {
if (Configure::read('MISP.default_attribute_distribution') === 'event') {
$dist = $this->Event->data['Event']['distribution'];
@ -1887,7 +1945,7 @@ class EventsController extends AppController {
$fieldList = array(
'Event' => array('published', 'timestamp'),
'Attribute' => array('event_id', 'category', 'type', 'value', 'value1', 'value2', 'to_ids', 'uuid', 'distribution', 'timestamp')
'Attribute' => array('event_id', 'category', 'type', 'value', 'value1', 'value2', 'to_ids', 'uuid', 'distribution', 'timestamp', 'comment')
);
// Save it all
$saveResult = $this->Event->saveAssociated($saveEvent, array('validate' => true, 'fieldList' => $fieldList));
@ -1904,6 +1962,36 @@ class EventsController extends AppController {
}
}
public function _addXMLFile() {
if (!empty($this->data) && $this->data['Event']['submittedxml']['size'] > 0 &&
is_uploaded_file($this->data['Event']['submittedxml']['tmp_name'])) {
$xmlData = fread(fopen($this->data['Event']['submittedxml']['tmp_name'], "r"),
$this->data['Event']['submittedxml']['size']);
App::uses('Xml', 'Utility');
$xmlArray = Xml::toArray(Xml::build($xmlData));
// In case we receive an event that is not encapsulated in a response. This should never happen (unless it's a copy+paste fail),
// but just in case, let's clean it up anyway.
if (isset($xmlArray['Event'])) {
$xmlArray['response']['Event'] = $xmlArray['Event'];
unset($xmlArray['Event']);
}
if (!isset($xmlArray['response']) || !isset($xmlArray['response']['Event'])) {
throw new Exception('This is not a valid MISP XML file.');
}
if (isset($xmlArray['response']['Event'][0])) {
foreach ($xmlArray['response']['Event'] as $event) {
$temp['Event'] = $event;
$this->_add($temp, true);
}
} else {
$temp['Event'] = $xmlArray['response']['Event'];
$this->_add($temp, true);
}
}
}
public function _readGfiXML($data, $id) {
$this->loadModel('Attribute');
@ -1924,13 +2012,13 @@ class EventsController extends AppController {
$realMalware = $realFileName;
$rootDir = APP . "files" . DS . $id . DS;
$malware = $rootDir . DS . 'sample';
$this->Event->Attribute->uploadAttachment($malware, $realFileName, true, $id);
$this->Event->Attribute->uploadAttachment($malware, $realFileName, true, $id, null, '', '', true);
//Network activity -- .pcap
$realFileName = 'analysis.pcap';
$rootDir = APP . "files" . DS . $id . DS;
$malware = $rootDir . DS . 'Analysis' . DS . 'analysis.pcap';
$this->Event->Attribute->uploadAttachment($malware, $realFileName, false, $id, 'Network activity');
$this->Event->Attribute->uploadAttachment($malware, $realFileName, false, $id, 'Network activity', '', '', true);
//Artifacts dropped -- filename|md5
$files = array();
@ -1979,7 +2067,7 @@ class EventsController extends AppController {
$extraPath = 'Analysis' . DS . 'proc_' . $index . DS . 'modified_files' . DS;
$file = new File($actualFile);
if ($file->exists()) { // TODO put in array for test later
$this->Event->Attribute->uploadAttachment($actualFile, $realFileName, true, $id, null, $extraPath, $keyName); // TODO was false
$this->Event->Attribute->uploadAttachment($actualFile, $realFileName, true, $id, null, $extraPath, $keyName, true); // TODO was false
} else {
}
}
@ -2004,7 +2092,9 @@ class EventsController extends AppController {
'category' => 'Network activity',
'type' => 'ip-dst',
'value' => $ip,
'to_ids' => false));
'to_ids' => false,
'comment' => 'GFI import',
));
}
foreach ($hostnames as $hostname) {
// add attribute..
@ -2014,7 +2104,9 @@ class EventsController extends AppController {
'category' => 'Network activity',
'type' => 'hostname',
'value' => $hostname,
'to_ids' => false));
'to_ids' => false,
'comment' => 'GFI import',
));
}
// Persistence mechanism -- regkey|value
$regs = array();
@ -2054,7 +2146,9 @@ class EventsController extends AppController {
'category' => $itsCategory, // 'Persistence mechanism'
'type' => $itsType,
'value' => $itsValue,
'to_ids' => false));
'to_ids' => false,
'comment' => 'GFI import',
));
}
}
@ -2142,7 +2236,7 @@ class EventsController extends AppController {
if (!in_array($attribute['Attribute']['event_id'], $eventIds)) $eventIds[] = $attribute['Attribute']['event_id'];
}
if (!empty($eventIds)) {
$results = $this->__fetchEvent(null, $eventIds, $user['User']['org']);
$results = $this->__fetchEvent(null, $eventIds, $user['User']['org'], true);
} else {
throw new NotFoundException('No matches.');
}
@ -2187,4 +2281,66 @@ class EventsController extends AppController {
$final = $this->IOCExport->buildAll($event, $isMyEvent, $isSiteAdmin);
$this->set('final', $final);
}
public function create_dummy_event() {
if (!$this->_isSiteAdmin()) throw new MethodNotAllowedException('You don\'t have the privileges to access this.');
$date = new DateTime();
$data['Event']['info'] = 'Test event showing every category-type combination';
$data['Event']['date'] = '2013-10-09';
$data['Event']['risk'] = 'Undefined';
$data['Event']['analysis'] = '0';
$data['Event']['distribution'] = '0';
$defaultValues = array(
'md5' => '098f6bcd4621d373cade4e832627b4f6',
'sha1' => 'a7645200866fd00bde529733ceac8506ab1f5518',
'sha256' => '0f58957831a9cf0b768451ee6b236555f519c04f0da5a5ea87538fd0990b29d1',
'filename' => 'test.exe',
'filename|md5' => 'test.exe|8886be8e4e862189a68d27e8fc7a6144',
'filename|sha1' => 'test.exe|a7645200866fd00bde529733ceac8506ab1f5518',
'filename|sha256' => 'test.exe|0f58957831a9cf0b768451ee6b236555f519c04f0da5a5ea87538fd0990b29d1',
'ip-src' => '1.1.1.1',
'ip-dst' => '2.2.2.2',
'hostname' => 'www.futuremark.com',
'domain' => 'evildomain.org',
'email-src' => 'bla@bla.com',
'email-dst' => 'hmm@hmm.com',
'email-subject' => 'Some made-up email subject',
'email-attachment' => 'filename.exe',
'url' => 'http://www.evilsite.com/test',
'http-method' => 'POST',
'user-agent' => 'Microsoft Internet Explorer',
'regkey' => 'HKLM\Software\Microsoft\Windows\CurrentVersion\Run\fishy',
'regkey|value' => 'HKLM\Software\Microsoft\Windows\CurrentVersion\Run\fishy|%ProgramFiles%\Malicios\malware.exe',
'AS' => '45566',
'snort' => 'alert ip 1.1.1.1 any -> $HOME_NET any (msg: "MISP e1 Incoming From IP: 1.1.1.1"; classtype:trojan-activity; sid:21; rev:1; priority:1; reference:url,http://localhost:8888/events/view/1;)',
'pattern-in-file' => 'Somestringinfile',
'pattern-in-traffic' => 'Somestringintraffic',
'pattern-in-memory' => 'Somestringinmemory',
'yara' => 'rule silent_banker : banker{meta:description = "This is just an example" thread_level = 3 in_the_wild = true strings: $a = {6A 40 68 00 30 00 00 6A 14 8D 91} $b = {8D 4D B0 2B C1 83 C0 27 99 6A 4E 59 F7 F9} $c = "UVODFRYSIHLNWPEJXQZAKCBGMT" condition:}',
'vulnerability' => 'CVE-2011-0001',
'attachment' => 'file.txt',
'malware-sample' => 'test.exe|8886be8e4e862189a68d27e8fc7a6144',
'link' => 'http://www.somesite.com/',
'comment' => 'Comment',
'text' => 'Any text',
'other' => 'Could be anything',
'named pipe' => '\\.\pipe\PipeName',
'mutex' => 'mutexstring',
);
$this->loadModel('Attribute');
foreach ($this->Attribute->categoryDefinitions as $category => $v) {
foreach ($v['types'] as $k => $type) {
$data['Attribute'][] = array(
'category' => $category,
'type' => $type,
'value' => $defaultValues[$type],
'to_ids' => '0',
'distribution' => '0',
);
}
}
$this->_add($data, false);
}
}

View File

@ -41,7 +41,7 @@ class LogsController extends AppController {
public function admin_index() {
if(!$this->userRole['perm_audit']) $this->redirect(array('controller' => 'events', 'action' => 'index', 'admin' => false));
$this->set('isSearch', 0);
if ($this->Auth->user('org') == 'ADMIN') {
if ($this->_isSiteAdmin()) {
$this->AdminCrud->adminIndex();
} else {
$orgRestriction = null;
@ -67,7 +67,7 @@ class LogsController extends AppController {
$this->Event->recursive = -1;
$this->Event->read(null, $id);
// send unauthorised people away. Only site admins and users of the same org may see events that are "your org only". Everyone else can proceed for all other levels of distribution
if ($this->Auth->user('org') != 'ADMIN') {
if (!$this->_isSiteAdmin()) {
if ($this->Event->data['Event']['distribution'] == 0) {
if ($this->Event->data['Event']['org'] != $this->Auth->user('org')) {
$this->Session->setFlash(__('You don\'t have access to view this event.'));
@ -118,7 +118,7 @@ class LogsController extends AppController {
if(!$this->userRole['perm_audit']) $this->redirect(array('controller' => 'events', 'action' => 'index', 'admin' => false));
$fullAddress = array('/admin/logs/search', '/logs/admin_search'); // FIXME remove this crap check
$orgRestriction = null;
if ($this->Auth->user('org') == 'ADMIN') {
if ($this->_isSiteAdmin()) {
$orgRestriction = false;
} else {
$orgRestriction = $this->Auth->user('org');

View File

@ -0,0 +1,280 @@
<?php
App::uses('AppController', 'Controller');
/**
* Posts Controller
*
*/
class PostsController extends AppController {
public $components = array(
'Security',
'Session',
'RequestHandler'
);
public $helpers = array('Js' => array('Jquery'));
public $paginate = array(
'limit' => 60,
);
public function beforeFilter() {
parent::beforeFilter();
}
// Find the thread_id and post_id in advance. If a user clicks post comment on the event view, send the event's related thread's ID
// Usage:
// /posts/add : Creates new thread with the added post as the first post. Title set by user
// /posts/add/event/id : Checks if the event already has a thread, if no it creates one. The post is added to the event's thread
// /posts/add/thread/id : Adds a post to the thread specified
// /posts/add/post/id : Adds a post as a reply to another post. The system finds the appropriate thread, adds the post to the thread and links to the post that is being replied to.
public function add($target_type = null, $target_id = null, $quick = false) {
$this->loadModel('Thread');
$this->Thread->recursive = -1;
$distribution = 1;
$event_id = 0;
$post_id = 0;
// we have a target type and a target id. The target id defines what type of object we want to attach this event to (is it a reply to another post,
// did someone add a post to a thread, does a thread for the event exist already, etc.
switch ($target_type) {
case 'event' :
$this->loadModel('Event');
$this->Event->recursive = -1;
$this->Event->read(null, $target_id);
$eventDiscussionTitle = 'Discussion about Event #' . $this->Event->data['Event']['id'] . ' (' . $this->Event->data['Event']['info'] . ')';
if (!$this->Event->exists()) {
throw new NotFoundException(__('Invalid event'));
}
if (!$this->_isSiteAdmin()) {
if ($this->Event->data['Event']['distribution'] == 0 && $this->Event->data['Event']['org'] != $this->Auth->user('org')) {
throw new MethodNotAllowedException('You don\'t have permission to do that.');
}
}
$thread = $this->Thread->find('first', array('conditions' => array('event_id' => $target_id)));
$title = $eventDiscussionTitle;
if (isset($thread['Thread']['id'])) {
$target_thread_id = $thread['Thread']['id'];
} else {
$target_thread_id = null;
}
$distribution = $this->Event->data['Event']['distribution'];
$org = $this->Event->data['Event']['org'];
break;
case 'thread' :
$target_thread_id = $target_id;
if ($target_id != null) {
$thread = $this->Thread->read(null, $target_thread_id);
if ($thread == null) {
throw new NotFoundException(__('Invalid thread'));
}
if (!$this->_isSiteAdmin()) {
if ($thread['Thread']['distribution'] == 0 && $this->Auth->user('org') != $thread['Thread']['org']) {
throw new MethodNotAllowedException('You don\'t have permission to do that.');
}
}
$title = $this->Thread->data['Thread']['title'];
}
break;
case 'post' :
$this->Post->read(null, $target_id);
$target_thread_id = $this->Post->data['Post']['thread_id'];
$thread = $this->Thread->read(null, $target_thread_id);
if (!$this->_isSiteAdmin()) {
if ($thread['Thread']['distribution'] == 0 && $this->Auth->user('org') != $thread['Thread']['org']) {
throw new MethodNotAllowedException('You don\'t have permission to do that.');
}
}
$title = $this->Thread->data['Thread']['title'];
$previousPost = $this->_grabPreviousPost($target_id);
$distribution = $previousPost['Thread']['distribution'];
$event_id = $previousPost['Thread']['event_id'];
$post_id = $target_id;
$target_thread_id = $previousPost['Thread']['id'];
break;
default:
$target_thread_id = null;
break;
}
if ($this->request->is('post')) {
// Set the default values that we'll alter before actually saving data. These are the default values unless specifically modified.
// By default, all discussions will be visibile to everyone on the platform
$org = $this->Auth->user('org');
// Set the title if it is setable in the add view.
if (empty($thread_id) && empty($target_type)) {
$title = $this->request->data['Post']['title'];
}
if ($target_thread_id == null) {
// We have a post that was posted in a new thread. This could also mean that someone created the first post related to an event!
$this->Thread->create();
// Take the title from above and the id of the event as event_id if we are adding a post to an event.
if ($target_type === 'event') {
$title = $eventDiscussionTitle;
$event_id = $this->Event->data['Event']['id'];
}
$newThread = array(
'date_created' => date('Y/m/d H:i:s'),
'date_modified' => date('Y/m/d H:i:s'),
'user_id' => $this->Auth->user('id'),
'event_id' => $event_id,
'title' => $title,
'distribution' => $distribution,
'post_count' => 1,
'org' => $org
);
$this->Thread->save($newThread);
$target_thread_id = $this->Thread->getId();
} else {
// In this case, we have a post that was posted in an already existing thread. Update the thread!
$this->Thread->read(null, $target_thread_id);
$this->Thread->data['Thread']['date_modified'] = date('Y/m/d H:i:s');
$this->Thread->save();
}
// Time to create our post!
$this->Post->create();
$newPost = array(
'date_created' => date('Y/m/d H:i:s'),
'date_modified' => date('Y/m/d H:i:s'),
'user_id' => $this->Auth->user('id'),
'contents' => $this->request->data['Post']['message'],
'post_id' => $post_id,
'thread_id' => $target_thread_id,
);
if ($this->Post->save($newPost)) {
$this->Thread->recursive = 0;
$this->Thread->contain('Post');
$this->Thread->read(null, $target_thread_id);
$this->Thread->updateAfterPostChange(true);
$this->Session->setFlash(__('Post added'));
$this->redirect(array('action' => 'view', $this->Post->getId()));
} else {
$this->Session->setFlash('The post could not be added.');
}
}
if ($target_type === 'post') {
$this->set('previous', $previousPost['Post']['contents']);
}
$this->set('thread_id', $target_thread_id);
$this->set('target_type', $target_type);
$this->set('target_id', $target_id);
if (isset($title)) {
$this->set('title', $title);
}
}
public function edit($post_id) {
$this->Post->id = $post_id;
if (!$this->Post->exists()) {
throw new NotFoundException(__('Invalid post'));
}
$this->Post->recursive = 1;
$this->Post->read(null, $post_id);
if (!$this->_isSiteAdmin() && $this->Auth->user('id') != $this->Post->data['Post']['user_id']) {
throw new MethodNotAllowedException('This is not your event.');
}
if ($this->request->is('post') || $this->request->is('put')) {
$this->request->data['Post']['date_modified'] = date('Y/m/d H:i:s');
$fieldList = array('date_modified', 'contents');
if ($this->Post->save($this->request->data, true, $fieldList)) {
$this->Session->setFlash('Post edited');
$this->loadModel('Thread');
$this->Thread->recursive = 0;
$this->Thread->contain('Post');
$this->Thread->read(null, $this->Post->data['Post']['thread_id']);
$this->Thread->updateAfterPostChange();
$this->redirect(array('action' => 'view', $post_id));
} else {
$this->Session->setFlash('The Post could not be edited. Please, try again.');
}
}
$this->set('title', $this->Post->data['Thread']['title']);
$this->set('contents', $this->Post->data['Post']['contents']);
$this->set('id', $post_id);
$this->set('thread_id', $this->Post->data['Post']['thread_id']);
}
public function quick_add() {
if($this->RequestHandler->isAjax()) {
$this->layout = 'ajax'; //THIS LINE NEWLY ADDED
if(!empty($this->data)) {
if($this->Message->save($this->data)) {
$this->Session->setFlash('Your Message has been posted');
}
}
}
}
public function quick_edit() {
throw new Exception();
if($this->RequestHandler->isAjax()) {
$this->layout = 'ajax'; //THIS LINE NEWLY ADDED
if(!empty($this->data)) {
if($this->Message->save($this->data)) {
$this->Session->setFlash('Your Message has been posted');
}
}
}
}
public function delete($post_id) {
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
$this->Post->id = $post_id;
if (!$this->Post->exists()) {
throw new NotFoundException(__('Invalid post'));
}
$this->Post->read();
$temp = $this->Post->data;
if ($this->Auth->user('id') != $this->Post->data['Post']['user_id'] && !$this->_isSiteAdmin()) {
throw new MethodNotAllowedException('This post doesn\'t belong to you, so you cannot delete it.');
}
if ($this->Post->delete()) {
$this->loadModel('Thread');
$this->Thread->recursive = 0;
$this->Thread->contain('Post');
$this->Thread->read(null, $this->Post->data['Thread']['id']);
$thread = $this->Thread->data['Thread']['id'];
if (!$this->Thread->updateAfterPostChange()) {
$this->Session->setFlash('Post and thread deleted');
$this->redirect(array('controller' => 'threads', 'action' => 'index'));
} else {
$this->Session->setFlash('Post deleted');
}
}
$this->redirect(array('controller' => 'threads', 'action' => 'view', $thread));
}
// Views the proper context for the post
public function view($post_id) {
$this->Post->id = $post_id;
if (!$this->Post->exists()) {
throw new NotFoundException(__('Invalid post'));
}
$this->Post->read();
// We don't know what the context was, so let's try to guess what the user wants to see!
// If the post belongs to an event's discussion thread, redirect the user to the event's view
if ($this->Post->data['Thread']['event_id'] != 0) {
$this->redirect(array('controller' => 'events', 'action' => 'view', $this->Post->data['Thread']['event_id']));
} else {
//Otherwise send the user to the thread's index.
$this->redirect(array('controller' => 'threads', 'action' => 'view', $this->Post->data['Thread']['id']));
}
}
private function _grabPreviousPost($post_id) {
$this->Post->id = $post_id;
$this->Post->read();
return $this->Post->data;
}
}
?>

View File

@ -30,7 +30,7 @@ class RegexpController extends AppController {
public function admin_add() {
$this->loadModel('Attribute');
$types = array_keys($this->Attribute->typeDefinitions);
if($this->Auth->User('org') != 'ADMIN') $this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
if(!$this->userRole['perm_regexp_access']) $this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
if ($this->request->is('post')) {
if ($this->request->data['Regexp']['all'] == 1) {
$this->Regexp->create();
@ -63,7 +63,7 @@ class RegexpController extends AppController {
* @return void
*/
public function admin_index() {
if($this->Auth->User('org') != 'ADMIN') $this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
if(!$this->userRole['perm_regexp_access']) $this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
$this->AdminCrud->adminIndex();
}
@ -81,7 +81,7 @@ class RegexpController extends AppController {
$this->loadModel('Attribute');
$types = array_keys($this->Attribute->typeDefinitions);
// send the user away if he/she's no admin
if ($this->Auth->User('org') != 'ADMIN') $this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
if (!$this->userRole['perm_regexp_access']) $this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
$this->Regexp->id = $id;
if (!$this->Regexp->exists()) {
throw new NotFoundException('Invalid Regexp');
@ -159,7 +159,7 @@ class RegexpController extends AppController {
* @throws NotFoundException
*/
public function admin_delete($id = null) {
if($this->Auth->User('org') != 'ADMIN') $this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
if(!$this->userRole['perm_regexp_access']) $this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
$this->AdminCrud->adminDelete($id);
}
@ -176,9 +176,8 @@ class RegexpController extends AppController {
/**
*
*/
public function admin_clean() {
if($this->Auth->User('org') != 'ADMIN') $this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
if(!$this->_isSiteAdmin()) $this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
$allRegexp = $this->Regexp->find('all');
$deletable = array();
$modifications = 0;

View File

@ -44,6 +44,7 @@ class RolesController extends AppController {
throw new NotFoundException(__('Invalid role'));
}
$this->set('role', $this->Role->read(null, $id));
$this->set('id', $id);
}
/**
@ -52,7 +53,7 @@ class RolesController extends AppController {
* @return void
*/
public function admin_add() {
if($this->Auth->User('org') != 'ADMIN') $this->redirect(array('controller' => 'roles', 'action' => 'index', 'admin' => false));
if(!$this->_isSiteAdmin()) $this->redirect(array('controller' => 'roles', 'action' => 'index', 'admin' => false));
if ($this->request->is('post')) {
$this->Role->create();
if ($this->Role->save($this->request->data)) {
@ -76,7 +77,7 @@ class RolesController extends AppController {
* @return void
*/
public function admin_index() {
if($this->Auth->User('org') != 'ADMIN') $this->redirect(array('controller' => 'roles', 'action' => 'index', 'admin' => false));
if(!$this->_isSiteAdmin()) $this->redirect(array('controller' => 'roles', 'action' => 'index', 'admin' => false));
$this->AdminCrud->adminIndex();
$this->set('options', $this->options);
}
@ -89,10 +90,11 @@ class RolesController extends AppController {
* @throws NotFoundException
*/
public function admin_edit($id = null) {
if($this->Auth->User('org') != 'ADMIN') $this->redirect(array('controller' => 'roles', 'action' => 'index', 'admin' => false));
if(!$this->_isSiteAdmin()) $this->redirect(array('controller' => 'roles', 'action' => 'index', 'admin' => false));
$this->AdminCrud->adminEdit($id);
$passAlong = $this->Role->read(null, $id);
$this->set('options', $this->options);
$this->set('id', $id);
}
/**

View File

@ -45,12 +45,12 @@ class ServersController extends AppController {
*/
public function index() {
$this->Server->recursive = 0;
if ($this->_IsSiteAdmin()) {
if ($this->_isSiteAdmin()) {
$this->paginate = array(
'conditions' => array(),
);
} else {
if (!$this->userRole['perm_sync']) $this->redirect(array('controller' => 'events', 'action' => 'index'));
if (!$this->userRole['perm_sync'] && !$this->userRole['perm_admin']) $this->redirect(array('controller' => 'events', 'action' => 'index'));
$conditions['Server.org LIKE'] = $this->Auth->user('org');
$this->paginate = array(
'conditions' => array($conditions),
@ -307,7 +307,7 @@ class ServersController extends AppController {
}
public function push($id = null, $technique=false) {
if ($this->Auth->user('org') != 'ADMIN' && !($this->Server->organization == $this->Auth->user('org') && $this->userRole['perm_sync'])) $this->redirect(array('controller' => 'servers', 'action' => 'index'));
if (!$this->_isSiteAdmin() && !($this->Server->organization == $this->Auth->user('org') && $this->userRole['perm_sync'])) $this->redirect(array('controller' => 'servers', 'action' => 'index'));
$this->Server->id = $id;
if (!$this->Server->exists()) {
throw new NotFoundException(__('Invalid server'));

View File

@ -0,0 +1,113 @@
<?php
App::uses('AppController', 'Controller');
/**
* Thread Controller
*
*/
class ThreadsController extends AppController {
public $components = array(
'Security',
'RequestHandler',
'Session',
);
public $helpers = array('Js' => array('Jquery'));
public $paginate = array(
'limit' => 60,
);
public function beforeFilter() {
parent::beforeFilter();
}
public function view($thread_id) {
$this->Thread->recursive = -1;
$this->Thread->id = $thread_id;
//If the thread doesn't exist, throw exception
if (!$this->Thread->exists()) {
throw new NotFoundException('Invalid thread.');
}
$this->Thread->read();
// If the thread belongs to an event, we have to make sure that the event's distribution level hasn't changed.
// This is also a good time to update the thread's distribution level if that did happen.
if (!empty($this->Thread->data['Thread']['event_id'])) {
$this->loadModel('Event');
$this->Event->id = $this->Thread->data['Thread']['event_id'];
$this->Event->recursive = -1;
$this->Event->read(array('id', 'distribution', 'org'));
if ($this->Event->data['Event']['distribution'] != $this->Thread->data['Thread']['distribution']) {
$this->Thread->saveField('distribution', $this->Event->data['Event']['distribution']);
}
}
// If the user shouldn't be allowed to see the event send him away.
if (!$this->_isSiteAdmin() && $this->Thread->data['Thread']['distribution'] == 0 && $this->Thread->data['Thread']['org'] != $this->Auth->user('org')) {
throw new MethodNotAllowedException('You are not authorised to view this.');
}
$this->paginate = array(
'limit' => 10,
'conditions' => array('Post.thread_id' => $thread_id),
'contain' => 'User'
);
$posts = $this->paginate('Post');
if (!$this->_isSiteAdmin()) {
foreach ($posts as &$post) {
if ($post['User']['org'] != $this->Auth->user('org')) {
$post['User']['email'] = 'User ' . $post['User']['id'] . ' (' . $post['User']['org'] . ')';
}
}
}
$this->set('posts', $posts);
$this->set('thread_id', $thread_id);
$this->set('myuserid', $this->Auth->user('id'));
$this->set('thread_title', $this->Thread->data['Thread']['title']);
if ($this->request->is('ajax')) {
$this->layout = 'ajax';
$this->render('/Elements/eventdiscussion');
}
}
public function index() {
$this->loadModel('Posts');
$conditions = null;
$conditions['AND']['OR'] = array(
'Thread.distribution >' => 0,
'Thread.org' => $this->Auth->user('org'),
);
$conditions['AND'][] = array('Thread.post_count >' => 0);
$this->paginate = array(
'conditions' => array($conditions),
'fields' => array('date_modified', 'date_created', 'org', 'distribution', 'title', 'post_count'),
'contain' => array(
'Post' =>array(
'fields' => array(),
'limit' => 1,
'order' => 'Post.date_modified DESC',
'User' => array(
'fields' => array('id','email', 'org'),
)
),
),
'order' => array('Thread.date_modified' => 'desc'),
'recursive' => 1
);
$threadsBeforeEmailRemoval = $this->paginate();
if (!$this->_isSiteAdmin()) {
foreach ($threadsBeforeEmailRemoval as &$thread) {
if ($thread['Post'][0]['User']['org'] != $this->Auth->user('org')) $thread['Post'][0]['User']['email'] = 'User ' . $thread['Post'][0]['User']['id'] . " (" . $thread['Post'][0]['User']['org'] . ")";
}
}
$this->set('threads', $threadsBeforeEmailRemoval);
$this->loadModel('Event');
$this->set('distributionLevels', $this->Event->distributionLevels);
}
}
?>

View File

@ -90,6 +90,7 @@ class UsersController extends AppController {
}
$roles = $this->User->Role->find('list');
$this->set(compact('roles'));
$this->set('id', $id);
}
public function change_pw() {
@ -183,6 +184,7 @@ class UsersController extends AppController {
$this->set('user', $this->User->read(null, $id));
if (!$this->_isSiteAdmin() && !($this->_isAdmin() && $this->Auth->user('org') == $this->User->data['User']['org'])) throw new MethodNotAllowedException();
$temp = $this->User->field('invited_by');
$this->set('id', $id);
$this->set('user2', $this->User->read(null, $temp));
}
@ -194,13 +196,27 @@ class UsersController extends AppController {
public function admin_add() {
if (!$this->_isAdmin()) throw new Exception('Administrators only.');
$this->set('currentOrg', $this->Auth->User('org'));
$this->set('isSiteAdmin', $this->_isSiteAdmin());
$params = null;
if (!$this->_isSiteAdmin()) {
$params = array('conditions' => array('perm_site_admin !=' => 1, 'perm_sync !=' => 1, 'perm_regexp_access !=' => 1));
}
$roles = $this->User->Role->find('list', $params);
if ($this->request->is('post')) {
$this->User->create();
// set invited by
$this->request->data['User']['invited_by'] = $this->Auth->user('id');
$this->request->data['User']['change_pw'] = 1;
$this->request->data['User']['newsread'] = '2000-01-01';
if ($this->Auth->User('org') != 'ADMIN') $this->request->data['User']['org'] = $this->Auth->User('org');
if (!$this->_isSiteAdmin()) {
$this->request->data['User']['org'] = $this->Auth->User('org');
$this->loadModel('Role');
$this->Role->recursive = -1;
$chosenRole = $this->Role->findById($this->request->data['User']['role_id']);
if ($chosenRole['Role']['perm_site_admin'] == 1 || $chosenRole['Role']['perm_regexp_access'] == 1 || $chosenRole['Role']['perm_sync'] == 1) {
throw new Exception('You are not authorised to assign that role to a user.');
}
}
if ($this->User->save($this->request->data)) {
$this->Session->setFlash(__('The user has been saved'));
$this->redirect(array('action' => 'index'));
@ -214,8 +230,6 @@ class UsersController extends AppController {
$this->newkey = $this->User->generateAuthKey();
$this->set('authkey', $this->newkey);
}
// XXX ACL roles
$roles = $this->User->Role->find('list');
$this->set(compact('roles'));
}
@ -233,6 +247,11 @@ class UsersController extends AppController {
if (!$this->User->exists()) {
throw new NotFoundException(__('Invalid user'));
}
$params = null;
if (!$this->_isSiteAdmin()) {
$params = array('conditions' => array('perm_site_admin !=' => 1, 'perm_sync !=' => 1, 'perm_regexp_access !=' => 1));
}
$roles = $this->User->Role->find('list', $params);
$this->set('currentId', $id);
if ($this->request->is('post') || $this->request->is('put')) {
$fields = array();
@ -249,7 +268,14 @@ class UsersController extends AppController {
if ("" != $this->request->data['User']['password'])
$fields[] = 'password';
$fields[] = 'role_id';
//debug($fields);debug(tru);
if (!$this->_isSiteAdmin()) {
$this->loadModel('Role');
$this->Role->recursive = -1;
$chosenRole = $this->Role->findById($this->request->data['User']['role_id']);
if ($chosenRole['Role']['perm_site_admin'] == 1 || $chosenRole['Role']['perm_regexp_access'] == 1 || $chosenRole['Role']['perm_sync'] == 1) {
throw new Exception('You are not authorised to assign that role to a user.');
}
}
if ($this->User->save($this->request->data, true, $fields)) {
// TODO Audit, extraLog, fields compare
// newValues to array
@ -292,17 +318,12 @@ class UsersController extends AppController {
} else {
$this->User->recursive = 0;
$this->User->read(null, $id);
if ($this->Auth->User('org') != 'ADMIN' && $this->Auth->User('org') != $this->User->data['User']['org']) $this->redirect(array('controller' => 'users', 'action' => 'index', 'admin' => true));
if (!$this->_isSiteAdmin() && $this->Auth->User('org') != $this->User->data['User']['org']) $this->redirect(array('controller' => 'users', 'action' => 'index', 'admin' => true));
$this->User->set('password', '');
$this->request->data = $this->User->data; // TODO CHECK
}
// TODO ACL CLEANUP combobox for orgs
$orgIds = array('ADMIN', 'NCIRC', 'Other MOD');
$orgIds = $this->_arrayToValuesIndexArray($orgIds);
$this->set('orgIds', compact('orgIds'));
// XXX ACL, Roles in Users
$roles = $this->User->Role->find('list');
$this->set('id', $id);
$this->set(compact('roles'));
}
@ -349,20 +370,39 @@ class UsersController extends AppController {
if($this->request->is('post')) {
$this->Session->setFlash(__('Invalid username or password, try again'));
}
// populate the DB with the first role (site admin) if it's empty
$this->loadModel('Role');
if ($this->Role->find('count') == 0 ) {
$siteAdmin = array('Role' => array(
'id' => 1,
'name' => 'Site Admin',
'perm_add' => 1,
'perm_modify' => 1,
'perm_modify_org' => 1,
'perm_publish' => 1,
'perm_sync' => 1,
'perm_admin' => 1,
'perm_audit' => 1,
'perm_auth' => 1,
'perm_site_admin' => 1,
'perm_regexp_access' => 1,
));
$this->Role->save($siteAdmin);
}
// populate the DB with the first user if it's empty
if ($this->User->find('count') == 0 ) {
$admin = array('User' => array(
'email' => 'admin@admin.test',
'org' => 'ADMIN',
'password' => 'admin',
'confirm_password' => 'admin',
'authkey' => $this->User->generateAuthKey(),
'nids_sid' => 4000000,
'date' => date('YYY-mm-dd'),
'role_id' => 1,
'change_pw' => 1
));
'id' => 1,
'email' => 'admin@admin.test',
'org' => 'ADMIN',
'password' => 'admin',
'confirm_password' => 'admin',
'authkey' => $this->User->generateAuthKey(),
'nids_sid' => 4000000,
'newsread' => date('Y-m-d'),
'role_id' => 1,
'change_pw' => 1
));
$this->User->validator()->remove('password'); // password is to simple, remove validation
$this->User->save($admin);
}

View File

@ -33,7 +33,7 @@ class WhitelistsController extends AppController {
* @return void
*/
public function admin_add() {
if($this->Auth->User('org') != 'ADMIN') $this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
if(!$this->userRole['perm_regexp_access']) $this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
$this->AdminCrud->adminAdd();
}
@ -43,7 +43,7 @@ class WhitelistsController extends AppController {
* @return void
*/
public function admin_index() {
if(!$this->_IsSiteAdmin()) $this->redirect(array('controller' => 'whitelists', 'action' => 'index', 'admin' => false));
if(!$this->userRole['perm_regexp_access']) $this->redirect(array('controller' => 'whitelists', 'action' => 'index', 'admin' => false));
$this->AdminCrud->adminIndex();
}
@ -55,7 +55,7 @@ class WhitelistsController extends AppController {
* @throws NotFoundException
*/
public function admin_edit($id = null) {
if(!$this->_IsSiteAdmin()) $this->redirect(array('controller' => 'whitelists', 'action' => 'index', 'admin' => false));
if(!$this->userRole['perm_regexp_access']) $this->redirect(array('controller' => 'whitelists', 'action' => 'index', 'admin' => false));
$this->AdminCrud->adminEdit($id);
}
@ -68,7 +68,7 @@ class WhitelistsController extends AppController {
* @throws NotFoundException
*/
public function admin_delete($id = null) {
if(!$this->_IsSiteAdmin()) $this->redirect(array('controller' => 'whitelists', 'action' => 'index', 'admin' => false));
if(!$this->userRole['perm_regexp_access']) $this->redirect(array('controller' => 'whitelists', 'action' => 'index', 'admin' => false));
$this->AdminCrud->adminDelete($id);
}

View File

@ -136,7 +136,7 @@ class Attribute extends AppModel {
),
'Antivirus detection' => array(
'desc' => 'All the info about how the malware is detected by the antivirus products',
'formdesc' => 'List of anti-virus vendors detecting the malware or information on detection performance (e.g. 13/43 or 67%).<br/>Attachment with list of detection or link to VirusTotal could be placed here as well.',
'formdesc' => 'List of anti-virus vendors detecting the malware or information on detection performance (e.g. 13/43 or 67%). Attachment with list of detection or link to VirusTotal could be placed here as well.',
'types' => array('link', 'comment', 'text', 'attachment', 'other')
),
'Payload delivery' => array(
@ -150,12 +150,12 @@ class Attribute extends AppModel {
),
'Payload installation' => array(
'desc' => 'Info on where the malware gets installed in the system',
'formdesc' => 'Location where the payload was placed in the system and the way it was installed.<br/>For example, a filename|md5 type attribute can be added here like this:<br/>c:\\windows\\system32\\malicious.exe|41d8cd98f00b204e9800998ecf8427e.',
'formdesc' => 'Location where the payload was placed in the system and the way it was installed. For example, a filename|md5 type attribute can be added here like this: c:\\windows\\system32\\malicious.exe|41d8cd98f00b204e9800998ecf8427e.',
'types' => array('md5', 'sha1', 'sha256', 'filename', 'filename|md5', 'filename|sha1', 'filename|sha256', 'pattern-in-file', 'pattern-in-traffic', 'pattern-in-memory', 'yara', 'vulnerability', 'attachment', 'malware-sample', 'comment', 'text', 'other')
),
'Persistence mechanism' => array(
'desc' => 'Mechanisms used by the malware to start at boot',
'formdesc' => 'Mechanisms used by the malware to start at boot.<br/>This could be a registry key, legitimate driver modification, LNK file in startup',
'formdesc' => 'Mechanisms used by the malware to start at boot. This could be a registry key, legitimate driver modification, LNK file in startup',
'types' => array('filename', 'regkey', 'regkey|value', 'comment', 'text', 'other')
),
'Network activity' => array(
@ -164,7 +164,7 @@ class Attribute extends AppModel {
),
'Payload type' => array(
'desc' => 'Information about the final payload(s)',
'formdesc' => 'Information about the final payload(s).<br/>Can contain a function of the payload, e.g. keylogger, RAT, or a name if identified, such as Poison Ivy.',
'formdesc' => 'Information about the final payload(s). Can contain a function of the payload, e.g. keylogger, RAT, or a name if identified, such as Poison Ivy.',
'types' => array('comment', 'text', 'other')
),
'Attribution' => array(
@ -173,7 +173,7 @@ class Attribute extends AppModel {
),
'External analysis' => array(
'desc' => 'Any other result from additional analysis of the malware like tools output',
'formdesc' => 'Any other result from additional analysis of the malware like tools output<br/>Examples: pdf-parser output, automated sandbox analysis, reverse engineering report.',
'formdesc' => 'Any other result from additional analysis of the malware like tools output Examples: pdf-parser output, automated sandbox analysis, reverse engineering report.',
'types' => array('md5', 'sha1', 'sha256','filename', 'filename|md5', 'filename|sha1', 'filename|sha256', 'ip-src', 'ip-dst', 'hostname', 'domain', 'url', 'user-agent', 'regkey', 'regkey|value', 'AS', 'snort', 'pattern-in-file', 'pattern-in-traffic', 'pattern-in-memory', 'vulnerability', 'attachment', 'malware-sample', 'link', 'comment', 'text', 'other')
),
'Other' => array(
@ -795,7 +795,7 @@ class Attribute extends AppModel {
*
* @return void
*/
public function uploadAttachment($fileP, $realFileName, $malware, $eventId = null, $category = null, $extraPath = '', $fullFileName = '') {
public function uploadAttachment($fileP, $realFileName, $malware, $eventId = null, $category = null, $extraPath = '', $fullFileName = '', $fromGFI = false) {
// Check if there were problems with the file upload
// only keep the last part of the filename, this should prevent directory attacks
$filename = basename($fileP);
@ -810,11 +810,13 @@ class Attribute extends AppModel {
$this->data['Attribute']['type'] = "malware-sample";
$this->data['Attribute']['value'] = $fullFileName ? $fullFileName . '|' . $md5 : $filename . '|' . $md5; // TODO gives problems with bigger files
$this->data['Attribute']['to_ids'] = 1; // LATER let user choose to send this to IDS
if ($fromGFI) $this->data['Attribute']['comment'] = 'GFI import';
} else {
$this->data['Attribute']['category'] = $category ? $category : "Artifacts dropped";
$this->data['Attribute']['type'] = "attachment";
$this->data['Attribute']['value'] = $fullFileName ? $fullFileName : $realFileName;
$this->data['Attribute']['to_ids'] = 0;
if ($fromGFI) $this->data['Attribute']['comment'] = 'GFI import';
}
if ($this->save($this->data)) {

View File

@ -34,11 +34,11 @@ class Event extends AppModel {
* @var array
*/
public $fieldDescriptions = array(
'risk' => array('desc' => 'Risk levels: *low* means mass-malware, *medium* means APT malware, *high* means sophisticated APT malware or 0-day attack', 'formdesc' => 'Risk levels:<br/>low: mass-malware<br/>medium: APT malware<br/>high: sophisticated APT malware or 0-day attack'),
'risk' => array('desc' => 'Risk levels: *low* means mass-malware, *medium* means APT malware, *high* means sophisticated APT malware or 0-day attack', 'formdesc' => 'Risk levels: low: mass-malware medium: APT malware high: sophisticated APT malware or 0-day attack'),
'classification' => array('desc' => 'Set the Traffic Light Protocol classification. <ol><li><em>TLP:AMBER</em>- Share only within the organization on a need-to-know basis</li><li><em>TLP:GREEN:NeedToKnow</em>- Share within your constituency on the need-to-know basis.</li><li><em>TLP:GREEN</em>- Share within your constituency.</li></ol>'),
'submittedgfi' => array('desc' => 'GFI sandbox: export upload', 'formdesc' => 'GFI sandbox:<br/>export upload'),
'submittedgfi' => array('desc' => 'GFI sandbox: export upload', 'formdesc' => 'GFI sandbox: export upload'),
'submittedioc' => array('desc' => '', 'formdesc' => ''),
'analysis' => array('desc' => 'Analysis Levels: *Initial* means the event has just been created, *Ongoing* means that the event is being populated, *Complete* means that the event\'s creation is complete', 'formdesc' => 'Analysis levels:<br />Initial: event has been started<br />Ongoing: event population is in progress<br />Complete: event creation has finished'),
'analysis' => array('desc' => 'Analysis Levels: *Initial* means the event has just been created, *Ongoing* means that the event is being populated, *Complete* means that the event\'s creation is complete', 'formdesc' => 'Analysis levels: Initial: event has been started Ongoing: event population is in progress Complete: event creation has finished'),
'distribution' => array('desc' => 'Describes who will have access to the event.')
);
@ -318,11 +318,11 @@ class Event extends AppModel {
return $this->field('id', array('id' => $eventid, 'org' => $org)) === $eventid;
}
public function getRelatedEvents($me, $eventId = null) {
public function getRelatedEvents($me, $isSiteAdmin = false, $eventId = null) {
if ($eventId == null) $eventId = $this->data['Event']['id'];
$this->Correlation = ClassRegistry::init('Correlation');
// search the correlation table for the event ids of the related events
if ('ADMIN' != $me['org']) {
if (!$isSiteAdmin) {
$conditionsCorrelation = array('AND' =>
array('Correlation.1_event_id' => $eventId),
array("OR" => array(
@ -355,11 +355,11 @@ class Event extends AppModel {
return $relatedEvents;
}
public function getRelatedAttributes($me, $id = null) {
public function getRelatedAttributes($me, $isSiteAdmin = false, $id = null) {
if ($id == null) $id = $this->data['Event']['id'];
$this->Correlation = ClassRegistry::init('Correlation');
// search the correlation table for the event ids of the related attributes
if ('ADMIN' != $me['org']) {
if (!$isSiteAdmin) {
$conditionsCorrelation = array('AND' =>
array('Correlation.1_event_id' => $id),
array("OR" => array(

19
app/Model/Post.php Normal file
View File

@ -0,0 +1,19 @@
<?php
App::uses('AppModel', 'Model');
/**
* Post Model
*
*/
class Post extends AppModel {
public $actsAs = array('Containable');
public $belongsTo = array(
'Thread',
'User' => array(
'fields' => array('email', 'org', 'id'),
)
);
}

View File

@ -66,7 +66,7 @@ class Regexp extends AppModel {
}
public function replaceSpecific($string, $allRegexp = null, $type) {
if($this->Auth->User('org') != 'ADMIN') $this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
if(!$this->_isSiteAdmin()) $this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
$orig = $string;
foreach ($allRegexp as $regexp) {
if (strlen($regexp['Regexp']['replacement']) && strlen($regexp['Regexp']['regexp']) && ($regexp['Regexp']['type'] === 'ALL' || $regexp['Regexp']['type'] === $type)) {

29
app/Model/Thread.php Normal file
View File

@ -0,0 +1,29 @@
<?php
App::uses('AppModel', 'Model');
/**
* Thread Model
*
*/
class Thread extends AppModel {
public $actsAs = array('Containable');
public $hasMany = 'Post';
public $belongsTo = 'Event';
public function updateAfterPostChange($add = false) {
$count = count($this->data['Post']);
// If we have 0 posts left, delete the thread!
if ($count == 0) {
$this->delete();
return false;
} else {
$this->data['Thread']['post_count'] = $count;
if ($add) {
$this->data['Thread']['date_modified'] = date('Y/m/d h:i:s');
}
$this->save($this->data);
return true;
}
}
}

View File

@ -228,6 +228,8 @@ class User extends AppModel {
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
),
'Post' => array(
)
);

View File

@ -31,6 +31,13 @@
'div' => 'input clear',
'class' => 'input-xxlarge'
));
echo $this->Form->input('comment', array(
'type' => 'text',
'label' => 'Contextual Comment',
'error' => array('escape' => false),
'div' => 'input clear',
'class' => 'input-xxlarge'
));
?>
<div class="input clear"></div>
<?php
@ -43,7 +50,6 @@
'type' => 'checkbox',
'data-content' => 'Create multiple attributes one per line',
));
// link an onchange event to the form elements
$this->Js->get('#AttributeCategory')->event('change', 'formCategoryChanged("#AttributeCategory")');
?>
@ -53,31 +59,11 @@ echo $this->Form->button('Submit', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><a href="/events/view/<?php echo $this->request->data['Attribute']['event_id']; ?>">View Event</a></li>
<li><a href="/logs/event_index/<?php echo $this->request->data['Attribute']['event_id'];?>">View Event History</a></li>
<li><a href="/events/edit/<?php echo $this->request->data['Attribute']['event_id']; ?>">Edit Event</a></li>
<li><?php echo $this->Form->postLink('Delete Event', array('controller' => 'events', 'action' => 'delete', $this->request->data['Attribute']['event_id']), null, __('Are you sure you want to delete # %s?', $this->request->data['Attribute']['event_id'])); ?></li>
<li class="divider"></li>
<li class="active"><a href="/attributes/add/<?php echo $this->request->data['Attribute']['event_id']; ?>">Add Attribute</a></li>
<li><a href="/attributes/add_attachment/<?php echo $this->request->data['Attribute']['event_id']; ?>">Add Attachment</a></li>
<li><a href="/events/addIOC/<?php echo $this->request->data['Attribute']['event_id']; ?>">Populate from IOC</a></li>
<li><a href="/attributes/add_threatconnect/<?php echo $this->request->data['Attribute']['event_id']; ?>">Populate from ThreatConnect</a></li>
<li class="divider"></li>
<li><a href="/events/contact/<?php echo $this->request->data['Attribute']['event_id']; ?>">Contact Reporter</a></li>
<li><a href="/events/xml/download/<?php echo $this->request->data['Attribute']['event_id']; ?>">Download as XML</a></li>
<?php if ($published): ?>
<li><a href="/events/downloadOpenIOCEvent/<?php echo $this->request->data['Attribute']['event_id'];?>">Download as IOC</a></li>
<li><a href="/events/csv/download/<?php echo $this->request->data['Attribute']['event_id'];?>">Download as CSV</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif; ?>
</ul>
</div>
<?php
$event['Event']['id'] = $this->request->data['Attribute']['event_id'];
$event['Event']['published'] = $published;
echo $this->element('side_menu', array('menuList' => 'event', 'menuItem' => 'addAttribute', 'event' => $event));
?>
<script type="text/javascript">
//

View File

@ -22,6 +22,13 @@
'label' => 'Distribution',
'selected' => $initialDistribution,
));
echo $this->Form->input('comment', array(
'type' => 'text',
'label' => 'Contextual Comment',
'error' => array('escape' => false),
'div' => 'input clear',
'class' => 'input-xxlarge'
));
//'before' => $this->Html->div('forminfo', isset($attrDescriptions['distribution']['formdesc']) ? $attrDescriptions['distribution']['formdesc'] : $attrDescriptions['distribution']['desc']),));
}
?>
@ -49,31 +56,11 @@ echo $this->Form->button('Upload', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><a href="/events/view/<?php echo $this->request->data['Attribute']['event_id']; ?>">View Event</a></li>
<li><a href="/logs/event_index/<?php echo $this->request->data['Attribute']['event_id'];?>">View Event History</a></li>
<li><a href="/events/edit/<?php echo $this->request->data['Attribute']['event_id']; ?>">Edit Event</a></li>
<li><?php echo $this->Form->postLink('Delete Event', array('controller' => 'events', 'action' => 'delete', $this->request->data['Attribute']['event_id']), null, __('Are you sure you want to delete # %s?', $this->request->data['Attribute']['event_id'])); ?></li>
<li class="divider"></li>
<li><a href="/attributes/add/<?php echo $this->request->data['Attribute']['event_id']; ?>">Add Attribute</a></li>
<li class="active"><a href="/attributes/add_attachment/<?php echo $this->request->data['Attribute']['event_id']; ?>">Add Attachment</a></li>
<li><a href="/events/addIOC/<?php echo $this->request->data['Attribute']['event_id']; ?>">Populate from IOC</a></li>
<li><a href="/attributes/add_threatconnect/<?php echo $this->request->data['Attribute']['event_id']; ?>">Populate from ThreatConnect</a></li>
<li class="divider"></li>
<li><a href="/events/contact/<?php echo $this->request->data['Attribute']['event_id']; ?>">Contact Reporter</a></li>
<li><a href="/events/xml/download/<?php echo $this->request->data['Attribute']['event_id']; ?>">Download as XML</a></li>
<?php if ($published): ?>
<li><a href="/events/downloadOpenIOCEvent/<?php echo $this->request->data['Attribute']['event_id'];?>">Download as IOC</a></li>
<li><a href="/events/csv/download/<?php echo $this->request->data['Attribute']['event_id'];?>">Download as CSV</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif; ?>
</ul>
</div>
<?php
$event['Event']['id'] = $this->request->data['Attribute']['event_id'];
$event['Event']['published'] = $published;
echo $this->element('side_menu', array('menuList' => 'event', 'menuItem' => 'addAttachment', 'event' => $event));
?>
<script type="text/javascript">
var formInfoValues = new Array();
<?php

View File

@ -19,28 +19,8 @@ echo $this->Form->button('Upload', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><a href="/events/view/<?php echo $this->request->data['Attribute']['event_id']; ?>">View Event</a></li>
<li><a href="/logs/event_index/<?php echo $this->request->data['Attribute']['event_id'];?>">View Event History</a></li>
<li><a href="/events/edit/<?php echo $this->request->data['Attribute']['event_id']; ?>">Edit Event</a></li>
<li><?php echo $this->Form->postLink('Delete Event', array('controller' => 'events', 'action' => 'delete', $this->request->data['Attribute']['event_id']), null, __('Are you sure you want to delete # %s?', $this->request->data['Attribute']['event_id'])); ?></li>
<li class="divider"></li>
<li><a href="/attributes/add/<?php echo $this->request->data['Attribute']['event_id']; ?>">Add Attribute</a></li>
<li><a href="/attributes/add_attachment/<?php echo $this->request->data['Attribute']['event_id']; ?>">Add Attachment</a></li>
<li><a href="/events/addIOC/<?php echo $this->request->data['Attribute']['event_id']; ?>">Populate from IOC</a></li>
<li class="active"><a href="/attributes/add_threatconnect/<?php echo $this->request->data['Attribute']['event_id']; ?>">Populate from ThreatConnect</a></li>
<li class="divider"></li>
<li><a href="/events/contact/<?php echo $this->request->data['Attribute']['event_id']; ?>">Contact Reporter</a></li>
<li><a href="/events/xml/download/<?php echo $this->request->data['Attribute']['event_id']; ?>">Download as XML</a></li>
<?php if ($published): ?>
<li><a href="/events/downloadOpenIOCEvent/<?php echo $this->request->data['Attribute']['event_id'];?>">Download as IOC</a></li>
<li><a href="/events/csv/download/<?php echo $this->request->data['Attribute']['event_id'];?>">Download as CSV</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif; ?>
</ul>
</div>
<?php
$event['Event']['id'] = $this->request->data['Attribute']['event_id'];
$event['Event']['published'] = $published;
echo $this->element('side_menu', array('menuList' => 'event', 'menuItem' => 'addThreatConnect', 'event' => $event));
?>

View File

@ -22,6 +22,13 @@
'div' => 'input clear',
'class' => 'input-xxlarge'
));
echo $this->Form->input('comment', array(
'type' => 'text',
'label' => 'Contextual Comment',
'error' => array('escape' => false),
'div' => 'input clear',
'class' => 'input-xxlarge'
));
?>
<div class="input clear"></div>
<?php
@ -43,27 +50,11 @@ echo $this->Form->button('Submit', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><a href="/events/view/<?php echo $this->request->data['Attribute']['event_id']; ?>">View Event</a></li>
<li><a href="/events/edit/<?php echo $this->request->data['Attribute']['event_id']; ?>">Edit Event</a></li>
<li><?php echo $this->Form->postLink('Delete Event', array('controller' => 'events', 'action' => 'delete', $this->request->data['Attribute']['event_id']), null, __('Are you sure you want to delete # %s?', $this->request->data['Attribute']['event_id'])); ?></li>
<li class="divider"></li>
<li><a href="/attributes/add/<?php echo $this->request->data['Attribute']['event_id']; ?>">Add Attribute</a></li>
<li><a href="/attributes/add_attachment/<?php echo $this->request->data['Attribute']['event_id']; ?>">Add Attachment</a></li>
<li><a href="/events/addIOC/<?php echo $this->request->data['Attribute']['event_id']; ?>">Populate from IOC</a></li>
<li><a href="/attributes/add_threatconnect/<?php echo $this->request->data['Attribute']['event_id']; ?>">Populate from ThreatConnect</a></li>
<li class="divider"></li>
<li><a href="/events/contact/<?php echo $this->request->data['Attribute']['event_id']; ?>">Contact Reporter</a></li>
<li><a href="/events/xml/download/<?php echo $this->request->data['Attribute']['event_id']; ?>">Download as XML</a></li>
<li><a href="/events/downloadOpenIOCEvent/<?php echo $this->request->data['Attribute']['event_id']; ?>">Download as IOC</a></li>
<li class="divider"></li>
<li><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif; ?>
</ul>
</div>
<?php
$event['Event']['id'] = $this->request->data['Attribute']['event_id'];
$event['Event']['published'] = $published;
echo $this->element('side_menu', array('menuList' => 'event', 'menuItem' => 'addAttribute', 'event' => $event));
?>
<script type="text/javascript">
//
//Generate Category / Type filtering array

View File

@ -32,6 +32,7 @@ if ($isSearch == 1) {
<th><?php echo $this->Paginator->sort('category');?></th>
<th><?php echo $this->Paginator->sort('type');?></th>
<th><?php echo $this->Paginator->sort('value');?></th>
<th><?php echo $this->Paginator->sort('comment');?></th>
<th<?php echo ' title="' . $attrDescriptions['signature']['desc'] . '"';?>>
<?php echo $this->Paginator->sort('IDS');?></th>
<th class="actions">Actions</th>
@ -83,7 +84,11 @@ foreach ($attributes as $attribute):
} else {
echo $sigDisplay;
}
?></td>
?>
</td>
<td onclick="document.location ='document.location ='/events/view/<?php echo $attribute['Event']['id'];?>';">
<?php echo h($attribute['Attribute']['comment']); ?>&nbsp;
</td>
<td class="short" onclick="document.location ='document.location ='/events/view/<?php echo $attribute['Event']['id'];?>';">
<?php echo $attribute['Attribute']['to_ids'] ? 'Yes' : 'No'; ?>&nbsp;
</td>
@ -119,36 +124,16 @@ endforeach;
</div>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif; ?>
<li class="divider"></li>
<?php
if ($isSearch == 1){
$searchClass = 'class="active"';
$listClass = '';
} else {
$searchClass = '';
$listClass = 'class="active"';
}
?>
<li <?php echo $listClass;?>><a href="/attributes/index">List Attributes</a></li>
<li <?php echo $searchClass;?>><a href="/attributes/search">Search Attributes</a></li>
<?php if ($isSearch == 1): ?>
<li class="divider"></li>
<li><a href="/events/downloadSearchResult">Download results as XML</a></li>
<li><a href="/events/csv/download/search">Download results as CSV</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/events/export">Export</a></li>
<?php if ($isAclAuth): ?>
<li><a href="/events/automation">Automation</a></li>
<?php endif;?>
</ul>
</div>
<?php
if ($isSearch == 1){
$class = 'searchAttributes2';
} else {
$class = 'listAttributes';
}
?>
<?php
echo $this->element('side_menu', array('menuList' => 'event-collection', 'menuItem' => $class));
?>
<script type="text/javascript">
// tooltips
$(document).ready(function () {

View File

@ -189,25 +189,8 @@ $(document).ready(function() {
});
});
</script>
<?php echo $this->Js->writeBuffer(); // Write cached scripts ?>
<div class="actions">
<ul class="nav nav-list">
<li><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/attributes/index">List Attributes</a></li>
<li class="active"><a href="/attributes/search">Search Attributes</a></li>
<li class="divider"></li>
<li><a href="/events/export">Export</a></li>
<?php if ($isAclAuth): ?>
<li><a href="/events/automation">Automation</a></li>
<?php endif;?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'event-collection', 'menuItem' => 'searchAttributes'));
?>
<?php echo $this->Js->writeBuffer(); // Write cached scripts ?>

View File

@ -0,0 +1,166 @@
<div id="top">
<div class="pagination">
<ul>
<?php
$this->Paginator->options(array(
'update' => '#top',
'evalScripts' => true,
'before' => '$(".loading").show()',
'complete' => '$(".loading").hide()',
));
echo $this->Paginator->prev('&laquo; ' . __('previous'), array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'prev disabled', 'escape' => false, 'disabledTag' => 'span'));
echo $this->Paginator->numbers(array('modulus' => 10, 'separator' => '', 'tag' => 'li', 'currentClass' => 'active', 'currentTag' => 'span'));
echo $this->Paginator->next(__('next') . ' &raquo;', array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'next disabled', 'escape' => false, 'disabledTag' => 'span'));
?>
</ul>
</div>
<div id = "posts">
<?php
foreach ($posts as $post) {
?>
<table class="discussionBox" id=<?php echo '"' . h($post['Post']['id']) . '"';?> >
<tr>
<td class="discussionBoxTD discussionBoxTDtop" colspan="2">
<div>
<table style="width:100%">
<tr>
<td>
<?php
echo 'Date: ' . h($post['Post']['date_created']);
?>
</td>
<td style="text-align:right">
<a href = #top class = "whitelink">Top</a> |
<a href = #<?php echo $post['Post']['id']; ?> class = "whitelink">#<?php echo h($post['Post']['id'])?></a>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td class="discussionBoxTD discussionBoxTDMid discussionBoxTDMidLeft">
<?php
$imgAbsolutePath = APP . WEBROOT_DIR . DS . 'img' . DS . 'orgs' . DS . h($post['User']['org']) . '.png';
if (file_exists($imgAbsolutePath)) echo $this->Html->image('orgs/' . h($post['User']['org']) . '.png', array('alt' => h($post['User']['org']), 'title' => h($post['User']['org']), 'style' => 'width:48px; height:48px'));
else echo $this->Html->tag('span', h($post['User']['org']), array('class' => 'welcome', 'style' => 'float:center;'));
?>
</td>
<td class="discussionBoxTD discussionBoxTDMid discussionBoxTDMidRight">
<?php
echo $this->Command->convertQuotes(nl2br(h($post['Post']['contents'])));
if ($post['Post']['post_id'] !=0 || ($post['Post']['date_created'] != $post['Post']['date_modified'])) {
?>
<br /><br />
<?php
}
if ($post['Post']['post_id'] != 0) {
?>
<span style="font-style:italic">
In reply to post
<a href = #<?php echo h($post['Post']['post_id']); ?>>#<?php echo h($post['Post']['post_id'])?></a>
</span>
<?php
}
if ($post['Post']['date_created'] != $post['Post']['date_modified']) {
echo '<span style="font-style:italic">Message edited at ' . h($post['Post']['date_modified']) . '<span>';
}
?>
</td>
</tr>
<tr>
<td class="discussionBoxTD discussionBoxTDbottom" colspan = "2">
<table style="width:100%">
<tr>
<td>
<?php echo h($post['User']['email']); ?>
</td>
<td style="text-align:right">
<?php
if (!$isSiteAdmin) {
if ($post['Post']['user_id'] == $myuserid) {
echo $this->Html->link('', array('controller' => 'posts', 'action' => 'edit', h($post['Post']['id'])), array('class' => 'icon-edit', 'title' => 'Edit'));
echo $this->Form->postLink('', array('controller' => 'posts', 'action' => 'delete', h($post['Post']['id'])), array('class' => 'icon-trash', 'title' => 'Delete'), __('Are you sure you want to delete this post?'));
} else {
?>
<a href = "<?php echo Configure::read('CyDefSIG.baseurl') . '/posts/add/post/' . h($post['Post']['id']); ?>" class="icon-comment" title = "Reply"></a>
<?php
}
} else {
echo $this->Html->link('', array('controller' => 'posts', 'action' => 'edit', h($post['Post']['id'])), array('class' => 'icon-edit', 'title' => 'Edit'));
echo $this->Form->postLink('', array('controller' => 'posts', 'action' => 'delete', h($post['Post']['id'])), array('class' => 'icon-trash', 'title' => 'Delete'), __('Are you sure you want to delete this post?'));
?>
<a href = "<?php echo Configure::read('CyDefSIG.baseurl') . '/posts/add/post/' . h($post['Post']['id']); ?>" class="icon-comment" title = "Reply"></a>
<?php
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<?php
}
?>
</div>
<p>
<?php
echo $this->Paginator->counter(array(
'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
));
?>
</p>
<div class="pagination">
<ul>
<?php
echo $this->Paginator->prev('&laquo; ' . __('previous'), array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'prev disabled', 'escape' => false, 'disabledTag' => 'span'));
echo $this->Paginator->numbers(array('modulus' => 20, 'separator' => '', 'tag' => 'li', 'currentClass' => 'active', 'currentTag' => 'span'));
echo $this->Paginator->next(__('next') . ' &raquo;', array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'next disabled', 'escape' => false, 'disabledTag' => 'span'));
?>
</ul>
</div>
<div class="comment">
<?php echo $this->Form->create('Post');?>
<fieldset>
<div class="input clear">
<button type="button" title="Insert a quote - just paste your quote between the [quote][/quote] tags." class="toggle-left btn btn-inverse qet" id = "quote" onclick="insertQuote()">Quote</button>
<button type="button" title="Insert a link to an event - just enter the event ID between the [event][/event] tags." class="toggle btn btn-inverse qet" id = "event" onclick="insertEvent()">Event</button>
<button type="button" title="Insert a link to a discussion thread - enter the thread's ID between the [thread][/thread] tags." class="toggle-right btn btn-inverse qet" id = "thread" onclick="insertThread()">Thread</button>
</div>
<?php
echo $this->Form->input('message', array(
'label' => false,
'type' => 'textarea',
'div' => 'input clear',
'class' => 'input-xxlarge',
));
?>
</fieldset>
<?php
echo $this->Js->submit('Send', array(
'before'=>$this->Js->get('#loading')->effect('fadeIn'),
'success'=>$this->Js->get('#loading')->effect('fadeOut'),
'update'=>'#top',
'class'=>'btn btn-primary',
'url' => '/posts/add/thread/' . $thread_id
));
echo $this->Form->end();
?>
</div>
</div>
<script type="text/javascript">
function insertQuote() {
document.getElementById("PostMessage").value+="[Quote][/Quote]";
}
function insertEvent() {
document.getElementById("PostMessage").value+="[Event][/Event]";
}
function insertThread() {
document.getElementById("PostMessage").value+="[Thread][/Thread]";
}
</script>
<?php echo $this->Js->writeBuffer();?>

View File

@ -37,11 +37,11 @@
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<?php if ($isSiteAdmin): ?>
<?php if ($isAclRegexp): ?>
<li><a href="/admin/regexp/index">Import Regexp</a></li>
<li><a href="/admin/whitelists/index">Signature Whitelist</a></li>
<?php endif;?>
<?php if (!$isSiteAdmin): ?>
<?php if (!$isAclRegexp): ?>
<li><a href="/regexp/index">Import Regexp</a></li>
<li><a href="/whitelists/index">Signature Whitelist</a></li>
<?php endif;?>
@ -112,7 +112,16 @@
</ul>
</li>
<?php endif;?>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
Discussions
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="/threads/index">List Discussions</a></li>
<li><a href="/posts/add">Start Discussion</a></li>
</ul>
</li>
</ul>
</div>
<div class="nav-collapse collapse pull-right">

View File

@ -2,12 +2,6 @@
echo $this->Html->css('tree');
?>
<div>
<h3>Pivot Thread</h3>
<div>
<?php
//echo $this->Html->link('Reset thread', array('controller' => 'events', 'action' => 'view', $event['Event']['id']));
?>
</div>
<div class="tree">
<?php
echo $this->Pivot->convertPivotToHTML($pivot, $currentEvent);

View File

@ -0,0 +1,169 @@
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<?php
switch ($menuList) {
case 'event': ?>
<li <?php if ($menuItem === 'viewEvent') echo 'class="active";'?>><a href="/events/view/<?php echo $event['Event']['id'];?>">View Event</a></li>
<li <?php if ($menuItem === 'eventLog') echo 'class="active";'?>><a href="/logs/event_index/<?php echo $event['Event']['id'];?>">View Event History</a></li>
<?php if ($isSiteAdmin || (isset($mayModify) && $mayModify)): ?>
<li <?php if ($menuItem === 'editEvent') echo 'class="active";'?>><a href="/events/edit/<?php echo $event['Event']['id'];?>">Edit Event</a></li>
<li><?php echo $this->Form->postLink('Delete Event', array('action' => 'delete', $event['Event']['id']), null, __('Are you sure you want to delete # %s?', $event['Event']['id'])); ?></li>
<li class="divider"></li>
<li <?php if ($menuItem === 'addAttribute') echo 'class="active";'?>><a href="/attributes/add/<?php echo $event['Event']['id'];?>">Add Attribute</a></li>
<li <?php if ($menuItem === 'addAttachment') echo 'class="active";'?>><a href="/attributes/add_attachment/<?php echo $event['Event']['id'];?>">Add Attachment</a></li>
<li <?php if ($menuItem === 'addIOC') echo 'class="active";'?>><a href="/events/addIOC/<?php echo $event['Event']['id'];?>">Populate from IOC</a></li>
<li <?php if ($menuItem === 'addThreatConnect') echo 'class="active";'?>><a href="/attributes/add_threatconnect/<?php echo $event['Event']['id']; ?>">Populate from ThreatConnect</a></li>
<?php elseif (!isset($mayModify) || !$mayModify): ?>
<li class="divider"></li>
<li <?php if ($menuItem === 'proposeAttribute') echo 'class="active";'?>><a href="/shadow_attributes/add/<?php echo $event['Event']['id'];?>">Propose Attribute</a></li>
<li <?php if ($menuItem === 'proposeAttachment') echo 'class="active";'?>><a href="/shadow_attributes/add_attachment/<?php echo $event['Event']['id'];?>">Propose Attachment</a></li>
<?php endif; ?>
<li class="divider"></li>
<?php if (isset($event['Event']['published']) && 0 == $event['Event']['published'] && ($isAdmin || (isset($mayPublish) && $mayPublish))): ?>
<li><?php echo $this->Form->postLink('Publish Event', array('action' => 'alert', $event['Event']['id']), null, 'Are you sure this event is complete and everyone should be informed?'); ?></li>
<li><?php echo $this->Form->postLink('Publish (no email)', array('action' => 'publish', $event['Event']['id']), null, 'Publish but do NOT send alert email? Only for minor changes!'); ?></li>
<?php endif; ?>
<li <?php if ($menuItem === 'contact') echo 'class="active";'?>><a href="/events/contact/<?php echo $event['Event']['id'];?>">Contact Reporter</a></li>
<li><a href="/events/xml/download/<?php echo $event['Event']['id'];?>">Download as XML</a></li>
<?php if (isset($event['Event']['published']) && $event['Event']['published']): ?>
<li><a href="/events/downloadOpenIOCEvent/<?php echo $event['Event']['id'];?>">Download as IOC</a></li>
<li><a href="/events/csv/download/<?php echo $event['Event']['id'];?>">Download as CSV</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif;
break;
case 'event-collection': ?>
<li <?php if ($menuItem === 'index') echo 'class="active";'?>><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li <?php if ($menuItem === 'add') echo 'class="active";'?>><a href="/events/add">Add Event</a></li>
<li <?php if ($menuItem === 'addXML') echo 'class="active";'?>><a href="/events/add_xml">Add MISP XML</a></li>
<?php endif; ?>
<li class="divider"></li>
<li <?php if ($menuItem === 'listAttributes') echo 'class="active";'?>><a href="/attributes/index">List Attributes</a></li>
<li <?php if ($menuItem === 'searchAttributes' || $menuItem === 'searchAttributes2') echo 'class="active";'?>><a href="/attributes/search">Search Attributes</a></li>
<?php if ($menuItem == 'searchAttributes2'): ?>
<li class="divider"></li>
<li><a href="/events/downloadSearchResult">Download results as XML</a></li>
<li><a href="/events/csv/download/search">Download results as CSV</a></li>
<?php endif; ?>
<li class="divider"></li>
<li <?php if ($menuItem === 'viewProposals') echo 'class="active";'?>><a href="/shadow_attributes/index">View Proposals</a></li>
<li class="divider"></li>
<li <?php if ($menuItem === 'export') echo 'class="active";'?>><a href="/events/export">Export</a></li>
<?php if ($isAclAuth): ?>
<li <?php if ($menuItem === 'automation') echo 'class="active";'?>><a href="/events/automation">Automation</a></li>
<?php endif;
break;
case 'regexp': ?>
<li <?php if ($menuItem === 'index') echo 'class="active";'?>><?php echo $this->Html->link('List Regexp', array('admin' => $isSiteAdmin, 'action' => 'index'));?></li>
<?php if ($isSiteAdmin): ?>
<li <?php if ($menuItem === 'add') echo 'class="active";'?>><?php echo $this->Html->link('New Regexp', array('admin' => true, 'action' => 'add'));?></li>
<li><?php echo $this->Html->link('Perform on existing', array('admin' => true, 'action' => 'clean'));?></li>
<?php endif;
if ($menuItem == 'edit'):?>
<li class="divider"></li>
<li class="active"><?php echo $this->Html->link('Edit Regexp', array('admin' => true, 'action' => 'edit', $id));?></li>
<li><?php echo $this->Form->postLink('Delete Regexp', array('admin' => true, 'action' => 'delete', $id), null, __('Are you sure you want to delete # %s?', $id));?></li>
<?php
endif;
break;
case 'whitelist':?>
<li <?php if ($menuItem === 'index') echo 'class="active";'?>><?php echo $this->Html->link('List Whitelist', array('admin' => $isSiteAdmin, 'action' => 'index'));?></li>
<?php if ($isSiteAdmin): ?>
<li <?php if ($menuItem === 'add') echo 'class="active";'?>><?php echo $this->Html->link('New Whitelist', array('admin' => true, 'action' => 'add'));?></li>
<?php endif;
if ($menuItem == 'edit'):?>
<li class="divider"></li>
<li class="active"><?php echo $this->Html->link('Edit Whitelist', array('admin' => true, 'action' => 'edit', $id));?></li>
<li><?php echo $this->Form->postLink('Delete Whitelist', array('admin' => true, 'action' => 'delete', $id), null, __('Are you sure you want to delete # %s?', $id));?></li>
<?php
endif;
break;
case 'globalActions':
if ($menuItem === 'edit' || $menuItem === 'view'): ?>
<li <?php if ($menuItem === 'edit') echo 'class="active";'?>><?php echo $this->Html->link(__('Edit User', true), array('action' => 'edit', $user['User']['id'])); ?></li>
<li class="divider"></li>
<?php endif; ?>
<li <?php if ($menuItem === 'news') echo 'class="active";'?>><a href="/users/news">News</a></li>
<li <?php if ($menuItem === 'view') echo 'class="active";'?>><a href="/users/view/me">My Profile</a></li>
<li <?php if ($menuItem === 'members') echo 'class="active";'?>><a href="/users/memberslist">Members List</a></li>
<li <?php if ($menuItem === 'userGuide') echo 'class="active";'?>><a href="/pages/display/doc/general">User Guide</a></li>
<li <?php if ($menuItem === 'terms') echo 'class="active";'?>><a href="/users/terms">Terms &amp; Conditions</a></li>
<?php
break;
case 'sync':
if ($menuItem === 'edit' && $isAdmin): ?>
<li class="active"><?php if ($isAdmin) echo $this->Html->link('Edit Server', array('controller' => 'servers', 'action' => 'edit')); ?></li>
<li><?php echo $this->Form->postLink('Delete', array('action' => 'delete', $this->Form->value('Server.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Server.id'))); ?></li>
<li class="divider"></li>
<?php endif; ?>
<li <?php if ($menuItem === 'index') echo 'class="active";'?>><?php echo $this->Html->link('List Servers', array('controller' => 'servers', 'action' => 'index'));?></li>
<li <?php if ($menuItem === 'add') echo 'class="active";'?>><?php if ($isAclAdd && $me['org'] == 'ADMIN') echo $this->Html->link(__('New Server'), array('controller' => 'servers', 'action' => 'add')); ?></li>
<?php
break;
case 'admin':
if ($menuItem === 'editUser' || $menuItem === 'viewUser'): ?>
<li <?php if ($menuItem === 'viewUser') echo 'class="active";'?>><?php echo $this->Html->link('View User', array('controller' => 'users', 'action' => 'view', 'admin' => true, $id)); ?> </li>
<li <?php if ($menuItem === 'editUser') echo 'class="active";'?>><?php echo $this->Html->link('Edit User', array('controller' => 'users', 'action' => 'edit', 'admin' => true, $id)); ?> </li>
<li><?php echo $this->Form->postLink('Delete User', array('admin' => true, 'action' => 'delete', $id), null, __('Are you sure you want to delete # %s?', $id));?></li>
<li class="divider"></li>
<?php endif;
if ($isSiteAdmin && $menuItem === 'editRole'): ?>
<li class="active"><?php echo $this->Html->link('Edit Role', array('controller' => 'roles', 'action' => 'edit', 'admin' => true, $id)); ?> </li>
<li><?php echo $this->Form->postLink('Delete Role', array('controller' => 'roles', 'admin' => true, 'action' => 'delete', $id), null, __('Are you sure you want to delete # %s?', $id));?></li>
<li class="divider"></li>
<?php endif; ?>
<li <?php if ($menuItem === 'addUser') echo 'class="active";'?>><?php echo $this->Html->link('New User', array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?> </li>
<li <?php if ($menuItem === 'indexUser') echo 'class="active";'?>><?php echo $this->Html->link('List Users', array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?> </li>
<li class="divider"></li>
<?php if ($isSiteAdmin): ?>
<li <?php if ($menuItem === 'addRole') echo 'class="active";'?>><?php echo $this->Html->link('New Role', array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?> </li>
<?php endif; ?>
<li <?php if ($menuItem === 'indexRole') echo 'class="active";'?>><?php echo $this->Html->link('List Roles', array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?> </li>
<?php if ($isSiteAdmin): ?>
<li class="divider"></li>
<li <?php if ($menuItem === 'contact') echo 'class="active";'?>><?php echo $this->Html->link('Contact users', array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?> </li>
<li <?php if ($menuItem === 'adminTools') echo 'class="active";'?>><a href="/pages/display/administration">Administrative tools</a></li>
<?php endif;
break;
case 'logs': ?>
<li <?php if ($menuItem === 'index') echo 'class="active";'?>><?php echo $this->Html->link('List Logs', array('admin' => true, 'action' => 'index'));?></li>
<li <?php if ($menuItem === 'search') echo 'class="active";'?>><?php echo $this->Html->link('Search Logs', array('admin' => true, 'action' => 'search'));?></li>
<?php
break;
case 'threads':
if ($menuItem === 'add' || $menuItem === 'view') {
if (!(empty($thread_id) && empty($target_type))) { ?>
<li <?php if ($menuItem === 'view') echo 'class="active";'?>><?php echo $this->Html->link('View Thread', array('controller' => 'threads', 'action' => 'view', $thread_id));?></li>
<li <?php if ($menuItem === 'add') echo 'class="active";'?>><?php echo $this->Html->link('Add Post', array('controller' => 'posts', 'action' => 'add', 'thread', $thread_id));?></li>
<li class="divider"></li>
<?php
}
}
if ($menuItem === 'edit') { ?>
<li><?php echo $this->Html->link('View Thread', array('controller' => 'threads', 'action' => 'view', $thread_id));?></li>
<li class="active"><?php echo $this->Html->link('Edit Post', array('controller' => 'threads', 'action' => 'view', $id));?></li>
<li class="divider"></li>
<?php
}
?>
<li <?php if ($menuItem === 'index') echo 'class="active";'?>><?php echo $this->Html->link('List Threads', array('controller' => 'threads', 'action' => 'index'));?></li>
<li <?php if ($menuItem === 'add' && !isset($thread_id)) echo 'class="active";'?>><a href = "<?php echo Configure::read('CyDefSIG.baseurl');?>/posts/add">New Thread</a></li>
<?php
break;
}
?>
</ul>
</div>

View File

@ -41,22 +41,9 @@ echo $this->Form->end();
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li class="active"><a href="/events/add">Add Event</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/attributes/index">List Attributes</a></li>
<li><a href="/attributes/search">Search Attributes</a></li>
<li class="divider"></li>
<li><a href="/events/export">Export</a></li>
<?php if ($isAclAuth): ?>
<li><a href="/events/automation">Automation</a></li>
<?php endif;?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'event-collection', 'menuItem' => 'add'));
?>
<script type="text/javascript">
//

View File

@ -14,33 +14,8 @@ echo $this->Form->button('Upload', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><a href="/events/view/<?php echo $id;?>">View Event</a></li>
<li><a href="/logs/event_index/<?php echo $id;?>">View Event History</a></li>
<?php if ($isSiteAdmin || $mayModify): ?>
<li><a href="/events/edit/<?php echo $id;?>">Edit Event</a></li>
<li><?php echo $this->Form->postLink('Delete Event', array('action' => 'delete', $id), null, __('Are you sure you want to delete # %s?', $id)); ?></li>
<li class="divider"></li>
<li><a href="/attributes/add/<?php echo $id;?>">Add Attribute</a></li>
<li><a href="/attributes/add_attachment/<?php echo $id;?>">Add Attachment</a></li>
<li class="active"><a href="/events/addIOC/<?php echo $id;?>">Populate from IOC</a></li>
<li><a href="/attributes/add_threatconnect/<?php echo $id; ?>">Populate from ThreatConnect</a></li>
<?php else: ?>
<li><a href="/shadow_attributes/add/<?php echo $id;?>">Propose Attribute</a></li>
<li><a href="/shadow_attributes/add_attachment/<?php echo $id;?>">Propose Attachment</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/events/contact/<?php echo $id;?>">Contact Reporter</a></li>
<li><a href="/events/xml/download/<?php echo $id;?>">Download as XML</a></li>
<?php if ($published): ?>
<li><a href="/events/downloadOpenIOCEvent/<?php echo $id;?>">Download as IOC</a></li>
<li><a href="/events/csv/download/<?php echo $id;?>">Download as CSV</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif; ?>
</ul>
</div>
<?php
$event['Event']['id'] = $id;
$event['Event']['published'] = $published;
echo $this->element('side_menu', array('menuList' => 'event', 'menuItem' => 'addIOC', 'event' => $event));
?>

View File

@ -0,0 +1,19 @@
<div class="events form">
<?php echo $this->Form->create('Event', array('type' => 'file'));?>
<fieldset>
<legend><?php echo __('Import from MISP XML'); ?></legend>
<?php
echo $this->Form->input('Event.submittedxml', array(
'label' => '<b>MISP XML</b>',
'type' => 'file',
));
?>
</fieldset>
<?php
echo $this->Form->button('Upload', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'event-collection', 'menuItem' => 'addXML'));
?>

View File

@ -92,19 +92,6 @@ For example, to get all IDS signature attributes of type md5 and sha256, but not
?>
</pre>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/attributes/index">List Attributes</a></li>
<li><a href="/attributes/search">Search Attributes</a></li>
<li class="divider"></li>
<li><a href="/events/export">Export</a></li>
<?php if ($isAclAuth): ?>
<li class="active"><a href="/events/automation">Automation</a></li>
<?php endif;?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'event-collection', 'menuItem' => 'automation'));
?>

View File

@ -33,32 +33,7 @@ $mayPublish = ($isAclPublish && $this->request->data['Event']['orgc'] == $me['or
</fieldset>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><a href="/events/view/<?php echo $this->data['Event']['id'];?>">View Event</a></li>
<li><a href="/logs/event_index/<?php echo $this->data['Event']['id'];?>">View Event History</a></li>
<?php if ($isSiteAdmin || $mayModify): ?>
<li><a href="/events/edit/<?php echo $this->data['Event']['id'];?>">Edit Event</a></li>
<li><?php echo $this->Form->postLink('Delete Event', array('action' => 'delete', $this->data['Event']['id']), null, __('Are you sure you want to delete # %s?', $this->data['Event']['id'])); ?></li>
<li class="divider"></li>
<li><a href="/attributes/add/<?php echo $this->data['Event']['id'];?>">Add Attribute</a></li>
<li><a href="/attributes/add_attachment/<?php echo $this->data['Event']['id'];?>">Add Attachment</a></li>
<li><a href="/events/addIOC/<?php echo $this->data['Event']['id'];?>">Populate from IOC</a></li>
<?php else: ?>
<li><a href="/shadow_attributes/add/<?php echo $this->data['Event']['id'];?>">Propose Attribute</a></li>
<li><a href="/shadow_attributes/add_attachment/<?php echo $this->data['Event']['id'];?>">Propose Attachment</a></li>
<?php endif; ?>
<li class="divider"></li>
<li class="active"><a href="/events/contact/<?php echo $this->data['Event']['id'];?>">Contact Reporter</a></li>
<li><a href="/events/xml/download/<?php echo $this->data['Event']['id'];?>">Download as XML</a></li>
<?php if ($this->data['Event']['published']): ?>
<li><a href="/events/downloadOpenIOCEvent/<?php echo $this->data['Event']['id'];?>">Download as IOC</a></li>
<li><a href="/events/csv/download/<?php echo $this->data['Event']['id'];?>">Download as CSV</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif; ?>
</ul>
</div>
<?php
$event = $this->data;
echo $this->element('side_menu', array('menuList' => 'event', 'menuItem' => 'contact', 'event' => $event));
?>

View File

@ -32,19 +32,9 @@ echo $this->Form->button('Submit', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><a href="/events/view/<?php echo $this->request->data['Event']['id'];?>">View Event</a></li>
<li><a href="/logs/event_index/<?php echo $this->request->data['Event']['id'];?>">View Event History</a></li>
<li class="active"><a href="/events/edit/<?php echo $this->request->data['Event']['id'];?>">Edit Event</a></li>
<li><?php echo $this->Form->postLink('Delete Event', array('action' => 'delete', $this->request->data['Event']['id']), null, __('Are you sure you want to delete # %s?', $this->request->data['Event']['id'])); ?></li>
<li class="divider"></li>
<li><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif; ?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'event', 'menuItem' => 'editEvent'));
?>
<script type="text/javascript">
//

View File

@ -64,19 +64,6 @@
</ul>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/attributes/index">List Attributes</a></li>
<li><a href="/attributes/search">Search Attributes</a></li>
<li class="divider"></li>
<li class="active"><a href="/events/export">Export</a></li>
<?php if ($isAclAuth): ?>
<li><a href="/events/automation">Automation</a></li>
<?php endif;?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'event-collection', 'menuItem' => 'export'));
?>

View File

@ -294,22 +294,9 @@
</ul>
</div>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li class="active"><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/attributes/index">List Attributes</a></li>
<li><a href="/attributes/search">Search Attributes</a></li>
<li class="divider"></li>
<li><a href="/events/export">Export</a></li>
<?php if ($isAclAuth): ?>
<li><a href="/events/automation">Automation</a></li>
<?php endif;?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'event-collection', 'menuItem' => 'index'));
?>
<script type="text/javascript">
$(document).ready( function () {

View File

@ -52,28 +52,8 @@ foreach ($graph as $line): ?>
endforeach; ?>
</div>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('View Event', array('controller' => 'events', 'action' => 'view', $eventId)); ?> </li>
<?php if ($isSiteAdmin || $mayModify): ?>
<li><?php echo $this->Html->link('Edit Event', array('controller' => 'events', 'action' => 'edit', $eventId)); ?> </li>
<li><?php echo $this->Form->postLink('Delete Event', array('controller' => 'events', 'action' => 'delete', $eventId), null, __('Are you sure you want to delete # %s?', $eventId)); ?></li>
<li class="divider"></li>
<li><?php echo $this->Html->link('Add Attribute', array('controller' => 'attributes', 'action' => 'add', $eventId));?> </li>
<li><?php echo $this->Html->link('Add Attachment', array('controller' => 'attributes', 'action' => 'add_attachment', $eventId));?> </li>
<li class="active"><?php echo $this->Html->link('Populate event from IOC', array('controller' => 'events', 'action' => 'addIOC', $eventId));?> </li>
<?php else: ?>
<li><?php echo $this->Html->link('Propose Attribute', array('controller' => 'shadow_attributes', 'action' => 'add', $eventId));?> </li>
<li><?php echo $this->Html->link('Propose Attachment', array('controller' => 'shadow_attributes', 'action' => 'add_attachment', $eventId));?> </li>
<?php endif; ?>
<li class="divider"></li>
<li><?php echo $this->Html->link(__('Contact reporter', true), array('controller' => 'events', 'action' => 'contact', $eventId)); ?> </li>
<li><?php echo $this->Html->link(__('Download as XML', true), array('controller' => 'events', 'action' => 'xml', 'download', $eventId)); ?></li>
<li><?php echo $this->Html->link(__('Download as IOC', true), array('controller' => 'events', 'action' => 'downloadOpenIOCEvent', $eventId)); ?> </li>
<li class="divider"></li>
<li><?php echo $this->Html->link('List Events', array('controller' => 'events', 'action' => 'index')); ?></li>
<?php if ($isAclAdd): ?>
<li><?php echo $this->Html->link('Add Event', array('controller' => 'events', 'action' => 'add')); ?></li>
<?php endif; ?>
</ul>
</div>
<?php
$event['Event']['id'] = $eventId;
$event['Event']['published'] = 0;
echo $this->element('side_menu', array('menuList' => 'event', 'menuItem' => 'addIOC', 'event' => $event));
?>

View File

@ -2,42 +2,9 @@
$mayModify = (($isAclModify && $event['Event']['user_id'] == $me['id']) || ($isAclModifyOrg && $event['Event']['orgc'] == $me['org']));
$mayPublish = ($isAclPublish && $event['Event']['orgc'] == $me['org']);
?>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li class="active"><a href="/events/view/<?php echo $event['Event']['id'];?>">View Event</a></li>
<li><a href="/logs/event_index/<?php echo $event['Event']['id'];?>">View Event History</a></li>
<?php if ($isSiteAdmin || $mayModify): ?>
<li><a href="/events/edit/<?php echo $event['Event']['id'];?>">Edit Event</a></li>
<li><?php echo $this->Form->postLink('Delete Event', array('action' => 'delete', $event['Event']['id']), null, __('Are you sure you want to delete # %s?', $event['Event']['id'])); ?></li>
<li class="divider"></li>
<li><a href="/attributes/add/<?php echo $event['Event']['id'];?>">Add Attribute</a></li>
<li><a href="/attributes/add_attachment/<?php echo $event['Event']['id'];?>">Add Attachment</a></li>
<li><a href="/events/addIOC/<?php echo $event['Event']['id'];?>">Populate from IOC</a></li>
<li><a href="/attributes/add_threatconnect/<?php echo $event['Event']['id']; ?>">Populate from ThreatConnect</a></li>
<?php else: ?>
<li><a href="/shadow_attributes/add/<?php echo $event['Event']['id'];?>">Propose Attribute</a></li>
<li><a href="/shadow_attributes/add_attachment/<?php echo $event['Event']['id'];?>">Propose Attachment</a></li>
<?php endif; ?>
<li class="divider"></li>
<?php if ( 0 == $event['Event']['published'] && ($isAdmin || $mayPublish)): ?>
<li><?php echo $this->Form->postLink('Publish Event', array('action' => 'alert', $event['Event']['id']), null, 'Are you sure this event is complete and everyone should be informed?'); ?></li>
<li><?php echo $this->Form->postLink('Publish (no email)', array('action' => 'publish', $event['Event']['id']), null, 'Publish but do NOT send alert email? Only for minor changes!'); ?></li>
<?php else: ?>
<!-- ul><li>Alert already sent</li></ul -->
<?php endif; ?>
<li><a href="/events/contact/<?php echo $event['Event']['id'];?>">Contact Reporter</a></li>
<li><a href="/events/xml/download/<?php echo $event['Event']['id'];?>">Download as XML</a></li>
<?php if ($event['Event']['published']): ?>
<li><a href="/events/downloadOpenIOCEvent/<?php echo $event['Event']['id'];?>">Download as IOC</a></li>
<li><a href="/events/csv/download/<?php echo $event['Event']['id'];?>">Download as CSV</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif; ?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'event', 'menuItem' => 'viewEvent'));
?>
<div class="events view">
@ -75,7 +42,7 @@ $mayPublish = ($isAclPublish && $event['Event']['orgc'] == $me['org']);
&nbsp;
</dd>
<?php endif; ?>
<?php if ($isSiteAdmin || ($isAdmin && $me['org'] == $event['Event']['org'])): ?>
<?php if (isset($event['User']['email']) && ($isSiteAdmin || ($isAdmin && $me['org'] == $event['Event']['org']))): ?>
<dt>Email</dt>
<dd>
<?php echo h($event['User']['email']); ?>
@ -136,11 +103,33 @@ $mayPublish = ($isAclPublish && $event['Event']['orgc'] == $me['org']);
</div>
<?php endif; ?>
</div>
<br />
<div>
<button class="btn btn-inverse toggle-left btn.active qet" id="pivots_active">
<span class="icon-minus icon-white" style="vertical-align:top;"></span>Pivots
</button>
<button class="btn btn-inverse toggle-left qet" style="display:none;" id="pivots_inactive">
<span class="icon-plus icon-white" style="vertical-align:top;"></span>Pivots
</button>
<button class="btn btn-inverse toggle qet" id="attributes_active">
<span class="icon-minus icon-white" style="vertical-align:top;"></span>Attributes
</button>
<button class="btn btn-inverse toggle qet" id="attributes_inactive" style="display:none;">
<span class="icon-plus icon-white" style="vertical-align:top;"></span>Attributes
</button>
<button class="btn btn-inverse toggle-right qet" id="discussions_active">
<span class="icon-minus icon-white" style="vertical-align:top;"></span>Discussion
</button>
<button class="btn btn-inverse toggle-right qet" id="discussions_inactive" style="display:none;">
<span class="icon-plus icon-white" style="vertical-align:top;"></span>Discussion
</button>
</div>
<br />
<br />
<div id="pivots_div">
<?php if (sizeOf($allPivots) > 1) echo $this->element('pivot'); ?>
</div>
<div>
<h3>Attributes</h3>
<div id="attributes_div">
<?php
if (!empty($event['Attribute'])):?>
<table class="table table-striped table-condensed">
@ -148,6 +137,7 @@ if (!empty($event['Attribute'])):?>
<th>Category</th>
<th>Type</th>
<th>Value</th>
<th>Comment</th>
<th>Related Events</th>
<th title="<?php echo $attrDescriptions['signature']['desc'];?>">IDS</th>
<th title="<?php echo $attrDescriptions['distribution']['desc'];?>">Distribution</th>
@ -174,9 +164,7 @@ if (!empty($event['Attribute'])):?>
</td>
<?php endif; ?>
<td class="short <?php echo $extra; ?>" title="<?php echo $typeDefinitions[$attribute['type']]['desc'];?>">
<?php echo h($attribute['type']);?>
</td>
<td class="showspaces <?php echo $extra; ?>"><?php $sigDisplay = $attribute['value'];
if ('attachment' == $attribute['type'] || 'malware-sample' == $attribute['type'] ) {
@ -207,8 +195,10 @@ if (!empty($event['Attribute'])):?>
$sigDisplay = str_replace("\r", '', $sigDisplay);
echo nl2br(h($sigDisplay));
}
?></td>
<td class="shortish <?php echo $extra; ?>">
?>
</td>
<td class="showspaces bitwider <?php echo $extra; ?>"><?php echo h($attribute['comment']); ?></td>
<td class="shortish <?php echo $extra; ?>">
<?php
$first = 0;
?>
@ -227,7 +217,7 @@ if (!empty($event['Attribute'])):?>
echo ' ';
}
}
?>&nbsp;
?>
</ul>
</td>
<td class="short <?php echo $extra; ?>"><?php echo $attribute['to_ids'] ? 'Yes' : 'No';?></td>
@ -305,6 +295,8 @@ if (!empty($event['Attribute'])):?>
<td class="short highlight2">
</td>
<td class="short highlight2">
</td>
<td class="short highlight2">
<?php
if ($shadowAttribute['to_ids'] != $attribute['to_ids']) echo $shadowAttribute['to_ids'] ? 'Yes' : 'No';
?>
@ -377,6 +369,8 @@ if (!empty($event['Attribute'])):?>
?></td>
<td class="short highlight2">
</td>
<td class="short highlight2">
</td>
<td class="short highlight2">
<?php
echo $remain['to_ids'] ? 'Yes' : 'No';
@ -399,6 +393,11 @@ if (!empty($event['Attribute'])):?>
<?php
endif; ?>
</div>
<div id="discussions_div">
<?php
echo $this->element('eventdiscussion');
?>
</div>
</div>
<script type="text/javascript">
// tooltips
@ -408,5 +407,38 @@ $(document).ready(function () {
'container' : 'body',
delay: { show: 500, hide: 100 }
});
$('#discussions_active').click(function() {
$('#discussions_div').hide();
$('#discussions_active').hide();
$('#discussions_inactive').show();
});
$('#discussions_inactive').click(function() {
$('#discussions_div').show();
$('#discussions_active').show();
$('#discussions_inactive').hide();
});
$('#attributes_active').click(function() {
$('#attributes_div').hide();
$('#attributes_active').hide();
$('#attributes_inactive').show();
});
$('#attributes_inactive').click(function() {
$('#attributes_div').show();
$('#attributes_active').show();
$('#attributes_inactive').hide();
});
$('#pivots_active').click(function() {
$('#pivots_div').hide();
$('#pivots_active').hide();
$('#pivots_inactive').show();
});
$('#pivots_inactive').click(function() {
$('#pivots_div').show();
$('#pivots_active').show();
$('#pivots_inactive').hide();
});
});
</script>

View File

@ -31,4 +31,5 @@ You can for example ask: /events/index/limit:999.xml to get the 999 first record
To export all the events at once, with their attributes, use the export functionality.
-->
-->

View File

@ -0,0 +1,30 @@
<?php
App::uses('AppHelper', 'View/Helper');
//this helper simply replaces quotes between [QUOTE][/QUOTE] with div tags.
class CommandHelper extends AppHelper {
public function convertQuotes($string){
$string = str_ireplace('[QUOTE]', '<div class="quote">', $string);
$string = str_ireplace('[/QUOTE]', '</div>', $string);
$matches = array();
while (preg_match ('%\[event\](.*?)\[/event\]%is', $string, $matches)) {
if (!empty($matches) && is_numeric($matches[1])) {
$string = preg_replace('%\[event\]' . $matches[1] . '\[/event\]%i', '<a href=/events/view/' . $matches[1] . '> Event ' . $matches[1] . '</a>', $string);
} else {
$string = preg_replace('%\[event\]' . $matches[1] . '\[/event\]%i', '%Malformed_Event_Link%', $string);
}
}
$matches = array();
while (preg_match ('%\[thread\](.*?)\[/thread\]%is', $string, $matches)) {
if (!empty($matches) && is_numeric($matches[1])) {
$string = preg_replace('%\[thread\]' . $matches[1] . '\[/thread\]%i', '<a href=/threads/view/' . $matches[1] . '> Thread ' . $matches[1] . '</a>', $string);
} else {
$string = preg_replace('%\[event\]' . $matches[1] . '\[/event\]%i', '%Malformed_Thread_Link%', $string);
}
$matches = array();
}
return $string;
}
}
?>

View File

@ -49,16 +49,7 @@
<?php
if (Configure::read('debug') == 0) echo "style=\"padding-top:100px;\"";
?>
>
<?php
// Add locations here that should not have a breadrumb displayed
// If we get an error, also, we don't want the breadcrumbs shown
if ($this->params['action'] !== 'login' && $this->response->statusCode() < '400'):
?>
<?php
endif;
?>
>
<?php echo $this->fetch('content'); ?>
</div>
<?php
@ -70,6 +61,10 @@
echo $this->Html->script('main');
?>
</div>
<div class="loading">
<div class="spinner"></div>
<div class="loadingText">Loading</div>
</div>
<script type="text/javascript">
$(window).scroll(function(e) {
$('.actions').css('left',-$(window).scrollLeft());

View File

@ -92,18 +92,11 @@
</ul>
</div>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<?php
if ($isSearch == 1){
$searchClass = 'class="active"';
$listClass = '';
} else {
$searchClass = '';
$listClass = 'class="active"';
}
?>
<li <?php echo $listClass;?>><?php echo $this->Html->link('List Logs', array('admin' => true, 'action' => 'index'));?></li>
<li <?php echo $searchClass;?>><?php echo $this->Html->link('Search Logs', array('admin' => true, 'action' => 'search'));?></li>
</ul>
</div>
<?php
if ($isSearch == 1){
$class = 'search';
} else {
$class = 'index';
}
echo $this->element('side_menu', array('menuList' => 'logs', 'menuItem' => $class));
?>

View File

@ -21,38 +21,6 @@ echo $this->Form->button('Search', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<script type="text/javascript">
var formInfoValues = new Array();
<?php
foreach ($actionDefinitions as $action => $def) {
$info = isset($def['formdesc']) ? $def['formdesc'] : $def['desc'];
echo "formInfoValues['$action'] = \"$info\";\n";
}
$this->Js->get('#LogAction')->event('change', 'showFormInfo("#LogAction")');
echo $this->element('side_menu', array('menuList' => 'logs', 'menuItem' => 'search'));
?>
formInfoValues['ALL'] = '';
function showFormInfo(id) {
idDiv = id+'Div';
// LATER use nice animations
//$(idDiv).hide('fast');
// change the content
var value = $(id).val(); // get the selected value
$(idDiv).html(formInfoValues[value]); // search in a lookup table
// show it again
$(idDiv).fadeIn('slow');
}
// hide the formInfo things
$('#LogActionDiv').hide();
</script>
<?php echo $this->Js->writeBuffer(); ?>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li ><?php echo $this->Html->link('List Logs', array('admin' => true, 'action' => 'index'));?></li>
<li class="active"><?php echo $this->Html->link('Search Logs', array('admin' => true, 'action' => 'search'));?></li>
</ul>
</div>

View File

@ -49,33 +49,8 @@
</ul>
</div>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><a href="/events/view/<?php echo $eventId;?>">View Event</a></li>
<li class="active"><a href="/logs/event_index/<?php echo $eventId;?>">View Event History</a></li>
<?php if ($isSiteAdmin || $mayModify): ?>
<li><a href="/events/edit/<?php echo $eventId;?>">Edit Event</a></li>
<li><?php echo $this->Form->postLink('Delete Event', array('controller' => 'events', 'action' => 'delete', $eventId), null, __('Are you sure you want to delete # %s?', $eventId)); ?></li>
<li class="divider"></li>
<li><a href="/attributes/add/<?php echo $eventId;?>">Add Attribute</a></li>
<li><a href="/attributes/add_attachment/<?php echo $eventId;?>">Add Attachment</a></li>
<li><a href="/events/addIOC/<?php echo $eventId;?>">Populate from IOC</a></li>
<li><a href="/attributes/add_threatconnect/<?php echo $eventId; ?>">Populate from ThreatConnect</a></li>
<?php else: ?>
<li><a href="/shadow_attributes/add/<?php echo $eventId;?>">Propose Attribute</a></li>
<li><a href="/shadow_attributes/add_attachment/<?php echo $eventId;?>">Propose Attachment</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/events/contact/<?php echo $eventId;?>">Contact Reporter</a></li>
<li><a href="/events/xml/download/<?php echo $eventId;?>">Download as XML</a></li>
<?php if ($published): ?>
<li><a href="/events/downloadOpenIOCEvent/<?php echo $eventId;?>">Download as IOC</a></li>
<li><a href="/events/csv/download/<?php echo $eventId;?>">Download as CSV</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif; ?>
</ul>
</div>
<?php
// We mimic the $event from some other views to pass the ID back to the sidemenu
$event['Event']['id'] = $eventId;
echo $this->element('side_menu', array('menuList' => 'event', 'event' => $event, 'menuItem' => 'eventLog'));
?>

View File

@ -15,4 +15,7 @@ if (!$isSiteAdmin) exit();
<li><a href="/events/generateCorrelation">generateCorrelation</a></li>
<li><a href="/events/generateLocked">generateLocked</a> (This is for upgrading to hotfix 2.1.8 or later, all events that were created by an organisation that doesn't have users on this instance, or only has a single sync user will have their locked setting set to 1)</li>
</ul>
</div>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'adminTools'));
?>

66
app/View/Posts/add.ctp Normal file
View File

@ -0,0 +1,66 @@
<div class="posts form">
<?php echo $this->Form->create('Post');?>
<fieldset>
<legend>Add Post</legend>
<?php
$quote = '';
// If it is a new thread, let the user enter a subject
if (empty($thread_id) && empty($target_type)) {
echo $this->Form->input('title', array(
'label' => 'Thread Subject',
'class' => 'input-xxlarge'
));
} else {
echo $this->Form->input('title', array(
'label' => 'Thread Subject',
'class' => 'input-xxlarge',
'disabled' => 'true',
'default' => $title
));
}
if ($target_type === 'post') {
echo $this->Form->input('responseTo', array(
'label' => 'In response to',
'type' => 'textarea',
'div' => 'input clear',
'class' => 'input-xxlarge',
'disabled' => 'true',
'default' => h($previous)
));
$quote = '[QUOTE]' . $previous . '[/QUOTE]' . "\n";
}
?>
<div class="input clear">
<button type="button" title="Insert a quote - just paste your quote between the [quote][/quote] tags." class="toggle-left btn btn-inverse qet" id = "quote" onclick="insertQuote()">Quote</button>
<button type="button" title="Insert a link to an event - just enter the event ID between the [event][/event] tags." class="toggle btn btn-inverse qet" id = "event" onclick="insertEvent()">Event</button>
<button type="button" title="Insert a link to a discussion thread - enter the thread's ID between the [thread][/thread] tags." class="toggle-right btn btn-inverse qet" id = "thread" onclick="insertThread()">Thread</button>
</div>
<?php
echo $this->Form->input('message', array(
'label' => false,
'type' => 'textarea',
'div' => 'input clear',
'class' => 'input-xxlarge',
'default' => h($quote)
));
?>
</fieldset>
<script type="text/javascript">
function insertQuote() {
document.getElementById("PostMessage").value+="[Quote][/Quote]";
}
function insertEvent() {
document.getElementById("PostMessage").value+="[Event][/Event]";
}
function insertThread() {
document.getElementById("PostMessage").value+="[Thread][/Thread]";
}
</script>
<?php
echo $this->Form->button('Submit', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'threads', 'menuItem' => 'add'));
?>

27
app/View/Posts/edit.ctp Normal file
View File

@ -0,0 +1,27 @@
<div class="posts form">
<?php echo $this->Form->create('Post');?>
<fieldset>
<legend>Edit Post</legend>
<?php
echo $this->Form->input('title', array(
'label' => 'Thread Subject',
'class' => 'input-xxlarge',
'disabled' => 'true',
'default' => $title
));
echo $this->Form->input('contents', array(
'type' => 'textarea',
'div' => 'input clear',
'class' => 'input-xxlarge',
'default' => $contents
));
?>
</fieldset>
<?php
echo $this->Form->button('Submit', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'threads', 'menuItem' => 'edit'));
?>

View File

@ -33,10 +33,6 @@ echo $this->Form->button('Add', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('List Regexp', array('admin' => true, 'action' => 'index'));?></li>
<li class="active"><?php echo $this->Html->link('New Regexp', array('admin' => true, 'action' => 'add'));?></li>
<li><?php echo $this->Html->link('Perform on existing', array('admin' => true, 'action' => 'clean'));?></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'regexp', 'menuItem' => 'add'));
?>

View File

@ -43,17 +43,7 @@ echo $this->Form->button('Add', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<div class="actions">
<ul>
<?php
echo $this->element('side_menu', array('menuList' => 'regexp', 'menuItem' => 'edit', 'id' => $this->Form->value('Regexp.id')));
?>
</ul>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('List Regexp', array('admin' => true, 'action' => 'index'));?></li>
<li><?php echo $this->Html->link('New Regexp', array('admin' => true, 'action' => 'add'));?></li>
<li><?php echo $this->Html->link('Perform on existing', array('admin' => true, 'action' => 'clean'));?></li>
<li class="divider"></li>
<li><?php echo $this->Form->postLink('Delete Regexp', array('admin' => true, 'action' => 'delete', $this->Form->value('Regexp.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Regexp.id')));?></li>
</ul>
</div>

View File

@ -55,10 +55,6 @@ endforeach;?>
</ul>
</div>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li class="active"><?php echo $this->Html->link('List Regexp', array('admin' => true, 'action' => 'index'));?></li>
<li><?php echo $this->Html->link('New Regexp', array('admin' => true, 'action' => 'add'));?></li>
<li><?php echo $this->Html->link('Perform on existing', array('admin' => true, 'action' => 'clean'));?></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'regexp', 'menuItem' => 'index'));
?>

View File

@ -49,8 +49,6 @@ endforeach;?>
</ul>
</div>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li class="active"><?php echo $this->Html->link('List Regexp', array('action' => 'index'));?></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'regexp', 'menuItem' => 'index'));
?>

View File

@ -6,41 +6,30 @@
echo $this->Form->input('name');?>
<?php echo $this->Form->input('permission', array('type' => 'select', 'options' => $options), array('value' => '3'));?>
<div class = 'input clear'></div>
<?php echo $this->Form->input('perm_sync', array(
'type' => 'checkbox',
'checked' => false,
));?>
<?php echo $this->Form->input('perm_sync', array('type' => 'checkbox', 'checked' => false));?>
<?php echo $this->Form->input('perm_admin', array('type' => 'checkbox', 'checked' => false));?>
<?php echo $this->Form->input('perm_audit', array('type' => 'checkbox', 'checked' => false));?>
<div class = 'input clear'></div>
<?php echo $this->Form->input('perm_auth', array('type' => 'checkbox', 'checked' => false));?>
<?php echo $this->Form->input('perm_site_admin', array('type' => 'checkbox', 'checked' => false));?>
<?php echo $this->Form->input('perm_regexp_access', array('type' => 'checkbox', 'checked' => false));?>
</fieldset>
<?php
echo $this->Form->button('Add', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('New User', array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?> </li>
<li><?php echo $this->Html->link('List Users', array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?> </li>
<li class="divider"></li>
<?php if ($isSiteAdmin): ?>
<li class="active"><?php echo $this->Html->link('New Role', array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?> </li>
<?php endif; ?>
<li><?php echo $this->Html->link('List Roles', array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?> </li>
<?php if ($isSiteAdmin): ?>
<li class="divider"></li>
<li><?php echo $this->Html->link('Contact users', array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?> </li>
<?php endif; ?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'addRole'));
<?php
$this->Js->get('#RolePermission')->event('change', 'deactivateActions()');
$this->Js->get('#RolePermission')->event('change', 'deactivateActions()');
$this->Js->get('#RolePermSync')->event('change', 'checkPerms("RolePermSync")');
$this->Js->get('#RolePermAdmin')->event('change', 'checkPerms("RolePermAdmin")');
$this->Js->get('#RolePermAudit')->event('change', 'checkPerms("RolePermAudit")');
$this->Js->get('#RolePermSiteAdmin')->event('change', 'checkPerms("RolePermSiteAdmin");activateAll();');
$this->Js->get('#RolePermRegexpAccess')->event('change', 'checkPerms("RolePermRegexpAccess")');
?>
<script type="text/javascript">
@ -52,6 +41,18 @@ function deactivateActions() {
document.getElementById("RolePermSync").checked = false;
document.getElementById("RolePermAdmin").checked = false;
document.getElementById("RolePermAudit").checked = false;
document.getElementById("RolePermSiteAdmin").checked = false;
document.getElementById("RolePermRegexpAccess").checked = false;
}
}
function activateAll() {
if (document.getElementById("RolePermSiteAdmin").checked) {
document.getElementById("RolePermSync").checked = true;
document.getElementById("RolePermAdmin").checked = true;
document.getElementById("RolePermAudit").checked = true;
document.getElementById("RolePermAuth").checked = true;
document.getElementById("RolePermRegexpAccess").checked = true;
}
}

View File

@ -14,28 +14,14 @@
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('New User', array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?> </li>
<li><?php echo $this->Html->link('List Users', array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?> </li>
<li class="divider"></li>
<?php if ($isSiteAdmin): ?>
<li><?php echo $this->Html->link('New Role', array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?> </li>
<?php endif; ?>
<li><?php echo $this->Html->link('List Roles', array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?> </li>
<?php if ($isSiteAdmin): ?>
<li class="divider"></li>
<li><?php echo $this->Html->link('Contact users', array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?> </li>
<?php endif; ?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'editRole'));
<?php
$this->Js->get('#RolePermission')->event('change', 'deactivateActions()');
$this->Js->get('#RolePermSync')->event('change', 'checkPerms("RolePermSync")');
$this->Js->get('#RolePermAdmin')->event('change', 'checkPerms("RolePermAdmin")');
$this->Js->get('#RolePermAudit')->event('change', 'checkPerms("RolePermAudit")');
$this->Js->get('#RolePermission')->event('change', 'deactivateActions()');
$this->Js->get('#RolePermSync')->event('change', 'checkPerms("RolePermSync")');
$this->Js->get('#RolePermAdmin')->event('change', 'checkPerms("RolePermAdmin")');
$this->Js->get('#RolePermAudit')->event('change', 'checkPerms("RolePermAudit")');
?>
<script type="text/javascript">

View File

@ -22,9 +22,11 @@
<th><?php echo $this->Paginator->sort('name');?></th>
<th><?php echo $this->Paginator->sort('permission', 'Permission');?></th>
<th><?php echo $this->Paginator->sort('perm_sync', 'Sync Actions');?></th>
<th><?php echo $this->Paginator->sort('perm_admin', 'Administration Actions');?></th>
<th><?php echo $this->Paginator->sort('perm_audit', 'Audit Actions');?></th>
<th><?php echo $this->Paginator->sort('perm_regexp', 'Regexp Actions');?></th>
<th><?php echo $this->Paginator->sort('perm_auth', 'Auth Key Access');?></th>
<th><?php echo $this->Paginator->sort('perm_admin', 'Admin');?></th>
<th><?php echo $this->Paginator->sort('perm_site_admin', 'Site Admin');?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr><?php
foreach ($list as $item): ?>
@ -33,9 +35,11 @@ foreach ($list as $item): ?>
<td><?php echo h($item['Role']['name']); ?>&nbsp;</td>
<td class="short"><?php echo h($options[$item['Role']['permission']]); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_sync']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_admin']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_audit']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_regexp_access']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_auth']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_admin']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_site_admin']); ?>&nbsp;</td>
<td class="short action-links">
<?php echo $this->Html->link('', array('admin' => true, 'action' => 'edit', $item['Role']['id']), array('class' => 'icon-edit', 'title' => 'Edit')); ?>
<?php echo $this->Form->postLink('', array('admin' => true, 'action' => 'delete', $item['Role']['id']), array('class' => 'icon-trash', 'title' => 'Delete'), __('Are you sure you want to delete %s?', $item['Role']['name'])); ?>
@ -61,18 +65,6 @@ endforeach; ?>
</div>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('New User', array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?> </li>
<li><?php echo $this->Html->link('List Users', array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?> </li>
<li class="divider"></li>
<?php if ($isSiteAdmin): ?>
<li><?php echo $this->Html->link('New Role', array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?> </li>
<?php endif; ?>
<li class="active"><?php echo $this->Html->link('List Roles', array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?> </li>
<?php if ($isSiteAdmin): ?>
<li class="divider"></li>
<li><?php echo $this->Html->link('Contact users', array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?> </li>
<?php endif; ?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'indexRole'));
?>

View File

@ -22,9 +22,11 @@
<th><?php echo $this->Paginator->sort('name');?></th>
<th><?php echo $this->Paginator->sort('permission', 'Permission');?></th>
<th><?php echo $this->Paginator->sort('perm_sync', 'Sync Actions');?></th>
<th><?php echo $this->Paginator->sort('perm_admin', 'Administration Actions');?></th>
<th><?php echo $this->Paginator->sort('perm_audit', 'Audit Actions');?></th>
<th><?php echo $this->Paginator->sort('perm_regexp', 'Regexp Actions');?></th>
<th><?php echo $this->Paginator->sort('perm_auth', 'Auth Key Access');?></th>
<th><?php echo $this->Paginator->sort('perm_admin', 'Administration Actions');?></th>
<th><?php echo $this->Paginator->sort('perm_site_admin', 'Site Admin');?></th>
</tr><?php
foreach ($list as $item): ?>
<tr>
@ -32,9 +34,11 @@ foreach ($list as $item): ?>
<td><?php echo h($item['Role']['name']); ?>&nbsp;</td>
<td class="short"><?php echo h($options[$item['Role']['permission']]); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_sync']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_admin']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_audit']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_regexp_access']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_auth']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_admin']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_site_admin']); ?>&nbsp;</td>
</tr><?php
endforeach; ?>
</table>
@ -55,18 +59,6 @@ endforeach; ?>
</ul>
</div>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('New User', array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?> </li>
<li><?php echo $this->Html->link('List Users', array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?> </li>
<li class="divider"></li>
<?php if ($isSiteAdmin): ?>
<li><?php echo $this->Html->link('New Role', array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?> </li>
<?php endif; ?>
<li class="active"><?php echo $this->Html->link('List Roles', array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?> </li>
<?php if ($isSiteAdmin): ?>
<li class="divider"></li>
<li><?php echo $this->Html->link('Contact users', array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?> </li>
<?php endif; ?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'indexRole'));
?>

View File

@ -26,30 +26,28 @@
<?php echo h($role['Role']['perm_publish']); ?>
&nbsp;
</dd>
<dt><?php echo __('Full'); ?></dt>
<dd>
<?php echo h($role['Role']['perm_full']); ?>
&nbsp;
</dd>
<dt><?php echo __('Auth'); ?></dt>
<dd>
<?php echo h($role['Role']['perm_auth']); ?>
&nbsp;
</dd>
<dt><?php echo __('Regexp'); ?></dt>
<dd>
<?php echo h($role['Role']['perm_regexp_access']); ?>
&nbsp;
</dd>
<dt><?php echo __('Admin'); ?></dt>
<dd>
<?php echo h($role['Role']['perm_admin']); ?>
&nbsp;
</dd>
<dt><?php echo __('Site Admin'); ?></dt>
<dd>
<?php echo h($role['Role']['perm_site_admin']); ?>
&nbsp;
</dd>
</dl>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('New User', array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?> </li>
<li><?php echo $this->Html->link('List Users', array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?> </li>
<li class="divider"></li>
<?php if ($isSiteAdmin): ?>
<li><?php echo $this->Html->link('New Role', array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?> </li>
<?php endif; ?>
<li><?php echo $this->Html->link('List Roles', array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?> </li>
<?php if ($isSiteAdmin): ?>
<li class="divider"></li>
<li><?php echo $this->Html->link('Contact users', array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?> </li>
<?php endif; ?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'indexRole'));
?>

View File

@ -5,23 +5,27 @@
<?php
echo $this->Form->input('url', array(
'label' => 'Base URL',
'after' => $this->Html->div('forminfo', 'The base-url to the external server you want to sync with.<br/>Example: <i>https://foo.sig.mil.be</i>'),
));
?>
<div class = "input clear"></div>
<?php
echo $this->Form->input('organization', array(
'label' => 'Organization',
'after' => $this->Html->div('forminfo', 'The organization having the external server you want to sync with.<br/>Example: <i>BE</i>'),
));
echo $this->Form->input('authkey', array(
'after' => $this->Html->div('forminfo', 'You can find the authentication key on your profile on the external server.'),
));
?>
?>
<div class = "input clear"></div>
<?php
echo $this->Form->input('push', array(
'after' => $this->Html->div('forminfo', 'Allow the <em>upload</em> of events and their attributes.'),
<?php
echo $this->Form->input('authkey', array(
));
?>
<div class = "input clear"></div>
<?php
echo $this->Form->input('push', array(
));
?>
<div class = "input clear"></div>
<?php
echo $this->Form->input('pull', array(
'after' => $this->Html->div('forminfo', 'Allow the <em>download</em> of events and their attributes from the server.'),
));
?>
</fieldset>
@ -30,10 +34,34 @@ echo $this->Form->button('Add', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('List Servers', array('controller' => 'servers', 'action' => 'index'));?></li>
<li class="active"><?php if ($isAclAdd && $me['org'] == 'ADMIN') echo $this->Html->link(__('New Server'), array('controller' => 'servers', 'action' => 'add')); ?></li>
<?php
echo $this->element('side_menu', array('menuList' => 'sync', 'menuItem' => 'add'));
?>
</ul>
</div>
<script type="text/javascript">
//
var formInfoValues = {
'ServerUrl' : "The base-url to the external server you want to sync with. Example: https://foo.sig.mil.be",
'ServerOrganization' : "The organization having the external server you want to sync with. Example: BE",
'ServerAuthkey' : "You can find the authentication key on your profile on the external server.",
'ServerPush' : "Allow the upload of events and their attributes.",
'ServerPull' : "Allow the download of events and their attributes from the server.",
};
$(document).ready(function() {
$("#ServerUrl, #ServerOrganization, #ServerAuthkey, #ServerPush, #ServerPull").on('mouseleave', function(e) {
$('#'+e.currentTarget.id).popover('destroy');
});
$("#ServerUrl, #ServerOrganization, #ServerAuthkey, #ServerPush, #ServerPull").on('mouseover', function(e) {
var $e = $(e.target);
$('#'+e.currentTarget.id).popover('destroy');
$('#'+e.currentTarget.id).popover({
trigger: 'focus',
placement: 'right',
content: formInfoValues[e.currentTarget.id],
}).popover('show');
});
});
</script>

View File

@ -3,38 +3,67 @@
<fieldset>
<legend>Edit Server</legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('url', array(
'label' => 'Base URL',
'before' => $this->Html->div('forminfo', 'The base-url to the external server you want to sync with.<br/>Example: <i>https://foo.sig.mil.be</i>'),
));
?>
<div class = "input clear"></div>
<?php
echo $this->Form->input('organization', array(
'label' => 'Organization',
'before' => $this->Html->div('forminfo', 'The organization having the external server you want to sync with.<br/>Example: <i>BE</i>'),
));
?>
<div class = "input clear"></div>
<?php
echo $this->Form->input('authkey', array(
'before' => $this->Html->div('forminfo', 'You can find the authentication key on your profile on the external server.'),
));
?>
<div class = "input clear"></div>
<?php
echo $this->Form->input('push', array(
'div' => 'input clear',
'before' => $this->Html->div('forminfo', 'Allow the <em>upload</em> of events and their attributes.'),
));
?>
<div class = "input clear"></div>
<?php
echo $this->Form->input('pull', array(
'before' => $this->Html->div('forminfo', 'Allow the <em>download</em> of events and their attributes from the server.'),
));
?>
</fieldset>
<?php
echo $this->Form->button('Edit', array('class' => 'btn btn-primary'));
echo $this->Form->end();
$id = $this->Form->value('Server.id');
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('List Servers', array('controller' => 'servers', 'action' => 'index'));?></li>
<li><?php if ($isAclAdd && $me['org'] == 'ADMIN') echo $this->Html->link(__('New Server'), array('controller' => 'servers', 'action' => 'add')); ?></li>
<li class="divider"></li>
<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Server.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Server.id'))); ?></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'sync', 'menuItem' => 'edit'));
?>
<script type="text/javascript">
//
var formInfoValues = {
'ServerUrl' : "The base-url to the external server you want to sync with. Example: https://foo.sig.mil.be",
'ServerOrganization' : "The organization having the external server you want to sync with. Example: BE",
'ServerAuthkey' : "You can find the authentication key on your profile on the external server.",
'ServerPush' : "Allow the upload of events and their attributes.",
'ServerPull' : "Allow the download of events and their attributes from the server.",
};
$(document).ready(function() {
$("#ServerUrl, #ServerOrganization, #ServerAuthkey, #ServerPush, #ServerPull").on('mouseleave', function(e) {
$('#'+e.currentTarget.id).popover('destroy');
});
$("#ServerUrl, #ServerOrganization, #ServerAuthkey, #ServerPush, #ServerPull").on('mouseover', function(e) {
var $e = $(e.target);
$('#'+e.currentTarget.id).popover('destroy');
$('#'+e.currentTarget.id).popover({
trigger: 'focus',
placement: 'right',
content: formInfoValues[e.currentTarget.id],
}).popover('show');
});
});
</script>

View File

@ -48,14 +48,14 @@ foreach ($servers as $server): ?>
<td class="short"><?php echo $server['Server']['lastpushedid']; ?></td>
<td class="short action-links">
<?php
if ($server['Server']['pull'] && $me['org'] == 'ADMIN')
if ($server['Server']['pull'] && $isSiteAdmin)
echo $this->Html->link('', array('action' => 'pull', $server['Server']['id'], 'full'), array('class' => 'icon-download', 'title' => 'Pull all'));
if ($server['Server']['push'] && $me['org'] == 'ADMIN')
if ($server['Server']['push'] && $isSiteAdmin)
echo $this->Html->link('', array('action' => 'push', $server['Server']['id'], 'full'), array('class' => 'icon-upload', 'title' => 'Push all'));
?>
&nbsp;
<?php
$mayModify = ($me['org'] == 'ADMIN' || $me['org'] == $server['Server']['organization']) || ($isAdmin && ($server['Server']['organization'] == $me['org']));
$mayModify = ($isSiteAdmin || $me['org'] == $server['Server']['organization']) || ($isAdmin && ($server['Server']['organization'] == $me['org']));
if ($mayModify) echo $this->Html->link('', array('action' => 'edit', $server['Server']['id']), array('class' => 'icon-edit', 'title' => 'Edit'));
if ($mayModify) echo $this->Form->postLink('', array('action' => 'delete', $server['Server']['id']), array('class' => 'icon-trash', 'title' => 'Delete'), __('Are you sure you want to delete # %s?', $server['Server']['id']));
?>
@ -83,9 +83,6 @@ endforeach; ?>
</div>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li class="active"><?php echo $this->Html->link('List Servers', array('controller' => 'servers', 'action' => 'index'));?></li>
<li><?php if ($isAclAdd && $me['org'] == 'ADMIN') echo $this->Html->link('New Server', array('controller' => 'servers', 'action' => 'add')); ?></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'sync', 'menuItem' => 'index'));
?>

View File

@ -22,9 +22,6 @@ else:?>
<?php
endif;?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li class="active"><?php echo $this->Html->link('List Servers', array('controller' => 'servers', 'action' => 'index'));?></li>
<li><?php if ($isAclAdd && $me['org'] == 'ADMIN') echo $this->Html->link('New Server', array('controller' => 'servers', 'action' => 'add')); ?></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'sync', 'menuItem' => 'pull'));
?>

View File

@ -22,9 +22,7 @@ else:?>
<?php
endif;?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li class="active"><?php echo $this->Html->link('List Servers', array('controller' => 'servers', 'action' => 'index'));?></li>
<li><?php if ($isAclAdd && $me['org'] == 'ADMIN') echo $this->Html->link('New Server', array('controller' => 'servers', 'action' => 'add')); ?></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'sync', 'menuItem' => 'push'));
?>

View File

@ -39,22 +39,10 @@
echo $this->Form->end();
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('View Event', array('controller' => 'events', 'action' => 'view', $this->request->data['ShadowAttribute']['event_id'])); ?> </li>
<li class="active"><?php echo $this->Html->link('Propose Attribute', array('controller' => 'shadow_attributes', 'action' => 'add', $this->request->data['ShadowAttribute']['event_id']));?> </li>
<li><?php echo $this->Html->link('Propose Attachment', array('controller' => 'shadow_attributes', 'action' => 'add_attachment', $this->request->data['ShadowAttribute']['event_id']));?> </li>
<li class="divider"></li>
<li><?php echo $this->Html->link('Contact reporter', array('controller' => 'events', 'action' => 'contact', $this->request->data['ShadowAttribute']['event_id'])); ?> </li>
<li><?php echo $this->Html->link('Download as XML', array('controller' => 'events', 'action' => 'xml', 'download', $this->request->data['ShadowAttribute']['event_id'])); ?></li>
<li><?php echo $this->Html->link('Download as IOC', array('controller' => 'events', 'action' => 'downloadOpenIOCEvent', $this->request->data['ShadowAttribute']['event_id'])); ?> </li>
<li class="divider"></li>
<li><?php echo $this->Html->link('List Events', array('controller' => 'events', 'action' => 'index')); ?></li>
<?php if ($isAclAdd): ?>
<li><?php echo $this->Html->link('Add Event', array('controller' => 'events', 'action' => 'add')); ?></li>
<?php endif; ?>
</ul>
</div>
<?php
$event['Event']['id'] = $this->request->data['ShadowAttribute']['event_id'];
echo $this->element('side_menu', array('menuList' => 'event', 'menuItem' => 'proposeAttribute', 'event' => $event));
?>
<script type="text/javascript">
//
//Generate Category / Type filtering array
@ -87,43 +75,30 @@ function formCategoryChanged(id) {
$(document).ready(function() {
$("#ShadowAttributeType, #ShadowAttributeCategory, #ShadowAttribute, #ShadowAttributeDistribution").on('mouseleave', function(e) {
$("#ShadowAttributeType, #ShadowAttributeCategory, #ShadowAttribute").on('mouseleave', function(e) {
$('#'+e.currentTarget.id).popover('destroy');
});
$("#ShadowAttributeType, #ShadowAttributeCategory, #ShadowAttribute, #ShadowAttributeDistribution").on('mouseover', function(e) {
$("#ShadowAttributeType, #ShadowAttributeCategory, #ShadowAttribute").on('mouseover', function(e) {
var $e = $(e.target);
if ($e.is('option')) {
$('#'+e.currentTarget.id).popover('destroy');
$('#'+e.currentTarget.id).popover({
trigger: 'manual',
trigger: 'focus',
placement: 'right',
content: formInfoValues[$e.val()],
}).popover('show');
}
});
$("input, label").on('mouseleave', function(e) {
$('#'+e.currentTarget.id).popover('destroy');
});
$("input, label").on('mouseover', function(e) {
var $e = $(e.target);
$('#'+e.currentTarget.id).popover('destroy');
$('#'+e.currentTarget.id).popover({
trigger: 'manual',
placement: 'right',
}).popover('show');
});
// workaround for browsers like IE and Chrome that do now have an onmouseover on the 'options' of a select.
// disadvangate is that user needs to click on the item to see the tooltip.
// no solutions exist, except to generate the select completely using html.
$("#ShadowAttributeType, #ShadowAttributeCategory, #ShadowAttribute, #ShadowAttributeDistribution").on('change', function(e) {
$("#ShadowAttributeType, #ShadowAttributeCategory, #ShadowAttribute").on('change', function(e) {
var $e = $(e.target);
$('#'+e.currentTarget.id).popover('destroy');
$('#'+e.currentTarget.id).popover({
trigger: 'manual',
trigger: 'focus',
placement: 'right',
content: formInfoValues[$e.val()],
}).popover('show');

View File

@ -4,11 +4,7 @@
<legend><?php echo __('Add Attachment'); ?></legend>
<?php
echo $this->Form->hidden('event_id');
echo $this->Form->input('category', array(
'after' => $this->Html->div('forminfo', '', array('id' => 'ShadowAttributeCategoryDiv')),
'empty' => '(choose one)',
'div' => 'input'
));
echo $this->Form->input('category');
?>
<div class="input clear">
<?php
@ -24,11 +20,6 @@
'type' => 'checkbox',
'checked' => false,
));
?>
<div class="forminfo input clear">
Tick this box to neutralize the sample. Every malware sample will be zipped with the password "infected"
</div>
<?php
// link an onchange event to the form elements
$this->Js->get('#ShadowAttributeType')->event('change', 'showFormInfo("#ShadowAttributeType")');
$this->Js->get('#ShadowAttributeCategory')->event('change', 'showFormInfo("#ShadowAttributeCategory")');
@ -39,116 +30,78 @@
echo $this->Form->end();
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('View Event', array('controller' => 'events', 'action' => 'view', $this->request->data['ShadowAttribute']['event_id'])); ?> </li>
<li><?php echo $this->Html->link('Propose Attribute', array('controller' => 'shadow_attributes', 'action' => 'add', $this->request->data['ShadowAttribute']['event_id']));?> </li>
<li class="active"><?php echo $this->Html->link('Propose Attachment', array('controller' => 'shadow_attributes', 'action' => 'add_attachment', $this->request->data['ShadowAttribute']['event_id']));?> </li>
<li class="divider"></li>
<li><?php echo $this->Html->link('Contact reporter', array('controller' => 'events', 'action' => 'contact', $this->request->data['ShadowAttribute']['event_id'])); ?> </li>
<li><?php echo $this->Html->link('Download as XML', array('controller' => 'events', 'action' => 'xml', 'download', $this->request->data['ShadowAttribute']['event_id'])); ?></li>
<li><?php echo $this->Html->link('Download as IOC', array('controller' => 'events', 'action' => 'downloadOpenIOCEvent', $this->request->data['ShadowAttribute']['event_id'])); ?> </li>
<li class="divider"></li>
<li><?php echo $this->Html->link('List Events', array('controller' => 'events', 'action' => 'index')); ?></li>
<?php if ($isAclAdd): ?>
<li><?php echo $this->Html->link('Add Event', array('controller' => 'events', 'action' => 'add')); ?></li>
<?php endif; ?>
</ul>
</div>
<?php
$event['Event']['id'] = $this->request->data['ShadowAttribute']['event_id'];
echo $this->element('side_menu', array('menuList' => 'event', 'menuItem' => 'proposeAttachment', 'event' => $event));
?>
<script type="text/javascript">
$(document).ready(function() {
$("#ShadowAttributeCategory, #ShadowAttribute").on('mouseleave', function(e) {
$('#'+e.currentTarget.id).popover('destroy');
});
$("#ShadowAttributeCategory, #ShadowAttribute").on('mouseover', function(e) {
var $e = $(e.target);
if ($e.is('option')) {
$('#'+e.currentTarget.id).popover('destroy');
$('#'+e.currentTarget.id).popover({
trigger: 'focus',
placement: 'right',
content: formInfoValues[$e.val()],
}).popover('show');
}
});
// workaround for browsers like IE and Chrome that do now have an onmouseover on the 'options' of a select.
// disadvangate is that user needs to click on the item to see the tooltip.
// no solutions exist, except to generate the select completely using html.
$("#ShadowAttributeCategory, #ShadowAttribute").on('change', function(e) {
var $e = $(e.target);
$('#'+e.currentTarget.id).popover('destroy');
$('#'+e.currentTarget.id).popover({
trigger: 'focus',
placement: 'right',
content: formInfoValues[$e.val()],
}).popover('show');
});
});
//
//Generate tooltip information
//
var formInfoValues = new Array();
<?php
foreach ($typeDefinitions as $type => $def) {
$info = isset($def['formdesc']) ? $def['formdesc'] : $def['desc'];
echo "formInfoValues['" . addslashes($type) . "'] = \"" . addslashes($info) . "\";\n"; // as we output JS code we need to add slashes
}
foreach ($categoryDefinitions as $category => $def) {
$info = isset($def['formdesc']) ? $def['formdesc'] : $def['desc'];
echo "formInfoValues['$category'] = \"$info\";\n";
echo "formInfoValues['" . addslashes($category) . "'] = \"" . addslashes($info) . "\";\n"; // as we output JS code we need to add slashes
}
?>
var formZipTypeValues = new Array();
<?php
foreach ($categoryDefinitions as $category => $def) {
$types = $def['types'];
$alreadySet = false;
foreach ($types as $type) {
if (in_array($type, $zippedDefinitions) && !$alreadySet) {
$alreadySet = true;
echo "formZipTypeValues['$category'] = \"true\";\n";
}
}
if (!$alreadySet) {
echo "formZipTypeValues['$category'] = \"false\";\n";
}
}
?>
var formAttTypeValues = new Array();
<?php
foreach ($categoryDefinitions as $category => $def) {
$types = $def['types'];
$alreadySet = false;
foreach ($types as $type) {
if (in_array($type, $uploadDefinitions) && !$alreadySet) {
$alreadySet = true;
echo "formAttTypeValues['$category'] = \"true\";\n";
}
}
if (!$alreadySet) {
echo "formAttTypeValues['$category'] = \"false\";\n";
}
}
?>
function showFormType(id) {
idDiv = id+'Div';
// LATER use nice animations
//$(idDiv).hide('fast');
// change the content
var value = $(id).val(); // get the selected value
//$(idDiv).html(formInfoValues[value]); // search in a lookup table
// do checkbox un/ticked when the document is changed
if (formZipTypeValues[value] == "true") {
document.getElementById("ShadowAttributeMalware").setAttribute("checked", "checked");
if (formAttTypeValues[value] == "false") document.getElementById("ShadowAttributeMalware").setAttribute("disabled", "disabled");
else document.getElementById("ShadowAttributeMalware").removeAttribute("disabled");
} else {
document.getElementById("ShadowAttributeMalware").removeAttribute("checked");
if (formAttTypeValues[value] == "true") document.getElementById("ShadowAttributeMalware").setAttribute("disabled", "disabled");
else document.getElementById("ShadowAttributeMalware").removeAttribute("disabled");
}
}
function showFormInfo(id) {
idDiv = id+'Div';
// LATER use nice animations
//$(idDiv).hide('fast');
// change the content
var value = $(id).val(); // get the selected value
$(idDiv).html(formInfoValues[value]); // search in a lookup table
var value = $(id).val(); // get the selected value
$(idDiv).html(formInfoValues[value]); // search in a lookup table
// show it again
$(idDiv).fadeIn('slow');
// do checkbox un/ticked when the document is changed
if (formZipTypeValues[value] == "true") {
document.getElementById("ShadowAttributeMalware").setAttribute("checked", "checked");
if (formAttTypeValues[value] == "false") document.getElementById("ShadowAttributeMalware").setAttribute("disabled", "disabled");
else document.getElementById("ShadowAttributeMalware").removeAttribute("disabled");
} else {
document.getElementById("ShadowAttributeMalware").removeAttribute("checked");
if (formAttTypeValues[value] == "true") document.getElementById("ShadowAttributeMalware").setAttribute("disabled", "disabled");
else document.getElementById("ShadowAttributeMalware").removeAttribute("disabled");
}
}
// hide the formInfo things
//hide the formInfo things
$('#ShadowAttributeTypeDiv').hide();
$('#ShadowAttributeCategoryDiv').hide();
$(function(){
// do checkbox un/ticked when the document is ready
showFormType("#ShadowAttributeCategory");
}
);
$('#ShadowAttributeType').prop('disabled', true);
</script>
<?php echo $this->Js->writeBuffer(); // Write cached scripts
<?php echo $this->Js->writeBuffer(); // Write cached scripts

View File

@ -24,9 +24,6 @@
?>
<div class="input clear"></div>
<?php
echo $this->Form->input('batch_import', array(
'type' => 'checkbox',
));
echo $this->Form->input('to_ids', array(
'checked' => true,
'label' => 'IDS Signature?',
@ -41,22 +38,10 @@
echo $this->Form->end();
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('View Event', array('controller' => 'events', 'action' => 'view', $this->request->data['ShadowAttribute']['event_id'])); ?> </li>
<li class="active"><?php echo $this->Html->link('Propose Attribute', array('controller' => 'shadow_attributes', 'action' => 'add', $this->request->data['ShadowAttribute']['event_id']));?> </li>
<li><?php echo $this->Html->link('Propose Attachment', array('controller' => 'shadow_attributes', 'action' => 'add_attachment', $this->request->data['ShadowAttribute']['event_id']));?> </li>
<li class="divider"></li>
<li><?php echo $this->Html->link('Contact reporter', array('controller' => 'events', 'action' => 'contact', $this->request->data['ShadowAttribute']['event_id'])); ?> </li>
<li><?php echo $this->Html->link('Download as XML', array('controller' => 'events', 'action' => 'xml', 'download', $this->request->data['ShadowAttribute']['event_id'])); ?></li>
<li><?php echo $this->Html->link('Download as IOC', array('controller' => 'events', 'action' => 'downloadOpenIOCEvent', $this->request->data['ShadowAttribute']['event_id'])); ?> </li>
<li class="divider"></li>
<li><?php echo $this->Html->link('List Events', array('controller' => 'events', 'action' => 'index')); ?></li>
<?php if ($isAclAdd): ?>
<li><?php echo $this->Html->link('Add Event', array('controller' => 'events', 'action' => 'add')); ?></li>
<?php endif; ?>
</ul>
</div>
<?php
$event['Event']['id'] = $this->request->data['ShadowAttribute']['event_id'];
echo $this->element('side_menu', array('menuList' => 'event', 'menuItem' => 'proposeAttribute', 'event' => $event));
?>
<script type="text/javascript">
//

View File

@ -70,19 +70,6 @@
</ul>
</div>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li class="active"><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li><a href="/events/add">Add Event</a></li>
<?php endif; ?>
<li class="divider"></li>
<li><a href="/attributes/index">List Attributes</a></li>
<li><a href="/attributes/search">Search Attributes</a></li>
<li class="divider"></li>
<li><a href="/events/export">Export</a></li>
<?php if ($isAclAuth): ?>
<li><a href="/events/automation">Automation</a></li>
<?php endif;?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'event-collection', 'menuItem' => 'viewProposals'));
?>

101
app/View/Threads/index.ctp Normal file
View File

@ -0,0 +1,101 @@
<div class="threads index">
<h2>Discussions</h2>
<div class="pagination">
<ul>
<?php
$this->Paginator->options(array(
'update' => '.span12',
'evalScripts' => true,
'before' => '$(".progress").show()',
'complete' => '$(".progress").hide()',
));
echo $this->Paginator->prev('&laquo; ' . __('previous'), array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'prev disabled', 'escape' => false, 'disabledTag' => 'span'));
echo $this->Paginator->numbers(array('modulus' => 20, 'separator' => '', 'tag' => 'li', 'currentClass' => 'active', 'currentTag' => 'span'));
echo $this->Paginator->next(__('next') . ' &raquo;', array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'next disabled', 'escape' => false, 'disabledTag' => 'span'));
?>
</ul>
</div>
<table class="table table-striped table-hover table-condensed">
<tr>
<th><?php echo $this->Paginator->sort('org');?></th>
<th>Title</th>
<th><?php echo $this->Paginator->sort('date_modified', 'Last Post On');?></th>
<th>Last Post By</th>
<th><?php echo $this->Paginator->sort('date_created', 'Thread started On');?></th>
<th>Posts</th>
<th>Distribution</th>
</tr>
<?php
$url = Configure::read('CyDefSIG.baseurl');
foreach ($threads as $thread):
$lastPost = end($thread['Post']);
?>
<tr>
<td class="short" style="text-align: left;" onclick="document.location.href ='<?php echo $url;?>/threads/view/<?php echo $thread['Thread']['id'];?>'">
<?php
$imgRelativePath = 'orgs' . DS . h($thread['Thread']['org']) . '.png';
$imgAbsolutePath = APP . WEBROOT_DIR . DS . 'img' . DS . $imgRelativePath;
if (file_exists($imgAbsolutePath)) echo $this->Html->image('orgs/' . h($thread['Thread']['org']) . '.png', array('alt' => h($thread['Thread']['org']), 'title' => h($thread['Thread']['org']), 'style' => 'width:24px; height:24px'));
else echo $this->Html->tag('span', h($thread['Thread']['org']), array('class' => 'welcome', 'style' => 'float:left;'));
?>
&nbsp;
</td>
<td onclick="document.location.href ='<?php echo $url;?>/threads/view/<?php echo $thread['Thread']['id'];?>'">
<?php
echo h($thread['Thread']['title']);
?>
</td>
<td class="short" style="text-align: center;" onclick="document.location.href ='<?php echo $url;?>/threads/view/<?php echo $thread['Thread']['id'];?>'">
<?php
echo h($thread['Thread']['date_modified']);
?>
&nbsp;
</td>
<td class="short" style="text-align: center;" onclick="document.location.href ='<?php echo $url;?>/threads/view/<?php echo $thread['Thread']['id'];?>'">
<?php
echo h($lastPost['User']['email']);
?>
&nbsp;
</td>
<td class="short" style="text-align: center;" onclick="document.location.href ='<?php echo $url;?>/threads/view/<?php echo $thread['Thread']['id'];?>'">
<?php
echo h($thread['Thread']['date_created']);
?>
</td>
<td class="short" onclick="document.location.href ='<?php echo $url;?>/threads/view/<?php echo $thread['Thread']['id'];?>'">
<?php
echo h($thread['Thread']['post_count']);
?>
</td>
<td class="short" onclick="document.location.href ='<?php echo $url;?>/threads/view/<?php echo $thread['Thread']['id'];?>'">
<?php
echo $distributionLevels[$thread['Thread']['distribution']];
?>
</td>
</tr>
<?php
endforeach; ?>
</table>
<p>
<?php
echo $this->Paginator->counter(array(
'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
));
?>
</p>
<div class="pagination">
<ul>
<?php
echo $this->Paginator->prev('&laquo; ' . __('previous'), array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'prev disabled', 'escape' => false, 'disabledTag' => 'span'));
echo $this->Paginator->numbers(array('modulus' => 20, 'separator' => '', 'tag' => 'li', 'currentClass' => 'active', 'currentTag' => 'span'));
echo $this->Paginator->next(__('next') . ' &raquo;', array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'next disabled', 'escape' => false, 'disabledTag' => 'span'));
?>
</ul>
</div>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'threads', 'menuItem' => 'index'));
?>

View File

@ -0,0 +1,9 @@
<div class="threads view">
<h3><?php echo $thread_title; ?></h3>
<?php
echo $this->element('eventdiscussion');
?>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'threads', 'menuItem' => 'view'));
?>

View File

@ -6,7 +6,7 @@
echo $this->Form->input('email');
echo $this->Form->input('password');
echo $this->Form->input('confirm_password', array('type' => 'password', 'div' => array('class' => 'input password required')));
if ($currentOrg == 'ADMIN') {
if ($isSiteAdmin) {
echo $this->Form->input('org', array('label' => 'Organisation'));
}
echo $this->Form->input('role_id', array('label' => 'Role', 'div' => 'input clear'));
@ -21,18 +21,6 @@
<?php echo $this->Form->button(__('Submit'), array('class' => 'btn btn-primary'));
echo $this->Form->end();?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li class="active"><a href="/admin/users/add">New User</a></li>
<li><a href="/admin/users/index">List Users</a></li>
<li class="divider"></li>
<?php if ($isSiteAdmin): ?>
<li><a href="/admin/roles/add">New Role</a></li>
<?php endif; ?>
<li><a href="/admin/roles/index">List Role</a></li>
<?php if ($isSiteAdmin): ?>
<li class="divider"></li>
<li><a href="/admin/users/email">Contact Users</a></li>
<?php endif; ?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'addUser'));
?>

View File

@ -6,7 +6,7 @@
echo $this->Form->input('email');
echo $this->Form->input('password');
echo $this->Form->input('confirm_password', array('type' => 'password', 'div' => array('class' => 'input password required')));
if ($currentOrg == 'ADMIN') {
if ($isSiteAdmin) {
echo $this->Form->input('org', array('label' => 'Organisation'));
}
echo $this->Form->input('role_id', array('label' => 'Role', 'div' => 'input clear')); // TODO ACL, User edit role_id.
@ -30,19 +30,7 @@
echo $this->Form->button(__('Submit'), array('class' => 'btn btn-primary'));
echo $this->Form->end();?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('New User', array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?> </li>
<li><?php echo $this->Html->link('List Users', array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?> </li>
<li class="divider"></li>
<?php if ($isSiteAdmin): ?>
<li><?php echo $this->Html->link('New Role', array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?> </li>
<?php endif; ?>
<li><?php echo $this->Html->link('List Roles', array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?> </li>
<?php if ($isSiteAdmin): ?>
<li class="divider"></li>
<li><?php echo $this->Html->link('Contact users', array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?> </li>
<?php endif; ?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'editUser'));
?>

View File

@ -64,21 +64,9 @@ function showMessage(){
</div>
</fieldset>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('New User', array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?> </li>
<li><?php echo $this->Html->link('List Users', array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?> </li>
<li class="divider"></li>
<?php if ($isSiteAdmin): ?>
<li><?php echo $this->Html->link('New Role', array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?> </li>
<?php endif; ?>
<li><?php echo $this->Html->link('List Roles', array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?> </li>
<?php if ($isSiteAdmin): ?>
<li class="divider"></li>
<li class="active"><?php echo $this->Html->link('Contact users', array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?> </li>
<?php endif; ?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'contact'));
?>
<script>
$("#recipient").change(setRecipientEmailList);
$("#recipient").change(setGPG);

View File

@ -61,7 +61,7 @@ foreach ($users as $user): ?>
<?php echo h($user['User']['newsread']); ?>&nbsp;</td>
<td class="short action-links">
<?php
if (($isAclAdmin && (($user['User']['org'] == $me['org'])) || ('1' == $me['id'])) || ($me['org'] == 'ADMIN')) {
if (($isAclAdmin && (($user['User']['org'] == $me['org'])) || ('1' == $me['id'])) || ($isSiteAdmin)) {
echo $this->Html->link('', array('admin' => true, 'action' => 'edit', $user['User']['id']), array('class' => 'icon-edit', 'title' => 'Edit'));
echo $this->Form->postLink('', array('admin' => true, 'action' => 'delete', $user['User']['id']), array('class' => 'icon-trash', 'title' => 'Delete'), __('Are you sure you want to delete # %s?', $user['User']['id']));
}?>
@ -89,18 +89,6 @@ endforeach; ?>
</div>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('New User', array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?> </li>
<li class="active"><?php echo $this->Html->link('List Users', array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?> </li>
<li class="divider"></li>
<?php if ($isSiteAdmin): ?>
<li><?php echo $this->Html->link('New Role', array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?> </li>
<?php endif; ?>
<li><?php echo $this->Html->link('List Roles', array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?> </li>
<?php if ($isSiteAdmin): ?>
<li class="divider"></li>
<li><?php echo $this->Html->link('Contact users', array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?> </li>
<?php endif; ?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'indexUser'));
?>

View File

@ -131,20 +131,6 @@ if (h($user['User']['change_pw']) == 1) {
endif; ?>
</div>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('Edit User', array('admin' => true, 'action' => 'edit', $user['User']['id'])); ?></li>
<li class="divider"></li>
<li class="active"><?php echo $this->Html->link('New User', array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?> </li>
<li><?php echo $this->Html->link('List Users', array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?> </li>
<li class="divider"></li>
<?php if ($isSiteAdmin): ?>
<li><?php echo $this->Html->link('New Role', array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?> </li>
<?php endif; ?>
<li><?php echo $this->Html->link('List Roles', array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?> </li>
<?php if ($isSiteAdmin): ?>
<li class="divider"></li>
<li><?php echo $this->Html->link('Contact users', array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?> </li>
<?php endif; ?>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'viewUser'));
?>

View File

@ -12,12 +12,6 @@ echo $this->Form->button(__('Submit'), array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><a href="/users/news">News</a></li>
<li><a href="/users/view/me">My Profile</a></li>
<li><a href="/users/memberslist">Members List</a></li>
<li><a href="/pages/display/doc/general">User Guide</a></li>
<li><a href="/users/terms">Terms & Conditions</a></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'globalActions', 'menuItem' => 'news'));
?>

View File

@ -19,12 +19,7 @@
<?php echo $this->Form->button(__('Submit'), array('class' => 'btn btn-primary'));
echo $this->Form->end();?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link(__('News', true), array('controller' => 'users', 'action' => 'news')); ?> </li>
<li><?php echo $this->Html->link(__('My Profile', true), array('controller' => 'users', 'action' => 'view', 'me')); ?> </li>
<li><?php echo $this->Html->link(__('Members List', true), array('controller' => 'users', 'action' => 'memberslist')); ?> </li>
<li><?php echo $this->Html->link(__('User Guide', true), array('controller' => 'pages', 'action' => 'display', 'documentation')); ?> </li>
<li><?php echo $this->Html->link(__('Terms & Conditions', true), array('controller' => 'users', 'action' => 'terms')); ?> </li>
</ul>
</div>
<?php
$user['User']['id'] = $id;
echo $this->element('side_menu', array('menuList' => 'globalActions', 'menuItem' => 'edit', 'user' => $user));
?>

View File

@ -39,7 +39,7 @@ foreach ($graphData as $row) {
});
var panel1 = Ext.create('widget.panel', {
width: 800,
height: 900,
height: 950,
//title: 'Attributes by Organisation',
renderTo: 'graph',
layout: 'fit',
@ -109,13 +109,6 @@ endforeach; ?>
</table -->
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><a href="/users/news">News</a></li>
<li><a href="/users/view/me">My Profile</a></li>
<li class="active"><a href="/users/memberslist">Members List</a></li>
<li><a href="/pages/display/doc/general">User Guide</a></li>
<li><a href="/users/terms">Terms & Conditions</a></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'globalActions', 'menuItem' => 'members'));
?>

View File

@ -73,13 +73,7 @@ The authkey generation algorithm has also been improved.</p>
A bug in the DNS attributes has been corrected.</p>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li class="active"><a href="/users/news">News</a></li>
<li><a href="/users/view/me">My Profile</a></li>
<li><a href="/users/memberslist">Members List</a></li>
<li><a href="/pages/display/doc/general">User Guide</a></li>
<li><a href="/users/terms">Terms & Conditions</a></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'globalActions', 'menuItem' => 'news'));
?>

View File

@ -21,12 +21,6 @@ if (!$termsaccepted) {
}
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><a href="/users/news">News</a></li>
<li><a href="/users/view/me">My Profile</a></li>
<li><a href="/users/memberslist">Members List</a></li>
<li><a href="/pages/display/doc/general">User Guide</a></li>
<li class="active"><a href="/users/terms">Terms & Conditions</a></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'globalActions', 'menuItem' => 'terms'));
?>

View File

@ -60,21 +60,7 @@ if (!empty($user['User']['gpgkey'])) {
</dd>
</dl>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<?php
if ($me['id'] == $user['User']['id']) {
?>
<li><?php echo $this->Html->link(__('Edit User', true), array('action' => 'edit', $user['User']['id'])); ?></li>
<li class="divider"></li>
<?php
}
?>
<li><a href="/users/news">News</a></li>
<li class="active"><a href="/users/view/me">My Profile</a></li>
<li><a href="/users/memberslist">Members List</a></li>
<li><a href="/pages/display/doc/general">User Guide</a></li>
<li><a href="/users/terms">Terms & Conditions</a></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'globalActions', 'menuItem' => 'view'));
?>

View File

@ -3,7 +3,10 @@
<fieldset>
<legend>Add Signature Whitelist</legend>
<?php
echo $this->Form->input('name');
echo $this->Form->input('name', array(
'class' => 'input-xxlarge'
));
?>
</fieldset>
<?php
@ -11,9 +14,6 @@ echo $this->Form->button('Add', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('List Whitelist', array('admin' => true, 'action' => 'index'));?></li>
<li class="active"><?php echo $this->Html->link('New Whitelist', array('admin' => true, 'action' => 'add'));?></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'whitelist', 'menuItem' => 'add'));
?>

View File

@ -4,16 +4,13 @@
<legend>Edit Signature Whitelist</legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('name');
echo $this->Form->input('name', array(
'class' => 'input-xxlarge'
));
?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li><?php echo $this->Html->link('List Whitelist', array('admin' => true, 'action' => 'index'));?></li>
<li><?php echo $this->Html->link('New Whitelist', array('admin' => true, 'action' => 'add'));?></li>
<li class="divider"></li>
<li><?php echo $this->Form->postLink(__('Delete Whitelist'), array('admin' => true, 'action' => 'delete', $this->Form->value('Whitelist.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Whitelist.id')));?></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'whitelist', 'menuItem' => 'edit', 'id' => $this->Form->value('Whitelist.id')));
?>

View File

@ -50,9 +50,6 @@ endforeach;?>
</ul>
</div>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li class="active"><?php echo $this->Html->link('List Whitelist', array('admin' => true, 'action' => 'index'));?></li>
<li><?php echo $this->Html->link('New Whitelist', array('admin' => true, 'action' => 'add'));?></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'whitelist', 'menuItem' => 'index'));
?>

View File

@ -45,8 +45,6 @@ endforeach;?>
</ul>
</div>
</div>
<div class="actions <?php echo $debugMode;?>">
<ul class="nav nav-list">
<li class="active"><?php echo $this->Html->link('List Whitelist', array('action' => 'index'));?></li>
</ul>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'whitelist', 'menuItem' => 'index'));
?>

View File

@ -240,6 +240,11 @@ td.shortish {
text-align: left;
}
td.bitwider {
width:20%;
text-align: left;
}
td.highlight1 {
background-color: #0088cc !important;
color: #ffffff !important;
@ -434,3 +439,152 @@ dd {
color: #FF0000 !important;
font-weight:bold !important;
}
.discussionBox {
border-collapse: separate;
box-shadow: 5px 5px 5px #888888;
width:100%;
max-width:900px;
}
.discussionBoxTD {
padding-right: 8px;
padding-left: 8px;
border-style: solid;
border-width: 0px;
}
.discussionBoxTDtop {
color: #ffffff;
background-color: #cccccc;
}
.discussionBoxTDbottom {
background-color: #eeeeee;
padding-left: 8px;
padding-bottom: 4px;
padding-top: 4px;
}
.discussionBoxTDMid {
padding-top: 8px;
height: 100px;
vertical-align: top;
}
.discussionBoxTDMidLeft {
background-color: #eeeeee;
width: 80px;
text-align:center;
}
.discussionBoxTDMidRight {
}
.whitelink {
color:#ffffff;
}
.quote {
margin: 0 10px;
margin-bottom: 10px;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
background: #f2f6f8 none;
border-radius: 0px;
border: 1px solid #417394;
position: relative;
top: 0;
padding: 4px;
}
.loading {
display: none;
text-color: #0088cc;
position: fixed;
top: 50%;
left: 50%;
right: 50%;
bottom: 50%;
}
.loadingText {
color: #0088cc;
position: relative;
top: -45px;
left: 13px;
}
.toggle {
border-radius: 0px !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
}
.toggle-left {
border-bottom-right-radius: 0px !important;
-webkit-bottom-right-radius: 0px !important;
-moz-border-bottom-right-radius: 0px !important;
border-top-right-radius: 0px !important;
-webkit-top-right-radius: 0px !important;
-moz-border-top-right-radius: 0px !important;
}
.toggle-right {
border-bottom-left-radius: 0px !important;
-webkit-bottom-left-radius: 0px !important;
-moz-border-bottom-left-radius: 0px !important;
border-top-left-radius: 0px !important;
-webkit-top-left-radius: 0px !important;
-moz-border-top-left-radius: 0px !important;
}
.spinner {
height:60px;
width:60px;
margin:0 auto;
position:relative;
-webkit-animation: rotation .6s infinite linear;
-moz-animation: rotation .6s infinite linear;
-o-animation: rotation .6s infinite linear;
animation: rotation .6s infinite linear;
border:6px solid rgba(0,174,239,.15);
border-radius:100%;
}
.spinner:before {
content:"";
display:block;
position:absolute;
left:-6px;
top:-6px;
height:100%;
width:100%;
border-top:6px solid rgba(0,136,204,.8);
border-left:6px solid transparent;
border-bottom:6px solid transparent;
border-right:6px solid transparent;
border-radius:100%;
}
.qet {
padding:1px 5px !important;
font-size:12px !important;
float:left !important;
}
@-webkit-keyframes rotation {
from {-webkit-transform: rotate(0deg);}
to {-webkit-transform: rotate(359deg);}
}
@-moz-keyframes rotation {
from {-moz-transform: rotate(0deg);}
to {-moz-transform: rotate(359deg);}
}
@-o-keyframes rotation {
from {-o-transform: rotate(0deg);}
to {-o-transform: rotate(359deg);}
}
@keyframes rotation {
from {transform: rotate(0deg);}
to {transform: rotate(359deg);}