Commit 16f5f2c7 authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes: #2945 Default values are now handled by sambaMungedDial

parent 4e6c58c9
...@@ -35,6 +35,15 @@ class MungedAttribute extends Attribute ...@@ -35,6 +35,15 @@ class MungedAttribute extends Attribute
$this->flagList = $flagList; $this->flagList = $flagList;
} }
protected function loadAttrValue ($attrs)
{
if (isset($attrs[$this->getLdapName()])) {
$this->setValue($this->inputValue($attrs[$this->getLdapName()][0]));
} else {
$this->resetToDefault();
}
}
function setParent(&$plugin) function setParent(&$plugin)
{ {
$this->plugin = $plugin; $this->plugin = $plugin;
...@@ -56,10 +65,9 @@ class MungedAttribute extends Attribute ...@@ -56,10 +65,9 @@ class MungedAttribute extends Attribute
function setValue($value) function setValue($value)
{ {
if (empty($value)) { if (!empty($value)) {
return; $this->mungedObject->load($value);
} }
$this->mungedObject->load($value);
if (is_object($this->plugin)) { if (is_object($this->plugin)) {
foreach ($this->attrList as $attr) { foreach ($this->attrList as $attr) {
if (isset($this->mungedObject->ctx[$attr])) { if (isset($this->mungedObject->ctx[$attr])) {
...@@ -188,7 +196,7 @@ class sambaAccount extends simplePlugin ...@@ -188,7 +196,7 @@ class sambaAccount extends simplePlugin
'attrs' => array( 'attrs' => array(
new BooleanAttribute ( new BooleanAttribute (
_('Allow login on terminal server'), _('Allow login on terminal server'), _('Allow login on terminal server'), _('Allow login on terminal server'),
'TsLogin', FALSE, TRUE 'TsLogin', FALSE
), ),
new SelectAttribute ( new SelectAttribute (
_('Home directory drive'), _('Letter for the home drive'), _('Home directory drive'), _('Letter for the home drive'),
...@@ -207,7 +215,7 @@ class sambaAccount extends simplePlugin ...@@ -207,7 +215,7 @@ class sambaAccount extends simplePlugin
), ),
new BooleanAttribute ( new BooleanAttribute (
_('Inherit client config'), _('Inherit client configuration'), _('Inherit client config'), _('Inherit client configuration'),
'InheritMode', FALSE, TRUE 'InheritMode', FALSE
), ),
new StringAttribute ( new StringAttribute (
_('Initial progam'), _('Program to start after connecting'), _('Initial progam'), _('Program to start after connecting'),
...@@ -234,15 +242,15 @@ class sambaAccount extends simplePlugin ...@@ -234,15 +242,15 @@ class sambaAccount extends simplePlugin
), ),
new BooleanAttribute ( new BooleanAttribute (
_('Connect client drives at logon'), _('Drive to connect after login'), _('Connect client drives at logon'), _('Drive to connect after login'),
'ConnectClientDrives', FALSE, TRUE 'ConnectClientDrives', FALSE
), ),
new BooleanAttribute ( new BooleanAttribute (
_('Connect client printers at logon'), _('Printers to connect after login'), _('Connect client printers at logon'), _('Printers to connect after login'),
'ConnectClientPrinters', FALSE, TRUE 'ConnectClientPrinters', FALSE
), ),
new BooleanAttribute ( new BooleanAttribute (
_('Default to main client printer'), _('Default printer for this client'), _('Default to main client printer'), _('Default printer for this client'),
'DefaultPrinter', FALSE, TRUE 'DefaultPrinter', FALSE
), ),
new SelectAttribute ( new SelectAttribute (
_('Shadowing'), _('Shadowing'), _('Shadowing'), _('Shadowing'),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment