base= $this->by_object['department']->base; /* Add references/acls/snapshots */ $this->addSpecialTabs(); $this->by_object['acl']->skipTagging= TRUE;; } function check($ignore_account= FALSE) { return (tabs::check(TRUE)); } /*! \brief Check if the department must must be moved return Boolean TRUE if we have to move the dep, else FALSE */ function am_i_moved() { return(FALSE); if($this->moved) return(FALSE); $baseobject= &$this->by_object['department']; $ou = preg_replace('/,/', '\,', $baseobject->ou); $new_dn = @LDAP::convert('ou='.$ou.','.$baseobject->base); $old_ou = preg_replace('/,/', '\,', $baseobject->orig_ou); $old_dn = @LDAP::convert('ou='.$ou.','.$baseobject->orig_base); if ($this->dn != $new_dn && $this->dn != "new"){ return(TRUE); } return(FALSE); } /*! \brief Checks if the department was moved successfully @return Boolean TRUE if the dep was already moved. */ function move_done() { return($this->moved); } /*! \brief Initiate recursive move */ function move_me() { if(!$this->am_i_moved()) return; $baseobject= &$this->by_object['department']; $ou = preg_replace('/,/', '\,', $baseobject->ou); $new_dn = @LDAP::convert('ou='.$ou.','.$baseobject->base); $old_ou = preg_replace('/,/', '\,', $baseobject->orig_ou); $old_dn = @LDAP::convert('ou='.$ou.','.$baseobject->orig_base); if ($this->dn != $new_dn && $this->dn != "new"){ $baseobject->recursive_move($this->dn, $new_dn); $this->moved= TRUE; } } function save($ignore_account= FALSE) { $baseobject= &$this->by_object['department']; $ou = preg_replace('/,/', '\,', $baseobject->ou); $new_dn = @LDAP::convert('ou='.$ou.','.$baseobject->base); /* Move group? */ if ($this->dn != $new_dn && $this->dn != "new"){ $baseobject->move($this->dn,$new_dn); } $this->dn= $new_dn; $baseobject->dn= $this->dn; if (!$ignore_account){ tabs::save(TRUE); } } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?>