summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 43b5d26)
raw | patch | inline | side by side (parent: 43b5d26)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 8 Aug 2005 11:52:34 +0000 (11:52 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 8 Aug 2005 11:52:34 +0000 (11:52 +0000) |
first remove assignment, then delete phone ..."
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1076 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1076 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_phoneGeneric.inc | patch | blob | history | |
plugins/admin/systems/class_systemManagement.inc | patch | blob | history |
diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc
index dfe1b4e148eeac86d02f257265edd0e753537680..11a0509d417c4854cbb87c6bb70706688b6db35e 100644 (file)
function execute()
{
-
-
/* Do we represent a valid phone? */
if (!$this->is_account && $this->parent == NULL){
$display= "<img alt=\"\" src=\"images/stop.png\" align=middle> <b>".
function remove_from_parent()
{
$ldap= $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+
+ $ldap->search ("(&(objectClass=goFonAccount)(goFonHardware=".$this->cn."))", array("uid","cn"));
+ while ($attr = $ldap->fetch()){
+ print_red(sprintf(_("Can't delete the phone. There are still users using this phone, one of them is user '%s'."),
+ ($attr['uid'][0]." - ".$attr['cn'][0])));
+ return;
+ }
+
$ldap->rmdir($this->dn);
show_ldap_error($ldap->get_error());
$this->handle_post_events("remove");
diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc
index 6efa50af39b2dfa034c1f719944dbe153cfc0431..03aca02f7de422421937333c3b2a97b7fd2b7d9d 100644 (file)
case "workstation":
$tabtype= "worktabs";
break;
+
+ case "phone":
+ $tabtype= "phonetabs";
+ break;
case "server":
$tabtype= "servtabs";
}
/* Delete request is permitted, perform LDAP action */
- $this->systab= new $tabtype($this->config,
- $this->config->data['TABS']['TERMTABS'], $this->dn);
- $this->systab->set_acl(array($this->acl));
- $this->systab->by_object['termgeneric']->remove_from_parent ();
+ if($tabtype=="phonetabs"){
+ $this->systab= new $tabtype($this->config,
+ $this->config->data['TABS']['PHONETABS'], $this->dn);
+ $this->systab->set_acl(array($this->acl));
+ $this->systab->by_object['phonegeneric']->remove_from_parent ();
+ }else{
+ $this->systab= new $tabtype($this->config,
+ $this->config->data['TABS']['TERMTABS'], $this->dn);
+ $this->systab->set_acl(array($this->acl));
+ $this->systab->by_object['termgeneric']->remove_from_parent ();
+ }
unset ($this->systab);
gosa_log ("System object'".$this->dn."' has been removed");
$this->systab= NULL;