Merge branch 'master' into develop

Conflicts:
	app/Controller/ServersController.php
pull/63/head
noud 2012-11-20 11:01:18 +01:00
commit 957b3e27b8
69 changed files with 27 additions and 14 deletions

0
app/.htaccess Normal file → Executable file
View File

0
app/Config/Schema/i18n.php Normal file → Executable file
View File

0
app/Config/Schema/i18n.sql Normal file → Executable file
View File

0
app/Config/Schema/schema_0.2.1.1.php Normal file → Executable file
View File

0
app/Config/Schema/sessions.php Normal file → Executable file
View File

0
app/Config/Schema/sessions.sql Normal file → Executable file
View File

0
app/Config/acl.ini.php Normal file → Executable file
View File

0
app/Config/acl.php Normal file → Executable file
View File

0
app/Config/email.php Normal file → Executable file
View File

0
app/Console/Command/PasswordShell.php Normal file → Executable file
View File

0
app/Console/cake.bat Normal file → Executable file
View File

0
app/Console/cake.php Normal file → Executable file
View File

0
app/Console/shell/migrate_0.2.1.1-0.2.2.sh Normal file → Executable file
View File

0
app/Controller/Component/SecureAuthComponent.php Normal file → Executable file
View File

0
app/Controller/Component/empty Normal file → Executable file
View File

View File

@ -365,10 +365,6 @@ class EventsController extends AppController {
// LATER do this with $this->validator()->remove('event_id');
unset($this->Event->Attribute->validate['event_id']);
unset($this->Event->Attribute->validate['value']['unique']); // otherwise gives bugs because event_id is not set
// thing a 'pull from server' sets ServersController.php:176
// Event.info is appended from the publishing side, given the need to have Server.url
$data['Event']['private'] = true;
}
if (isset($data['Event']['uuid'])) { // TODO here we should start RESTful dialog
@ -408,9 +404,7 @@ class EventsController extends AppController {
if ($this->Event->saveAssociated($data, array('validate' => true, 'fieldList' => $fieldList))) {
if (!empty($data['Event']['published']) && 1 == $data['Event']['published']) {
// call __sendAlertEmail if published was set in the request
if (!$fromXml) {
$this->__sendAlertEmail($this->Event->getId());
}
$this->__sendAlertEmail($this->Event->getId());
}
return true;
} else {
@ -595,7 +589,9 @@ class EventsController extends AppController {
private function __deleteEventFromServers($uuid) {
// get a list of the servers
$this->loadModel('Server');
$servers = $this->Server->find('all', array());
$servers = $this->Server->find('all', array(
'conditions' => array('Server.push' => true)
));
// iterate over the servers and upload the event
if(empty($servers))
@ -822,7 +818,7 @@ class EventsController extends AppController {
} catch (Exception $e){
// catch errors like expired PGP keys
$this->log($e->getMessage());
return $e->getMessage();
// no need to return here, as we want to send out mails to the other users if GPG encryption fails for a single user
}
// If you wish to send multiple emails using a loop, you'll need
// to reset the email fields using the reset method of the Email component.
@ -973,6 +969,7 @@ class EventsController extends AppController {
} catch (Exception $e){
// catch errors like expired PGP keys
$this->log($e->getMessage());
// no need to return here, as we want to send out mails to the other users if GPG encryption fails for a single user
}
} else {
$bodyEncSig = $bodySigned;

0
app/Controller/PagesController.php Normal file → Executable file
View File

View File

@ -237,7 +237,15 @@ class ServersController extends AppController {
} else {
$event['Event']['private'] = true;
}
$event['Event']['info'] .= "\n Imported from " . $this->Server->data['Server']['url'];
// check if the event already exist (using the uuid)
$existingEventCount = $this->Event->find('count', array('conditions' => array('Event.uuid' => $event['Event']['uuid'])));
if ($existingEventCount == 0) {
// add data for newly imported events
$event['Event']['private'] = true;
$event['Event']['info'] .= "\n Imported from " . $this->Server->data['Server']['url'];
}
$eventsController = new EventsController();
try {
$result = $eventsController->_add($event, $this->Auth, $fromXml = true, $this->Server->data['Server']['organization']);

0
app/LICENSE Normal file → Executable file
View File

0
app/Lib/empty Normal file → Executable file
View File

0
app/Locale/eng/LC_MESSAGES/empty Normal file → Executable file
View File

0
app/Model/Behavior/empty Normal file → Executable file
View File

0
app/Model/Bruteforce.php Normal file → Executable file
View File

0
app/Model/Datasource/empty Normal file → Executable file
View File

View File

@ -588,11 +588,19 @@ class Event extends AppModel {
}
$eventIds = array();
foreach ($eventArray['response']['Event'] as &$event) {
if (1 != $event['published']) {
continue; // do not keep non-published events
// different actions if it's only 1 event or more
// only one event.
if (isset($eventArray['response']['Event']['id'])) {
$eventIds[] = $eventArray['response']['Event']['id'];
}
else {
// multiple events, iterate over the array
foreach ($eventArray['response']['Event'] as &$event) {
if (1 != $event['published']) {
continue; // do not keep non-published events
}
$eventIds[] = $event['id'];
}
$eventIds[] = $event['id'];
}
return $eventIds;
}

0
app/Plugin/empty Normal file → Executable file
View File

0
app/README.sysop.txt Normal file → Executable file
View File

0
app/README.vhost.txt Normal file → Executable file
View File

0
app/Vendor/empty vendored Normal file → Executable file
View File

0
app/View/Elements/empty Normal file → Executable file
View File

0
app/View/Emails/html/default.ctp Normal file → Executable file
View File

0
app/View/Emails/text/default.ctp Normal file → Executable file
View File

0
app/View/Errors/error400.ctp Normal file → Executable file
View File

0
app/View/Errors/error500.ctp Normal file → Executable file
View File

0
app/View/Events/text.ctp Normal file → Executable file
View File

0
app/View/Helper/AppHelper.php Normal file → Executable file
View File

0
app/View/Layouts/Emails/html/default.ctp Normal file → Executable file
View File

0
app/View/Layouts/Emails/text/default.ctp Normal file → Executable file
View File

0
app/View/Layouts/ajax.ctp Normal file → Executable file
View File

0
app/View/Layouts/error.ctp Normal file → Executable file
View File

0
app/View/Layouts/flash.ctp Normal file → Executable file
View File

0
app/View/Layouts/js/default.ctp Normal file → Executable file
View File

0
app/View/Layouts/rss/default.ctp Normal file → Executable file
View File

0
app/View/Layouts/text/default.ctp Normal file → Executable file
View File

0
app/View/Layouts/xml/default.ctp Normal file → Executable file
View File

0
app/View/Scaffolds/empty Normal file → Executable file
View File

0
app/View/Servers/pull.ctp Normal file → Executable file
View File

0
app/View/Servers/push.ctp Normal file → Executable file
View File

0
app/View/Whitelists/admin_add.ctp Normal file → Executable file
View File

0
app/View/Whitelists/admin_view.ctp Normal file → Executable file
View File

0
app/files/empty Normal file → Executable file
View File

0
app/index.php Normal file → Executable file
View File

0
build/Makefile Normal file → Executable file
View File

0
build/patches/app_Config_bootstrap.php.diff Normal file → Executable file
View File

0
build/patches/app_Config_core.php.diff Normal file → Executable file
View File

0
build/patches/app_Config_database.php.diff Normal file → Executable file
View File

0
build/patches/app_Config_email.php.diff Normal file → Executable file
View File

0
build/patches/app_Config_routes.php.diff Normal file → Executable file
View File

0
build/patches/app_Controller_AppController.php.diff Normal file → Executable file
View File

0
build/patches/app_Controller_PagesController.php.diff Normal file → Executable file
View File

0
build/patches/app_View_Helper_AppHelper.php.diff Normal file → Executable file
View File

View File

View File

View File

0
build/patches/app_View_Layouts_default.ctp.diff Normal file → Executable file
View File

0
build/patches/app_webroot_css_cake.generic.css.diff Normal file → Executable file
View File

View File

0
build/patches/app_webroot_index.php.diff Normal file → Executable file
View File

0
plugins/empty Normal file → Executable file
View File