diff --git a/gosa-plugins/samba/personal/samba/class_sambaAccount.inc b/gosa-plugins/samba/personal/samba/class_sambaAccount.inc
index b0f396274c5b2c8e5f2bfdfed914bf38c04d1dfc..593263262645dd31268e39234d3f786890741a6c 100644 (file)
/* Do we represent a valid account? */
if (!$this->is_account && $this->parent === NULL){
$display= "<img alt=\"\"src=\"images/stop.png\" align=\"middle\"> <b>".
/* Do we represent a valid account? */
if (!$this->is_account && $this->parent === NULL){
$display= "<img alt=\"\"src=\"images/stop.png\" align=\"middle\"> <b>".
- _("This account has no samba extensions.")."</b>";
+ msgPool::noValidExtension(_("Samba"))."</b>";
$display.= back_to_main();
return ($display);
}
$display.= back_to_main();
return ($display);
}
$display= "";
if ($this->parent !== NULL){
if ($this->is_account){
$display= "";
if ($this->parent !== NULL){
if ($this->is_account){
- $display= $this->show_disable_header(_("Remove samba account"),
- _("This account has samba features enabled. You can disable them by clicking below."));
+ $display= $this->show_disable_header(msgPool::removeFeaturesButton(_("Samba")),
+ msgPool::featuresEnabled(_("Samba")));
} else {
$obj= $this->parent->by_object['posixAccount'];
} else {
$obj= $this->parent->by_object['posixAccount'];
uidNumbers. There'll be a better solution later
on. */
if ($obj->is_account){
uidNumbers. There'll be a better solution later
on. */
if ($obj->is_account){
- $display= $this->show_enable_header(_("Create samba account"),
- _("This account has samba features disabled. You can enable them by clicking below."));
+ $display= $this->show_enable_header(msgPool::addFeaturesButton(_("Samba")),
+ msgPool::featuresDisabled(_("Samba")));
} else {
} else {
- $display= $this->show_enable_header(_("Create samba account"),
- _("This account has samba features disabled. Posix features are needed for samba accounts, enable them first."), TRUE);
+ $display= $this->show_enable_header(msgPool::addFeaturesButton(_("Samba")),
+ msgPool::featuresDisabled(_("Samba"), _("POSIX")), TRUE);
}
return ($display);
}
}
return ($display);
}
}
/* 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());
for($y= $date['year']-4; $y<$date['year']+4; $y++){
$years[]= $y;
}
for($y= $date['year']-4; $y<$date['year']+4; $y++){
$years[]= $y;
}
- $months= array(_("January"), _("February"), _("March"), _("April"),
- _("May"), _("June"), _("July"), _("August"), _("September"),
- _("October"), _("November"), _("December"));
+ $months= msgPool::months();
$smarty->assign("day", $date["mday"]);
$smarty->assign("days", $days);
$smarty->assign("months", $months);
$smarty->assign("day", $date["mday"]);
$smarty->assign("days", $days);
$smarty->assign("months", $months);
for($y= $date['year']-4; $y<$date['year']+4; $y++){
$sambaLogonTime_years[]= $y;
}
for($y= $date['year']-4; $y<$date['year']+4; $y++){
$sambaLogonTime_years[]= $y;
}
- $sambaLogonTime_months= array(_("January"), _("February"), _("March"), _("April"),
- _("May"), _("June"), _("July"), _("August"), _("September"),
- _("October"), _("November"), _("December"));
+ $sambaLogonTime_months= msgPool::months();
$smarty->assign("sambaLogonTime_day", $sambaLogonTime_date["mday"]);
$smarty->assign("sambaLogonTime_days", $sambaLogonTime_days);
$smarty->assign("sambaLogonTime_months", $sambaLogonTime_months);
$smarty->assign("sambaLogonTime_day", $sambaLogonTime_date["mday"]);
$smarty->assign("sambaLogonTime_days", $sambaLogonTime_days);
$smarty->assign("sambaLogonTime_months", $sambaLogonTime_months);
for($y= $date['year']-4; $y<$date['year']+4; $y++){
$sambaLogoffTime_years[]= $y;
}
for($y= $date['year']-4; $y<$date['year']+4; $y++){
$sambaLogoffTime_years[]= $y;
}
- $sambaLogoffTime_months= array(_("January"), _("February"), _("March"), _("April"),
- _("May"), _("June"), _("July"), _("August"), _("September"),
- _("October"), _("November"), _("December"));
+ $sambaLogoffTime_months= msgPool::months();
$smarty->assign("sambaLogoffTime_day", $sambaLogoffTime_date["mday"]);
$smarty->assign("sambaLogoffTime_days", $sambaLogoffTime_days);
$smarty->assign("sambaLogoffTime_months", $sambaLogoffTime_months);
$smarty->assign("sambaLogoffTime_day", $sambaLogoffTime_date["mday"]);
$smarty->assign("sambaLogoffTime_days", $sambaLogoffTime_days);
$smarty->assign("sambaLogoffTime_months", $sambaLogoffTime_months);
for($y= $date['year']-4; $y<$date['year']+4; $y++){
$sambaKickoffTime_years[]= $y;
}
for($y= $date['year']-4; $y<$date['year']+4; $y++){
$sambaKickoffTime_years[]= $y;
}
- $sambaKickoffTime_months= array(_("January"), _("February"), _("March"), _("April"),
- _("May"), _("June"), _("July"), _("August"), _("September"),
- _("October"), _("November"), _("December"));
+ $sambaKickoffTime_months= msgPool::months();
//$smarty->assign("sambaKickoffTime_day", $sambaKickoffTime_date["mday"]-1);
$smarty->assign("sambaKickoffTime_day", $sambaKickoffTime_date["mday"]); // hickert
$smarty->assign("sambaKickoffTime_days", $sambaKickoffTime_days);
//$smarty->assign("sambaKickoffTime_day", $sambaKickoffTime_date["mday"]-1);
$smarty->assign("sambaKickoffTime_day", $sambaKickoffTime_date["mday"]); // hickert
$smarty->assign("sambaKickoffTime_days", $sambaKickoffTime_days);
new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/samba account with dn '%s' failed."),$this->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
+ }
/* Optionally execute a command after we're done */
$this->handle_post_events("remove", array("uid" => $this->uid));
/* Optionally execute a command after we're done */
$this->handle_post_events("remove", array("uid" => $this->uid));
/* Too many workstations? Windows usrmgr only supports eight */
if (substr_count($this->sambaUserWorkstations, ",") >= 8){
/* Too many workstations? Windows usrmgr only supports eight */
if (substr_count($this->sambaUserWorkstations, ",") >= 8){
- $message[]= _("The windows user manager only allows eight clients. You've specified more than eight.");
+ $message[]= _("The windows usermanager allows eight clients at maximum!");
}
}
}
}
new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
}
new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
}
- show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/samba account with dn '%s' failed."),$this->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
+ }
/* Optionally execute a command after we're done */
if ($this->initially_was_account == $this->is_account){
/* Optionally execute a command after we're done */
if ($this->initially_was_account == $this->is_account){
}
}
- 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;
}