public function process()
 {
     parent::process();
     if ($this->getRequest()->isMutation()) {
         $ndb = $this->getPlatform()->getDatabase('networks');
         $ndb->deleteKey($this->parameters['device']);
         $this->getAdapter()->flush();
     }
 }
 public function process()
 {
     parent::process();
     if ($this->getRequest()->isMutation()) {
         $ndb = $this->getPlatform()->getDatabase('networks');
         $ndb->delProp($this->parameters['device'], array('master', 'bridge', 'bootproto', 'ipaddr', 'netmask', 'gateway', 'vlan'));
         $ndb->setProp($this->parameters['device'], array('role' => ''));
         if ($this->parameters['role'] === 'pppoe') {
             $ndb->setType('ppp0', 'xdsl-disabled');
         }
         $this->getAdapter()->flush();
         $this->getPlatform()->signalEvent('interface-update &');
     }
 }
 public function process()
 {
     parent::process();
     $ndb = $this->getPlatform()->getDatabase('networks');
 }
예제 #4
0
 public function process()
 {
     $this->plugins->process();
     $this->innerAction->process();
 }
 public function process()
 {
     parent::process();
     if ($this->getRequest()->isMutation()) {
         $ndb = $this->getPlatform()->getDatabase('networks');
         $state = $this->parameters->getArrayCopy();
         $props = array('role' => $state['role']);
         if ($state['bootproto'] === 'none') {
             $props['bootproto'] = 'none';
             $props['ipaddr'] = $state['ipaddr'];
             $props['netmask'] = $state['netmask'];
             $props['gateway'] = $state['gateway'];
         } elseif ($state['bootproto'] === 'dhcp') {
             $props['bootproto'] = 'dhcp';
             $props['ipaddr'] = '';
             $props['netmask'] = '';
             $props['gateway'] = '';
         }
         if ($state['type'] === 'bond') {
             $props['BondOptMode'] = $state['bondMode'];
         }
         foreach ($this->getParts($state['device']) as $key) {
             if ($state['type'] === 'bridge') {
                 $ndb->delProp($key, array('master', 'ipaddr', 'netmask', 'gateway', 'vlan'));
                 $ndb->setProp($key, array('role' => 'bridged', 'bootproto' => 'none', 'bridge' => $state['device']));
             } elseif ($state['type'] === 'bond') {
                 $ndb->delProp($key, array('bridge', 'ipaddr', 'netmask', 'gateway', 'vlan'));
                 $ndb->setProp($key, array('role' => 'slave', 'bootproto' => 'none', 'master' => $state['device']));
             }
         }
         $this->getPlatform()->getDatabase('networks')->setKey($state['device'], $state['type'], $props);
         $this->getAdapter()->flush();
         $this->getPlatform()->signalEvent('interface-update &');
     }
 }
 public function process()
 {
     parent::process();
     if ($this->getRequest()->isMutation()) {
         foreach ($this->getDeviceParts($this->parameters['device']) as $partKey) {
             if ($this->getParent()->hasParent($this->parameters['device'])) {
                 $this->movePartToParent($partKey);
             } else {
                 $this->releasePart($partKey);
             }
         }
         if ($this->parameters['type'] === 'xdsl') {
             $this->releasePppoeDevices();
         } else {
             $this->getPlatform()->getDatabase('networks')->deleteKey($this->parameters['device']);
         }
         $this->getAdapter()->flush();
         $this->getPlatform()->signalEvent('interface-update &');
     }
 }
 public function process()
 {
     $this->getPlatform()->exec('/usr/bin/sudo /usr/libexec/nethserver/fetchmail-wakeup');
     parent::process();
 }
 public function process()
 {
     parent::process();
     if ($this->getRequest()->isMutation()) {
         $this->getPlatform()->getDatabase('SESSION')->setProp($this->sessionKey, $this->getRoleIpSettings($this->parameters['role']));
     }
 }
예제 #9
0
 public function process()
 {
     parent::process();
     if ($this->getRequest()->isMutation()) {
         $this->stash->store($this->parameters['newPassword']);
         $this->getPlatform()->signalEvent('password-modify@post-process', array($this->userName, $this->stash->getFilePath()));
     }
 }