diff --git a/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc b/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc
index c09a13a9eb3221448d96b380eaefdf119ad4f99e..86303b93776bb39dc042fc9e904b084f289e4437 100644 (file)
/* Definitions */
var $plHeadline = "Netatalk";
- var $plDescription = "Manage netatalk account";
+ var $plDescription = "Manage Netatalk account";
var $view_logged = FALSE;
$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;
}
/* Get netatalk shares */
$this->shares = array();
$ldap = $this->config->get_ldap_link();
-
- if($this->dn === "new" || $this->dn === NULL) {
- $base = session::get('CurrentMainBase');
- } else {
- $base = preg_replace("/^[^,]+,".preg_quote(get_people_ou(), '/')."/","",$this->dn);
- }
-
- $ldap->cd($base);
+ $ldap->cd($this->config->current['BASE']);
$ldap->search ("(&(objectClass=mount)(|(mountType=url)(mountType=nfs))(cn=*))");
while ($attrs = $ldap->fetch()){
- $tmp = split(":", $attrs["cn"][0]);
+ $tmp = explode(":", $attrs["cn"][0]);
$host = trim($tmp[0]);
$dir = trim($tmp[1]);
$mountType = trim($attrs["mountType"][0]);
/* Do we represent a valid account? */
if (!$this->is_account && $this->parent === NULL) {
$display = "<img alt=\"\"src=\"images/small-error.png\" align=\"middle\"> <b>".
- msgPool::noValidExtension(_("netatalk"))."</b>";
+ msgPool::noValidExtension(_("Netatalk"))."</b>";
$display .= back_to_main();
return ($display);
}
/* Show tab dialog headers */
if ($this->parent !== NULL) {
if ($this->is_account) {
- $display = $this->show_disable_header(msgPool::removeFeaturesButton(_("netatalk")),
- msgPool::featuresEnabled(_("netatalk")));
+ $display = $this->show_disable_header(msgPool::removeFeaturesButton(_("Netatalk")),
+ msgPool::featuresEnabled(_("Netatalk")));
} else {
$errmsg="";
$obj = $this->parent->by_object['posixAccount'];
if (!($obj->is_account) ) {
- $display = $this->show_enable_header(msgPool::addFeaturesButton(_("netatalk")),
- msgPool::featuresDisabled(_("netatalk"), _("POSIX")), TRUE);
+ $display = $this->show_enable_header(msgPool::addFeaturesButton(_("Netatalk")),
+ msgPool::featuresDisabled(_("Netatalk"), _("POSIX")), TRUE);
} elseif (count($this->shares)== 0) {
- $display = $this->show_enable_header(msgPool::addFeaturesButton(_("netatalk")),
- msgPool::featuresDisabled(_("netatalk"), _("netatalk or NFS share")), TRUE);
+ $display = $this->show_enable_header(msgPool::addFeaturesButton(_("Netatalk")),
+ msgPool::featuresDisabled(_("Netatalk"), _("Netatalk or NFS share")), TRUE);
} else {
- $display = $this->show_enable_header(msgPool::addFeaturesButton(_("netatalk")),
- msgPool::featuresDisabled(_("netatalk")));
+ $display = $this->show_enable_header(msgPool::addFeaturesButton(_("Netatalk")),
+ msgPool::featuresDisabled(_("Netatalk")));
}
return ($display);
}
/* Assign attributes
*/
foreach ($this->smarty_attributes as $val) {
- $smarty->assign("$val", $this-> $val);
+ $smarty->assign("$val", set_post($this-> $val));
}
/* Assign ACLs
*/
$tmp = $this->plInfo();
- $SkipWrite = (!isset($this->parent) || !$this->parent) && !session::is_set('edit');
foreach($tmp['plProvidedAcls'] as $name => $desc){
- $smarty->assign($name."ACL",$this->getacl($name,$SkipWrite));
+ $smarty->assign($name."ACL",$this->getacl($name));
}
/* Let smarty fetch and process the page. */
if($mountType=="url") {
$this->apple_user_homeurl_xml = '<home_dir><url>afp://'.$host.$dir . '</url><path>'.
$this->apple_user_homepath_raw.'</path></home_dir>';
- $this->apple_user_homeurl = base64_encode($this->apple_user_homeurl_xml);
+ $this->apple_user_homeurl = $this->apple_user_homeurl_xml;
} else {
$this->apple_user_homeurl = "";
}
foreach($this->post_attributes as $acl => $val) {
if(!preg_match("/w/",$this->getacl($acl))) continue;
if (isset ($_POST[$val])) {
- $this->$val = $_POST[$val];
+ $this->$val = get_post($val);
} else {
$this->$val = "";
}
"plSection" => array("personal" => _("My account")),
"plCategory" => array("users"),
"plOptions" => array(),
-
+ "plRequirements"=> array(
+ 'ldapSchema' => array('apple-user' => ''),
+ 'onFailureDisablePlugin' => array(get_class())),
"plProvidedAcls" => array(
"netatalkUserHomepath" => _("User home path"),
"netatalkShare" => _("Share"))