Skip to content

Commit

Permalink
Fix Zeroconf issue. This is not done via avahi manually, instead the …
Browse files Browse the repository at this point in the history
…netatalk daemon will take about this itself.
  • Loading branch information
votdev committed Sep 25, 2016
1 parent 73e75f0 commit 7a9cbe8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 34 deletions.
1 change: 1 addition & 0 deletions deb/openmediavault-netatalk/debian/changelog
@@ -1,6 +1,7 @@
openmediavault-netatalk (3.2.2) stable; urgency=low

* Harden installation script.
* Fix Zeroconf issue.

-- Volker Theile <volker.theile@openmediavault.org> Sun, 25 Sep 2016 12:39:53 +0200

Expand Down
Expand Up @@ -118,6 +118,10 @@ case "$1" in
omv_config_delete "/config/services/afp/shares/share/options/usedots"
omv_config_delete "/config/services/afp/shares/share/options/mswindows"
fi
if dpkg --compare-versions "$2" lt-nl "3.2.2"; then
# Zeroconf is now handled by the netatalk daemon itself.
omv_config_delete "/config/services/zeroconf/services/service[id='afp']"
fi
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down
Expand Up @@ -34,8 +34,6 @@ case "$1" in
purge)
# Remove the configuration data.
omv_config_delete "/config/services/afp"
# Remove Zeroconf configuration.
omv_config_delete "/config/services/zeroconf/services/service[id='afp']"
;;

remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
Expand Down
Expand Up @@ -20,8 +20,7 @@
* along with OpenMediaVault. If not, see <http://www.gnu.org/licenses/>.
*/
class OMVModuleAFP extends \OMV\Engine\Module\ServiceAbstract implements
\OMV\Engine\Notify\IListener, \OMV\Engine\Module\IServiceStatus,
\OMV\Engine\Module\IZeroconf {
\OMV\Engine\Notify\IListener, \OMV\Engine\Module\IServiceStatus {
private $invalidUsers = [ "admin" ];

/**
Expand Down Expand Up @@ -99,32 +98,6 @@ class OMVModuleAFP extends \OMV\Engine\Module\ServiceAbstract implements
];
}

/**
* Get the Zeroconf service configuration.
*/
public function getZeroconfConfig() {
return [
"id" => "afp",
"title" => gettext("Apple Filing")
];
}

/**
* Helper function that is called whenever a share is created, modified
* or deleted.
* @param type The event message type.
* @param path The event message path.
* @param object The configuration object.
*/
final public function onShare($type, $path, $object) {
// Set this module to dirty.
$this->setDirty();
// If this share is used for time machine then set the 'zeroconf'
// module to dirty to update the Zeroconf/Bonjour configuration.
if (array_boolval($object['options'], "tm"))
$this->setDirtyByName("zeroconf");
}

/**
* Helper function to find out whether the given shared folder
* configuration object is used. If it is used, then mark the
Expand Down Expand Up @@ -152,10 +125,6 @@ class OMVModuleAFP extends \OMV\Engine\Module\ServiceAbstract implements
OMV_NOTIFY_MODIFY,
"org.openmediavault.conf.service.afp",
[ $this, "setDirty" ]);
$dispatcher->addListener(
OMV_NOTIFY_CREATE | OMV_NOTIFY_MODIFY | OMV_NOTIFY_DELETE,
"org.openmediavault.conf.service.afp.share",
[ $this, "onShare" ]);
$dispatcher->addListener(
OMV_NOTIFY_MODIFY,
"org.openmediavault.conf.system.sharedfolder",
Expand Down

0 comments on commit 7a9cbe8

Please sign in to comment.