X-Git-Url: http://git.datanom.net/omvzfs.git/blobdiff_plain/6b3ce31b7350912d6080771f0f02f0990fdcbf5e..5ff626ba7c8db2bd124cc64d49a8f31117d1f26c:/gui/rpc/zfs.inc diff --git a/gui/rpc/zfs.inc b/gui/rpc/zfs.inc index bdf8c44..48c7ef4 100644 --- a/gui/rpc/zfs.inc +++ b/gui/rpc/zfs.inc @@ -70,7 +70,8 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { public function deleteObject($params, $context) { $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR)); switch ($params['type']) { - case "Filesystem" || "Clone": + case "Filesystem": + case "Clone": $name = $params['name']; $tmp = new OMVModuleZFSDataset($name); $tmp->destroy(); @@ -96,7 +97,8 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { $objects = array(); $name = $params['name']; switch ($params['type']) { - case "Filesystem" || "Clone": + case "Filesystem": + case "Clone": $tmp = new OMVModuleZFSDataset($name); break; case "Snapshot": @@ -125,7 +127,8 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR)); $objects = array(); switch ($params['type']) { - case "Filesystem" || "Clone": + case "Filesystem": + case "Clone": $tmp = new OMVModuleZFSDataset($params['name']); break; case "Snapshot": @@ -137,7 +140,7 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { default: throw new OMVModuleZFSException("Illegal type provided: " . $params['type']); break; - } + } foreach ($params['properties'] as $property) { $objects[$property['property']] = $property['value']; } @@ -158,7 +161,8 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { $bgOutputFilename = $this->createBgProcOutput(); $this->updateBgProcStatus($bgStatusFilename, "outputfilename", $bgOutputFilename); switch ($params['type']) { - case "Filesystem" || "Clone": + case "Filesystem": + case "Clone": $tmp = new OMVModuleZFSDataset($params['name']); break; case "Snapshot": @@ -229,7 +233,8 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { // Prepare the configuration object. Use the name of the shared // folder as the relative directory name of the share. switch ($params['type']) { - case "Filesystem" || "Clone": + case "Filesystem": + case "Clone": $tmp = new OMVModuleZFSDataset($name); break; default: @@ -239,7 +244,7 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { $uuid = OMVUtil::uuid(); $pathName = $tmp->getMountPoint(); - $subdirs = preg_split('/\//',$pathName); + $subdirs = preg_split('/\//',$pathName); $reldirpath = $subdirs[count($subdirs)-1]; $object = array( "uuid" => $uuid, @@ -307,7 +312,7 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { } // Register the RPC service. -$rpcServiceMgr = &OMVRpcServiceMgr::getInstance(); // Get the "root" instance for the Services +$rpcServiceMgr = &OMVRpcServiceMgr::getInstance(); // Get the "root" instance for the Services $rpcServiceMgr->registerService(new OMVRpcServiceZFS()); // Register a new instance of the RPC service described above ?>