public function execute() { $isAdmin = Api_Bo_Users::isUserAdmin($this->getUserId()); if (!$isAdmin) { throw new Exception('Only the administrator can delete networks.'); } $enid = $this->m_nid; Api_Bo_Network::deleteNetwork($enid); return true; }
public function execute() { $netKeys = Api_Bo_Network::createNetwork($this->getUserId(), $this->m_properties); //return response $response = array(); if ($netKeys !== false) { $response['network'] = array(); $response['network']['name'] = isset($this->m_properties['name']) ? $this->m_properties['name'] : $netKeys[0]; $response['network']['key'] = $netKeys[0]; $response['network']['secret'] = $netKeys[1]; } return $response; }
/** * Execute the api call to get user app list. */ public function execute() { $isAdmin = Api_Bo_Users::isUserAdmin($this->getUserId()); if (!$isAdmin) { throw new Exception('Only the administrator set network properties.'); } $this->checkDefaultApp(); $enid = $this->m_nid; $eprops = array(); foreach ($this->m_props as $name => $val) { $ename = $name; $eval = $val; $eprops[$ename] = $eval; } Api_Bo_Network::setNetworkProperties($this->getUserId(), $enid, $eprops); return true; }
/** * Execute the api call to get user app list. */ public function execute() { $isAdmin = Api_Bo_Users::isUserAdmin($this->getUserId()); if (!$isAdmin) { throw new Exception('Only the administrator view network properties.'); } $this->checkDefaultApp(); $enids = array(); foreach ($this->m_nids as $nid) { $enids[] = $nid; } $eprops = array(); foreach ($this->m_props as $name => $val) { $ename = $name; $eval = $val; $eprops[$ename] = $eval; } $props = Api_Bo_Network::getNetworkProperties($this->getUserId(), $enids, $eprops); $response = array('networks' => $props); return $response; }