From 0fa30912a3202c034acdbacbe64769ad7341a4a8 Mon Sep 17 00:00:00 2001 From: Christophe Vandeplas Date: Thu, 30 May 2013 11:14:00 +0200 Subject: [PATCH 01/56] mirated first parts of nice GUI proposed by Alexandru of CERT-EU --- app/Controller/AppController.php | 23 +- app/View/Attributes/add.ctp | 233 +- app/View/Attributes/add_attachment.ctp | 273 +- app/View/Attributes/check_composites.ctp | 5 - app/View/Attributes/edit.ctp | 247 +- app/View/Attributes/index.ctp | 9 +- app/View/Attributes/search.ctp | 5 - app/View/Blacklists/admin_add.ctp | 5 - app/View/Blacklists/admin_edit.ctp | 2 - app/View/Blacklists/admin_index.ctp | 2 - app/View/Blacklists/index.ctp | 6 - app/View/Elements/actions_menu.ctp | 80 - app/View/Elements/global_menu.ctp | 111 + app/View/Events/add.ctp | 144 +- app/View/Events/add_i_o_c.ctp | 6 - app/View/Events/automation.ctp | 7 - app/View/Events/contact.ctp | 5 +- app/View/Events/edit.ctp | 2 +- app/View/Events/export.ctp | 6 - app/View/Events/index.ctp | 10 +- app/View/Events/show_i_o_c_results.ctp | 2 +- app/View/Events/succes.ctp | 5 - app/View/Events/view.ctp | 76 +- app/View/Layouts/default.ctp | 67 +- app/View/Logs/admin_index.ctp | 5 - app/View/Logs/admin_search.ctp | 5 - app/View/Pages/administration.ctp | 5 - app/View/Pages/categories_and_types.ctp | 5 - app/View/Pages/documentation.ctp | 5 - app/View/Pages/user_management.ctp | 3 - app/View/Pages/using_the_system.ctp | 5 - app/View/Regexp/admin_add.ctp | 5 - app/View/Regexp/admin_edit.ctp | 2 - app/View/Regexp/admin_index.ctp | 2 - app/View/Regexp/index.ctp | 6 - app/View/Roles/admin_add.ctp | 5 - app/View/Roles/admin_edit.ctp | 5 - app/View/Roles/admin_index.ctp | 5 - app/View/Roles/index.ctp | 5 - app/View/Roles/view.ctp | 5 - app/View/Servers/add.ctp | 5 - app/View/Servers/edit.ctp | 2 - app/View/Servers/index.ctp | 2 - app/View/Servers/pull.ctp | 3 +- app/View/Servers/push.ctp | 2 - app/View/ShadowAttributes/add.ctp | 5 - app/View/ShadowAttributes/add_attachment.ctp | 5 - app/View/ShadowAttributes/edit.ctp | 197 +- app/View/Users/admin_add.ctp | 5 - app/View/Users/admin_edit.ctp | 5 - app/View/Users/admin_email.ctp | 6 - app/View/Users/admin_index.ctp | 5 - app/View/Users/admin_view.ctp | 1 - app/View/Users/change_pw.ctp | 5 - app/View/Users/check_and_correct_pgps.ctp | 5 - app/View/Users/edit.ctp | 5 - app/View/Users/memberslist.ctp | 5 - app/View/Users/news.ctp | 5 - app/View/Users/succes.ctp | 5 - app/View/Users/terms.ctp | 5 - app/View/Users/view.ctp | 2 - app/View/Whitelists/admin_add.ctp | 5 - app/View/Whitelists/admin_edit.ctp | 2 - app/View/Whitelists/admin_index.ctp | 2 - app/View/Whitelists/index.ctp | 6 - app/webroot/css/bootstrap-responsive.css | 1109 +++ app/webroot/css/bootstrap-responsive.min.css | 9 + app/webroot/css/bootstrap.css | 6158 +++++++++++++++++ app/webroot/css/bootstrap.min.css | 9 + app/webroot/css/datepicker.css | 182 + .../css/fonts/roboto/Roboto-Black-webfont.eot | Bin 0 -> 25828 bytes .../css/fonts/roboto/Roboto-Black-webfont.svg | 147 + .../css/fonts/roboto/Roboto-Black-webfont.ttf | Bin 0 -> 25640 bytes .../fonts/roboto/Roboto-Black-webfont.woff | Bin 0 -> 14920 bytes .../roboto/Roboto-BlackItalic-webfont.eot | Bin 0 -> 30040 bytes .../roboto/Roboto-BlackItalic-webfont.svg | 147 + .../roboto/Roboto-BlackItalic-webfont.ttf | Bin 0 -> 29824 bytes .../roboto/Roboto-BlackItalic-webfont.woff | Bin 0 -> 17696 bytes .../css/fonts/roboto/Roboto-Bold-webfont.eot | Bin 0 -> 25880 bytes .../css/fonts/roboto/Roboto-Bold-webfont.svg | 147 + .../css/fonts/roboto/Roboto-Bold-webfont.ttf | Bin 0 -> 25696 bytes .../css/fonts/roboto/Roboto-Bold-webfont.woff | Bin 0 -> 14940 bytes .../roboto/Roboto-BoldCondensed-webfont.eot | Bin 0 -> 26100 bytes .../roboto/Roboto-BoldCondensed-webfont.svg | 147 + .../roboto/Roboto-BoldCondensed-webfont.ttf | Bin 0 -> 25876 bytes .../roboto/Roboto-BoldCondensed-webfont.woff | Bin 0 -> 15036 bytes .../Roboto-BoldCondensedItalic-webfont.eot | Bin 0 -> 30884 bytes .../Roboto-BoldCondensedItalic-webfont.svg | 147 + .../Roboto-BoldCondensedItalic-webfont.ttf | Bin 0 -> 30632 bytes .../Roboto-BoldCondensedItalic-webfont.woff | Bin 0 -> 18112 bytes .../roboto/Roboto-BoldItalic-webfont.eot | Bin 0 -> 30980 bytes .../roboto/Roboto-BoldItalic-webfont.svg | 147 + .../roboto/Roboto-BoldItalic-webfont.ttf | Bin 0 -> 30768 bytes .../roboto/Roboto-BoldItalic-webfont.woff | Bin 0 -> 18208 bytes .../fonts/roboto/Roboto-Condensed-webfont.eot | Bin 0 -> 26444 bytes .../fonts/roboto/Roboto-Condensed-webfont.svg | 147 + .../fonts/roboto/Roboto-Condensed-webfont.ttf | Bin 0 -> 26240 bytes .../roboto/Roboto-Condensed-webfont.woff | Bin 0 -> 15380 bytes .../roboto/Roboto-CondensedItalic-webfont.eot | Bin 0 -> 31352 bytes .../roboto/Roboto-CondensedItalic-webfont.svg | 147 + .../roboto/Roboto-CondensedItalic-webfont.ttf | Bin 0 -> 31120 bytes .../Roboto-CondensedItalic-webfont.woff | Bin 0 -> 18428 bytes .../fonts/roboto/Roboto-Italic-webfont.eot | Bin 0 -> 30544 bytes .../fonts/roboto/Roboto-Italic-webfont.svg | 147 + .../fonts/roboto/Roboto-Italic-webfont.ttf | Bin 0 -> 30352 bytes .../fonts/roboto/Roboto-Italic-webfont.woff | Bin 0 -> 17940 bytes .../css/fonts/roboto/Roboto-Light-webfont.eot | Bin 0 -> 26368 bytes .../css/fonts/roboto/Roboto-Light-webfont.svg | 147 + .../css/fonts/roboto/Roboto-Light-webfont.ttf | Bin 0 -> 26180 bytes .../fonts/roboto/Roboto-Light-webfont.woff | Bin 0 -> 15296 bytes .../roboto/Roboto-LightItalic-webfont.eot | Bin 0 -> 31260 bytes .../roboto/Roboto-LightItalic-webfont.svg | 147 + .../roboto/Roboto-LightItalic-webfont.ttf | Bin 0 -> 31044 bytes .../roboto/Roboto-LightItalic-webfont.woff | Bin 0 -> 18188 bytes .../fonts/roboto/Roboto-Medium-webfont.eot | Bin 0 -> 26264 bytes .../fonts/roboto/Roboto-Medium-webfont.svg | 147 + .../fonts/roboto/Roboto-Medium-webfont.ttf | Bin 0 -> 26072 bytes .../fonts/roboto/Roboto-Medium-webfont.woff | Bin 0 -> 15192 bytes .../roboto/Roboto-MediumItalic-webfont.eot | Bin 0 -> 31048 bytes .../roboto/Roboto-MediumItalic-webfont.svg | 147 + .../roboto/Roboto-MediumItalic-webfont.ttf | Bin 0 -> 30828 bytes .../roboto/Roboto-MediumItalic-webfont.woff | Bin 0 -> 18108 bytes .../fonts/roboto/Roboto-Regular-webfont.eot | Bin 0 -> 26220 bytes .../fonts/roboto/Roboto-Regular-webfont.svg | 147 + .../fonts/roboto/Roboto-Regular-webfont.ttf | Bin 0 -> 26024 bytes .../fonts/roboto/Roboto-Regular-webfont.woff | Bin 0 -> 15280 bytes .../css/fonts/roboto/Roboto-Thin-webfont.eot | Bin 0 -> 26684 bytes .../css/fonts/roboto/Roboto-Thin-webfont.svg | 147 + .../css/fonts/roboto/Roboto-Thin-webfont.ttf | Bin 0 -> 26500 bytes .../css/fonts/roboto/Roboto-Thin-webfont.woff | Bin 0 -> 15568 bytes .../roboto/Roboto-ThinItalic-webfont.eot | Bin 0 -> 33324 bytes .../roboto/Roboto-ThinItalic-webfont.svg | 147 + .../roboto/Roboto-ThinItalic-webfont.ttf | Bin 0 -> 33112 bytes .../roboto/Roboto-ThinItalic-webfont.woff | Bin 0 -> 18984 bytes app/webroot/css/main.css | 233 + app/webroot/css/roboto.css | 192 + .../img/glyphicons-halflings-white.png | Bin 0 -> 8777 bytes app/webroot/img/glyphicons-halflings.png | Bin 0 -> 12799 bytes app/webroot/js/bootstrap-datepicker.js | 474 ++ app/webroot/js/bootstrap.min.js | 6 + app/webroot/js/jquery-1.8.3.min.js | 2 - app/webroot/js/jquery-1.9.1.min.js | 5 + app/webroot/js/main.js | 26 + 143 files changed, 11506 insertions(+), 950 deletions(-) delete mode 100755 app/View/Elements/actions_menu.ctp create mode 100755 app/View/Elements/global_menu.ctp create mode 100755 app/webroot/css/bootstrap-responsive.css create mode 100755 app/webroot/css/bootstrap-responsive.min.css create mode 100755 app/webroot/css/bootstrap.css create mode 100755 app/webroot/css/bootstrap.min.css create mode 100755 app/webroot/css/datepicker.css create mode 100755 app/webroot/css/fonts/roboto/Roboto-Black-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-Black-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-Black-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-Black-webfont.woff create mode 100755 app/webroot/css/fonts/roboto/Roboto-BlackItalic-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-BlackItalic-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-BlackItalic-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-BlackItalic-webfont.woff create mode 100755 app/webroot/css/fonts/roboto/Roboto-Bold-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-Bold-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-Bold-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-Bold-webfont.woff create mode 100755 app/webroot/css/fonts/roboto/Roboto-BoldCondensed-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-BoldCondensed-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-BoldCondensed-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-BoldCondensed-webfont.woff create mode 100755 app/webroot/css/fonts/roboto/Roboto-BoldCondensedItalic-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-BoldCondensedItalic-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-BoldCondensedItalic-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-BoldCondensedItalic-webfont.woff create mode 100755 app/webroot/css/fonts/roboto/Roboto-BoldItalic-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-BoldItalic-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-BoldItalic-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-BoldItalic-webfont.woff create mode 100755 app/webroot/css/fonts/roboto/Roboto-Condensed-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-Condensed-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-Condensed-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-Condensed-webfont.woff create mode 100755 app/webroot/css/fonts/roboto/Roboto-CondensedItalic-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-CondensedItalic-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-CondensedItalic-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-CondensedItalic-webfont.woff create mode 100755 app/webroot/css/fonts/roboto/Roboto-Italic-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-Italic-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-Italic-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-Italic-webfont.woff create mode 100755 app/webroot/css/fonts/roboto/Roboto-Light-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-Light-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-Light-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-Light-webfont.woff create mode 100755 app/webroot/css/fonts/roboto/Roboto-LightItalic-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-LightItalic-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-LightItalic-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-LightItalic-webfont.woff create mode 100755 app/webroot/css/fonts/roboto/Roboto-Medium-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-Medium-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-Medium-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-Medium-webfont.woff create mode 100755 app/webroot/css/fonts/roboto/Roboto-MediumItalic-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-MediumItalic-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-MediumItalic-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-MediumItalic-webfont.woff create mode 100755 app/webroot/css/fonts/roboto/Roboto-Regular-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-Regular-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-Regular-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-Regular-webfont.woff create mode 100755 app/webroot/css/fonts/roboto/Roboto-Thin-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-Thin-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-Thin-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-Thin-webfont.woff create mode 100755 app/webroot/css/fonts/roboto/Roboto-ThinItalic-webfont.eot create mode 100755 app/webroot/css/fonts/roboto/Roboto-ThinItalic-webfont.svg create mode 100755 app/webroot/css/fonts/roboto/Roboto-ThinItalic-webfont.ttf create mode 100755 app/webroot/css/fonts/roboto/Roboto-ThinItalic-webfont.woff create mode 100755 app/webroot/css/main.css create mode 100755 app/webroot/css/roboto.css create mode 100644 app/webroot/img/glyphicons-halflings-white.png create mode 100644 app/webroot/img/glyphicons-halflings.png create mode 100755 app/webroot/js/bootstrap-datepicker.js create mode 100755 app/webroot/js/bootstrap.min.js delete mode 100644 app/webroot/js/jquery-1.8.3.min.js create mode 100755 app/webroot/js/jquery-1.9.1.min.js create mode 100755 app/webroot/js/main.js diff --git a/app/Controller/AppController.php b/app/Controller/AppController.php index 565861a52..4744ed569 100755 --- a/app/Controller/AppController.php +++ b/app/Controller/AppController.php @@ -87,15 +87,15 @@ class AppController extends Controller { // Authenticate user with authkey in Authorization HTTP header if (!empty($_SERVER['HTTP_AUTHORIZATION'])) { $user = $this->checkAuthUser($_SERVER['HTTP_AUTHORIZATION']); - if ($user) { - // User found in the db, add the user info to the session - $this->Session->renew(); - $this->Session->write(AuthComponent::$sessionKey, $user['User']); + if ($user) { + // User found in the db, add the user info to the session + $this->Session->renew(); + $this->Session->write(AuthComponent::$sessionKey, $user['User']); } else { - // User not authenticated correctly + // User not authenticated correctly // reset the session information - $this->Session->destroy(); + $this->Session->destroy(); throw new ForbiddenException('The authentication key provided cannot be used for syncing.'); } } @@ -117,6 +117,17 @@ class AppController extends Controller { $this->set('isAclAdmin', $role['perm_admin']); $this->set('isAclAudit', $role['perm_audit']); $this->set('isAclAuth', $role['perm_auth']); + } else { + $this->set('isAdmin', false); + $this->set('isSiteAdmin', false); + $this->set('isAclAdd', false); + $this->set('isAclModify', false); + $this->set('isAclModifyOrg', false); + $this->set('isAclPublish', false); + $this->set('isAclSync', false); + $this->set('isAclAdmin', false); + $this->set('isAclAudit', false); + $this->set('isAclAuth', false); } } diff --git a/app/View/Attributes/add.ctp b/app/View/Attributes/add.ctp index 8ba989584..077a9161c 100755 --- a/app/View/Attributes/add.ctp +++ b/app/View/Attributes/add.ctp @@ -1,118 +1,117 @@ - -
-Form->create('Attribute');?> -
- -Form->hidden('event_id'); -echo $this->Form->input('category', array( - 'between' => $this->Html->div('forminfo', '', array('id' => 'AttributeCategoryDiv')), - 'empty' => '(choose one)' - )); -echo $this->Form->input('type', array( - 'between' => $this->Html->div('forminfo', '', array('id' => 'AttributeTypeDiv')), - 'empty' => '(first choose category)' - )); -if ('true' == Configure::read('CyDefSIG.sync')) { - echo $this->Form->input('distribution', array('label' => 'Distribution', 'selected' => $maxDist, - 'between' => $this->Html->div('forminfo', '', array('id' => 'AttributeDistributionDiv')) - )); -} -echo $this->Form->input('to_ids', array( - 'checked' => true, - 'before' => $this->Html->div('forminfo', isset($attrDescriptions['signature']['formdesc']) ? $attrDescriptions['signature']['formdesc'] : $attrDescriptions['signature']['desc']), - 'label' => 'IDS Signature?' -)); -echo $this->Form->input('batch_import', array( - 'type' => 'checkbox', - 'after' => $this->Html->div('forminfo', 'Create multiple attributes one per line'), -)); -echo $this->Form->input('value', array( - 'type' => 'textarea', - 'error' => array('escape' => false), -)); - -// link an onchange event to the form elements -$this->Js->get('#AttributeCategory')->event('change', 'formCategoryChanged("#AttributeCategory")'); -$this->Js->get('#AttributeType')->event('change', 'showFormInfo("#AttributeType")'); -$this->Js->get('#AttributeDistribution')->event('change', 'showFormInfo("#AttributeDistribution")'); -?> -
-Form->end(__('Submit'));?> -
-
- -
- +
+Form->create('Attribute');?> +
+ +Form->hidden('event_id'); +echo $this->Form->input('category', array( + 'between' => $this->Html->div('forminfo', '', array('id' => 'AttributeCategoryDiv')), + 'empty' => '(choose one)' + )); +echo $this->Form->input('type', array( + 'between' => $this->Html->div('forminfo', '', array('id' => 'AttributeTypeDiv')), + 'empty' => '(first choose category)' + )); +if ('true' == Configure::read('CyDefSIG.sync')) { + echo $this->Form->input('distribution', array('label' => 'Distribution', 'selected' => $maxDist, + 'between' => $this->Html->div('forminfo', '', array('id' => 'AttributeDistributionDiv')) + )); +} +echo $this->Form->input('to_ids', array( + 'checked' => true, + 'before' => $this->Html->div('forminfo', isset($attrDescriptions['signature']['formdesc']) ? $attrDescriptions['signature']['formdesc'] : $attrDescriptions['signature']['desc']), + 'label' => 'IDS Signature?' +)); +echo $this->Form->input('batch_import', array( + 'type' => 'checkbox', + 'after' => $this->Html->div('forminfo', 'Create multiple attributes one per line'), +)); +echo $this->Form->input('value', array( + 'type' => 'textarea', + 'error' => array('escape' => false), +)); + +// link an onchange event to the form elements +$this->Js->get('#AttributeCategory')->event('change', 'formCategoryChanged("#AttributeCategory")'); +$this->Js->get('#AttributeType')->event('change', 'showFormInfo("#AttributeType")'); +$this->Js->get('#AttributeDistribution')->event('change', 'showFormInfo("#AttributeDistribution")'); +?> +
+Form->end(__('Submit'));?> +
+
+ +
+ Js->writeBuffer(); // Write cached scripts \ No newline at end of file diff --git a/app/View/Attributes/add_attachment.ctp b/app/View/Attributes/add_attachment.ctp index d0b270772..9361e8b27 100755 --- a/app/View/Attributes/add_attachment.ctp +++ b/app/View/Attributes/add_attachment.ctp @@ -1,138 +1,137 @@ -
-Form->create('Attribute', array('enctype' => 'multipart/form-data','onSubmit' => 'document.getElementById("AttributeMalware").removeAttribute("disabled");'));?> -
- -Form->hidden('event_id'); -echo $this->Form->input('category', array('between' => $this->Html->div('forminfo', '', array('id' => 'AttributeCategoryDiv')))); -echo $this->Form->file('value', array( - 'error' => array('escape' => false), -)); -echo $this->Form->input('malware', array( - 'type' => 'checkbox', - 'checked' => false, - 'after' => '
Tick this box to neutralize the sample. Every malware sample will be zipped with the password "infected"', -)); -if ('true' == Configure::read('CyDefSIG.sync')) { - echo $this->Form->input('distribution', array('label' => 'Distribution', 'selected' => $maxDist, - 'between' => $this->Html->div('forminfo', '', array('id' => 'AttributeDistributionDiv')) - )); - //'before' => $this->Html->div('forminfo', isset($attrDescriptions['distribution']['formdesc']) ? $attrDescriptions['distribution']['formdesc'] : $attrDescriptions['distribution']['desc']),)); -} -// link an onchange event to the form elements -$this->Js->get('#AttributeType')->event('change', 'showFormInfo("#AttributeType")'); -$this->Js->get('#AttributeCategory')->event('change', 'showFormInfo("#AttributeCategory")'); -$this->Js->get('#AttributeDistribution')->event('change', 'showFormInfo("#AttributeDistribution")'); -?> -
-Form->end(__('Upload'));?> -
-
- -
- - +
+Form->create('Attribute', array('enctype' => 'multipart/form-data','onSubmit' => 'document.getElementById("AttributeMalware").removeAttribute("disabled");'));?> +
+ +Form->hidden('event_id'); +echo $this->Form->input('category', array('between' => $this->Html->div('forminfo', '', array('id' => 'AttributeCategoryDiv')))); +echo $this->Form->file('value', array( + 'error' => array('escape' => false), +)); +echo $this->Form->input('malware', array( + 'type' => 'checkbox', + 'checked' => false, + 'after' => '
Tick this box to neutralize the sample. Every malware sample will be zipped with the password "infected"', +)); +if ('true' == Configure::read('CyDefSIG.sync')) { + echo $this->Form->input('distribution', array('label' => 'Distribution', 'selected' => $maxDist, + 'between' => $this->Html->div('forminfo', '', array('id' => 'AttributeDistributionDiv')) + )); + //'before' => $this->Html->div('forminfo', isset($attrDescriptions['distribution']['formdesc']) ? $attrDescriptions['distribution']['formdesc'] : $attrDescriptions['distribution']['desc']),)); +} +// link an onchange event to the form elements +$this->Js->get('#AttributeType')->event('change', 'showFormInfo("#AttributeType")'); +$this->Js->get('#AttributeCategory')->event('change', 'showFormInfo("#AttributeCategory")'); +$this->Js->get('#AttributeDistribution')->event('change', 'showFormInfo("#AttributeDistribution")'); +?> +
+Form->end(__('Upload'));?> +
+
+ +
+ Js->writeBuffer(); // Write cached scripts \ No newline at end of file diff --git a/app/View/Attributes/check_composites.ctp b/app/View/Attributes/check_composites.ctp index ad23ed05a..371718fb5 100755 --- a/app/View/Attributes/check_composites.ctp +++ b/app/View/Attributes/check_composites.ctp @@ -8,9 +8,4 @@ if (0 == count($fails)):?> - -
-
\ No newline at end of file diff --git a/app/View/Attributes/edit.ctp b/app/View/Attributes/edit.ctp index 77fa8c900..648a6a8b2 100755 --- a/app/View/Attributes/edit.ctp +++ b/app/View/Attributes/edit.ctp @@ -1,124 +1,123 @@ - -
-Form->create('Attribute');?> -
- -Form->input('id'); -echo $this->Form->input('category', array('between' => $this->Html->div('forminfo', '', array('id' => 'AttributeCategoryDiv')))); -if ($attachment) { - echo $this->Form->hidden('type', array('between' => $this->Html->div('forminfo', '', array('id' => 'AttributeTypeDiv')))); - echo "
Type: " . $this->Form->value('Attribute.type'); -} else { - echo $this->Form->input('type', array('between' => $this->Html->div('forminfo', '', array('id' => 'AttributeTypeDiv')))); -} -if ('true' == Configure::read('CyDefSIG.sync')) { - if ('true' == $canEditDist) { - echo $this->Form->input('distribution', array('label' => 'Distribution', - 'between' => $this->Html->div('forminfo', '', array('id' => 'AttributeDistributionDiv')) - )); - } -} -echo $this->Form->input('to_ids', array( - 'before' => $this->Html->div('forminfo', isset($attrDescriptions['signature']['formdesc']) ? $attrDescriptions['signature']['formdesc'] : $attrDescriptions['signature']['desc']), - 'label' => 'IDS Signature?' -)); -if ($attachment) { - echo $this->Form->hidden('value'); - echo "
Value: " . $this->Form->value('Attribute.value'); -} else { - echo $this->Form->input('value', array( - 'type' => 'textarea', - 'error' => array('escape' => false), - )); -} -$this->Js->get('#AttributeCategory')->event('change', 'formCategoryChanged("#AttributeCategory")'); -$this->Js->get('#AttributeType')->event('change', 'showFormInfo("#AttributeType")'); -if ($canEditDist) { - $this->Js->get('#AttributeDistribution')->event('change', 'showFormInfo("#AttributeDistribution")'); -} -?> -
-Form->end(__('Submit'));?> -
-
- -
- - -Js->writeBuffer(); // Write cached scripts + +
+Form->create('Attribute');?> +
+ +Form->input('id'); +echo $this->Form->input('category', array('between' => $this->Html->div('forminfo', '', array('id' => 'AttributeCategoryDiv')))); +if ($attachment) { + echo $this->Form->hidden('type', array('between' => $this->Html->div('forminfo', '', array('id' => 'AttributeTypeDiv')))); + echo "
Type: " . $this->Form->value('Attribute.type'); +} else { + echo $this->Form->input('type', array('between' => $this->Html->div('forminfo', '', array('id' => 'AttributeTypeDiv')))); +} +if ('true' == Configure::read('CyDefSIG.sync')) { + if ('true' == $canEditDist) { + echo $this->Form->input('distribution', array('label' => 'Distribution', + 'between' => $this->Html->div('forminfo', '', array('id' => 'AttributeDistributionDiv')) + )); + } +} +echo $this->Form->input('to_ids', array( + 'before' => $this->Html->div('forminfo', isset($attrDescriptions['signature']['formdesc']) ? $attrDescriptions['signature']['formdesc'] : $attrDescriptions['signature']['desc']), + 'label' => 'IDS Signature?' +)); +if ($attachment) { + echo $this->Form->hidden('value'); + echo "
Value: " . $this->Form->value('Attribute.value'); +} else { + echo $this->Form->input('value', array( + 'type' => 'textarea', + 'error' => array('escape' => false), + )); +} +$this->Js->get('#AttributeCategory')->event('change', 'formCategoryChanged("#AttributeCategory")'); +$this->Js->get('#AttributeType')->event('change', 'showFormInfo("#AttributeType")'); +if ($canEditDist) { + $this->Js->get('#AttributeDistribution')->event('change', 'showFormInfo("#AttributeDistribution")'); +} +?> +
+Form->end(__('Submit'));?> +
+
+ +
+ +Js->writeBuffer(); // Write cached scripts diff --git a/app/View/Attributes/index.ctp b/app/View/Attributes/index.ctp index c2f2b08ed..17c873572 100755 --- a/app/View/Attributes/index.ctp +++ b/app/View/Attributes/index.ctp @@ -74,10 +74,10 @@ foreach ($attributes as $attribute):   Html->link(__('Edit'), array('action' => 'edit', $attribute['Attribute']['id']), null); - echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $attribute['Attribute']['id']), null, __('Are you sure you want to delete this attribute?')); + echo $this->Html->link('', array('action' => 'edit', $attribute['Attribute']['id']), array('class' => 'icon-edit', 'title' => 'Edit')); + echo $this->Form->postLink('',array('action' => 'delete', $attribute['Attribute']['id']), array('class' => 'icon-trash', 'title' => 'Delete'), __('Are you sure you want to delete this attribute?')); } - echo $this->Html->link(__('View'), array('controller' => 'events', 'action' => 'view', $attribute['Attribute']['event_id'])); + echo $this->Html->link('', array('controller' => 'events', 'action' => 'view', $attribute['Attribute']['event_id']), array('class' => 'icon-list-alt', 'title' => 'View')); ?> @@ -92,7 +92,7 @@ endforeach; )); ?>

-
+
Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled')); echo $this->Paginator->numbers(array('separator' => '')); @@ -103,6 +103,5 @@ endforeach;
  • Html->link(__('Download results as XML'), array('admin' => false, 'controller' => 'events', 'action' => 'downloadSearchResult'));?>
  • - element('actions_menu'); ?>
\ No newline at end of file diff --git a/app/View/Attributes/search.ctp b/app/View/Attributes/search.ctp index 1ab55c79c..c7a66e0db 100755 --- a/app/View/Attributes/search.ctp +++ b/app/View/Attributes/search.ctp @@ -12,11 +12,6 @@ Form->end(__('Search', true));?>
-
-
    - element('actions_menu'); ?> -
-
-Js->writeBuffer(); \ No newline at end of file +
+Form->create('Event', array('type' => 'file'));?> +
+ +Form->input('date'); +if ('true' == Configure::read('CyDefSIG.sync')) { + echo $this->Form->input('distribution', array('label' => 'Distribution', 'selected' => 'All communities', + 'between' => $this->Html->div('forminfo', '', array('id' => 'EventDistributionDiv')) + )); +} +echo $this->Form->input('risk', array( + 'before' => $this->Html->div('forminfo', '', array('id' => 'EventRiskDiv')))); +echo $this->Form->input('analysis', array( + 'options' => array($analysisLevels), + 'before' => $this->Html->div('forminfo', '', array('id' => 'EventAnalysisDiv')) + )); +echo $this->Form->input('info'); +echo $this->Form->input('Event.submittedfile', array( + 'label' => 'GFI sandbox', + 'type' => 'file', + 'before' => $this->Html->div('forminfo', isset($eventDescriptions['submittedfile']['formdesc']) ? $eventDescriptions['submittedfile']['formdesc'] : $eventDescriptions['submittedfile']['desc']))); + +// link an onchange event to the form elements +$this->Js->get('#EventDistribution')->event('change', 'showFormInfo("#EventDistribution")'); +$this->Js->get('#EventRisk')->event('change', 'showFormInfo("#EventRisk")'); +$this->Js->get('#EventAnalysis')->event('change', 'showFormInfo("#EventAnalysis")'); +?> +
+Form->end(__('Submit', true));?> +
+ + +Js->writeBuffer(); diff --git a/app/View/Events/add_i_o_c.ctp b/app/View/Events/add_i_o_c.ctp index 284369fa3..d52ef027c 100644 --- a/app/View/Events/add_i_o_c.ctp +++ b/app/View/Events/add_i_o_c.ctp @@ -11,9 +11,3 @@ echo $this->Form->input('Event.submittedioc', array( Form->end(__('Submit', true));?>
-
- -
diff --git a/app/View/Events/automation.ctp b/app/View/Events/automation.ctp index 1ea0947fa..875adbaaf 100644 --- a/app/View/Events/automation.ctp +++ b/app/View/Events/automation.ctp @@ -53,11 +53,4 @@ This would enable you to export:

  • ...
  • - - -
    - -
    \ No newline at end of file diff --git a/app/View/Events/contact.ctp b/app/View/Events/contact.ctp index 07c409045..654d1356a 100755 --- a/app/View/Events/contact.ctp +++ b/app/View/Events/contact.ctp @@ -18,7 +18,6 @@ echo $this->Form->input('person', array(
    -
    + \ No newline at end of file diff --git a/app/View/Events/edit.ctp b/app/View/Events/edit.ctp index 1206c9770..8b2f33ff1 100755 --- a/app/View/Events/edit.ctp +++ b/app/View/Events/edit.ctp @@ -32,7 +32,7 @@ $this->Js->get('#EventAnalysis')->event('change', 'showFormInfo("#EventAnalysis"
    diff --git a/app/View/Events/export.ctp b/app/View/Events/export.ctp index 5c4a48661..6a6404547 100755 --- a/app/View/Events/export.ctp +++ b/app/View/Events/export.ctp @@ -42,10 +42,4 @@ foreach ($sigTypes as $sigType): endforeach; ?>

    - - -
    -
    \ No newline at end of file diff --git a/app/View/Events/index.ctp b/app/View/Events/index.ctp index 74189a368..9bef91199 100755 --- a/app/View/Events/index.ctp +++ b/app/View/Events/index.ctp @@ -88,15 +88,15 @@ foreach ($events as $event):?> Form->postLink('Publish Event', array('action' => 'alert', $event['Event']['id']), array('action' => 'alert', $event['Event']['id']), 'Are you sure this event is complete and everyone should be informed?'); + echo $this->Form->postLink('', array('action' => 'alert', $event['Event']['id']), array('class' => 'icon-download-alt', 'title' => 'Publish Event'), 'Are you sure this event is complete and everyone should be informed?'); elseif (0 == $event['Event']['published']) echo 'Not published'; ?> Html->link(__('Edit', true), array('action' => 'edit', $event['Event']['id']), null); - echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $event['Event']['id']), null, __('Are you sure you want to delete # %s?', $event['Event']['id'])); + echo $this->Html->link('', array('action' => 'edit', $event['Event']['id']), array('class' => 'icon-edit', 'title' => 'Edit')); + echo $this->Form->postLink('', array('action' => 'delete', $event['Event']['id']), array('class' => 'icon-trash', 'title' => 'Delete'), __('Are you sure you want to delete # %s?', $event['Event']['id'])); }?> - Html->link(__('View', true), array('controller' => 'events', 'action' => 'view', $event['Event']['id'])); ?> + Html->link('', array('controller' => 'events', 'action' => 'view', $event['Event']['id']), array('class' => 'icon-list-alt', 'title' => 'View')); ?>
    \ No newline at end of file diff --git a/app/View/Events/show_i_o_c_results.ctp b/app/View/Events/show_i_o_c_results.ctp index 37c9e7e7f..95d1e3771 100644 --- a/app/View/Events/show_i_o_c_results.ctp +++ b/app/View/Events/show_i_o_c_results.ctp @@ -55,6 +55,6 @@ endforeach; ?>
    \ No newline at end of file diff --git a/app/View/Events/succes.ctp b/app/View/Events/succes.ctp index 97773d14c..3387166cd 100755 --- a/app/View/Events/succes.ctp +++ b/app/View/Events/succes.ctp @@ -5,9 +5,4 @@ if (0 == count($succes)):?> else:?>

    Succes, all done.

    - -
    -
    \ No newline at end of file diff --git a/app/View/Events/view.ctp b/app/View/Events/view.ctp index ae039e5d7..0c7531393 100755 --- a/app/View/Events/view.ctp +++ b/app/View/Events/view.ctp @@ -2,14 +2,33 @@ $mayModify = (($isAclModify && $event['Event']['user_id'] == $me['id']) || ($isAclModifyOrg && $event['Event']['orgc'] == $me['org'])); $mayPublish = ($isAclPublish && $event['Event']['orgc'] == $me['org']); ?> -
    -
    +
    +
      + +
    • Html->link(__('Add Attribute', true), array('controller' => 'attributes', 'action' => 'add', $event['Event']['id']));?>
    • +
    • Html->link(__('Add Attachment', true), array('controller' => 'attributes', 'action' => 'add_attachment', $event['Event']['id']));?>
    • +
    • Html->link(__('Edit Event', true), array('action' => 'edit', $event['Event']['id'])); ?>
    • +
    • Form->postLink(__('Delete Event'), array('action' => 'delete', $event['Event']['id']), null, __('Are you sure you want to delete # %s?', $event['Event']['id'])); ?>
    • +
    •  
    • + +
    • Html->link(__('Propose Attribute', true), array('controller' => 'shadow_attributes', 'action' => 'add', $event['Event']['id']));?>
    • +
    • Html->link(__('Propose Attachment', true), array('controller' => 'shadow_attributes', 'action' => 'add_attachment', $event['Event']['id']));?>
    • +
    •  
    • + +
    + +if ($isSiteAdmin || $mayModify): ?>
    • Html->link('Add Attribute', array('controller' => 'attributes', 'action' => 'add', $event['Event']['id']));?> Html->link('Add Attachment', array('controller' => 'attributes', 'action' => 'add_attachment', $event['Event']['id']));?> Html->link('Populate event from IOC', array('controller' => 'events', 'action' => 'addIOC', $event['Event']['id']));?>

    - +
    • Html->link('Propose Attribute', array('controller' => 'shadow_attributes', 'action' => 'add', $event['Event']['id']));?>
    • Html->link(__('Propose Attachment', true), array('controller' => 'shadow_attributes', 'action' => 'add_attachment', $event['Event']['id']));?>
    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!'); } ?> - +
    • Not published
    - + -
    • Html->link(__('Contact reporter', true), array('action' => 'contact', $event['Event']['id'])); ?>

    +
    +
    • Html->link(__('Contact reporter', true), array('action' => 'contact', $event['Event']['id'])); ?>

    • Html->link(__('Download as XML', true), array('action' => 'xml', 'download', $event['Event']['id'])); ?> Html->link(__('Download as IOC', true), array('action' => 'downloadOpenIOCEvent', $event['Event']['id'])); ?>
    + +
    + +
    + element('img', array('id' => $event['Event']['orgc']));?>

    Event

    @@ -206,10 +231,10 @@ if (!empty($event['Attribute'])):?> Html->link(__('Edit', true), array('controller' => 'attributes', 'action' => 'edit', $attribute['id'])); - echo $this->Form->postLink(__('Delete'), array('controller' => 'attributes', 'action' => 'delete', $attribute['id']), null, __('Are you sure you want to delete this attribute? Keep in mind that this will also delete this attribute on remote MISP instances.')); + echo $this->Html->link('', array('controller' => 'attributes', 'action' => 'edit', $attribute['id']), array('class' => 'icon-edit', 'title' => 'Edit')); + echo $this->Form->postLink('', array('controller' => 'attributes', 'action' => 'delete', $attribute['id']), array('class' => 'icon-trash', 'title' => 'Delete'), __('Are you sure you want to delete this attribute? Keep in mind that this will also delete this attribute on remote MISP instances.')); } else { - echo $this->Html->link(__('Propose edit', true), array('controller' => 'shadow_attributes', 'action' => 'edit', $attribute['id'])); + echo $this->Html->link('', array('controller' => 'shadow_attributes', 'action' => 'edit', $attribute['id']), array('class' => 'icon-edit', 'title' => 'Propose Edit')); } ?> @@ -275,9 +300,9 @@ if (!empty($event['Attribute'])):?> Html->link(__('Accept', true), array('controller' => 'shadow_attributes', 'action' => 'accept', $shadowAttribute['id'])); + echo $this->Html->link('', array('controller' => 'shadow_attributes', 'action' => 'accept', $shadowAttribute['id']), array('class' => 'icon-ok', 'title' => 'Accept')); } - echo $this->Html->link(__('Discard', true), array('controller' => 'shadow_attributes', 'action' => 'discard', $shadowAttribute['id'])); + echo $this->Html->link('', array('controller' => 'shadow_attributes', 'action' => 'discard', $shadowAttribute['id']), array('class' => 'icon-trash', 'title' => 'Discard')); ?> @@ -349,9 +374,9 @@ if (!empty($event['Attribute'])):?> Html->link(__('Accept', true), array('controller' => 'shadow_attributes', 'action' => 'accept', $remain['ShadowAttribute']['id'])); + echo $this->Html->link('', array('controller' => 'shadow_attributes', 'action' => 'accept', $remain['ShadowAttribute']['id']), array('class' => 'icon-ok', 'title' => 'Accept')); } - echo $this->Html->link(__('Discard', true), array('controller' => 'shadow_attributes', 'action' => 'discard',$remain['ShadowAttribute']['id'])); + echo $this->Html->link('', array('controller' => 'shadow_attributes', 'action' => 'discard',$remain['ShadowAttribute']['id']), array('class' => 'icon-trash', 'title' => 'Discard')); ?> @@ -363,26 +388,3 @@ if (!empty($event['Attribute'])):?>
    -
    -
    -
      - -
    • Html->link(__('Add Attribute', true), array('controller' => 'attributes', 'action' => 'add', $event['Event']['id']));?>
    • -
    • Html->link(__('Add Attachment', true), array('controller' => 'attributes', 'action' => 'add_attachment', $event['Event']['id']));?>
    • -
    • Html->link(__('Edit Event', true), array('action' => 'edit', $event['Event']['id'])); ?>
    • -
    • Form->postLink(__('Delete Event'), array('action' => 'delete', $event['Event']['id']), null, __('Are you sure you want to delete # %s?', $event['Event']['id'])); ?>
    • -
    •  
    • - -
    • Html->link(__('Propose Attribute', true), array('controller' => 'shadow_attributes', 'action' => 'add', $event['Event']['id']));?>
    • -
    • Html->link(__('Propose Attachment', true), array('controller' => 'shadow_attributes', 'action' => 'add_attachment', $event['Event']['id']));?>
    • -
    •  
    • - element('actions_menu'); - ?> -
    -
    diff --git a/app/View/Layouts/default.ctp b/app/View/Layouts/default.ctp index 888fd1925..e77690e2f 100755 --- a/app/View/Layouts/default.ctp +++ b/app/View/Layouts/default.ctp @@ -1,71 +1,64 @@ - Html->charset(); ?> - <?php echo Configure::read('CyDefSIG.name')?>: - <?php echo $title_for_layout; ?> + <?php echo $title_for_layout, ' - ', Configure::read('CyDefSIG.name')?>: Html->meta('icon'); - echo $this->Html->css('cake.generic'); - echo $this->Html->css(array('print'), 'stylesheet', array('media' => 'print')); + //echo $this->Html->css('cake.generic'); + echo $this->Html->css('roboto'); + echo $this->Html->css('bootstrap.min'); + echo $this->Html->css('datepicker'); + echo $this->Html->css('main'); + + // FIXME chri: re-add print stylesheet + //echo $this->Html->css(array('print'), 'stylesheet', array('media' => 'print')); echo $this->fetch('meta'); echo $this->fetch('css'); echo $this->fetch('script'); - echo $this->Html->script('jquery-1.8.3.min'); // Include jQuery library + echo $this->Html->script('jquery-1.9.1.min'); // Include jQuery library + echo $this->Html->script('bootstrap.min'); + echo $this->Html->script('bootstrap-datepicker'); + echo $this->Html->script('main'); ?>
    - - element('sql_dump'); ?> diff --git a/app/View/Logs/admin_index.ctp b/app/View/Logs/admin_index.ctp index cfba07beb..c83e45b6c 100755 --- a/app/View/Logs/admin_index.ctp +++ b/app/View/Logs/admin_index.ctp @@ -60,8 +60,3 @@ endforeach; ?> ?>
    -
    - -
    diff --git a/app/View/Logs/admin_search.ctp b/app/View/Logs/admin_search.ctp index fee76cf0d..00f2e5fbd 100755 --- a/app/View/Logs/admin_search.ctp +++ b/app/View/Logs/admin_search.ctp @@ -14,11 +14,6 @@ Form->end(__('Search', true));?> -
    - -
    -Js->writeBuffer(); // Write cached scripts +
    +Form->create('ShadowAttribute');?> +
    + +Form->input('id'); +echo $this->Form->input('category', array('between' => $this->Html->div('forminfo', '', array('id' => 'ShadowAttributeCategoryDiv')))); +if (!$attachment) { + echo $this->Form->input('type', array('between' => $this->Html->div('forminfo', '', array('id' => 'ShadowAttributeTypeDiv')))); +} +echo $this->Form->input('to_ids', array( + 'before' => $this->Html->div('forminfo', isset($attrDescriptions['signature']['formdesc']) ? $attrDescriptions['signature']['formdesc'] : $attrDescriptions['signature']['desc']), + 'label' => 'IDS Signature?' +)); +if (!$attachment) { + echo $this->Form->input('value', array( + 'type' => 'textarea', + 'error' => array('escape' => false), + )); +} + +$this->Js->get('#ShadowAttributeCategory')->event('change', 'formCategoryChanged("#ShadowAttributeCategory")'); +$this->Js->get('#ShadowAttributeType')->event('change', 'showFormInfo("#ShadowAttributeType")'); +?> +
    +Form->end(__('Submit'));?> +
    + + +Js->writeBuffer(); // Write cached scripts diff --git a/app/View/Users/admin_add.ctp b/app/View/Users/admin_add.ctp index e155a2f0e..cb8da33d4 100644 --- a/app/View/Users/admin_add.ctp +++ b/app/View/Users/admin_add.ctp @@ -19,8 +19,3 @@ Form->end(__('Submit'));?> -
    - -
    diff --git a/app/View/Users/admin_edit.ctp b/app/View/Users/admin_edit.ctp index 6dd5fd616..f8140c586 100755 --- a/app/View/Users/admin_edit.ctp +++ b/app/View/Users/admin_edit.ctp @@ -24,8 +24,3 @@ Form->end(__('Submit'));?> -
    - -
    diff --git a/app/View/Users/admin_email.ctp b/app/View/Users/admin_email.ctp index 262b9c909..dcdd08d1b 100644 --- a/app/View/Users/admin_email.ctp +++ b/app/View/Users/admin_email.ctp @@ -51,12 +51,6 @@ function showMessage(){ ?> -
    - -
    -Js->writeBuffer(); // Write cached scripts \ No newline at end of file +Js->writeBuffer(); // Write cached scripts ?> +
    + +
    \ No newline at end of file diff --git a/app/View/Layouts/default.ctp b/app/View/Layouts/default.ctp index 8921c56fa..5e11eaa1b 100755 --- a/app/View/Layouts/default.ctp +++ b/app/View/Layouts/default.ctp @@ -10,7 +10,7 @@ // echo $this->Html->css('cake.generic'); echo $this->Html->css('roboto'); - echo $this->Html->css('bootstrap'); + echo $this->Html->css('bootstrap'); // see http://twitter.github.io/bootstrap/base-css.html echo $this->Html->css('datepicker'); echo $this->Html->css('main'); echo $this->Html->css('misp'); @@ -23,7 +23,8 @@ echo $this->fetch('script'); echo $this->Html->script('jquery-1.9.1.min'); // Include jQuery library - echo $this->Html->script('bootstrap.min'); + echo $this->Html->script('bootstrap'); + //echo $this->Html->script('bootstrap.min'); echo $this->Html->script('bootstrap-datepicker'); echo $this->Html->script('main'); ?> diff --git a/app/webroot/js/bootstrap.js b/app/webroot/js/bootstrap.js new file mode 100644 index 000000000..643e71cdf --- /dev/null +++ b/app/webroot/js/bootstrap.js @@ -0,0 +1,2280 @@ +/* =================================================== + * bootstrap-transition.js v2.3.2 + * http://twitter.github.com/bootstrap/javascript.html#transitions + * =================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) + * ======================================================= */ + + $(function () { + + $.support.transition = (function () { + + var transitionEnd = (function () { + + var el = document.createElement('bootstrap') + , transEndEventNames = { + 'WebkitTransition' : 'webkitTransitionEnd' + , 'MozTransition' : 'transitionend' + , 'OTransition' : 'oTransitionEnd otransitionend' + , 'transition' : 'transitionend' + } + , name + + for (name in transEndEventNames){ + if (el.style[name] !== undefined) { + return transEndEventNames[name] + } + } + + }()) + + return transitionEnd && { + end: transitionEnd + } + + })() + + }) + +}(window.jQuery);/* ========================================================== + * bootstrap-alert.js v2.3.2 + * http://twitter.github.com/bootstrap/javascript.html#alerts + * ========================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* ALERT CLASS DEFINITION + * ====================== */ + + var dismiss = '[data-dismiss="alert"]' + , Alert = function (el) { + $(el).on('click', dismiss, this.close) + } + + Alert.prototype.close = function (e) { + var $this = $(this) + , selector = $this.attr('data-target') + , $parent + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + $parent = $(selector) + + e && e.preventDefault() + + $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) + + $parent.trigger(e = $.Event('close')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + $parent + .trigger('closed') + .remove() + } + + $.support.transition && $parent.hasClass('fade') ? + $parent.on($.support.transition.end, removeElement) : + removeElement() + } + + + /* ALERT PLUGIN DEFINITION + * ======================= */ + + var old = $.fn.alert + + $.fn.alert = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('alert') + if (!data) $this.data('alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.alert.Constructor = Alert + + + /* ALERT NO CONFLICT + * ================= */ + + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } + + + /* ALERT DATA-API + * ============== */ + + $(document).on('click.alert.data-api', dismiss, Alert.prototype.close) + +}(window.jQuery);/* ============================================================ + * bootstrap-button.js v2.3.2 + * http://twitter.github.com/bootstrap/javascript.html#buttons + * ============================================================ + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* BUTTON PUBLIC CLASS DEFINITION + * ============================== */ + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.button.defaults, options) + } + + Button.prototype.setState = function (state) { + var d = 'disabled' + , $el = this.$element + , data = $el.data() + , val = $el.is('input') ? 'val' : 'html' + + state = state + 'Text' + data.resetText || $el.data('resetText', $el[val]()) + + $el[val](data[state] || this.options[state]) + + // push to event loop to allow forms to submit + setTimeout(function () { + state == 'loadingText' ? + $el.addClass(d).attr(d, d) : + $el.removeClass(d).removeAttr(d) + }, 0) + } + + Button.prototype.toggle = function () { + var $parent = this.$element.closest('[data-toggle="buttons-radio"]') + + $parent && $parent + .find('.active') + .removeClass('active') + + this.$element.toggleClass('active') + } + + + /* BUTTON PLUGIN DEFINITION + * ======================== */ + + var old = $.fn.button + + $.fn.button = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('button') + , options = typeof option == 'object' && option + if (!data) $this.data('button', (data = new Button(this, options))) + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) + } + + $.fn.button.defaults = { + loadingText: 'loading...' + } + + $.fn.button.Constructor = Button + + + /* BUTTON NO CONFLICT + * ================== */ + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + + /* BUTTON DATA-API + * =============== */ + + $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') + }) + +}(window.jQuery);/* ========================================================== + * bootstrap-carousel.js v2.3.2 + * http://twitter.github.com/bootstrap/javascript.html#carousel + * ========================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* CAROUSEL CLASS DEFINITION + * ========================= */ + + var Carousel = function (element, options) { + this.$element = $(element) + this.$indicators = this.$element.find('.carousel-indicators') + this.options = options + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) + } + + Carousel.prototype = { + + cycle: function (e) { + if (!e) this.paused = false + if (this.interval) clearInterval(this.interval); + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + return this + } + + , getActiveIndex: function () { + this.$active = this.$element.find('.item.active') + this.$items = this.$active.parent().children() + return this.$items.index(this.$active) + } + + , to: function (pos) { + var activeIndex = this.getActiveIndex() + , that = this + + if (pos > (this.$items.length - 1) || pos < 0) return + + if (this.sliding) { + return this.$element.one('slid', function () { + that.to(pos) + }) + } + + if (activeIndex == pos) { + return this.pause().cycle() + } + + return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) + } + + , pause: function (e) { + if (!e) this.paused = true + if (this.$element.find('.next, .prev').length && $.support.transition.end) { + this.$element.trigger($.support.transition.end) + this.cycle(true) + } + clearInterval(this.interval) + this.interval = null + return this + } + + , next: function () { + if (this.sliding) return + return this.slide('next') + } + + , prev: function () { + if (this.sliding) return + return this.slide('prev') + } + + , slide: function (type, next) { + var $active = this.$element.find('.item.active') + , $next = next || $active[type]() + , isCycling = this.interval + , direction = type == 'next' ? 'left' : 'right' + , fallback = type == 'next' ? 'first' : 'last' + , that = this + , e + + this.sliding = true + + isCycling && this.pause() + + $next = $next.length ? $next : this.$element.find('.item')[fallback]() + + e = $.Event('slide', { + relatedTarget: $next[0] + , direction: direction + }) + + if ($next.hasClass('active')) return + + if (this.$indicators.length) { + this.$indicators.find('.active').removeClass('active') + this.$element.one('slid', function () { + var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) + $nextIndicator && $nextIndicator.addClass('active') + }) + } + + if ($.support.transition && this.$element.hasClass('slide')) { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + this.$element.one($.support.transition.end, function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { that.$element.trigger('slid') }, 0) + }) + } else { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger('slid') + } + + isCycling && this.cycle() + + return this + } + + } + + + /* CAROUSEL PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.carousel + + $.fn.carousel = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('carousel') + , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) + , action = typeof option == 'string' ? option : options.slide + if (!data) $this.data('carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.pause().cycle() + }) + } + + $.fn.carousel.defaults = { + interval: 5000 + , pause: 'hover' + } + + $.fn.carousel.Constructor = Carousel + + + /* CAROUSEL NO CONFLICT + * ==================== */ + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + + /* CAROUSEL DATA-API + * ================= */ + + $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { + var $this = $(this), href + , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + , options = $.extend({}, $target.data(), $this.data()) + , slideIndex + + $target.carousel(options) + + if (slideIndex = $this.attr('data-slide-to')) { + $target.data('carousel').pause().to(slideIndex).cycle() + } + + e.preventDefault() + }) + +}(window.jQuery);/* ============================================================= + * bootstrap-collapse.js v2.3.2 + * http://twitter.github.com/bootstrap/javascript.html#collapse + * ============================================================= + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* COLLAPSE PUBLIC CLASS DEFINITION + * ================================ */ + + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.collapse.defaults, options) + + if (this.options.parent) { + this.$parent = $(this.options.parent) + } + + this.options.toggle && this.toggle() + } + + Collapse.prototype = { + + constructor: Collapse + + , dimension: function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + , show: function () { + var dimension + , scroll + , actives + , hasData + + if (this.transitioning || this.$element.hasClass('in')) return + + dimension = this.dimension() + scroll = $.camelCase(['scroll', dimension].join('-')) + actives = this.$parent && this.$parent.find('> .accordion-group > .in') + + if (actives && actives.length) { + hasData = actives.data('collapse') + if (hasData && hasData.transitioning) return + actives.collapse('hide') + hasData || actives.data('collapse', null) + } + + this.$element[dimension](0) + this.transition('addClass', $.Event('show'), 'shown') + $.support.transition && this.$element[dimension](this.$element[0][scroll]) + } + + , hide: function () { + var dimension + if (this.transitioning || !this.$element.hasClass('in')) return + dimension = this.dimension() + this.reset(this.$element[dimension]()) + this.transition('removeClass', $.Event('hide'), 'hidden') + this.$element[dimension](0) + } + + , reset: function (size) { + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + [dimension](size || 'auto') + [0].offsetWidth + + this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') + + return this + } + + , transition: function (method, startEvent, completeEvent) { + var that = this + , complete = function () { + if (startEvent.type == 'show') that.reset() + that.transitioning = 0 + that.$element.trigger(completeEvent) + } + + this.$element.trigger(startEvent) + + if (startEvent.isDefaultPrevented()) return + + this.transitioning = 1 + + this.$element[method]('in') + + $.support.transition && this.$element.hasClass('collapse') ? + this.$element.one($.support.transition.end, complete) : + complete() + } + + , toggle: function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + } + + + /* COLLAPSE PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.collapse + + $.fn.collapse = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('collapse') + , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option) + if (!data) $this.data('collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.collapse.defaults = { + toggle: true + } + + $.fn.collapse.Constructor = Collapse + + + /* COLLAPSE NO CONFLICT + * ==================== */ + + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + /* COLLAPSE DATA-API + * ================= */ + + $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { + var $this = $(this), href + , target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + , option = $(target).data('collapse') ? 'toggle' : $this.data() + $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') + $(target).collapse(option) + }) + +}(window.jQuery);/* ============================================================ + * bootstrap-dropdown.js v2.3.2 + * http://twitter.github.com/bootstrap/javascript.html#dropdowns + * ============================================================ + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* DROPDOWN CLASS DEFINITION + * ========================= */ + + var toggle = '[data-toggle=dropdown]' + , Dropdown = function (element) { + var $el = $(element).on('click.dropdown.data-api', this.toggle) + $('html').on('click.dropdown.data-api', function () { + $el.parent().removeClass('open') + }) + } + + Dropdown.prototype = { + + constructor: Dropdown + + , toggle: function (e) { + var $this = $(this) + , $parent + , isActive + + if ($this.is('.disabled, :disabled')) return + + $parent = getParent($this) + + isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + if ('ontouchstart' in document.documentElement) { + // if mobile we we use a backdrop because click events don't delegate + $(' +
    +
    \ No newline at end of file diff --git a/app/webroot/css/misp.css b/app/webroot/css/misp.css index c5a6e9e52..c45d09469 100644 --- a/app/webroot/css/misp.css +++ b/app/webroot/css/misp.css @@ -9,4 +9,9 @@ td.short { width:5%; white-space: nowrap; text-align: left; -} \ No newline at end of file +} + +pre { + font-size: 11px; + +}} \ No newline at end of file From e865b84d6782a680b4f0782f870065a71031c196 Mon Sep 17 00:00:00 2001 From: Christophe Vandeplas Date: Fri, 31 May 2013 13:42:02 +0200 Subject: [PATCH 07/56] UI blacklist whitelist regexp --- app/View/Blacklists/admin_add.ctp | 13 +++++- app/View/Blacklists/admin_edit.ctp | 7 +++- app/View/Blacklists/admin_index.ctp | 62 +++++++++++++++++++---------- app/View/Blacklists/index.ctp | 53 +++++++++++++++++------- app/View/Regexp/admin_add.ctp | 14 ++++++- app/View/Regexp/admin_edit.ctp | 15 +++++-- app/View/Regexp/admin_index.ctp | 56 +++++++++++++++++--------- app/View/Regexp/index.ctp | 57 ++++++++++++++++++-------- app/View/Whitelists/admin_add.ctp | 13 +++++- app/View/Whitelists/admin_edit.ctp | 7 +++- app/View/Whitelists/admin_index.ctp | 48 +++++++++++++++------- app/View/Whitelists/index.ctp | 53 +++++++++++++++++------- 12 files changed, 283 insertions(+), 115 deletions(-) diff --git a/app/View/Blacklists/admin_add.ctp b/app/View/Blacklists/admin_add.ctp index 64331d277..7a6281748 100755 --- a/app/View/Blacklists/admin_add.ctp +++ b/app/View/Blacklists/admin_add.ctp @@ -1,10 +1,19 @@
    Form->create('Blacklist');?>
    - + Add Import Blacklist Form->input('name'); ?>
    -Form->end(__('Submit'));?> +Form->button('Add', array('class' => 'btn btn-primary')); +echo $this->Form->end(); +?>
    +
    + +
    \ No newline at end of file diff --git a/app/View/Blacklists/admin_edit.ctp b/app/View/Blacklists/admin_edit.ctp index 76d164bb5..237a3a91c 100755 --- a/app/View/Blacklists/admin_edit.ctp +++ b/app/View/Blacklists/admin_edit.ctp @@ -1,7 +1,7 @@
    Form->create('Blacklist');?>
    - + Edit Import Blacklist Form->input('id'); echo $this->Form->input('name'); @@ -10,7 +10,10 @@ Form->end(__('Submit'));?>
    -
      +
    \ No newline at end of file diff --git a/app/View/Blacklists/admin_index.ctp b/app/View/Blacklists/admin_index.ctp index fdd311a56..b0a2666c8 100755 --- a/app/View/Blacklists/admin_index.ctp +++ b/app/View/Blacklists/admin_index.ctp @@ -1,6 +1,22 @@
    -

    - +

    Import Blacklist

    + +
    @@ -9,32 +25,34 @@ foreach ($list as $item):?> - - +
    Paginator->sort('id');?> Paginator->sort('name');?>
       - Html->link(__('Edit'), array('admin' => true, 'action' => 'edit', $item['Blacklist']['id']));?> - Form->postLink(__('Delete'), array('admin' => true, 'action' => 'delete', $item['Blacklist']['id']), null, __('Are you sure you want to delete "%s"?', $item['Blacklist']['name']));?> +   + Html->link('', array('admin' => true, 'action' => 'edit', $item['Blacklist']['id']), array('class' => 'icon-edit', 'title' => 'Edit'));?> + Form->postLink('', array('admin' => true, 'action' => 'delete', $item['Blacklist']['id']), array('class' => 'icon-trash', 'title' => 'Delete'), __('Are you sure you want to delete "%s"?', $item['Blacklist']['name']));?>

    - Paginator->counter(array( - 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') - )); - ?>

    - -
    - Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled')); - echo $this->Paginator->numbers(array('separator' => '')); - echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled')); - ?> -
    + Paginator->counter(array( + 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') + )); + ?> +

    +
    -
      - -
    • Html->link(__('New Blacklist'), array('admin' => true, 'action' => 'add'));?>
    • +
    \ No newline at end of file diff --git a/app/View/Blacklists/index.ctp b/app/View/Blacklists/index.ctp index cd9d8dd76..85190e789 100644 --- a/app/View/Blacklists/index.ctp +++ b/app/View/Blacklists/index.ctp @@ -1,6 +1,22 @@
    -

    - +

    Import Blacklist

    + +
    @@ -13,17 +29,24 @@ foreach ($list as $item):?> endforeach;?>
    Paginator->sort('id');?> Paginator->sort('name');?>

    - Paginator->counter(array( - 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') - )); - ?>

    - -
    - Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled')); - echo $this->Paginator->numbers(array('separator' => '')); - echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled')); - ?> -
    + Paginator->counter(array( + 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') + )); + ?> +

    + +
    +
    +
    \ No newline at end of file diff --git a/app/View/Regexp/admin_add.ctp b/app/View/Regexp/admin_add.ctp index 1e23c2962..007ed6133 100755 --- a/app/View/Regexp/admin_add.ctp +++ b/app/View/Regexp/admin_add.ctp @@ -1,11 +1,21 @@
    Form->create('Regexp');?>
    - + Add Import Regexp Form->input('regexp'); echo $this->Form->input('replacement'); ?>
    -Form->end(__('Submit'));?> +Form->button('Add', array('class' => 'btn btn-primary')); +echo $this->Form->end(); +?> +
    +
    +
    diff --git a/app/View/Regexp/admin_edit.ctp b/app/View/Regexp/admin_edit.ctp index e3543309f..2a72bc831 100755 --- a/app/View/Regexp/admin_edit.ctp +++ b/app/View/Regexp/admin_edit.ctp @@ -1,7 +1,7 @@
    Form->create('Regexp');?>
    - + Edit Import Regexp Form->input('id'); echo $this->Form->input('regexp'); @@ -12,6 +12,15 @@
      -
    • 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')));?>
    • +
    -
    \ No newline at end of file + +
    + +
    diff --git a/app/View/Regexp/admin_index.ctp b/app/View/Regexp/admin_index.ctp index b7d77d681..24899cced 100755 --- a/app/View/Regexp/admin_index.ctp +++ b/app/View/Regexp/admin_index.ctp @@ -1,20 +1,36 @@
    -

    - +

    Import Regexp

    + +
    - + - - - + + @@ -24,19 +40,23 @@ endforeach;?> echo $this->Paginator->counter(array( 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') )); - ?>

    - -
    - Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled')); - echo $this->Paginator->numbers(array('separator' => '')); - echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled')); ?> +

    + +
    -
      -
    • Html->link(__('Perform on existing'), array('admin' => true, 'action' => 'clean'));?>
    • -
    • Html->link(__('New Regexp'), array('admin' => true, 'action' => 'add'));?>
    • +
    diff --git a/app/View/Regexp/index.ctp b/app/View/Regexp/index.ctp index fcd4a1d89..aefb8f389 100644 --- a/app/View/Regexp/index.ctp +++ b/app/View/Regexp/index.ctp @@ -1,6 +1,22 @@
    -

    -
    Paginator->sort('id');?> Paginator->sort('regexp');?> Paginator->sort('replacement');?>Actions
        - Html->link(__('Edit'), array('admin' => true, 'action' => 'edit', $item['Regexp']['id']));?> - Form->postLink(__('Delete'), array('admin' => true, 'action' => 'delete', $item['Regexp']['id']), null, __('Are you sure you want to delete %s?', h($item['Regexp']['regexp'])));?> +    + Html->link('', array('admin' => true, 'action' => 'edit', $item['Regexp']['id']), array('class' => 'icon-edit', 'title' => 'Edit'));?> + Form->postLink('', array('admin' => true, 'action' => 'delete', $item['Regexp']['id']), array('class' => 'icon-trash', 'title' => 'Delete'), __('Are you sure you want to delete %s?', h($item['Regexp']['regexp'])));?>
    +

    Import Regexp

    + +
    @@ -9,23 +25,30 @@ foreach ($list as $item):?> - - + +
    Paginator->sort('id');?> Paginator->sort('regexp');?>
         

    - Paginator->counter(array( - 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') - )); - ?>

    - -
    - Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled')); - echo $this->Paginator->numbers(array('separator' => '')); - echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled')); - ?> -
    + Paginator->counter(array( + 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') + )); + ?> +

    + +
    +
    +
    diff --git a/app/View/Whitelists/admin_add.ctp b/app/View/Whitelists/admin_add.ctp index 44dca2d9f..90e46d3c4 100755 --- a/app/View/Whitelists/admin_add.ctp +++ b/app/View/Whitelists/admin_add.ctp @@ -1,10 +1,19 @@
    Form->create('Whitelist');?>
    - + Add Signature Whitelist Form->input('name'); ?>
    -Form->end(__('Submit'));?> +Form->button('Add', array('class' => 'btn btn-primary')); +echo $this->Form->end(); +?>
    +
    + +
    \ No newline at end of file diff --git a/app/View/Whitelists/admin_edit.ctp b/app/View/Whitelists/admin_edit.ctp index d08fd3b34..bd0210008 100755 --- a/app/View/Whitelists/admin_edit.ctp +++ b/app/View/Whitelists/admin_edit.ctp @@ -1,7 +1,7 @@
    Form->create('Whitelist');?>
    - + Edit Signature Whitelist Form->input('id'); echo $this->Form->input('name'); @@ -10,7 +10,10 @@ Form->end(__('Submit'));?>
    -
      +
    \ No newline at end of file diff --git a/app/View/Whitelists/admin_index.ctp b/app/View/Whitelists/admin_index.ctp index 6d1b6cf00..23d4abbf6 100755 --- a/app/View/Whitelists/admin_index.ctp +++ b/app/View/Whitelists/admin_index.ctp @@ -1,6 +1,22 @@
    -

    - +

    Import Whitelist

    + +
    @@ -9,10 +25,10 @@ foreach ($list as $item):?> - - + @@ -22,19 +38,21 @@ endforeach;?> echo $this->Paginator->counter(array( 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') )); - ?>

    - -
    + ?> +

    +
    -
      - -
    • Html->link(__('New Whitelist'), array('admin' => true, 'action' => 'add'));?>
    • +
    \ No newline at end of file diff --git a/app/View/Whitelists/index.ctp b/app/View/Whitelists/index.ctp index da48e8952..ed71c170f 100644 --- a/app/View/Whitelists/index.ctp +++ b/app/View/Whitelists/index.ctp @@ -1,6 +1,22 @@
    -

    -
    Paginator->sort('id');?> Paginator->sort('name');?>
       - Html->link(__('Edit'), array('admin' => true, 'action' => 'edit', $item['Whitelist']['id']));?> - Form->postLink(__('Delete'), array('admin' => true, 'action' => 'delete', $item['Whitelist']['id']), null, __('Are you sure you want to delete "%s"?', h($item['Whitelist']['name'])));?> +   + Html->link('', array('admin' => true, 'action' => 'edit', $item['Whitelist']['id']), array('class' => 'icon-edit', 'title' => 'Edit'));?> + Form->postLink('', array('admin' => true, 'action' => 'delete', $item['Whitelist']['id']), array('class' => 'icon-trash', 'title' => 'Delete'), __('Are you sure you want to delete "%s"?', $item['Whitelist']['name']));?>
    +

    Signature Whitelist

    + +
    @@ -13,17 +29,24 @@ foreach ($list as $item):?> endforeach;?>
    Paginator->sort('id');?> Paginator->sort('name');?>

    - Paginator->counter(array( - 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') - )); - ?>

    - -
    - Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled')); - echo $this->Paginator->numbers(array('separator' => '')); - echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled')); - ?> -
    + Paginator->counter(array( + 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') + )); + ?> +

    + +
    +
    +
    \ No newline at end of file From e1296bad7eab00c84376adff17ec112f8e9ab6e6 Mon Sep 17 00:00:00 2001 From: Christophe Vandeplas Date: Fri, 31 May 2013 13:59:56 +0200 Subject: [PATCH 08/56] UI servers --- app/View/Servers/add.ctp | 31 +++++++++++------ app/View/Servers/edit.ctp | 29 ++++++++++------ app/View/Servers/index.ctp | 71 ++++++++++++++++++++++++-------------- app/View/Servers/pull.ctp | 7 ++-- app/View/Servers/push.ctp | 6 ++-- 5 files changed, 90 insertions(+), 54 deletions(-) diff --git a/app/View/Servers/add.ctp b/app/View/Servers/add.ctp index e50f1a4a2..4c43f6d1c 100755 --- a/app/View/Servers/add.ctp +++ b/app/View/Servers/add.ctp @@ -1,26 +1,37 @@
    Form->create('Server');?>
    - + Add Server Form->input('url', array( - 'label' => 'Base URL', - 'before' => $this->Html->div('forminfo', 'The base-url to the external server you want to sync with.
    Example: https://foo.sig.mil.be'), + 'label' => 'Base URL', + 'before' => $this->Html->div('forminfo', 'The base-url to the external server you want to sync with.
    Example: https://foo.sig.mil.be'), )); echo $this->Form->input('organization', array( - 'label' => 'Organization', - 'before' => $this->Html->div('forminfo', 'The organization having the external server you want to sync with.
    Example: BE'), + 'label' => 'Organization', + 'before' => $this->Html->div('forminfo', 'The organization having the external server you want to sync with.
    Example: BE'), )); echo $this->Form->input('authkey', array( - 'before' => $this->Html->div('forminfo', 'You can find the authentication key on your profile on the external server.'), + 'before' => $this->Html->div('forminfo', 'You can find the authentication key on your profile on the external server.'), )); echo $this->Form->input('push', array( - 'before' => $this->Html->div('forminfo', 'Allow the upload of events and their attributes.'), + 'div' => 'input clear', + 'before' => $this->Html->div('forminfo', 'Allow the upload of events and their attributes.'), )); echo $this->Form->input('pull', array( - 'before' => $this->Html->div('forminfo', 'Allow the download of events and their attributes from the server.'), + 'before' => $this->Html->div('forminfo', 'Allow the download of events and their attributes from the server.'), )); ?>
    -Form->end(__('Submit'));?> -
    \ No newline at end of file +Form->button('Add', array('class' => 'btn btn-primary')); +echo $this->Form->end(); +?> + +
    + +
    diff --git a/app/View/Servers/edit.ctp b/app/View/Servers/edit.ctp index 17398030f..3eb7cd46c 100755 --- a/app/View/Servers/edit.ctp +++ b/app/View/Servers/edit.ctp @@ -1,33 +1,40 @@
    Form->create('Server');?>
    - + Edit Server 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.
    Example: https://foo.sig.mil.be'), + 'label' => 'Base URL', + 'before' => $this->Html->div('forminfo', 'The base-url to the external server you want to sync with.
    Example: https://foo.sig.mil.be'), )); echo $this->Form->input('organization', array( - 'label' => 'Organization', - 'before' => $this->Html->div('forminfo', 'The organization having the external server you want to sync with.
    Example: https://foo.sig.mil.be'), + 'label' => 'Organization', + 'before' => $this->Html->div('forminfo', 'The organization having the external server you want to sync with.
    Example: BE'), )); echo $this->Form->input('authkey', array( - 'before' => $this->Html->div('forminfo', 'You can find the authentication key on your profile on the external server.
    Leave empty if you don\'t want to change it.'), + 'before' => $this->Html->div('forminfo', 'You can find the authentication key on your profile on the external server.'), )); echo $this->Form->input('push', array( - 'before' => $this->Html->div('forminfo', 'Allow the upload of events and their attributes.'), + 'div' => 'input clear', + 'before' => $this->Html->div('forminfo', 'Allow the upload of events and their attributes.'), )); echo $this->Form->input('pull', array( - 'before' => $this->Html->div('forminfo', 'Allow the download of events and their attributes from the server.'), + 'before' => $this->Html->div('forminfo', 'Allow the download of events and their attributes from the server.'), )); ?>
    -Form->end(__('Submit'));?> +Form->button('Edit', array('class' => 'btn btn-primary')); +echo $this->Form->end(); +?>
    -
      - +
    + diff --git a/app/View/Servers/index.ctp b/app/View/Servers/index.ctp index 69a2e1fc1..f7d000f08 100755 --- a/app/View/Servers/index.ctp +++ b/app/View/Servers/index.ctp @@ -1,6 +1,22 @@
    -

    - +

    Servers

    + +
    @@ -14,7 +30,7 @@ if ($isAdmin): ?> endif; ?> - + @@ -31,40 +47,43 @@ foreach ($servers as $server): ?>
    Paginator->sort('push');?> Paginator->sort('pull');?>Last Pulled ID Last Pushed IDActions
    + Form->postLink('', array('action' => 'pull', $server['Server']['id'], 'full'), array('class' => 'icon-download', 'title' => 'Pull all')); + if ($server['Server']['push'] && $me['org'] == 'ADMIN') echo $this->Form->postLink('', array('action' => 'push', $server['Server']['id'], 'full'), array('class' => 'icon-upload', 'title' => 'Push all') ); + ?> +   Html->link(__('Edit'), array('action' => 'edit', $server['Server']['id']), null); - if ($mayModify) echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $server['Server']['id']), null, __('Are you sure you want to delete # %s?', $server['Server']['id'])); ?> + 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'])); + ?> - Form->postLink(__('Pull'), array('action' => 'pull', $server['Server']['id']) ); ?> - Form->postLink(__('Push'), array('action' => 'push', $server['Server']['id']) ); ?> - - Form->postLink(__('Pull All'), array('action' => 'pull', $server['Server']['id'], 'full') ); ?> - Form->postLink(__('Push All'), array('action' => 'push', $server['Server']['id'], 'full') ); ?>

    - Paginator->counter(array( - 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') - )); - ?>

    - -
    - Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled')); - echo $this->Paginator->numbers(array('separator' => '')); - echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled')); - ?> -
    + Paginator->counter(array( + 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') + )); + ?> +

    +
    -
      -
    • Html->link(__('New Server'), array('controller' => 'servers', 'action' => 'add')); ?>
    • -
    • Html->link(__('List Servers'), array('controller' => 'servers', 'action' => 'index'));?>
    • +
    diff --git a/app/View/Servers/pull.ctp b/app/View/Servers/pull.ctp index 9a98e3c2b..58a431e3f 100755 --- a/app/View/Servers/pull.ctp +++ b/app/View/Servers/pull.ctp @@ -23,9 +23,8 @@ else:?> endif;?>
    -
      -
    • Html->link(__('New Server'), array('controller' => 'servers', 'action' => 'add')); ?>
    • -
    • Html->link(__('List Servers'), array('controller' => 'servers', 'action' => 'index'));?>
    • - +
    \ No newline at end of file diff --git a/app/View/Servers/push.ctp b/app/View/Servers/push.ctp index 6ca029561..d92f63e82 100755 --- a/app/View/Servers/push.ctp +++ b/app/View/Servers/push.ctp @@ -23,8 +23,8 @@ else:?> endif;?>
    -
      -
    • Html->link(__('New Server'), array('controller' => 'servers', 'action' => 'add')); ?>
    • -
    • Html->link(__('List Servers'), array('controller' => 'servers', 'action' => 'index'));?>
    • +
    \ No newline at end of file From d768d30e793ff1909075f0347e7be6152e8a5a88 Mon Sep 17 00:00:00 2001 From: iglocska Date: Fri, 31 May 2013 15:42:53 +0200 Subject: [PATCH 09/56] GUI changes for the user views --- app/View/Users/admin_add.ctp | 23 ++++-- app/View/Users/admin_edit.ctp | 37 ++++++++-- app/View/Users/admin_email.ctp | 81 ++++++++++++++------ app/View/Users/admin_index.ctp | 19 ++++- app/View/Users/admin_view.ctp | 131 +++++++++++++++++++-------------- app/View/Users/change_pw.ctp | 5 +- app/View/Users/edit.ctp | 21 ++++-- app/View/Users/login.ctp | 3 +- app/View/Users/memberslist.ctp | 22 ++++-- app/View/Users/news.ctp | 10 ++- app/View/Users/terms.ctp | 10 ++- app/View/Users/view.ctp | 28 ++++--- 12 files changed, 264 insertions(+), 126 deletions(-) diff --git a/app/View/Users/admin_add.ctp b/app/View/Users/admin_add.ctp index cb8da33d4..31eb21e03 100644 --- a/app/View/Users/admin_add.ctp +++ b/app/View/Users/admin_add.ctp @@ -9,13 +9,26 @@ if ($currentOrg == 'ADMIN') { echo $this->Form->input('org', array('label' => 'Organisation')); } - echo $this->Form->input('role_id', array('label' => 'Role')); - echo $this->Form->input('autoalert', array('label' => 'Receive alerts when events are published')); - echo $this->Form->input('contactalert', array('label' => 'Receive alerts from "contact reporter" requests')); + echo $this->Form->input('role_id', array('label' => 'Role', 'div' => 'input clear')); echo $this->Form->input('authkey', array('value' => $authkey, 'readonly' => 'readonly')); echo $this->Form->input('nids_sid'); - echo $this->Form->input('gpgkey', array('label' => 'GPG key')); + echo $this->Form->input('gpgkey', array('label' => 'GPG key', 'div' => 'clear', 'class' => 'input-xxlarge')); + echo $this->Form->input('autoalert', array('label' => 'Receive alerts when events are published')); + echo $this->Form->input('contactalert', array('label' => 'Receive alerts from "contact reporter" requests')); + ?> -Form->end(__('Submit'));?> +Form->button(__('Submit'), array('class' => 'btn btn-primary')); + echo $this->Form->end();?> + +
    +
      +
    • Html->link(__('New User', true), array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?>
    • +
    • Html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?>
    • +
      +
    • Html->link(__('New Role', true), array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?>
    • +
    • Html->link(__('List Roles', true), array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?>
    • +
      +
    • Html->link(__('Contact users', true), array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?>
    • +
    diff --git a/app/View/Users/admin_edit.ctp b/app/View/Users/admin_edit.ctp index f8140c586..a7ccfbb9a 100755 --- a/app/View/Users/admin_edit.ctp +++ b/app/View/Users/admin_edit.ctp @@ -9,18 +9,39 @@ if ($currentOrg == 'ADMIN') { echo $this->Form->input('org', array('label' => 'Organisation')); } - echo $this->Form->input('role_id', array('label' => 'Role')); // TODO ACL, User edit role_id. - echo $this->Form->input('autoalert', array('label' => 'Receive alerts when events are published')); - echo $this->Form->input('contactalert', array('label' => 'Receive alerts from "contact reporter" requests')); + echo $this->Form->input('role_id', array('label' => 'Role', 'div' => 'input clear')); // TODO ACL, User edit role_id. echo $this->Form->input('authkey', array('disabled' => 'disabled', 'label' => 'Authentication key')); - echo $this->Html->link('reset', array('controller' => 'users', 'action' => 'resetauthkey', $currentId)); - echo ('

    '); echo $this->Form->input('nids_sid'); + echo $this->Form->input('newsread', array( + 'label' => 'News read (date)', + 'type' => 'text', + 'class' => 'datepicker', + )); + echo $this->Form->input('gpgkey', array('label' => 'GPG key', 'div' => 'clear', 'class' => 'input-xxlarge')); echo $this->Form->input('termsaccepted', array('label' => 'Terms accepted')); echo $this->Form->input('change_pw', array('type' => 'checkbox', 'label' => 'Change Password')); - echo $this->Form->input('newsread', array('label' => 'News read (date)')); - echo $this->Form->input('gpgkey', array('label' => 'GPG key')); + echo $this->Form->input('autoalert', array('label' => 'Receive alerts when events are published')); + echo $this->Form->input('contactalert', array('label' => 'Receive alerts from "contact reporter" requests')); + + echo $this->Html->link('Reset Auth Key', array('controller' => 'users', 'action' => 'resetauthkey', $currentId)); ?> -Form->end(__('Submit'));?> +Form->button(__('Submit'), array('class' => 'btn btn-primary')); +echo $this->Form->end();?> + +
    +
      +
    • Html->link(__('New User', true), array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?>
    • +
    • Html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?>
    • +
      + +
    • Html->link(__('New Role', true), array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?>
    • + +
    • Html->link(__('List Roles', true), array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?>
    • +
      + +
    • Html->link(__('Contact users', true), array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?>
    • + +
    diff --git a/app/View/Users/admin_email.ctp b/app/View/Users/admin_email.ctp index dcdd08d1b..867031d66 100644 --- a/app/View/Users/admin_email.ctp +++ b/app/View/Users/admin_email.ctp @@ -19,38 +19,77 @@ function showMessage(){ // This choice will determine $actionOptions = array('Custom message', 'Send temporary password'); $recipientOptions = array('All existing users', 'An existing user', 'New user'); - echo '
    '; + ?> +
    + Form->input('action', array('type' => 'select', 'options' => $actionOptions, 'id' => 'action')); + ?> +
    + Form->input('subject', array('type' => 'text', 'label' => 'Subject', 'style' => 'width:400px;')); + ?> +
    +
    +
    + Form->input('recipient', array('type' => 'select', 'options' => $recipientOptions, 'id' => 'recipient')); - echo '
    '; - echo '
    '; - echo $this->Form->input('recipientEmail', array('type' => 'text', 'label' => 'Recipient Email', 'style' => 'width:300px;')); - echo '
    '; - echo '
    '; - echo $this->Form->input('subject', array('type' => 'text', 'label' => 'Subject', 'style' => 'width:400px;')); - echo '
    '; - echo '
    '; - echo $this->Form->input('recipientEmailList', array('type' => 'select', 'options' => $recipientEmail, 'label' => 'Recipient Email')); - echo '
    '; - echo '
    '; + ?> +
    + Form->input('recipientEmail', array('type' => 'text', 'label' => 'Recipient Email', 'style' => 'width:300px;')); + ?> +
    +
    + Form->input('recipientEmailList', array('type' => 'select', 'options' => $recipientEmail, 'label' => 'Recipient Email')); + ?> +
    +
    + +
    + Form->input('gpg', array('type' => 'textarea')); - echo '
    '; - echo '
    '; - echo $this->Form->input('customMessage', array( + ?> +
    +
    + Form->input('customMessage', array( 'label' => __('Enter a custom message', true), 'type' => 'checkbox', 'checked' => 'checked', 'id' => 'customMessageToggle' - )); - echo '
    '; + )); + ?> +
    +
    + Form->input('message', array('type' => 'textarea')); echo $this->Html->div('messageDiv', $str, array('id' => 'messageDiv')); - ?> - Form->end(__('Submit', true)); - // link an onchange event to the form elements - ?> + ?> +
    +
    + Form->button(__('Submit'), array('class' => 'btn btn-primary')); + echo $this->Form->end(); + ?> +
    +
    +
      +
    • Html->link(__('New User', true), array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?>
    • +
    • Html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?>
    • +
      + +
    • Html->link(__('New Role', true), array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?>
    • + +
    • Html->link(__('List Roles', true), array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?>
    • +
      + +
    • Html->link(__('Contact users', true), array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?>
    • + +
    +
    -Js->writeBuffer(); \ No newline at end of file +Js->writeBuffer(); ?> +
    + +
    \ No newline at end of file diff --git a/app/View/Pages/administration.ctp b/app/View/Pages/administration.ctp index fa6a420bf..e8b05c1ec 100755 --- a/app/View/Pages/administration.ctp +++ b/app/View/Pages/administration.ctp @@ -1,154 +1,158 @@ -
    -Table of contents
    -1. Html->link(__('General Layout', true), array('controller' => 'pages', 'action' => 'display', 'documentation')); ?>
    -2. Html->link(__('User Management and Global Actions', true), array('controller' => 'pages', 'action' => 'display', 'user_management')); ?>
    -3. Html->link(__('Using the system', true), array('controller' => 'pages', 'action' => 'display', 'using_the_system')); ?>
    -4. Html->link(__('Administration', true), array('controller' => 'pages', 'action' => 'display', 'administration')); ?>
    - -5. Html->link(__('Categories and Types', true), array('controller' => 'pages', 'action' => 'display', 'categories_and_types')); ?> -



    +
    + +
    + +

    Import Blacklist

    -It is possible to ban certain values from ever being entered into the system via an event info field or an attribute value. This is done by blacklisting the value in this section.

    +It is possible to ban certain values from ever being entered into the system via an event info field or an attribute value. This is done by blacklisting the value in this section.

    Adding and modifying entries

    Administrators can add, edit or delete blacklisted items by using the appropriate functions in the list's action menu and the menu on the left.
    -


    +

    Import Regexp

    -The system allows administrators to set up rules for regular expressions that will automatically alter newly entered or imported events (from GFI Sandbox).

    +The system allows administrators to set up rules for regular expressions that will automatically alter newly entered or imported events (from GFI Sandbox).

    The purpose of Import Regexp entries

    They can be used for several things, such as unifying the capitalisation of file paths for more accurate event correlation or to automatically censor the usernames and use system path variable names (changing C:\Users\UserName\Appdata\Roaming\file.exe to %APPDATA%\file.exe).
    -The second use is blocking, if a regular expression is entered with a blank replacement, any event info or attribute value containing the expression will not be added. Please make sure the entered regexp expression follows the preg_replace pattern rules as described here.

    +The second use is blocking, if a regular expression is entered with a blank replacement, any event info or attribute value containing the expression will not be added. Please make sure the entered regexp expression follows the preg_replace pattern rules as described here.

    Adding and modifying entries

    -Administrators can add, edit or delete regular expression rules, which are made up of a regex pattern that the system searches for and a replacement for the detected pattern.

    +Administrators can add, edit or delete regular expression rules, which are made up of a regex pattern that the system searches for and a replacement for the detected pattern.


    -


    +

    Managing the Signature whitelist

    -The signature whitelist view, accessible through the administration menu on the left, allows administrators to create and maintain a list of addresses that are whitelisted from ever being added to the NIDS signatures. Addresses listed here will be commented out when exporting the NIDS list.

    +The signature whitelist view, accessible through the administration menu on the left, allows administrators to create and maintain a list of addresses that are whitelisted from ever being added to the NIDS signatures. Addresses listed here will be commented out when exporting the NIDS list.

    Whitelisting an address:

    - While in the whitelist view, click on New Whitelist on the left to bring up the add whitelist view to add a new address.

    + While in the whitelist view, click on New Whitelist on the left to bring up the add whitelist view to add a new address.

    Managing the list:

    - When viewing the list of whitelisted addresses, the following pieces of information are shown: The ID of the whitelist entry (assigned automatically when a new address is added), the address itself that is being whitelisted and a set of controls allowing you to delete the entry or edit the address.

    -Whitelist

    -


    + When viewing the list of whitelisted addresses, the following pieces of information are shown: The ID of the whitelist entry (assigned automatically when a new address is added), the address itself that is being whitelisted and a set of controls allowing you to delete the entry or edit the address.
    +Whitelist
    +

    Managing the users:

    -As an admin, you can set up new accounts for users, edit the profiles of users, delete them, or just have a look at all the viewers' profiles. Organisation admins are restricted to executing the same actions on their organisation's users only.

    +As an admin, you can set up new accounts for users, edit the profiles of users, delete them, or just have a look at all the viewers' profiles. Organisation admins are restricted to executing the same actions on their organisation's users only.
    Add user

    Adding a new user:

    -To add a new user, click on the New User button in the administration menu to the left and fill out the following fields in the view that is loaded:

    +To add a new user, click on the New User button in the administration menu to the left and fill out the following fields in the view that is loaded:
      -
    • Email: The user's e-mail address, this will be used as his/her login name and as an address to send all the automatic e-mails and e-mails sent by contacting the user as the reporter of an event.

    • -
    • Password: A temporary password for the user that he/she should change after the first login. Make sure that it is at least 6 characters long, includes a digit or a special character and contains at least one upper-case and at least one lower-case character.

    • -
    • Confirm Password: This should be an exact copy of the Password field.

    • -
    • Org:The organisation of the user. Entering ADMIN into this field will give administrator privileges to the user. If you are an organisation admin, then this field will be unchangeable and be set to your own organisation.

    • -
    • Roles: A drop-down list allows you to choose a role-group that the user should belong to. Roles define the privileges of the user. To learn more about roles, click here.

    • -
    • Receive alerts when events are published: This option will subscribe the new user to automatically generated e-mails whenever an event is published.

    • -
    • Receive alerts from "contact reporter" requests: This option will subscribe the new user to e-mails that are generated when another user tries to get in touch with an event's reporting organisation that matches that of the new user.

    • -
    • Authkey: This is assigned automatically and is the unique authentication key of the user (he/she will be able to reset this and receive a new key). It is used for exports and for connecting one server to another, but it requires the user to be assigned to a role that has auth permission enabled.

    • -
    • NIDS Sid: Nids ID, not yet implemented.

    • -
    • Gpgkey: The key used for encrypting e-mails sent through the system.

    • +
    • Email: The user's e-mail address, this will be used as his/her login name and as an address to send all the automatic e-mails and e-mails sent by contacting the user as the reporter of an event.
    • +
    • Password: A temporary password for the user that he/she should change after the first login. Make sure that it is at least 6 characters long, includes a digit or a special character and contains at least one upper-case and at least one lower-case character.
    • +
    • Confirm Password: This should be an exact copy of the Password field.
    • +
    • Org:The organisation of the user. Entering ADMIN into this field will give administrator privileges to the user. If you are an organisation admin, then this field will be unchangeable and be set to your own organisation.
    • +
    • Roles: A drop-down list allows you to choose a role-group that the user should belong to. Roles define the privileges of the user. To learn more about roles, click here.
    • +
    • Receive alerts when events are published: This option will subscribe the new user to automatically generated e-mails whenever an event is published.
    • +
    • Receive alerts from "contact reporter" requests: This option will subscribe the new user to e-mails that are generated when another user tries to get in touch with an event's reporting organisation that matches that of the new user.
    • +
    • Authkey: This is assigned automatically and is the unique authentication key of the user (he/she will be able to reset this and receive a new key). It is used for exports and for connecting one server to another, but it requires the user to be assigned to a role that has auth permission enabled.
    • +
    • NIDS Sid: Nids ID, not yet implemented.
    • +
    • Gpgkey: The key used for encrypting e-mails sent through the system.

    Listing all users:

    -To list all current users of the system, just click on List Users under the administration menu to the left. A view will be loaded with a list of all users and the following columns of information:

    -List users

    +To list all current users of the system, just click on List Users under the administration menu to the left. A view will be loaded with a list of all users and the following columns of information:
    +List users
      -
    • Id: The user's automatically assigned ID number.

    • -
    • Org: The organisation that the user belongs to.

    • -
    • Email: The e-mail address (and login name) of the user.

    • -
    • Autoalert: Shows whether the user has subscribed to auto-alerts and is always receiving the mass-emails regarding newly published events that he/she is eligible for.

    • -
    • ontactalert: Shows whether the user has the subscription to contact reporter e-mails directed at his/her organisation turned on or off.

    • -
    • Gpgkey: Shows whether the user has entered a Gpgkey yet.

    • -
    • Nids Sid: Shows the currently assigned NIDS ID.

    • -
    • Termsaccepted: This flag indicates whether the user has accepted the terms of use or not.

    • -
    • Newsread: The last point in time when the user has looked at the news section of the system.

    • -
    • Action Buttons: Here you can view a detailed view of a user, edit the basic details of a user (same view as the one used for creating a new user, but all the fields come filled out by default) or remove a user completely.

    • +
    • Id: The user's automatically assigned ID number.
    • +
    • Org: The organisation that the user belongs to.
    • +
    • Email: The e-mail address (and login name) of the user.
    • +
    • Autoalert: Shows whether the user has subscribed to auto-alerts and is always receiving the mass-emails regarding newly published events that he/she is eligible for.
    • +
    • ontactalert: Shows whether the user has the subscription to contact reporter e-mails directed at his/her organisation turned on or off.
    • +
    • Gpgkey: Shows whether the user has entered a Gpgkey yet.
    • +
    • Nids Sid: Shows the currently assigned NIDS ID.
    • +
    • Termsaccepted: This flag indicates whether the user has accepted the terms of use or not.
    • +
    • Newsread: The last point in time when the user has looked at the news section of the system.
    • +
    • Action Buttons: Here you can view a detailed view of a user, edit the basic details of a user (same view as the one used for creating a new user, but all the fields come filled out by default) or remove a user completely.

    Editing a user:

    -To add a new user, click on the New User button in the administration menu to the left and fill out the following fields in the view that is loaded:

    +To add a new user, click on the New User button in the administration menu to the left and fill out the following fields in the view that is loaded:
      -
    • Email: The user's e-mail address, this will be used as his/her login name and as an address to send all the automatic e-mails and e-mails sent by contacting the user as the reporter of an event.

    • -
    • Password: It is possible to assign a new password manually for a user. For example, in case that he/she forgot the old one a new temporary one can be assigned. Make sure to check the "Change password" field if you do give out a temporary password, so that the user will be forced to change it after login.

    • -
    • Confirm Password: This should be an exact copy of the Password field.

    • -
    • Org:The organisation of the user. Entering ADMIN into this field will give administrator privileges to the user. If you are an organisation admin, then this field will be unchangeable and be set to your own organisation.

    • -
    • Roles: A drop-down list allows you to choose a role-group that the user should belong to. Roles define the privileges of the user. To learn more about roles, click here.

    • -
    • Receive alerts when events are published: This option will subscribe the user to automatically generated e-mails whenever an event is published.

    • -
    • Receive alerts from "contact reporter" requests: This option will subscribe the user to e-mails that are generated when another user tries to get in touch with an event's reporting organisation that matches that of the user.

    • -
    • Authkey: It is possible to request a new authentication key for the user.

    • -
    • NIDS Sid: Nids ID, not yet implemented.

    • -
    • Termsaccepted: Indicates whether the user has accepted the terms of use already or not.

    • -
    • Change Password: Setting this flag will require the user to change password after the next login.

    • -
    • Gpgkey: The key used for encrypting e-mails sent through the system.

    • +
    • Email: The user's e-mail address, this will be used as his/her login name and as an address to send all the automatic e-mails and e-mails sent by contacting the user as the reporter of an event.
    • +
    • Password: It is possible to assign a new password manually for a user. For example, in case that he/she forgot the old one a new temporary one can be assigned. Make sure to check the "Change password" field if you do give out a temporary password, so that the user will be forced to change it after login.
    • +
    • Confirm Password: This should be an exact copy of the Password field.
    • +
    • Org:The organisation of the user. Entering ADMIN into this field will give administrator privileges to the user. If you are an organisation admin, then this field will be unchangeable and be set to your own organisation.
    • +
    • Roles: A drop-down list allows you to choose a role-group that the user should belong to. Roles define the privileges of the user. To learn more about roles, click here.
    • +
    • Receive alerts when events are published: This option will subscribe the user to automatically generated e-mails whenever an event is published.
    • +
    • Receive alerts from "contact reporter" requests: This option will subscribe the user to e-mails that are generated when another user tries to get in touch with an event's reporting organisation that matches that of the user.
    • +
    • Authkey: It is possible to request a new authentication key for the user.
    • +
    • NIDS Sid: Nids ID, not yet implemented.
    • +
    • Termsaccepted: Indicates whether the user has accepted the terms of use already or not.
    • +
    • Change Password: Setting this flag will require the user to change password after the next login.
    • +
    • Gpgkey: The key used for encrypting e-mails sent through the system.

    Contacting a user:

    -Site admins can use the "Contact users" feature to send all or an individual user an e-mail. Users that have a PGP key set will receive their e-mails encrypted. When clicking this button on the left, you'll be presented with a form that allows you to specify the type of the e-mail, who it should reach and what the content is using the following options:

    -Contact

    +Site admins can use the "Contact users" feature to send all or an individual user an e-mail. Users that have a PGP key set will receive their e-mails encrypted. When clicking this button on the left, you'll be presented with a form that allows you to specify the type of the e-mail, who it should reach and what the content is using the following options:
    +Contact
      -
    • Action: This defines the type of the e-mail, which can be a custom message or a password reset. Password resets automatically include a new temporary password at the bottom of the message and will automatically change the user's password accordingly.

    • -
    • Recipient: The recipient toggle lets you contact all your users, a single user (which creates a second drop-down list with all the e-mail addresses of the users) and potential future users (which opens up a text field for the e-mail address and a text area field for a PGP public key).

    • -
    • Subject: In the case of a custom e-mail, you can enter a subject line here.

    • -
    • Subject: In the case of a custom e-mail, you can enter a subject line here.

    • -
    • Custom message checkbox: This is available for password resets, you can either write your own message (which will be appended with a temporary key and the signature), or let the system generate one automatically.

    • +
    • Action: This defines the type of the e-mail, which can be a custom message or a password reset. Password resets automatically include a new temporary password at the bottom of the message and will automatically change the user's password accordingly.
    • +
    • Recipient: The recipient toggle lets you contact all your users, a single user (which creates a second drop-down list with all the e-mail addresses of the users) and potential future users (which opens up a text field for the e-mail address and a text area field for a PGP public key).
    • +
    • Subject: In the case of a custom e-mail, you can enter a subject line here.
    • +
    • Subject: In the case of a custom e-mail, you can enter a subject line here.
    • +
    • Custom message checkbox: This is available for password resets, you can either write your own message (which will be appended with a temporary key and the signature), or let the system generate one automatically.
    Keep in mind that all e-mails sent through this system will, in addition to your own message, will be signed in the name of the instance's host organisation's support team, will include the e-mail address of the instance's support (if the contact field is set in the bootstrap file), and will include the instance's PGP signature for users that have a PGP key set (and thus are eligible for an encrypted e-mail). -


    +

    Managing the roles

    -Privileges are assigned to users by assigning them to rule groups, which use one of four options determining what they can do with events and four additional privilege elevating settings. The four options for event manipulation are: Read Only, Manage My Own Events, Manage Organisation Events, Manage & Publish Organisation Events. The extra privileges are admin, sync, authentication key usage and audit permission

    -Read Only: This allows the user to browse events that his organisation has access to, but doesn't allow any changes to be made to the database.

    -Manage My Own Events: The second option, gives its users rights to create, modify or delete their own events, but they cannot publish them.

    -Manage Organization Events: allows users to create events or modify and delete events created by a member of their organisation.

    -Manage & Publish Organisation Events: This last setting, gives users the right to do all of the above and also to publish the events of their organisation.

    -Perm sync: This setting allows the users of the role to be used as a synchronisation user. The authentication key of this user can be handed out to the administrator of a remote MISP instance to allow the synchronisation features to work.

    -Perm admin: Gives the user administrator privileges, this setting is used for the organisation admins.

    -Perm audit: Grants access to the logs. With the exception of site admins, only logs generated by the user's own org are visible.

    -Perm auth: This setting enables the authentication key of the role's users to be used for rest requests.

    +Privileges are assigned to users by assigning them to rule groups, which use one of four options determining what they can do with events and four additional privilege elevating settings. The four options for event manipulation are: Read Only, Manage My Own Events, Manage Organisation Events, Manage & Publish Organisation Events. The extra privileges are admin, sync, authentication key usage and audit permission
    +Read Only: This allows the user to browse events that his organisation has access to, but doesn't allow any changes to be made to the database.
    +Manage My Own Events: The second option, gives its users rights to create, modify or delete their own events, but they cannot publish them.
    +Manage Organization Events: allows users to create events or modify and delete events created by a member of their organisation.
    +Manage & Publish Organisation Events: This last setting, gives users the right to do all of the above and also to publish the events of their organisation.
    +Perm sync: This setting allows the users of the role to be used as a synchronisation user. The authentication key of this user can be handed out to the administrator of a remote MISP instance to allow the synchronisation features to work.
    +Perm admin: Gives the user administrator privileges, this setting is used for the organisation admins.
    +Perm audit: Grants access to the logs. With the exception of site admins, only logs generated by the user's own org are visible.
    +Perm auth: This setting enables the authentication key of the role's users to be used for rest requests.

    Creating roles:

    -When creating a new role, you will have to enter a name for the role to be created and set up the permissions (as described above) using the radio toggle and the four check-boxes.

    +When creating a new role, you will have to enter a name for the role to be created and set up the permissions (as described above) using the radio toggle and the four check-boxes.

    Listing roles:

    -By clicking on the List Roles button, you can view a list of all the currently registered roles and a list of the permission flags turned on for each. In addition, you can find buttons that allow you to edit and delete the roles. Keep in mind that you will need to first remove every member from a role before you can delete it.

    -List roles

    -


    +By clicking on the List Roles button, you can view a list of all the currently registered roles and a list of the permission flags turned on for each. In addition, you can find buttons that allow you to edit and delete the roles. Keep in mind that you will need to first remove every member from a role before you can delete it.
    +List roles
    +

    Using the logs of MISP

    -Users with audit permissions are able to browse or search the logs that MISP automatically appends each time certain actions are taken (actions that modify data or if a user logs in and out).

    -Generally, the following actions are logged:

    +Users with audit permissions are able to browse or search the logs that MISP automatically appends each time certain actions are taken (actions that modify data or if a user logs in and out).
    +Generally, the following actions are logged:
      -
    • User: Creation, deletion, modification, Login / Logout

    • -
    • Event:Creation, deletion, modification, publishing

    • -
    • Attribute: Creation, deletion, modification

    • -
    • Roles: Creation, deletion, modification

    • -
    • Blacklist: Creation, deletion, modification

    • -
    • Whitelist: Creation, deletion, modification

    • +
    • User: Creation, deletion, modification, Login / Logout
    • +
    • Event:Creation, deletion, modification, publishing
    • +
    • Attribute: Creation, deletion, modification
    • +
    • Roles: Creation, deletion, modification
    • +
    • Blacklist: Creation, deletion, modification
    • +
    • Whitelist: Creation, deletion, modification
    • Regexp: Creation, deletion, modification

    Browsing the logs:

    -Listing all the log entries will show the following columns generated by the users of your organisation (or all organisations in the case of site admins):

    -List logs

    +Listing all the log entries will show the following columns generated by the users of your organisation (or all organisations in the case of site admins):
    +List logs
      -
    • Id: The automatically assigned ID number of the entry.

    • -
    • Email: The e-mail address of the user whose actions triggered the entry.

    • -
    • Org: The organisation of the above mentioned user.

    • -
    • Created: The date and time when the entry originated.

    • -
    • Action: The action's type. This can include: login/logout for users, add, edit, delete for events, attributes, users and servers.

    • -
    • Title: The title of an event always includes the target type (Event, User, Attribute, Server), the target's ID and the target's name (for example: e-mail address for users, event description for events).

    • +
    • Id: The automatically assigned ID number of the entry.
    • +
    • Email: The e-mail address of the user whose actions triggered the entry.
    • +
    • Org: The organisation of the above mentioned user.
    • +
    • Created: The date and time when the entry originated.
    • +
    • Action: The action's type. This can include: login/logout for users, add, edit, delete for events, attributes, users and servers.
    • +
    • Title: The title of an event always includes the target type (Event, User, Attribute, Server), the target's ID and the target's name (for example: e-mail address for users, event description for events).
    • Change: This field is only filled out for entries with the action being add or edit. The changes are detailed in the following format:
      variable (initial_value) => (new_value),...
      When the entry is about the creation of a new item (such as adding a new event) then the change will look like this for example:
      - org() => (ADMIN), date() => (20012-10-19),...

      + org() => (ADMIN), date() => (20012-10-19),...
    Search log

    Searching the Logs:

    -Another way to browse the logs is to search it by filtering the results according to the following fields (the search is a sub-string search, the sub-string has to be an exact match for the entry in the field that is being searched for):

    +Another way to browse the logs is to search it by filtering the results according to the following fields (the search is a sub-string search, the sub-string has to be an exact match for the entry in the field that is being searched for):
      -
    • Email: By searching by Email, it is possible to view the log entries of a single user.

    • -
    • Org: Searching for an organisation allows you to see all actions taken by any member of the organisation.

    • -
    • Action: With the help of this drop down menu, you can search for various types of actions taken (such as logins, deletions, etc).

    • -
    • Title: There are several ways in which to use this field, since the title fields contain several bits of information and the search searches for any substrings contained within the field, it is possible to just search for the ID number of a logged event, the username / server's name / event's name / attribute's name of the event target.

    • -
    • Change: With the help of this field, you can search for various specific changes or changes to certain variables (such as published will find all the log entries where an event has gotten published, ip-src will find all attributes where a source IP address has been entered / edited, etc).

    • +
    • Email: By searching by Email, it is possible to view the log entries of a single user.
    • +
    • Org: Searching for an organisation allows you to see all actions taken by any member of the organisation.
    • +
    • Action: With the help of this drop down menu, you can search for various types of actions taken (such as logins, deletions, etc).
    • +
    • Title: There are several ways in which to use this field, since the title fields contain several bits of information and the search searches for any substrings contained within the field, it is possible to just search for the ID number of a logged event, the username / server's name / event's name / attribute's name of the event target.
    • +
    • Change: With the help of this field, you can search for various specific changes or changes to certain variables (such as published will find all the log entries where an event has gotten published, ip-src will find all attributes where a source IP address has been entered / edited, etc).
    \ No newline at end of file diff --git a/app/View/Pages/categories_and_types.ctp b/app/View/Pages/categories_and_types.ctp index 3ec1b4994..40c1ab58d 100644 --- a/app/View/Pages/categories_and_types.ctp +++ b/app/View/Pages/categories_and_types.ctp @@ -1,11 +1,13 @@ -
    -Table of contents
    -1. Html->link(__('General Layout', true), array('controller' => 'pages', 'action' => 'display', 'documentation')); ?>
    -2. Html->link(__('User Management and Global Actions', true), array('controller' => 'pages', 'action' => 'display', 'user_management')); ?>
    -3. Html->link(__('Using the system', true), array('controller' => 'pages', 'action' => 'display', 'using_the_system')); ?>
    -4. Html->link(__('Administration', true), array('controller' => 'pages', 'action' => 'display', 'administration')); ?>
    -5. Html->link(__('Categories and Types', true), array('controller' => 'pages', 'action' => 'display', 'categories_and_types')); ?> -



    +
    + +
    +

    Attribute Categories and Types

    Attribute Categories vs Types

    - +
    - + categoryDefinitions as $cat => $catDef): ?> - + + typeDefinitions as $type => $def): ?> - - categoryDefinitions as $cat => $catDef): - ?> + + categoryDefinitions as $cat => $catDef): ?> - - + + + categoryDefinitions as $cat => $catDef): ?> - + +
    - Category - Category Category
    - -
    Category Category

    Categories

    - +
    categoryDefinitions as $cat => $def): ?> - + - +
    Category Description
    + - + -

    Types

    - +
    typeDefinitions as $type => $def): ?> - - +
    Type Description
    + - +
    diff --git a/app/View/Pages/documentation.ctp b/app/View/Pages/documentation.ctp index 831965d6f..035bcb805 100644 --- a/app/View/Pages/documentation.ctp +++ b/app/View/Pages/documentation.ctp @@ -1,54 +1,57 @@ -
    -Table of contents
    -1. Html->link(__('General Layout', true), array('controller' => 'pages', 'action' => 'display', 'documentation')); ?>
    -2. Html->link(__('User Management and Global actions', true), array('controller' => 'pages', 'action' => 'display', 'user_management')); ?>
    -3. Html->link(__('Using the system', true), array('controller' => 'pages', 'action' => 'display', 'using_the_system')); ?>
    -4. Html->link(__('Administration', true), array('controller' => 'pages', 'action' => 'display', 'administration')); ?>
    -5. Html->link(__('Categories and Types', true), array('controller' => 'pages', 'action' => 'display', 'categories_and_types')); ?>
    -


    -

    General Layout


    +
    + +
    + +
    +

    General Layout

    The top bar

    - The top bar's only interactive part is a link to the MISP system itself - this will redirect the user to the default view of the site, which is the List Events view.

    + The top bar's only interactive part is a link to the MISP system itself - this will redirect the user to the default view of the site, which is the List Events view.

    The left menu

    - This menu contains all of the main functions of the site as a series of buttons.

    + This menu contains all of the main functions of the site as a series of buttons.

    • New Event: Allows you to create a new event.
    • List Events: You can browse all the currently stored events here.
    • List Attributes: You can browse all the currently stored attributes of events here.
    • Search Attributes: Search for and filter a list of attributes.
    • -
    • Export: Export various types of data from the system for NIDSs or other uses.

    - Global Actions

    +
  • Export: Export various types of data from the system for NIDSs or other uses.
  • + Global Actions
    • News: Read about the latest news regarding the MISP system
    • My Profile: Manage your user account.
    • Members List: View the number of users per organisation and get some statistics about the currently stored attributes.
    • User Guide: A link to this user guide.
    • Terms & Conditions: View the terms & conditions again.
    • -
    • Log out: Logs the current user out.

    - Sync Actions

    +
  • Log out: Logs the current user out.
  • + Sync Actions
      -
    • List Servers: Connect your MISP instance to other instances, or view and modify the currently established connections.

    - Input Filters

    +
  • List Servers: Connect your MISP instance to other instances, or view and modify the currently established connections.
  • + Input Filters
    • Import Blacklist: Create, modify or delete blacklisted strings. These will stop any matching events/attributes from being entered into the system.
    • Import Regexp: Create, modify or delete regular expressions and their replacements. Each time an event / attribute is created or modified, they will be parsed and found expressions will be replaced.
    • -
    • Signature Whitelist: View and manage the list of whitelisted addresses. These, if contained in attributes, will be blocked from the NIDS signature exports.

    - Administration

    +
  • Signature Whitelist: View and manage the list of whitelisted addresses. These, if contained in attributes, will be blocked from the NIDS signature exports.
  • + Administration
    • New User: Create an account for a new user.
    • List Users: View, modify or delete the currently registered users.
    • New Role: Create a new role group for the users of this instance, controlling their privileges to create, modify, delete and to publish events.
    • -
    • List Roles: List, modify or delete currently existing roles.

    - Audit

    +
  • List Roles: List, modify or delete currently existing roles.
  • + Audit
    • List Logs: View the logs of the instance.
    • -
    • Search Logs: Search the logs by various attributes.

    +
  • Search Logs: Search the logs by various attributes.
  • The main area

    - This is where all the views (navigated to via the menu buttons) will be displayed. In general, there are two main view types, information views (which list the currently stored data and allow you to modify it) and form views (allowing you to enter or alter data). All lists are organised in such a way that all the information columns are on the left and every line of data can be modified or viewed in more detail on the right-most column, titled "Actions". All lists display a certain set number of the most recent items, but page control buttons at the bottom allow you to browse older entries.

    + This is where all the views (navigated to via the menu buttons) will be displayed. In general, there are two main view types, information views (which list the currently stored data and allow you to modify it) and form views (allowing you to enter or alter data). All lists are organised in such a way that all the information columns are on the left and every line of data can be modified or viewed in more detail on the right-most column, titled "Actions". All lists display a certain set number of the most recent items, but page control buttons at the bottom allow you to browse older entries.

    The bottom bar

    - Contains a link to download the gpg key used for encrypting the e-mails sent through the system and the current version number - if you are logged in.

    + Contains a link to download the gpg key used for encrypting the e-mails sent through the system and the current version number - if you are logged in.


    diff --git a/app/View/Pages/user_management.ctp b/app/View/Pages/user_management.ctp index 77c62487f..708dfed9a 100644 --- a/app/View/Pages/user_management.ctp +++ b/app/View/Pages/user_management.ctp @@ -1,18 +1,20 @@ -
    - Table of contents
    - 1. Html->link(__('General Layout', true),array('controller' => 'pages', 'action' => 'display','documentation')); ?>
    - 2. Html->link(__('User Management and Global Actions', true), array('controller' => 'pages', 'action' => 'display', 'user_management')); ?>
    - - 3. Html->link(__('Using the system', true),array('controller' => 'pages', 'action' => 'display','using_the_system')); ?>
    - 4. Html->link(__('Administration', true),array('controller' => 'pages', 'action' => 'display','administration')); ?>
    - 5. Html->link(__('Categories and Types', true),array('controller' => 'pages', 'action' => 'display','categories_and_types')); ?>
    -


    +
    + +
    +

    User Management and Global Actions

    -

    First run of the system:

    When first logging into MISP with the username and password provided by your administrator, there are a number of things that need to be done, before you can start using the system.

    @@ -26,7 +28,7 @@
  • Subscribing to e-mails sent via the "Contact Reporter" functionality: This feature is turned on right below the autoalerts and will allow you to receive e-mails addressed to your organisation whenever a user tries to ask about an event that was posted by a user of your organisation. Keep in mind that you can still be addressed by such a request even when this setting is turned off, if someone tries to contact you as the event creator directly or your organisation for an event that you personally have created then you will be notified.

  • Reviewing the Terms & Conditions: To review the Terms & Conditions or to read the User Guide, use the appropriate button on the left navigation menu.

  • Making sure that compatibility mode is turned off (IE9&IE10):Compatibility mode can cause some elements to appear differently than intended or not appear at all. Make sure you have this option turned off.
  • -


    +

    Managing your account:

    To alter any details regarding your profile, use the "My Profile" menu button to bring up the profile overview and then click on "Edit Profile" in the right upper corner.
      @@ -40,7 +42,7 @@ To alter any details regarding your profile, use the "My Profile" menu button to
    • Setting up the GPG Key: In order for the system to be able to encrypt the messages that you send through it, it needs to know your GPG key. You can acquire this by clicking on the PGP/GPG key link at the bottom left of the screen. Copy the entirety of the key and navigate to the Edit profile view (My Profile on the left -> Edit profile in the top right corner). Paste the key into the Gpgkey field and click submit.

    • Requesting a new authentication key: It is possible to make the system generate a new authentication key for you (for example if your previous one gets compromised. This can be accessed by clicking on the My Profile button and then clicking the reset key next to the currently active authentication code. The old key will become invalid when the new one is generated.

    -


    +

    Staying up to date:

    MISP also provides its users with some information about itself and its users through the links provided in the Global Actions menu.

      diff --git a/app/View/Pages/using_the_system.ctp b/app/View/Pages/using_the_system.ctp index f7056a1e8..d9a8cce0e 100755 --- a/app/View/Pages/using_the_system.ctp +++ b/app/View/Pages/using_the_system.ctp @@ -1,21 +1,24 @@ -
      -Table of contents
      -1. Html->link(__('General Layout', true), array('controller' => 'pages', 'action' => 'display', 'documentation')); ?>
      -2. Html->link(__('User Management and Global actions', true), array('controller' => 'pages', 'action' => 'display', 'user_management')); ?>
      -3. Html->link(__('Using the system', true), array('controller' => 'pages', 'action' => 'display', 'using_the_system')); ?>
      - -4. Html->link(__('Administration', true), array('controller' => 'pages', 'action' => 'display', 'administration')); ?>
      -5. Html->link(__('Categories and Types', true), array('controller' => 'pages', 'action' => 'display', 'categories_and_types')); ?>
      -


      +
      + +
      +

      Using the system:

      Creating an event:

      The process of entering an event can be split into 3 phases, the creation of the event itself, populating it with attributes and attachments and finally publishing it.

      @@ -46,7 +49,7 @@ The process of entering an event can be split into 3 phases, the creation of the
    • Info: The info field, where the malware/incident can get a brief description starting with the internal reference. This field should be as brief and concise as possible, the more detailed description happens through attributes in the next stage of the event's creation. Keep in mind that the system will automatically replace detected text strings that match a regular expression entry set up by your server's administrator(s).

    • GFI Sandbox: It is possible to upload the exported .zip file from GFI sandbox with the help of this tool. These will be dissected by the MISP and a list of attributes and attachments will automatically be generated from the .zip file. Whilst this does most of the work needed to be done in the second step of the event's creation, it is important to manually look over all the data that is being entered.

    -


    +

    Add attributes to the event:

    The second step of creating an event is to populate it with attributes and attachments. In addition to being able to import the attributes and attachments from GFI, it is also possible to manually add attributes and attachments to an event, by using the two appropriate buttons on the event's page. Let's look at adding attributes first.
    When clicking on the add attribute button, you will have to fill out a form with all the data about the attribute.

    @@ -67,7 +70,7 @@ Keep in mind that the system searches for regular expressions in the value field
  • Value: The actual value of the attribute, enter data about the value based on what is valid for the chosen attribute type. For example, for an attribute of type ip-src (source IP address), 11.11.11.11 would be a valid value. For more information on types and values, Html->link(__('click here', true), array('controller' => 'pages', 'action' => 'display', 'categories_and_types')); ?>.

  • Batch import: If there are several attributes of the same type to enter (such as a list of IP addresses, it is possible to enter them all into the same value-field, separated by a line break between each line. This will allow the system to create separate lines for the each attribute.

  • -


    +

    Add attachments to the event:

    You can also upload attachments, such as the malware itself, report files from external analysis or simply artifacts dropped by the malware. Clicking on the add attachment button brings up a form that allows you to quickly attach a file to the event. The following fields need to be filled out:

    Add attachment


    @@ -84,12 +87,12 @@ You can also upload attachments, such as the malware itself, report files from e
  • All: This will share the attachment with all MISP communities, allowing the attachment to be freely propagated from one server to the next.

  • -


    +

    Publish an event:

    Publish


    Once all the attributes and attachments that you want to include with the event are uploaded / set, it is time to finalise its creation by publishing the event (click on publish event in the event view). This will alert the eligible users of it (based on the private-controls of the event and its attributes/attachments and whether they have auto-alert turned on), push the event to instances that your instance connects to and propagate it further based on the distribution rules. It also readies the network related attributes for NIDS signature creation (through the NIDS signature export feature, for more information, go to the export section.).

    There is an alternate way of publishing an event without alerting any other users, by using the "publish (no email)" button. This should only be used for minor edits (such as correcting a typo).
    -


    +

    Browsing past events:

    The MISP interface allows the user to have an overview over or to search for events and attributes of events that are already stored in the system in various ways.

    To list all events:

    @@ -130,7 +133,7 @@ On the left menu bar, the option "List events" will generate a list of the last
  • Attributes: A list of all attributes attached to the event, including its category, type, value, whether the attribute in itself is related to another event, whether the flag signalling that the attribute can be turned into an IDS signature is on, and a field showing the current privacy setting of the attribute.Attributes can also be modified or deleted via the 3 buttons at the end of each line.

    Using the modify button will bring up the attribute creation view, with all data filled out with the attribute's currently stored data.

  • -


    +

    Listing all attributes:

    Apart from having a list of all the events, it is also possible to get a list of all the stored attributes in the system by clicking on the list attributes button. The produced list of attributes will include the followings fields:



    @@ -142,25 +145,25 @@ On the left menu bar, the option "List events" will generate a list of the last
  • Signature: Shows whether the attribute has been flagged for NIDS signature generation or not.

  • Actions: A set of buttons that allow you to view the event that the attribute is tied to, to edit the attribute (using the same view as what is used to set up attributes, but filled out with the attribute's current data) and a delete button.

  • -


    +

    Searching for attributes:

    Apart from being able to list all events, it is also possible to search for data contained in the value field of an attribute, by clicking on the "Search Attributes" button.

    Search attribute

    This will bring up a form that lets you enter one or several search strings (separate search strings with line breaks) that will be compared to the values of all attributes, along with options to narrow down the search based on category and type. The entered search string has to be an exact match with (the sub-string of) a value. A second text field makes it possible to enter event IDs for events that should be excluded from the search (again, each line represents an event ID to be excluded).

    The list generated by the search will look exactly the same as listing all attributes, except that only the attributes that matched the search criteria will be listed (to find out more about the list attributes view, Html->link(__('click here', true), array('controller' => 'pages', 'action' => 'display', 'categories_and_types')); ?>.). The search parameters will be shown above the produced list and the search terms will be highlighted.


    -


    +

    Updating and modifying events and attributes:

    Every event and attribute can easily be edited. First of all it is important to find the event or attribute that is to be edited, using any of the methods mentioned in the section on browsing past events.

    Once it is found, the edit button (whether it be under actions when events/attributes get listed or simply on the event view) will bring up the same screen as what is used to create the entry of the same type (for an event it would be the event screen as seen here, for an attribute the attribute screen as described here).

    Keep in mind that editing any event (either directly or indirectly through an attribute) will unpublish it, meaning that you'll have to publish it (through the event view) again once you are done.

    -


    +

    Contacting the reporter:

    To get in touch with the reporter of a previously registered event, just find the event for which you would like to contact the reporter by either finding it on the list of events, by finding it through one of its attributes or by finding it through a related event.

    Once the event is found and the event view opened, click the button titled "Contact Reporter". This will bring up a view where you can enter your message that is to be e-mailed to all members of the reporting organisation that subscribe to receiving such reports or the reporting user himself. Along with your message, the detailed information about the event in question will be included in the e-mail.




    By default, the message will be sent to every member of the organisation that posted the event in the first place, but if you tick the check-box below the message field before sending the mail, only the person that reported the event will get e-mailed.
    -


    +

    Automation:

    It is possible to quickly and conveniently export the data contained within the system using the automation features located in the main menu on the left (available to users with authentication key access only). There are various sets of data that can be exported, by using the authentication key provided by the system (also shown on the export page). If for whatever reason you would need to invalidate your current key and get a new one instead (for example due to the old one becoming compromised) just hit the reset link next to the authentication key in the export view or in your "my profile" view.

    The following types of export are possible:

    @@ -178,7 +181,7 @@ The following types of export are possible:

    It is also possible to export a list of all eligible attributes that match a specific type into a plain text file. The format to do this is:

    <server>/events/text/<authentication_key>/<type>

    Type could be any valid type (as according to the list of Html->link(__('categories and types', true), array('controller' => 'pages', 'action' => 'display', 'categories_and_types')); ?>), for example md5, ip-src or comment.
    -


    +

    Exporting data:

    For users that do not have authentication key access, an alternate export feature is available that relies on your interactive login to the site. To access these, just use the automation menu button to the left and you'll be presented with a list of export options. The results of the export will automatically be offered as a file download.




    @@ -186,7 +189,7 @@ Apart from that, it's also possible to export all events involved in a search at


    Each event's view has its own export feature, both as an XML export and as a .ioc file. To reach these features, just navigate to an event and use the appropriate buttons on the right side.




    -


    +

    Connecting to other instances:

    Apart from being a self contained repository of attacks/malware, one of the main features of MISP is its ability to connect to other instances and share (parts of) its information. The following options allow you to set up and maintain such connections.

    Setting up a connection to another server:

    @@ -213,7 +216,7 @@ If you ever need to change the data about the linked servers or remove any conne
  • Push all: By clicking this button, all events that are eligible to be pushed on the instance you are on will start to be pushed to the remote instance. Events and attributes that exist on the far end will be updated.

  • Pull all: By clicking this button, all events that are set to be pull-able or full access on the remote server will be copied to this instance. Existing events will not be updated.

  • -


    +

    Rest API:

    The platform is also RESTfull, so this means that you can use structured format (XML) to access Events data.

    Requests

    diff --git a/app/View/Users/memberslist.ctp b/app/View/Users/memberslist.ctp index 6bf884e77..f5e0fe276 100755 --- a/app/View/Users/memberslist.ctp +++ b/app/View/Users/memberslist.ctp @@ -1,6 +1,6 @@

    Members

    - +
    @@ -85,7 +85,7 @@ foreach ($graphData as $row) { }); - - -
    -
    • Html->link(__('Contact reporter', true), array('action' => 'contact', $event['Event']['id'])); ?>

    -
    • Html->link(__('Download as XML', true), array('action' => 'xml', 'download', $event['Event']['id'])); ?> - Html->link(__('Download as IOC', true), array('action' => 'downloadOpenIOCEvent', $event['Event']['id'])); ?>
    + +
  • Html->link(__('Contact reporter', true), array('action' => 'contact', $event['Event']['id'])); ?>
  • +
  • Html->link(__('Download as XML', true), array('action' => 'xml', 'download', $event['Event']['id'])); ?>
  • +
  • Html->link(__('Download as IOC', true), array('action' => 'downloadOpenIOCEvent', $event['Event']['id'])); ?>
  • +
  • +
  • Html->link('List Events', array('controller' => 'events', 'action' => 'index')); ?>
  • + +
  • Html->link('Add Event', array('controller' => 'events', 'action' => 'add')); ?>
  • + + -
    +
    element('img', array('id' => $event['Event']['orgc']));?> diff --git a/app/View/Layouts/default.ctp b/app/View/Layouts/default.ctp index 5e11eaa1b..4c51fc0b5 100755 --- a/app/View/Layouts/default.ctp +++ b/app/View/Layouts/default.ctp @@ -13,7 +13,6 @@ echo $this->Html->css('bootstrap'); // see http://twitter.github.io/bootstrap/base-css.html echo $this->Html->css('datepicker'); echo $this->Html->css('main'); - echo $this->Html->css('misp'); // FIXME chri: re-add print stylesheet //echo $this->Html->css(array('print'), 'stylesheet', array('media' => 'print')); @@ -23,10 +22,6 @@ echo $this->fetch('script'); echo $this->Html->script('jquery-1.9.1.min'); // Include jQuery library - echo $this->Html->script('bootstrap'); - //echo $this->Html->script('bootstrap.min'); - echo $this->Html->script('bootstrap-datepicker'); - echo $this->Html->script('main'); ?> @@ -62,6 +57,13 @@

    - element('sql_dump'); ?> + element('sql_dump'); + + echo $this->Html->script('bootstrap'); + //echo $this->Html->script('bootstrap.min'); + echo $this->Html->script('bootstrap-datepicker'); + echo $this->Html->script('main'); + ?> diff --git a/app/webroot/css/main.css b/app/webroot/css/main.css index e394c13b4..6e8dda1dd 100755 --- a/app/webroot/css/main.css +++ b/app/webroot/css/main.css @@ -19,6 +19,18 @@ h3{ font-size: 18px; line-height: 20px; } +pre { + font-size: 11px; + +} +.nav-list { + padding-right: 5px; +} + +.nav-list > li > a { + margin-right: -30px; +} + .navbar-lab .navbar-inner{ background: #FF9900; @@ -78,7 +90,6 @@ div.view { div.actions { float:left; width:10%; - padding:10px 1%; } div.actions h3 { padding-top:0; @@ -120,6 +131,11 @@ td.actions { white-space: nowrap; } +td.short { + width:5%; + white-space: nowrap; + text-align: left; +} table.fullwidth { border:1px solid #f0f0f0; @@ -151,6 +167,13 @@ table.fullwidth tr:hover{ table.fullwidth th:hover{ color:#fff; } + +.table-hover tbody tr:hover > td, +.table-hover tbody tr:hover > th { + background-color: #CFEFFF; +} + + /* .view_icon{ background-position: 0 0; diff --git a/app/webroot/css/misp.css b/app/webroot/css/misp.css deleted file mode 100644 index c45d09469..000000000 --- a/app/webroot/css/misp.css +++ /dev/null @@ -1,17 +0,0 @@ -@CHARSET "UTF-8"; - -.table-hover tbody tr:hover > td, -.table-hover tbody tr:hover > th { - background-color: #CFEFFF; -} - -td.short { - width:5%; - white-space: nowrap; - text-align: left; -} - -pre { - font-size: 11px; - -}} \ No newline at end of file diff --git a/app/webroot/js/main.js b/app/webroot/js/main.js index 964b069d9..c80206aa0 100755 --- a/app/webroot/js/main.js +++ b/app/webroot/js/main.js @@ -9,18 +9,4 @@ }); - $(".span12").on('change', ".updateCIMBL", function(){ - $.ajax({ - url: $(this).parent().attr('action'), - type: 'POST', - dataType: 'json', - data: $(this).parent().serialize(), - success: function(data){ - if(data.msg !== null){ - alert(data.msg); - } - } - }); - }); - }()); \ No newline at end of file From b68994d11f3c1c7769d84157b262b6ed8c108826 Mon Sep 17 00:00:00 2001 From: Andras Date: Sat, 1 Jun 2013 20:21:10 +0200 Subject: [PATCH 14/56] New forminfo tooltip and update to search attribute - added tooltip to css - small update to search attribute --- app/View/Attributes/search.ctp | 8 ++++---- app/webroot/css/main.css | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/View/Attributes/search.ctp b/app/View/Attributes/search.ctp index cc8f6e2be..6a21570e7 100755 --- a/app/View/Attributes/search.ctp +++ b/app/View/Attributes/search.ctp @@ -3,8 +3,8 @@
    Search Attribute Form->input('keyword', array('type' => 'textarea', 'label' => 'Containing the following expressions')); - echo $this->Form->input('keyword2', array('type' => 'textarea', 'label' => 'Excluding the following events')); + echo $this->Form->input('keyword', array('type' => 'textarea', 'label' => 'Containing the following expressions', 'div' => 'clear', 'class' => 'input-xxlarge')); + echo $this->Form->input('keyword2', array('type' => 'textarea', 'label' => 'Excluding the following events', 'div' => 'clear', 'class' => 'input-xxlarge')); ?> Form->input('type', array( 'div' => 'input clear', - 'between' => $this->Html->div('forminfo', '', array('id' => 'AttributeTypeDiv')) + 'after' => $this->Html->div('forminfo', '', array('id' => 'AttributeTypeDiv')) )); - echo $this->Form->input('category', array('between' => $this->Html->div('forminfo', '', array('id' => 'AttributeCategoryDiv')))); + echo $this->Form->input('category', array('after' => $this->Html->div('forminfo', '', array('id' => 'AttributeCategoryDiv')))); ?>
    Date: Sun, 2 Jun 2013 12:44:11 +0200 Subject: [PATCH 15/56] UI changes to event add/edit and change to events controller - updated the UI for the event add and edit views - change to the privileges when editing events - siteadmins could not edit events of other orgs. --- app/Controller/EventsController.php | 8 +---- app/View/Events/add.ctp | 13 +++---- app/View/Events/edit.ctp | 54 +++++++++++++++++++++-------- 3 files changed, 45 insertions(+), 30 deletions(-) diff --git a/app/Controller/EventsController.php b/app/Controller/EventsController.php index 5746fad50..40c6efcf0 100755 --- a/app/Controller/EventsController.php +++ b/app/Controller/EventsController.php @@ -436,18 +436,12 @@ class EventsController extends AppController { } $this->Event->read(null, $id); // check for if private and user not authorised to edit, go away - if (!$this->_isSiteAdmin() && !$this->checkAction('perm_sync') && $this->Event->data['Event']['distribution'] == 'Your organization only') { + if (!$this->_isSiteAdmin() && !$this->checkAction('perm_sync')) { if (($this->Event->data['Event']['org'] != $this->_checkOrg()) || !($this->checkAction('perm_modify'))) { $this->Session->setFlash(__('You are not authorised to do that.')); $this->redirect(array('controller' => 'events', 'action' => 'index')); } } - if (!$this->_isRest()) { - if ($this->Event->data['Event']['org'] != $this->_checkOrg()) { - $this->Session->setFlash(__('Invalid event.')); - $this->redirect(array('controller' => 'events', 'action' => 'index')); - } - } // check if the user is of the creating org, if not, don't let him/her change the distribution. $canEditDist = false; diff --git a/app/View/Events/add.ctp b/app/View/Events/add.ctp index 5db59df8c..90d7d389e 100755 --- a/app/View/Events/add.ctp +++ b/app/View/Events/add.ctp @@ -11,16 +11,16 @@ echo $this->Form->input('distribution', array( 'label' => 'Distribution', 'selected' => 'All communities', - 'between' => $this->Html->div('forminfo', '', array('id' => 'EventDistributionDiv')) + 'after' => $this->Html->div('forminfo', '', array('id' => 'EventDistributionDiv')), )); } echo $this->Form->input('risk', array( - 'before' => $this->Html->div('forminfo', '', array('id' => 'EventRiskDiv')), + 'after' => $this->Html->div('forminfo', '', array('id' => 'EventRiskDiv')), 'div' => 'input clear' )); echo $this->Form->input('analysis', array( 'options' => array($analysisLevels), - 'before' => $this->Html->div('forminfo', '', array('id' => 'EventAnalysisDiv')) + 'after' => $this->Html->div('forminfo', '', array('id' => 'EventAnalysisDiv')) )); echo $this->Form->input('info', array( 'div' => 'clear', @@ -29,14 +29,9 @@ echo $this->Form->input('Event.submittedgfi', array( 'label' => 'GFI sandbox', 'type' => 'file', - 'before' => $this->Html->div('forminfo', isset($eventDescriptions['submittedgfi']['formdesc']) ? $eventDescriptions['submittedgfi']['formdesc'] : $eventDescriptions['submittedgfi']['desc']), + // 'between' => $this->Html->div('forminfo', isset($eventDescriptions['submittedgfi']['formdesc']) ? $eventDescriptions['submittedgfi']['formdesc'] : $eventDescriptions['submittedgfi']['desc']), 'div' => 'clear' )); - echo $this->Form->input('Event.submittedioc', array( - 'label' => 'OpenIOC', - 'type' => 'file', - 'before' => $this->Html->div('forminfo', isset($eventDescriptions['submittedioc']['formdesc']) ? $eventDescriptions['submittedioc']['formdesc'] : $eventDescriptions['submittedioc']['desc']), - )); // link an onchange event to the form elements $this->Js->get('#EventDistribution')->event('change', 'showFormInfo("#EventDistribution")'); $this->Js->get('#EventRisk')->event('change', 'showFormInfo("#EventRisk")'); diff --git a/app/View/Events/edit.ctp b/app/View/Events/edit.ctp index 8b2f33ff1..52f9f8570 100755 --- a/app/View/Events/edit.ctp +++ b/app/View/Events/edit.ctp @@ -3,22 +3,32 @@
    Form->input('id'); -echo $this->Form->input('date'); + echo $this->Form->input('id'); + echo $this->Form->input('date', array( + 'type' => 'text', + 'class' => 'datepicker' + )); if ('true' == Configure::read('CyDefSIG.sync')) { if ('true' == $canEditDist) { - echo $this->Form->input('distribution', array('label' => 'Distribution', - 'between' => $this->Html->div('forminfo', '', array('id' => 'EventDistributionDiv')) - )); + echo $this->Form->input('distribution', array( + 'label' => 'Distribution', + 'selected' => 'All communities', + 'after' => $this->Html->div('forminfo', '', array('id' => 'EventDistributionDiv')), + )); } } -echo $this->Form->input('risk', array( - 'before' => $this->Html->div('forminfo', '', array('id' => 'EventRiskDiv')))); -echo $this->Form->input('analysis', array( - 'options' => array($analysisLevels), - 'before' => $this->Html->div('forminfo', '', array('id' => 'EventAnalysisDiv')) - )); -echo $this->Form->input('info'); + echo $this->Form->input('risk', array( + 'after' => $this->Html->div('forminfo', '', array('id' => 'EventRiskDiv')), + 'div' => 'input clear' + )); + echo $this->Form->input('analysis', array( + 'options' => array($analysisLevels), + 'after' => $this->Html->div('forminfo', '', array('id' => 'EventAnalysisDiv')) + )); + echo $this->Form->input('info', array( + 'div' => 'clear', + 'class' => 'input-xxlarge' + )); // link an onchange event to the form elements if ('true' == $canEditDist) { @@ -28,11 +38,27 @@ $this->Js->get('#EventRisk')->event('change', 'showFormInfo("#EventRisk")'); $this->Js->get('#EventAnalysis')->event('change', 'showFormInfo("#EventAnalysis")'); ?>
    -Form->end(__('Submit', true));?> +Form->button('Edit', array('class' => 'btn btn-primary')); +echo $this->Form->end(); +?>
    -
      +
    From a27b3d7208f0579b96cfd64460ed6fb98b9e000e Mon Sep 17 00:00:00 2001 From: Andras Date: Sun, 2 Jun 2013 13:51:41 +0200 Subject: [PATCH 16/56] More UI changes --- app/View/Elements/global_menu.ctp | 8 +++++++- app/View/Events/show_i_o_c_results.ctp | 22 ++++++++++++++++------ app/View/Servers/add.ctp | 10 +++++----- app/View/Users/edit.ctp | 2 +- app/View/Users/memberslist.ctp | 4 ++-- app/View/Users/news.ctp | 4 ++-- app/View/Users/terms.ctp | 4 ++-- app/View/Users/view.ctp | 7 ++++--- 8 files changed, 39 insertions(+), 22 deletions(-) diff --git a/app/View/Elements/global_menu.ctp b/app/View/Elements/global_menu.ctp index 23337af4d..69301009d 100755 --- a/app/View/Elements/global_menu.ctp +++ b/app/View/Elements/global_menu.ctp @@ -33,10 +33,16 @@ diff --git a/app/View/Events/show_i_o_c_results.ctp b/app/View/Events/show_i_o_c_results.ctp index 95d1e3771..93bd4553f 100644 --- a/app/View/Events/show_i_o_c_results.ctp +++ b/app/View/Events/show_i_o_c_results.ctp @@ -1,14 +1,11 @@
    -
    -
    • Html->link(__('View the event', true), array('action' => 'view', $eventId)); ?>
    -

    Results of the import:

    attributes created successfully, indicators could not be mapped and saved.



    Successfully added attributes:

    -
    Organisation # of members
    +
    @@ -30,7 +27,7 @@ endif;?> if (isset($fails)):?>

    Failed indicators:

    -
    Uuid Category
    +
    @@ -54,7 +51,20 @@ foreach ($graph as $line): ?> endforeach; ?>
    -
      +
    \ No newline at end of file diff --git a/app/View/Servers/add.ctp b/app/View/Servers/add.ctp index 4c43f6d1c..bfedfb80d 100755 --- a/app/View/Servers/add.ctp +++ b/app/View/Servers/add.ctp @@ -5,21 +5,21 @@ Form->input('url', array( 'label' => 'Base URL', - 'before' => $this->Html->div('forminfo', 'The base-url to the external server you want to sync with.
    Example: https://foo.sig.mil.be'), + 'after' => $this->Html->div('forminfo', 'The base-url to the external server you want to sync with.
    Example: https://foo.sig.mil.be'), )); echo $this->Form->input('organization', array( 'label' => 'Organization', - 'before' => $this->Html->div('forminfo', 'The organization having the external server you want to sync with.
    Example: BE'), + 'after' => $this->Html->div('forminfo', 'The organization having the external server you want to sync with.
    Example: BE'), )); echo $this->Form->input('authkey', array( - 'before' => $this->Html->div('forminfo', 'You can find the authentication key on your profile on the external server.'), + 'after' => $this->Html->div('forminfo', 'You can find the authentication key on your profile on the external server.'), )); echo $this->Form->input('push', array( + 'after' => $this->Html->div('forminfo', 'Allow the upload of events and their attributes.'), 'div' => 'input clear', - 'before' => $this->Html->div('forminfo', 'Allow the upload of events and their attributes.'), )); echo $this->Form->input('pull', array( - 'before' => $this->Html->div('forminfo', 'Allow the download of events and their attributes from the server.'), + 'after' => $this->Html->div('forminfo', 'Allow the download of events and their attributes from the server.'), )); ?> diff --git a/app/View/Users/edit.ctp b/app/View/Users/edit.ctp index 14d599563..f03c1c997 100755 --- a/app/View/Users/edit.ctp +++ b/app/View/Users/edit.ctp @@ -20,7 +20,7 @@ echo $this->Form->end();?>
    -
      +
    -
      + diff --git a/app/View/Users/news.ctp b/app/View/Users/news.ctp index e21d01f59..383ff4782 100755 --- a/app/View/Users/news.ctp +++ b/app/View/Users/news.ctp @@ -74,8 +74,8 @@ A bug in the DNS attributes has been corrected.

    -
      -
    • Html->link(__('News', true), array('controller' => 'users', 'action' => 'news')); ?>
    • +
    -
      +
    \ No newline at end of file diff --git a/app/View/Users/view.ctp b/app/View/Users/view.ctp index 8cb6d8a03..499ea5927 100755 --- a/app/View/Users/view.ctp +++ b/app/View/Users/view.ctp @@ -61,16 +61,17 @@ if (h($user['User']['gpgkey']) != 0) {
    -
      +
    - + diff --git a/app/View/Roles/index.ctp b/app/View/Roles/index.ctp index 9957098be..c5b3d6e1d 100644 --- a/app/View/Roles/index.ctp +++ b/app/View/Roles/index.ctp @@ -30,7 +30,7 @@ foreach ($list as $item): ?> - + diff --git a/app/View/Users/admin_email.ctp b/app/View/Users/admin_email.ctp index 423010fff..26cbf1183 100644 --- a/app/View/Users/admin_email.ctp +++ b/app/View/Users/admin_email.ctp @@ -38,7 +38,7 @@ function showMessage(){
    - Form->input('gpg', array('type' => 'textarea')); ?> + Form->input('gpg', array('type' => 'textarea', 'class' => 'input-xxlarge')); ?>
    Form->input('message', array('type' => 'textarea')); + $str=$this->Form->input('message', array('type' => 'textarea', 'class' => 'input-xxlarge')); echo $this->Html->div('messageDiv', $str, array('id' => 'messageDiv')); ?>
    From 92416cdea56e1f4346a0f0b8fc3a5503304ad2bd Mon Sep 17 00:00:00 2001 From: Iglocska Date: Sun, 2 Jun 2013 14:41:41 +0200 Subject: [PATCH 18/56] Slight changes to the role creation and edit views --- app/View/Roles/admin_add.ctp | 20 ++++++++++++-------- app/View/Roles/admin_edit.ctp | 19 ++++++++++++------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/app/View/Roles/admin_add.ctp b/app/View/Roles/admin_add.ctp index 059b84552..935887f46 100755 --- a/app/View/Roles/admin_add.ctp +++ b/app/View/Roles/admin_add.ctp @@ -4,11 +4,12 @@ Add Role Form->input('name');?> - Form->radio('permission', $options, array('value' => '3'));?> + Form->input('permission', array('type' => 'select', 'options' => $options), array('value' => '3'));?> +
    Form->input('perm_sync', array( 'type' => 'checkbox', 'checked' => false, - 'div' => 'input clear'));?> + ));?> Form->input('perm_admin', array('type' => 'checkbox', 'checked' => false));?> Form->input('perm_audit', array('type' => 'checkbox', 'checked' => false));?> Form->input('perm_auth', array('type' => 'checkbox', 'checked' => false));?> @@ -35,8 +36,7 @@ echo $this->Form->end();
    Js->get('#RolePermission0')->event('change', 'deactivateActions()'); -$this->Js->get('#RolePermission1')->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")'); @@ -47,13 +47,17 @@ $this->Js->get('#RolePermAudit')->event('change', 'checkPerms("RolePermAudit")') // only be able to tick perm_sync if manage org events and above. function deactivateActions() { - document.getElementById("RolePermSync").checked = false; - document.getElementById("RolePermAdmin").checked = false; - document.getElementById("RolePermAudit").checked = false; + var e = document.getElementById("RolePermission"); + if (e.options[e.selectedIndex].value == '0' || e.options[e.selectedIndex].value == '1') { + document.getElementById("RolePermSync").checked = false; + document.getElementById("RolePermAdmin").checked = false; + document.getElementById("RolePermAudit").checked = false; + } } function checkPerms(id) { - if ((document.getElementById("RolePermission0").checked) || (document.getElementById("RolePermission1").checked)) { + var e = document.getElementById("RolePermission"); + if (e.options[e.selectedIndex].value == '0' || e.options[e.selectedIndex].value == '1') { document.getElementById(id).checked = false; } } diff --git a/app/View/Roles/admin_edit.ctp b/app/View/Roles/admin_edit.ctp index 86741953c..6635a7775 100755 --- a/app/View/Roles/admin_edit.ctp +++ b/app/View/Roles/admin_edit.ctp @@ -4,7 +4,9 @@ Form->input('name');?> - Form->radio('permission', $options, array('label' => 'Permissions', 'style' => 'vertical-align: middle'));?> + Form->input('permission', array('label' => 'Permissions', 'type' => 'select', 'options' => $options), array('value' => '3'));?> +
    + Form->input('perm_sync', array('type' => 'checkbox', 'label' => 'Sync Actions', 'style' => 'vertical-align: middle'));?> Form->input('perm_admin', array('type' => 'checkbox', 'label' => 'Administration Actions', 'style' => 'vertical-align: middle'));?> Form->input('perm_audit', array('type' => 'checkbox', 'label' => 'Audit Actions', 'style' => 'vertical-align: middle'));?> @@ -29,8 +31,7 @@ Js->get('#RolePermission0')->event('change', 'deactivateActions()'); -$this->Js->get('#RolePermission1')->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")'); @@ -41,13 +42,17 @@ $this->Js->get('#RolePermAudit')->event('change', 'checkPerms("RolePermAudit")') // only be able to tick perm_sync if manage org events and above. function deactivateActions() { - document.getElementById("RolePermSync").checked = false; - document.getElementById("RolePermAdmin").checked = false; - document.getElementById("RolePermAudit").checked = false; + var e = document.getElementById("RolePermission"); + if (e.options[e.selectedIndex].value == '0' || e.options[e.selectedIndex].value == '1') { + document.getElementById("RolePermSync").checked = false; + document.getElementById("RolePermAdmin").checked = false; + document.getElementById("RolePermAudit").checked = false; + } } function checkPerms(id) { - if ((document.getElementById("RolePermission0").checked) || (document.getElementById("RolePermission1").checked)) { + var e = document.getElementById("RolePermission"); + if (e.options[e.selectedIndex].value == '0' || e.options[e.selectedIndex].value == '1') { document.getElementById(id).checked = false; } } From 9a8f090b7935ab82d3d47d88377969be41df1c25 Mon Sep 17 00:00:00 2001 From: iglocska Date: Mon, 3 Jun 2013 08:58:57 +0200 Subject: [PATCH 19/56] Update to the event index view --- app/View/Events/index.ctp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/View/Events/index.ctp b/app/View/Events/index.ctp index 559fa7ecb..2ff4a1fdb 100755 --- a/app/View/Events/index.ctp +++ b/app/View/Events/index.ctp @@ -50,9 +50,9 @@ @@ -60,7 +60,7 @@ $imgRelativePath = 'orgs' . DS . h($event['Event']['orgc']) . '.png'; $imgAbsolutePath = APP . WEBROOT_DIR . DS . 'img' . DS . $imgRelativePath; if (file_exists($imgAbsolutePath)) echo $this->Html->image('orgs/' . h($event['Event']['orgc']) . '.png', array('alt' => h($event['Event']['orgc']),'width' => '48','hight' => '48')); - else echo $this->Html->tag('span', h($event['Event']['orgc']), array('class' => 'welcome', 'style' => 'float:right;'));?>Html->tag('span', h($event['Event']['orgc']), array('class' => 'welcome', 'style' => 'float:left;'));?>   @@ -71,7 +71,7 @@ $imgRelativePath = 'orgs' . DS . h($event['Event']['org']) . '.png'; $imgAbsolutePath = APP . WEBROOT_DIR . DS . 'img' . DS . $imgRelativePath; if (file_exists($imgAbsolutePath)) echo $this->Html->image('orgs/' . h($event['Event']['org']) . '.png', array('alt' => h($event['Event']['org']),'width' => '48','hight' => '48')); - else echo $this->Html->tag('span', h($event['Event']['org']), array('class' => 'welcome', 'style' => 'float:right;'));?>Html->tag('span', h($event['Event']['org']), array('class' => 'welcome', 'style' => 'float:left;'));?>  @@ -95,7 +95,7 @@ - @@ -103,7 +103,7 @@ - - - + else echo h($attribute['category']); + ?> + + + + + - - - + + - +
    diff --git a/app/View/Attributes/search.ctp b/app/View/Attributes/search.ctp index 7d6f52557..b7b87fa50 100755 --- a/app/View/Attributes/search.ctp +++ b/app/View/Attributes/search.ctp @@ -166,6 +166,18 @@ $(document).ready(function() { } }); + // 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. + $("#AttributeType, #AttributeCategory").on('change', function(e) { + var $e = $(e.target); + $('#'+e.currentTarget.id).popover('destroy'); + $('#'+e.currentTarget.id).popover({ + trigger: 'manual', + placement: 'right', + content: formInfoValues[$e.val()], + }).popover('show'); + }); }); @@ -176,17 +188,17 @@ $(document).ready(function() { Js->writeBuffer(); // Write cached scripts ?>
    \ No newline at end of file diff --git a/app/View/Elements/global_menu.ctp b/app/View/Elements/global_menu.ctp index 1e76de380..de6c8b262 100755 --- a/app/View/Elements/global_menu.ctp +++ b/app/View/Elements/global_menu.ctp @@ -4,7 +4,7 @@ From 0cafc7ec6bee2628eff2ff4948fb147c0319fa9f Mon Sep 17 00:00:00 2001 From: Christophe Vandeplas Date: Mon, 10 Jun 2013 12:26:32 +0200 Subject: [PATCH 52/56] fix documentation link --- app/View/Elements/global_menu.ctp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/View/Elements/global_menu.ctp b/app/View/Elements/global_menu.ctp index de6c8b262..4a5017d9f 100755 --- a/app/View/Elements/global_menu.ctp +++ b/app/View/Elements/global_menu.ctp @@ -57,7 +57,7 @@
  • News
  • My Profile
  • Members List
  • -
  • User Guide
  • +
  • User Guide
  • Terms & Conditions
  • Log out
  • From 3ed50e2aeffa424e665f25a761d4bf8e6045bf06 Mon Sep 17 00:00:00 2001 From: Christophe Vandeplas Date: Mon, 10 Jun 2013 17:24:41 +0200 Subject: [PATCH 53/56] improve UI of event index filtering --- app/Controller/EventsController.php | 3 + app/View/Events/index.ctp | 274 +++++++++++++++++----------- app/View/Events/view.ctp | 2 +- 3 files changed, 170 insertions(+), 109 deletions(-) diff --git a/app/Controller/EventsController.php b/app/Controller/EventsController.php index d1376b387..856824932 100755 --- a/app/Controller/EventsController.php +++ b/app/Controller/EventsController.php @@ -87,6 +87,9 @@ class EventsController extends AppController { public function index() { // list the events + // TODO information exposure vulnerability - as we don't limit the filter depending on the CyDefSIG.showorg parameter + // this filter will work if showorg=false and users will be able to perform the filtering and see what events were posted by what org. + // same goes for orgc in all cases //transform POST into GET if($this->request->is("post")) { $url = array('action'=>'index'); diff --git a/app/View/Events/index.ctp b/app/View/Events/index.ctp index 5671b96e9..ec58b9a72 100755 --- a/app/View/Events/index.ctp +++ b/app/View/Events/index.ctp @@ -7,130 +7,206 @@ - Form->create('', array('action' => 'index', 'style' => 'margin-bottom:0px')); ?> -
    -
    -
    + Form->create('', array('action' => 'index', 'style' => 'margin-bottom:0px')); + ?> + -
    Uuid Search term
    Html->link(h($item['Role']['id']), array('admin' => true, 'action' => 'edit', $item['Role']['id'])); ?>           
                Html->image('yes.png', array('title' => 'Validated', 'alt' => 'Validated', 'width' => '16', 'hight' => '16')); + echo $this->Html->link('', array('controller' => 'events', 'action' => 'view', $event['Event']['id']), array('class' => 'icon-ok', 'title' => 'View')); } else { - echo $this->Html->image('no.png', array('title' => 'Not validated', 'alt' => 'Not Validated', 'width' => '16', 'hight' => '16')); + echo $this->Html->link('', array('controller' => 'events', 'action' => 'view', $event['Event']['id']), array('class' => 'icon-remove', 'title' => 'View')); }?>    +   + Form->postLink('', array('action' => 'alert', $event['Event']['id']), array('class' => 'icon-download-alt', 'title' => 'Publish Event'), 'Are you sure this event is complete and everyone should be informed?'); From 0c30fd1227e8e0776bb5b0665ea4efaad01a1a69 Mon Sep 17 00:00:00 2001 From: iglocska Date: Mon, 3 Jun 2013 09:38:55 +0200 Subject: [PATCH 20/56] Attribute type pipe and mutex - 2 new attribute types - Same change as on develop --- app/Model/Attribute.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/Model/Attribute.php b/app/Model/Attribute.php index d8a192f6b..0b36fc48b 100755 --- a/app/Model/Attribute.php +++ b/app/Model/Attribute.php @@ -134,7 +134,9 @@ class Attribute extends AppModel { 'link' => array('desc' => 'Link to an external information'), 'comment' => array('desc' => 'Comment or description in a human language', 'formdesc' => 'Comment or description in a human language.
    This will not be correlated with other attributes (NOT IMPLEMENTED YET)'), 'text' => array('desc' => 'Name, ID or a reference'), - 'other' => array('desc' => 'Other attribute') + 'other' => array('desc' => 'Other attribute'), + 'named pipe' => array('desc' => 'Named pipe, use the format \\.\pipe\'), + 'mutex' => array('desc' => 'Mutex, use the format \BaseNamedObjects\'), ); // definitions of categories @@ -155,7 +157,7 @@ class Attribute extends AppModel { ), 'Artifacts dropped' => array( 'desc' => 'Any artifact (files, registry keys etc.) dropped by the malware or other modifications to the system', - 'types' => array('md5', 'sha1', 'filename', 'filename|md5', 'filename|sha1', 'regkey', 'regkey|value', 'pattern-in-file', 'pattern-in-memory', 'yara', 'attachment', 'malware-sample', 'comment', 'text', 'other') + 'types' => array('md5', 'sha1', 'filename', 'filename|md5', 'filename|sha1', 'regkey', 'regkey|value', 'pattern-in-file', 'pattern-in-memory', 'yara', 'attachment', 'malware-sample', 'comment', 'text', 'other', 'named pipe', 'mutex') ), 'Payload installation' => array( 'desc' => 'Info on where the malware gets installed in the system', @@ -691,6 +693,16 @@ class Attribute extends AppModel { $returnValue = 'Invalid format. Expected: CVE-xxxx-xxxx.'; } break; + case 'named pipe': + if (preg_match('#^(\\\\\\\\.\\\\pipe\\\\)#', $value) && !preg_match("#\n#", $value)) { + $returnValue = true; + } + break; + case 'mutex': + if (preg_match('#^(\\\\BaseNamedObjects\\\\)#', $value) && !preg_match("#\n#", $value)) { + $returnValue = true; + } + break; case 'AS': case 'snort': case 'pattern-in-file': From 7691476fae8ea272d781397923e71f35031dc255 Mon Sep 17 00:00:00 2001 From: iglocska Date: Mon, 3 Jun 2013 10:48:38 +0200 Subject: [PATCH 21/56] More UI changes --- app/View/Attributes/add.ctp | 100 ++++++++++++++++--------- app/View/Attributes/add_attachment.ctp | 85 ++++++++++++++------- app/View/Attributes/index.ctp | 6 +- app/View/Events/add_i_o_c.ctp | 30 +++++++- app/View/Events/contact.ctp | 45 +++++++++-- app/View/Events/edit.ctp | 36 ++++++--- app/View/Events/view.ctp | 1 + 7 files changed, 223 insertions(+), 80 deletions(-) diff --git a/app/View/Attributes/add.ctp b/app/View/Attributes/add.ctp index 077a9161c..531d517e0 100755 --- a/app/View/Attributes/add.ctp +++ b/app/View/Attributes/add.ctp @@ -2,46 +2,78 @@ Form->create('Attribute');?>
    -Form->hidden('event_id'); -echo $this->Form->input('category', array( - 'between' => $this->Html->div('forminfo', '', array('id' => 'AttributeCategoryDiv')), - 'empty' => '(choose one)' + Form->hidden('event_id'); + echo $this->Form->input('category', array( + 'after' => $this->Html->div('forminfo', '', array('id' => 'AttributeCategoryDiv')), + 'empty' => '(choose one)' + )); + echo $this->Form->input('type', array( + 'after' => $this->Html->div('forminfo', '', array('id' => 'AttributeTypeDiv')), + 'empty' => '(first choose category)' + )); + if ('true' == Configure::read('CyDefSIG.sync')) { + echo $this->Form->input('distribution', array( + 'label' => 'Distribution', + 'selected' => $maxDist, + 'after' => $this->Html->div('forminfo', '', array('id' => 'AttributeDistributionDiv')) + )); + } + echo $this->Form->input('value', array( + 'type' => 'textarea', + 'error' => array('escape' => false), + 'div' => 'input clear', + 'class' => 'input-xxlarge' )); -echo $this->Form->input('type', array( - 'between' => $this->Html->div('forminfo', '', array('id' => 'AttributeTypeDiv')), - 'empty' => '(first choose category)' + ?> +
    + Form->input('to_ids', array( + 'checked' => true, + 'after' => $this->Html->div('forminfo', isset($attrDescriptions['signature']['formdesc']) ? $attrDescriptions['signature']['formdesc'] : $attrDescriptions['signature']['desc']), + 'label' => 'IDS Signature?', + )); + echo $this->Form->input('batch_import', array( + 'type' => 'checkbox', + 'after' => $this->Html->div('forminfo', 'Create multiple attributes one per line'), )); -if ('true' == Configure::read('CyDefSIG.sync')) { - echo $this->Form->input('distribution', array('label' => 'Distribution', 'selected' => $maxDist, - 'between' => $this->Html->div('forminfo', '', array('id' => 'AttributeDistributionDiv')) - )); -} -echo $this->Form->input('to_ids', array( - 'checked' => true, - 'before' => $this->Html->div('forminfo', isset($attrDescriptions['signature']['formdesc']) ? $attrDescriptions['signature']['formdesc'] : $attrDescriptions['signature']['desc']), - 'label' => 'IDS Signature?' -)); -echo $this->Form->input('batch_import', array( - 'type' => 'checkbox', - 'after' => $this->Html->div('forminfo', 'Create multiple attributes one per line'), -)); -echo $this->Form->input('value', array( - 'type' => 'textarea', - 'error' => array('escape' => false), -)); -// link an onchange event to the form elements -$this->Js->get('#AttributeCategory')->event('change', 'formCategoryChanged("#AttributeCategory")'); -$this->Js->get('#AttributeType')->event('change', 'showFormInfo("#AttributeType")'); -$this->Js->get('#AttributeDistribution')->event('change', 'showFormInfo("#AttributeDistribution")'); -?> + // link an onchange event to the form elements + $this->Js->get('#AttributeCategory')->event('change', 'formCategoryChanged("#AttributeCategory")'); + $this->Js->get('#AttributeType')->event('change', 'showFormInfo("#AttributeType")'); + $this->Js->get('#AttributeDistribution')->event('change', 'showFormInfo("#AttributeDistribution")'); + ?>
    -Form->end(__('Submit'));?> +Form->button('Submit', array('class' => 'btn btn-primary')); +echo $this->Form->end(); +?>
    -
      -
    • Html->link(__('View Event', true), array('controller' => 'events' ,'action' => 'view', $this->request->data['Attribute']['event_id'])); ?>
    • + +
    diff --git a/app/View/Attributes/edit.ctp b/app/View/Attributes/edit.ctp index 8d6b7ce7f..2af50a5e7 100755 --- a/app/View/Attributes/edit.ctp +++ b/app/View/Attributes/edit.ctp @@ -1,6 +1,3 @@ -
    Form->create('Attribute');?>
    @@ -8,18 +5,15 @@ $mayModify = (($isAclModify && $attribute['Event']['user_id'] == $me['id']) || ( Form->hidden('event_id'); echo $this->Form->input('category', array( - 'after' => $this->Html->div('forminfo', '', array('id' => 'AttributeCategoryDiv')), 'empty' => '(choose one)' )); echo $this->Form->input('type', array( - 'after' => $this->Html->div('forminfo', '', array('id' => 'AttributeTypeDiv')), 'empty' => '(first choose category)' )); - if ('true' == Configure::read('CyDefSIG.sync')) { + if ('true' == Configure::read('CyDefSIG.sync') && $canEditDist) { echo $this->Form->input('distribution', array( 'label' => 'Distribution', 'selected' => $maxDist, - 'after' => $this->Html->div('forminfo', '', array('id' => 'AttributeDistributionDiv')) )); } echo $this->Form->input('value', array( @@ -33,18 +27,16 @@ $mayModify = (($isAclModify && $attribute['Event']['user_id'] == $me['id']) || ( Form->input('to_ids', array( 'checked' => true, - 'after' => $this->Html->div('forminfo', isset($attrDescriptions['signature']['formdesc']) ? $attrDescriptions['signature']['formdesc'] : $attrDescriptions['signature']['desc']), + 'data-content' => isset($attrDescriptions['signature']['formdesc']) ? $attrDescriptions['signature']['formdesc'] : $attrDescriptions['signature']['desc'], 'label' => 'IDS Signature?', )); echo $this->Form->input('batch_import', array( 'type' => 'checkbox', - 'after' => $this->Html->div('forminfo', 'Create multiple attributes one per line'), + 'data-content' => 'Create multiple attributes one per line', )); // link an onchange event to the form elements $this->Js->get('#AttributeCategory')->event('change', 'formCategoryChanged("#AttributeCategory")'); - $this->Js->get('#AttributeType')->event('change', 'showFormInfo("#AttributeType")'); - $this->Js->get('#AttributeDistribution')->event('change', 'showFormInfo("#AttributeDistribution")'); ?>
    Form->end();
    -
    \ No newline at end of file +
    + \ No newline at end of file diff --git a/app/View/Attributes/search.ctp b/app/View/Attributes/search.ctp index 6a21570e7..7d6f52557 100755 --- a/app/View/Attributes/search.ctp +++ b/app/View/Attributes/search.ctp @@ -16,9 +16,9 @@ Form->input('type', array( 'div' => 'input clear', - 'after' => $this->Html->div('forminfo', '', array('id' => 'AttributeTypeDiv')) )); - echo $this->Form->input('category', array('after' => $this->Html->div('forminfo', '', array('id' => 'AttributeCategoryDiv')))); + echo $this->Form->input('category', array( + )); ?> $def) { function formCategoryChanged(id) { var alreadySelected = $('#AttributeType').val(); - showFormInfo(id); // display the tooltip // empty the types document.getElementById("AttributeType").options.length = 1; // add new items to options @@ -112,15 +111,10 @@ function formCategoryChanged(id) { }); // enable the form element $('#AttributeType').prop('disabled', false); - if ("ALL" == $('#AttributeCategory').val()) { - //alert($('#AttributeCategory').val()); - $('#AttributeCategoryDiv').hide(); - } } function formTypeChanged(id) { var alreadySelected = $('#AttributeCategory').val(); - showFormInfo(id); // display the tooltip // empty the categories document.getElementById("AttributeCategory").options.length = 2; // add new items to options @@ -133,10 +127,6 @@ function formTypeChanged(id) { }); // enable the form element $('#AttributeCategory').prop('disabled', false); - if ("ALL" == $('#AttributeType').val()) { - //alert($('#AttributeType').val()); - $('#AttributeTypeDiv').hide(); - } } var formInfoValues = new Array(); @@ -151,33 +141,36 @@ foreach ($categoryDefinitions as $category => $def) { echo "formInfoValues['$category'] = \"$info\";\n"; } $this->Js->get('#AttributeCategory')->event('change', 'formCategoryChanged("#AttributeCategory")'); -$this->Js->get('#AttributeCategory')->event('change', 'showFormInfo("#AttributeCategory")'); $this->Js->get('#AttributeType')->event('change', 'formTypeChanged("#AttributeType")'); -$this->Js->get('#AttributeType')->event('change', 'showFormInfo("#AttributeType")'); ?> formInfoValues['ALL'] = ''; formInfoValues[''] = ''; -function showFormInfo(id) { - idDiv = id+'Div'; - if (("ALL" != $(id).val()) && ("" != $(id).val())) { - // 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'); - } else { - $(idDiv).hide(); - } -} +$(document).ready(function() { + + $("#AttributeType, #AttributeCategory").on('mouseleave', function(e) { + $('#'+e.currentTarget.id).popover('destroy'); + }); + + $("#AttributeType, #AttributeCategory").on('mouseover', function(e) { + var $e = $(e.target); + if ($e.is('option')) { + $('#'+e.currentTarget.id).popover('destroy'); + $('#'+e.currentTarget.id).popover({ + trigger: 'manual', + placement: 'right', + content: formInfoValues[$e.val()], + }).popover('show'); + } + }); + + +}); + + -// hide the formInfo things -$('#AttributeTypeDiv').hide(); -$('#AttributeCategoryDiv').hide(); Js->writeBuffer(); // Write cached scripts ?> diff --git a/app/View/Elements/global_menu.ctp b/app/View/Elements/global_menu.ctp index 484c99d26..1e76de380 100755 --- a/app/View/Elements/global_menu.ctp +++ b/app/View/Elements/global_menu.ctp @@ -113,7 +113,7 @@ -
    + + +   + + + + + endif; ?> + From d4d24a3aea0f6e88df431c3b98a3b4d7dac7b8d1 Mon Sep 17 00:00:00 2001 From: Christophe Vandeplas Date: Sat, 8 Jun 2013 11:31:22 +0200 Subject: [PATCH 47/56] peformance --- app/Controller/AppController.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/Controller/AppController.php b/app/Controller/AppController.php index 5ec0f2f1d..46ea7e576 100755 --- a/app/Controller/AppController.php +++ b/app/Controller/AppController.php @@ -183,13 +183,9 @@ class AppController extends Controller { * @return void */ protected function _refreshAuth() { - if (isset($this->User)) { - $user = $this->User->read(false, $this->Auth->user('id')); - } else { - $this->loadModel('User'); - $this->User->recursive = -1; - $user = $this->User->findById($this->Auth->user('id')); - } + $this->loadModel('User'); + $this->User->recursive = -1; + $user = $this->User->findById($this->Auth->user('id')); $this->Auth->login($user['User']); } From bd88c10bf175c2224d0b7a774d256d864f7b471f Mon Sep 17 00:00:00 2001 From: Christophe Vandeplas Date: Sat, 8 Jun 2013 16:55:04 +0200 Subject: [PATCH 48/56] removed not necessary sort results in huge performance improvement --- app/Model/Attribute.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Model/Attribute.php b/app/Model/Attribute.php index be47267eb..75ef8b1df 100755 --- a/app/Model/Attribute.php +++ b/app/Model/Attribute.php @@ -177,7 +177,7 @@ class Attribute extends AppModel { ) ); - public $order = array("Attribute.event_id" => "DESC", "Attribute.type" => "ASC"); + public $order = array("Attribute.event_id" => "DESC"); /** * Validation rules From 482fd8b8b08fe0c96135a4b2a524eccbb72a28f6 Mon Sep 17 00:00:00 2001 From: Christophe Vandeplas Date: Mon, 10 Jun 2013 10:41:29 +0200 Subject: [PATCH 49/56] fix no tooltip bug on Chrome and probably IE. --- app/View/Attributes/add.ctp | 15 +++++++++++++++ app/View/Attributes/edit.ctp | 15 +++++++++++++++ app/View/Events/add.ctp | 13 +++++++++++++ app/View/Events/edit.ctp | 13 +++++++++++++ 4 files changed, 56 insertions(+) diff --git a/app/View/Attributes/add.ctp b/app/View/Attributes/add.ctp index ddea58463..5107bbb71 100755 --- a/app/View/Attributes/add.ctp +++ b/app/View/Attributes/add.ctp @@ -145,6 +145,21 @@ $(document).ready(function() { }).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. + $("#AttributeType, #AttributeCategory, #Attribute, #AttributeDistribution").on('change', function(e) { + var $e = $(e.target); + if ($e.is('option')) { + $('#'+e.currentTarget.id).popover('destroy'); + $('#'+e.currentTarget.id).popover({ + trigger: 'manual', + placement: 'right', + content: formInfoValues[$e.val()], + }).popover('show'); + } + }); + }); diff --git a/app/View/Attributes/edit.ctp b/app/View/Attributes/edit.ctp index 2af50a5e7..4ddbb86b9 100755 --- a/app/View/Attributes/edit.ctp +++ b/app/View/Attributes/edit.ctp @@ -146,6 +146,21 @@ $(document).ready(function() { }).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. + $("#AttributeType, #AttributeCategory, #Attribute, #AttributeDistribution").on('change', function(e) { + var $e = $(e.target); + if ($e.is('option')) { + $('#'+e.currentTarget.id).popover('destroy'); + $('#'+e.currentTarget.id).popover({ + trigger: 'manual', + placement: 'right', + content: formInfoValues[$e.val()], + }).popover('show'); + } + }); + }); diff --git a/app/View/Events/add.ctp b/app/View/Events/add.ctp index b8281a2e8..244dda8c0 100755 --- a/app/View/Events/add.ctp +++ b/app/View/Events/add.ctp @@ -90,6 +90,19 @@ $(document).ready(function() { }).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. + $("#EventAnalysis, #EventRisk, #EventDistribution").on('change', function(e) { + var $e = $(e.target); + $('#'+e.currentTarget.id).popover('destroy'); + $('#'+e.currentTarget.id).popover({ + trigger: 'manual', + placement: 'right', + content: formInfoValues[$e.val()], + }).popover('show'); + }); }); diff --git a/app/View/Events/edit.ctp b/app/View/Events/edit.ctp index ed892c9a6..35a8dfc8f 100755 --- a/app/View/Events/edit.ctp +++ b/app/View/Events/edit.ctp @@ -105,6 +105,19 @@ $(document).ready(function() { }).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. + $("#EventAnalysis, #EventRisk, #EventDistribution").on('change', function(e) { + var $e = $(e.target); + $('#'+e.currentTarget.id).popover('destroy'); + $('#'+e.currentTarget.id).popover({ + trigger: 'manual', + placement: 'right', + content: formInfoValues[$e.val()], + }).popover('show'); + }); }); From c348c62a0e1c76653086e3377039485a5f4bdd57 Mon Sep 17 00:00:00 2001 From: Christophe Vandeplas Date: Mon, 10 Jun 2013 10:46:03 +0200 Subject: [PATCH 50/56] fix bug no tooltip with Chrome/IE on attributes --- app/View/Attributes/add.ctp | 14 ++++++-------- app/View/Attributes/edit.ctp | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/app/View/Attributes/add.ctp b/app/View/Attributes/add.ctp index 5107bbb71..4154f1c5d 100755 --- a/app/View/Attributes/add.ctp +++ b/app/View/Attributes/add.ctp @@ -150,14 +150,12 @@ $(document).ready(function() { // no solutions exist, except to generate the select completely using html. $("#AttributeType, #AttributeCategory, #Attribute, #AttributeDistribution").on('change', function(e) { var $e = $(e.target); - if ($e.is('option')) { - $('#'+e.currentTarget.id).popover('destroy'); - $('#'+e.currentTarget.id).popover({ - trigger: 'manual', - placement: 'right', - content: formInfoValues[$e.val()], - }).popover('show'); - } + $('#'+e.currentTarget.id).popover('destroy'); + $('#'+e.currentTarget.id).popover({ + trigger: 'manual', + placement: 'right', + content: formInfoValues[$e.val()], + }).popover('show'); }); }); diff --git a/app/View/Attributes/edit.ctp b/app/View/Attributes/edit.ctp index 4ddbb86b9..2c95bbe9e 100755 --- a/app/View/Attributes/edit.ctp +++ b/app/View/Attributes/edit.ctp @@ -151,14 +151,12 @@ $(document).ready(function() { // no solutions exist, except to generate the select completely using html. $("#AttributeType, #AttributeCategory, #Attribute, #AttributeDistribution").on('change', function(e) { var $e = $(e.target); - if ($e.is('option')) { - $('#'+e.currentTarget.id).popover('destroy'); - $('#'+e.currentTarget.id).popover({ - trigger: 'manual', - placement: 'right', - content: formInfoValues[$e.val()], - }).popover('show'); - } + $('#'+e.currentTarget.id).popover('destroy'); + $('#'+e.currentTarget.id).popover({ + trigger: 'manual', + placement: 'right', + content: formInfoValues[$e.val()], + }).popover('show'); }); }); From d81ffe56b7c38aaaf620e8829203d1afdc50ebca Mon Sep 17 00:00:00 2001 From: Christophe Vandeplas Date: Mon, 10 Jun 2013 11:31:46 +0200 Subject: [PATCH 51/56] Performance improvement with static urls --- app/View/Attributes/add.ctp | 20 ++++----- app/View/Attributes/add_attachment.ctp | 25 +++++------- app/View/Attributes/edit.ctp | 20 ++++----- app/View/Attributes/index.ctp | 56 +++++++++++++------------- app/View/Attributes/search.ctp | 24 ++++++++--- app/View/Elements/global_menu.ctp | 56 +++++++++++++------------- 6 files changed, 105 insertions(+), 96 deletions(-) diff --git a/app/View/Attributes/add.ctp b/app/View/Attributes/add.ctp index 4154f1c5d..66c370ac2 100755 --- a/app/View/Attributes/add.ctp +++ b/app/View/Attributes/add.ctp @@ -46,21 +46,21 @@ echo $this->Form->end();
    diff --git a/app/View/Attributes/add_attachment.ctp b/app/View/Attributes/add_attachment.ctp index 77ab0d569..38a38787e 100755 --- a/app/View/Attributes/add_attachment.ctp +++ b/app/View/Attributes/add_attachment.ctp @@ -42,26 +42,21 @@ echo $this->Form->end();
    diff --git a/app/View/Attributes/edit.ctp b/app/View/Attributes/edit.ctp index 2c95bbe9e..1ce2bae02 100755 --- a/app/View/Attributes/edit.ctp +++ b/app/View/Attributes/edit.ctp @@ -46,21 +46,21 @@ echo $this->Form->end();
    diff --git a/app/View/Attributes/index.ctp b/app/View/Attributes/index.ctp index 859762b58..7438ad8a5 100755 --- a/app/View/Attributes/index.ctp +++ b/app/View/Attributes/index.ctp @@ -21,7 +21,7 @@ if ($isSearch == 1) { )); echo $this->Paginator->prev('« ' . __('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->numbers(array('modulus' => 20, 'separator' => '', 'tag' => 'li', 'currentClass' => 'active', 'currentTag' => 'span')); echo $this->Paginator->next(__('next') . ' »', array('tag' => 'li', 'escape' => false), null, array('tag' => 'li', 'class' => 'next disabled', 'escape' => false, 'disabledTag' => 'span')); ?> @@ -53,45 +53,47 @@ foreach ($attributes as $attribute):
    + onclick="document.location='/events/view/';"> Html->link($attribute['Event']['id'], array('controller' => 'events', 'action' => 'view', $attribute['Event']['id']), array('class' => 'SameOrgLink')); + $class='class="SameOrgLink"'; } else { - echo $this->Html->link($attribute['Event']['id'], array('controller' => 'events', 'action' => 'view', $attribute['Event']['id'])); + $class=''; } $currentCount++; ?> + >
    -   -   + +   +   Highlight->highlighter($sigDisplay, $replacePairs)); + $sigDisplay = $this->Highlight->highlighter($sigDisplay, $replacePairs); } if ('attachment' == $attribute['Attribute']['type'] || 'malware-sample' == $attribute['Attribute']['type']) { - echo $this->Html->link($sigDisplay, array('controller' => 'attributes', 'action' => 'download', $attribute['Attribute']['id']), array('escape' => FALSE)); + ?>Html->link($sigDisplay, nl2br(h($attribute['Attribute']['value'])), array('escape' => FALSE)); + ?>  -   +   +
    - passedArgs as $k => $v) { - if ((substr($k, 0, 6) === 'search')) { - $searchTerm = substr($k, 6); - if ($searchTerm === 'published') { - switch ($v) { - case '0' : - $value = 'No'; - break; - case '1' : - $value = 'Yes'; - break; - case '2' : - continue 2; - break; - } - } else { - if (!$v) { - continue; - } - $value = $v; - } - ?> - +
    :
    + passedArgs as $k => $v) { + if ((substr($k, 0, 6) === 'search')) { + $searchTerm = substr($k, 6); + if ($searchTerm === 'published') { + switch ($v) { + case '0' : + $value = 'No'; + break; + case '1' : + $value = 'Yes'; + break; + case '2' : + continue 2; + break; + } + } else { + if (!$v) { + continue; + } + $value = $v; + } + ?> + + 0) { - ?> - - -
    + : + Html->link('', array('controller' => 'events', 'action' => 'index'), array('class' => 'icon-remove', 'title' => 'Remove filters'));?>
    - Form->end(); - ?> + if ($count > 0) { + ?> + + Html->link('', array('controller' => 'events', 'action' => 'index'), array('class' => 'icon-remove', 'title' => 'Remove filters'));?> + + + + + - + + if ('true' == Configure::read('CyDefSIG.showorg') || $isAdmin) { + if ($isSiteAdmin) { ?> - + - + - + - + - + + + Form->end(); + ?>
    Paginator->sort('published', 'Valid.');?>
    + Paginator->sort('published', 'Valid.');?> + +
    + Form->input('searchpublished', array( + 'options' => array('0' => 'No', '1' => 'Yes', '2' => 'Any'), + 'default' => 2, + 'label' => '', + 'class' => 'input-mini', + 'onchange' => "$('#EventIndexForm').submit()" + )); + ?> +
    +
    Paginator->sort('org'); ?> Paginator->sort('org'); ?>
    Paginator->sort('org'); ?> + + Paginator->sort('owner org');?>
    + Paginator->sort('owner org');?> + +
    + Form->input('searchorgc', array( + 'value' => $this->passedArgs['searchorgc'], + 'label' => '', + 'class' => 'input-mini')); + ?> +
    +
    Paginator->sort('id');?> Paginator->sort('attribute_count', '#Attr.');?> Paginator->sort('user_id', 'Email');?> Paginator->sort('date');?>
    + Paginator->sort('date');?> + +
    +
    + Form->input('searchDatefrom', array( + 'value' => $this->passedArgs['searchDatefrom'], + 'label' => false, + 'div' => false, + 'class' => 'span1 datepicker', + )); + ?> + + Form->input('searchDateuntil', array( + 'value' => $this->passedArgs['searchDateuntil'], + 'label' => false, + 'class' => 'span1 datepicker', + 'div' => false + )); + ?> +
    +
    Paginator->sort('risk');?> Paginator->sort('analysis');?> Paginator->sort('info');?>
    + Paginator->sort('info');?> + +
    + Form->input('searchinfo', array( + 'value' => $this->passedArgs['searchinfo'], + 'label' => '', + 'class' => 'input-large')); + ?> +
    +
    Paginator->sort('distribution');?> Actions
    @@ -239,37 +315,19 @@ \ No newline at end of file diff --git a/app/View/Events/view.ctp b/app/View/Events/view.ctp index 4c0ec7de3..3f4560054 100755 --- a/app/View/Events/view.ctp +++ b/app/View/Events/view.ctp @@ -11,7 +11,7 @@ $mayPublish = ($isAclPublish && $event['Event']['orgc'] == $me['org']);
  • Html->link('Add Attribute', array('controller' => 'attributes', 'action' => 'add', $event['Event']['id']));?>
  • Html->link('Add Attachment', array('controller' => 'attributes', 'action' => 'add_attachment', $event['Event']['id']));?>
  • -
  • Html->link('Populate event from IOC', array('controller' => 'events', 'action' => 'addIOC', $event['Event']['id']));?>
  • +
  • Html->link('Populate from IOC', array('controller' => 'events', 'action' => 'addIOC', $event['Event']['id']));?>
  • Html->link('Propose Attribute', array('controller' => 'shadow_attributes', 'action' => 'add', $event['Event']['id']));?>
  • Html->link('Propose Attachment', array('controller' => 'shadow_attributes', 'action' => 'add_attachment', $event['Event']['id']));?>
  • From e0c0e7ccf5dde3cafab59823090eff31211a363b Mon Sep 17 00:00:00 2001 From: Christophe Vandeplas Date: Mon, 10 Jun 2013 17:57:20 +0200 Subject: [PATCH 54/56] unified links --- app/View/Events/add.ctp | 12 ++++---- app/View/Events/add_i_o_c.ctp | 32 +++++++++++++--------- app/View/Events/automation.ctp | 12 ++++---- app/View/Events/contact.ctp | 34 +++++++++++++---------- app/View/Events/edit.ctp | 30 ++++++++++---------- app/View/Events/export.ctp | 12 ++++---- app/View/Events/index.ctp | 50 +++++----------------------------- app/View/Events/view.ctp | 30 ++++++++++---------- 8 files changed, 94 insertions(+), 118 deletions(-) diff --git a/app/View/Events/add.ctp b/app/View/Events/add.ctp index 244dda8c0..a8d12e3b9 100755 --- a/app/View/Events/add.ctp +++ b/app/View/Events/add.ctp @@ -38,17 +38,17 @@ echo $this->Form->end();
    diff --git a/app/View/Events/add_i_o_c.ctp b/app/View/Events/add_i_o_c.ctp index ce834fc69..35ad77b23 100644 --- a/app/View/Events/add_i_o_c.ctp +++ b/app/View/Events/add_i_o_c.ctp @@ -16,26 +16,32 @@ echo $this->Form->end();
    \ No newline at end of file diff --git a/app/View/Events/automation.ctp b/app/View/Events/automation.ctp index 104ee9467..0819526e8 100644 --- a/app/View/Events/automation.ctp +++ b/app/View/Events/automation.ctp @@ -58,17 +58,17 @@ This would enable you to export:

    diff --git a/app/View/Events/contact.ctp b/app/View/Events/contact.ctp index 8ac364a29..c27bb3965 100755 --- a/app/View/Events/contact.ctp +++ b/app/View/Events/contact.ctp @@ -35,26 +35,32 @@ $mayPublish = ($isAclPublish && $this->request->data['Event']['orgc'] == $me['or
    -
    \ No newline at end of file + diff --git a/app/View/Events/edit.ctp b/app/View/Events/edit.ctp index 35a8dfc8f..916632009 100755 --- a/app/View/Events/edit.ctp +++ b/app/View/Events/edit.ctp @@ -36,35 +36,37 @@ echo $this->Form->end();
    +