code standards

corrections toward code standards.
pull/63/head
noud 2012-11-14 17:16:36 +01:00
parent b84bc50c56
commit ea0ab59e4f
8 changed files with 56 additions and 58 deletions

View File

@ -64,7 +64,6 @@ class AppController extends Controller {
}
public function beforeFilter() {
// user must accept terms
if (!$this->Auth->user('termsaccepted') && ($this->request->here != '/users/terms') && ($this->request->here != '/users/logout') && ($this->request->here != '/users/login')) {
$this->redirect(array('controller' => 'users', 'action' => 'terms'));
@ -431,7 +430,9 @@ class AppController extends Controller {
}
}
// CakePHP returns false if filesize is 0 at lib/cake/Utility/File.php:384
/**
* CakePHP returns false if filesize is 0 at lib/cake/Utility/File.php:384
*/
public function checkEmpty($fileP = '/var/www/cydefsig/app/files/test') {
// Check if there were problems with the file upload
// only keep the last part of the filename, this should prevent directory attacks

View File

@ -191,7 +191,7 @@ class ServersController extends AppController {
}
if (is_array($event['Event']['Attribute']) && !isset($event['Event']['Attribute']['id'])) {
$toRemove = array();
$size = sizeof($event['Event']['Attribute']);
$size = count($event['Event']['Attribute']);
for ($i = 0; $i < $size; $i++) {
switch($event['Event']['Attribute'][$i]['distribution']) {
case 'Org':

View File

@ -18,9 +18,6 @@ if ('true' == Configure::read('CyDefSIG.sync')) {
echo $this->Form->input('distribution', array('label' => 'Distribution', 'selected' => 'All',
'between' => $this->Html->div('forminfo', '', array('id' => 'AttributeDistributionDiv'))
));
// echo $this->Form->input('sharing', array('label' => 'Distribution',
// 'before' => $this->Html->div('forminfo', isset($attrDescriptions['sharing']['formdesc']) ? $attrDescriptions['sharing']['formdesc'] : $attrDescriptions['sharing']['desc']),
// ));
} else {
echo $this->Form->input('private', array(
'before' => $this->Html->div('forminfo', isset($attrDescriptions['private']['formdesc']) ? $attrDescriptions['private']['formdesc'] : $attrDescriptions['private']['desc']),