distribution

removed No push as a distribution.
pull/63/head
noud 2012-11-05 13:05:31 +01:00
parent 3e46eaa5ea
commit f66b199f26
4 changed files with 8 additions and 23 deletions

View File

@ -61,7 +61,6 @@ class Attribute extends AppModel {
public $distributionDescriptions = array(
'Org' => array('desc' => 'This field determines the current distribution of the even', 'formdesc' => "Only organization members will see the attribute"),
'Community' => array('desc' => 'This field determines the current distribution of the even', 'formdesc' => "Attribute visible to all on this CyDefSIG instance but will not be shared past it"),
'No push' => array('desc' => 'This field determines the current distribution of the even', 'formdesc' => "To be distributed to other servers but no push (compatible with CyDefSIG v1 *private* field"),
'All' => array('desc' => 'This field determines the current distribution of the even', 'formdesc' => "To be distributed to other connected CyDefSIG servers"),
);
@ -287,7 +286,7 @@ class Attribute extends AppModel {
if ('true' == Configure::read('CyDefSIG.private')) {
$this->virtualFields = Set::merge($this->virtualFields,array(
'distribution' => 'IF (Attribute.private=true, "Org", IF (Attribute.cluster=true, "Community", IF (Attribute.pull=true, "No push", "All")))',
'distribution' => 'IF (Attribute.private=true, "Org", IF (Attribute.cluster=true, "Community", "All"))',
));
$this->fieldDescriptions = Set::merge($this->fieldDescriptions,array(
@ -316,7 +315,7 @@ class Attribute extends AppModel {
),
),
'distribution' => array(
'rule' => array('inList', array('Org', 'Community', 'No push', 'All')),
'rule' => array('inList', array('Org', 'Community', 'All')),
//'message' => 'Your custom message here',
'allowEmpty' => false,
'required' => false,
@ -427,11 +426,6 @@ class Attribute extends AppModel {
$data['Attribute']['cluster'] = true;
$data['Attribute']['pull'] = false;
break;
case 'No push':
$data['Attribute']['private'] = false;
$data['Attribute']['cluster'] = false;
$data['Attribute']['pull'] = true;
break;
case 'All':
$data['Attribute']['private'] = false;
$data['Attribute']['cluster'] = false;

View File

@ -47,7 +47,6 @@ class Event extends AppModel {
public $distributionDescriptions = array(
'Org' => array('desc' => 'This field determines the current distribution of the even', 'formdesc' => "Only organization members will see the event"),
'Community' => array('desc' => 'This field determines the current distribution of the even', 'formdesc' => "Event visible to all on this CyDefSIG instance but will not be shared past it"),
'No push' => array('desc' => 'This field determines the current distribution of the even', 'formdesc' => "To be distributed to other servers but no push (compatible with CyDefSIG v1 *private* field"),
'All' => array('desc' => 'This field determines the current distribution of the even', 'formdesc' => "To be distributed to other connected CyDefSIG servers"),
);
@ -161,11 +160,11 @@ class Event extends AppModel {
if ('true' == Configure::read('CyDefSIG.private')) {
$this->virtualFields = Set::merge($this->virtualFields, array(
'distribution' => 'IF (Event.private=true, "Org", IF (Event.cluster=true, "Community", IF (Event.pull=true, "No push", "All")))',
'distribution' => 'IF (Event.private=true, "Org", IF (Event.cluster=true, "Community", "All"))',
));
$this->fieldDescriptions = Set::merge($this->fieldDescriptions, array(
'distribution' => array('desc' => 'This field determines the current distribution of the event', 'formdesc' => 'This field determines the current distribution of the event:<br/>Org - only organization memebers will see the event<br/>Community - event visible to all on this CyDefSIG instance but will not be shared past it</br>No push - to be distributed to other servers but no push (compatible with CyDefSIG v1 *private* field)<br/>All - to be distributed to other connected CyDefSIG servers'),
'distribution' => array('desc' => 'This field determines the current distribution of the event', 'formdesc' => 'This field determines the current distribution of the event:<br/>Org - only organization memebers will see the event<br/>Community - event visible to all on this CyDefSIG instance but will not be shared past it</br>All - to be distributed to other connected CyDefSIG servers'),
));
$this->validate = Set::merge($this->validate,array(
@ -190,7 +189,7 @@ class Event extends AppModel {
),
),
'distribution' => array(
'rule' => array('inList', array('Org', 'Community', 'No push', 'All')),
'rule' => array('inList', array('Org', 'Community', 'All')),
//'message' => 'Your custom message here',
'allowEmpty' => false,
'required' => false,
@ -293,11 +292,6 @@ class Event extends AppModel {
$data['Event']['cluster'] = true;
$data['Event']['pull'] = false;
break;
case 'No push':
$data['Event']['private'] = false;
$data['Event']['cluster'] = false;
$data['Event']['pull'] = true;
break;
case 'All':
$data['Event']['private'] = false;
$data['Event']['cluster'] = false;
@ -377,9 +371,6 @@ class Event extends AppModel {
if (true == $event['Event']['private']) { // never upload private events
return "Event is private and non exportable";
}
if (('true' == Configure::read('CyDefSIG.private')) && ($event['Event']['pull'])) {
return "Event is No push so non exportable";
}
$url = $server['Server']['url'];
$authkey = $server['Server']['authkey'];

View File

@ -57,7 +57,7 @@ $buttonPublishStatus = $isAclPublish ? 'button_on':'button_off';
<?php if ('true' == Configure::read('CyDefSIG.sync')): ?>
<?php if ('true' == Configure::read('CyDefSIG.private')): ?>
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';">
<?php echo $event['Event']['distribution'] == 'Org' ? 'Org' : ($event['Event']['distribution'] == 'Community' ? 'Community' : ($event['Event']['distribution'] == 'No push' ? 'No push' : ' '));?></td>
<?php echo $event['Event']['distribution'] == 'Org' ? 'Org' : ($event['Event']['distribution'] == 'Community' ? 'Community' : ' ');?></td>
<?php else: ?>
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true);?>';">
<?php echo ($event['Event']['private']) ? 'Private' : ''; ?>&nbsp;</td>

View File

@ -65,7 +65,7 @@ if ($mayPublish) {
<?php if ('true' == Configure::read('CyDefSIG.private')): ?>
<dt>Distribution</dt>
<dd>
<?php echo ($event['Event']['distribution'] == 'All') ? 'All, to be distributed to other connected CyDefSIG servers.' : (($event['Event']['distribution'] == 'Community') ? 'Community, event visible to all on this CyDefSIG instance but will not be shared past it.' : (($event['Event']['distribution'] == 'No push') ? 'No push, to be distributed to other servers but no push (compatible with CyDefSIG v1 *private* field").': 'Org, only organization memebers will see the event.')); ?>
<?php echo ($event['Event']['distribution'] == 'All') ? 'All, to be distributed to other connected CyDefSIG servers.' : (($event['Event']['distribution'] == 'Community') ? 'Community, event visible to all on this CyDefSIG instance but will not be shared past it.' : 'Org, only organization memebers will see the event.'); ?>
&nbsp;
</dd>
<?php else: ?>
@ -177,7 +177,7 @@ if (isset($relatedAttributes[$attribute['id']]) && (null != $relatedAttributes[$
<td class="short" style="text-align: center;"><?php echo $attribute['to_ids'] ? 'Yes' : 'No';?></td>
<?php if ('true' == Configure::read('CyDefSIG.sync')): ?>
<?php if ('true' == Configure::read('CyDefSIG.private')): ?>
<td class="short" style="text-align: center;"><?php echo $attribute['distribution'] == 'Org' ? 'Org' : ($attribute['distribution'] == 'Community' ? 'Community' : ($attribute['distribution'] == 'No push' ? 'No push' : ' '));?></td>
<td class="short" style="text-align: center;"><?php echo $attribute['distribution'] == 'Org' ? 'Org' : ($attribute['distribution'] == 'Community' ? 'Community' : ' ');?></td>
<?php else:?>
<td class="short" style="text-align: center;"><?php echo $attribute['private'] ? 'Private' : '&nbsp;';?></td>
<?php endif;?>