micro cleanup of servers index

pull/217/head
Christophe Vandeplas 2013-06-19 14:58:48 +02:00
parent 435c52c457
commit 8fe83c333f
2 changed files with 4 additions and 7 deletions

View File

@ -152,9 +152,6 @@ class ServersController extends AppController {
public function pull($id = null, $technique=false) {
// TODO should we de-activate data validation for type and category / and or mapping? Maybe other instances have other configurations that are incompatible.
if (!$this->_IsSiteAdmin() && !($this->Server->organization == $this->Auth->user('org') && $this->checkAction('perm_sync'))) $this->redirect(array('controller' => 'servers', 'action' => 'index'));
// if (!$this->request->is('post')) {
// throw new MethodNotAllowedException();
// }
$this->Server->id = $id;
if (!$this->Server->exists()) {
throw new NotFoundException(__('Invalid server'));
@ -184,10 +181,8 @@ class ServersController extends AppController {
$eventIds = array_reverse($eventIds);
} elseif ("incremental" == $technique) {
// TODO incremental pull
// lastpulledid
throw new NotFoundException('Sorry, this is not yet implemented');
// increment lastid based on the highest ID seen
} elseif (true == $technique) {
$eventIds[] = intval($technique);
}

View File

@ -48,8 +48,10 @@ foreach ($servers as $server): ?>
<td class="short"><?php echo $server['Server']['lastpushedid']; ?></td>
<td class="short action-links">
<?php
if ($server['Server']['pull'] && $me['org'] == 'ADMIN') echo $this->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') );
if ($server['Server']['pull'] && $me['org'] == 'ADMIN')
echo $this->Html->link('', array('action' => 'pull', $server['Server']['id'], 'full'), array('class' => 'icon-download', 'title' => 'Pull all'));
if ($server['Server']['push'] && $me['org'] == 'ADMIN')
echo $this->Form->postLink('', array('action' => 'push', $server['Server']['id'], 'full'), array('class' => 'icon-upload', 'title' => 'Push all') );
?>
&nbsp;
<?php