summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2d316eb)
raw | patch | inline | side by side (parent: 2d316eb)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 14 Jan 2011 13:59:01 +0000 (13:59 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 14 Jan 2011 13:59:01 +0000 (13:59 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@20587 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc | patch | blob | history |
diff --git a/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc b/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc
index 1329d135510a35894127e16b2a627d3034edb119..6b4cfcbe8382545778276826500092d8ad899215 100644 (file)
$this->get_netatalk_shares();
$this->apple_user_share = $this->selectedshare;
+ if(!$this->is_account){
+ $this->apple_user_share = key($this->shares);
+ }
+
/* Save initial account state */
$this->initially_was_account = $this->is_account;
}
));
}
+ function adapt_from_template($dn, $skip= array())
+ {
+ /* As the 'apple-user-homeDirectory' LDAP attribute is stored as
+ * 'apple_user_homeDirectory' internally by GOsa (to avoid problem with
+ * dashes as variable names), we need to add the dashed version to
+ * $this->attributes so that the adapt_from_template function in the plugin
+ * class will find the dashed LDAP attribute and substitute possibly
+ * placeholders like %uid. We remove the dashed version of
+ * 'apple_user_homeDirectory' from the attributes again afterwards. */
+ array_push($this->attributes, "apple-user-homeDirectory");
+ plugin::adapt_from_template($dn, $skip);
+ array_pop($this->attributes);
+
+ /* Loop through the available shares and find out which is the share from
+ * 'apple-user-homeDirectory'. Remove its host and directory (as well as
+ * the default 'mountDirectory' prefix) to get 'apple_user_homepath_raw'
+ * and store that share as 'selectedshare' so that it gets displayed by
+ * default in the netatalk tab. */
+ foreach($this->shares as $share) {
+ $apple_user_homepath = $this->mountDirectory."/".
+ $this->shares_settings[$share]["host"].
+ $this->shares_settings[$share]["dir"]."/";
+ if (preg_match("#$apple_user_homepath#", $this->{'apple-user-homeDirectory'})) {
+ $this->apple_user_homepath_raw = preg_replace("#$apple_user_homepath#", "", $this->{'apple-user-homeDirectory'});
+ $this->selectedshare = $share;
+ }
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: