diff --git a/gosa-plugins/samba/personal/samba/class_sambaAccount.inc b/gosa-plugins/samba/personal/samba/class_sambaAccount.inc
index 7c197fa1fe04e6a8633f3d919079f4d26e0b0030..593263262645dd31268e39234d3f786890741a6c 100644 (file)
}
/* Add user workstation finished? */
}
/* Add user workstation finished? */
- if (isset($_POST["add_ws_finish"]) || isset($_POST["add_ws_cancel"])){
+ if (isset($_POST["add_ws_cancel"])){
$this->show_ws_dialog= FALSE;
$this->dialog= FALSE;
}
/* Add user workstation? */
$this->show_ws_dialog= FALSE;
$this->dialog= FALSE;
}
/* Add user workstation? */
- if (isset($_POST["add_ws_finish"]) && isset($_POST['wslist'])){
+ if (isset($_POST["add_ws_finish"])){
- if($this->multiple_support_active){
- foreach($_POST['wslist'] as $ws){
- $this->multiple_sambaUserWorkstations[trim($we)] = array("Name" => trim($ws), "UsedByAllUsers" => TRUE);
- }
- }else{
- $tmp= $this->sambaUserWorkstations;
- foreach($_POST['wslist'] as $ws){
- $tmp.= ",$ws";
+ if (isset($_POST['wslist'])){
+ if($this->multiple_support_active){
+ foreach($_POST['wslist'] as $ws){
+ $this->multiple_sambaUserWorkstations[trim($we)] = array("Name" => trim($ws), "UsedByAllUsers" => TRUE);
+ }
+ }else{
+ $tmp= $this->sambaUserWorkstations;
+ foreach($_POST['wslist'] as $ws){
+ $tmp.= ",$ws";
+ }
+ $tmp= preg_replace('/,+/', ',', $tmp);
+ $this->sambaUserWorkstations= trim($tmp, ',');
}
}
- $tmp= preg_replace('/,+/', ',', $tmp);
- $this->sambaUserWorkstations= trim($tmp, ',');
+ $this->is_modified= TRUE;
+
+ $this->show_ws_dialog= FALSE;
+ $this->dialog= FALSE;
+ } else {
+ msg_dialog::display(_("Error"), _("Please select an entry!"), ERROR_DIALOG);
}
}
- $this->is_modified= TRUE;
}
/* Show ws dialog */
}
/* Show ws dialog */
asort($wslist);
$smarty->assign("search_image", get_template_path('images/search.png'));
asort($wslist);
$smarty->assign("search_image", get_template_path('images/search.png'));
- $smarty->assign("launchimage", get_template_path('images/small_filter.png'));
+ $smarty->assign("launchimage", get_template_path('images/lists/action.png'));
$smarty->assign("tree_image", get_template_path('images/tree.png'));
$smarty->assign("deplist", $this->config->idepartments);
$smarty->assign("alphabet", generate_alphabet());
$smarty->assign("tree_image", get_template_path('images/tree.png'));
$smarty->assign("deplist", $this->config->idepartments);
$smarty->assign("alphabet", generate_alphabet());
}
}
- function adapt_from_template($dn)
+ function adapt_from_template($dn, $skip= array())
{
{
- plugin::adapt_from_template($dn);
+ plugin::adapt_from_template($dn, $skip);
$this->sambaSID= "";
$this->sambaPrimaryGroupSID= "";
/* Fill mungedDial field */
$this->sambaSID= "";
$this->sambaPrimaryGroupSID= "";
/* Fill mungedDial field */
- if ($this->samba3 && isset($this->attrs['sambaMungedDial'])){
+ if ($this->samba3 && isset($this->attrs['sambaMungedDial']) && !in_array('sambaMungedDial', $skip)){
$this->mungedObject->load($this->sambaMungedDial);
}
/* Password expiery */
if(isset($this->attrs['sambaPwdMustChange']) &&
$this->mungedObject->load($this->sambaMungedDial);
}
/* Password expiery */
if(isset($this->attrs['sambaPwdMustChange']) &&
- $this->attrs['sambaPwdMustChange'][0] != 0){
+ $this->attrs['sambaPwdMustChange'][0] != 0 && !in_array('sambaPwdMustChange', $skip)){
$this->password_expires= 1;
}
if(isset($this->attrs['sambaLogonTime']) && ! (
$this->attrs['sambaLogonTime'][0] == 0 ||
$this->attrs['sambaLogonTime'][0] == 2147483647
$this->password_expires= 1;
}
if(isset($this->attrs['sambaLogonTime']) && ! (
$this->attrs['sambaLogonTime'][0] == 0 ||
$this->attrs['sambaLogonTime'][0] == 2147483647
- )){
+ ) && !in_array('sambaLogonTime', $skip)){
$this->logon_time_set= 1;
}
if(isset($this->attrs['sambaLogoffTime']) && ! (
$this->attrs['sambaLogoffTime'][0] == 0 ||
$this->attrs['sambaLogoffTime'][0] == 2147483647
$this->logon_time_set= 1;
}
if(isset($this->attrs['sambaLogoffTime']) && ! (
$this->attrs['sambaLogoffTime'][0] == 0 ||
$this->attrs['sambaLogoffTime'][0] == 2147483647
- )){
+ ) && !in_array('sambaLogonTime', $skip)){
$this->logoff_time_set= 1;
}
$this->logoff_time_set= 1;
}
if(isset($this->attrs['sambaKickoffTime']) && ! (
$this->attrs['sambaKickoffTime'][0] == 0 ||
$this->attrs['sambaKickoffTime'][0] == 2147483647
if(isset($this->attrs['sambaKickoffTime']) && ! (
$this->attrs['sambaKickoffTime'][0] == 0 ||
$this->attrs['sambaKickoffTime'][0] == 2147483647
- )){
+ ) && !in_array('sambaKickoffTime', $skip)){
$this->kickoff_time_set= 1;
}
$this->kickoff_time_set= 1;
}