diff --git a/trunk/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/trunk/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc
index 7246e559782671d88870fd27aa25bafab71a8fb7..a9c0d62d8a4644083f60e952df26e573ca487701 100644 (file)
var $orig_dn= "";
var $orig_cn= "";
var $orig_base= "";
+ var $ogroup=FALSE;
/* Plugin side filled */
var $modes= array();
/* Call parent execute */
plugin::execute();
+ if ($this->ogroup) {
+ $this->member_of_ogroup = TRUE;
+ $this->parent->by_object['workservice']->ogroup = $this->ogroup;
+ $this->set_everything_to_inherited();
+ }
+
if($this->is_account && !$this->view_logged){
$this->view_logged = TRUE;
new log("view","workstation/".get_class($this),$this->dn);
}
}
}
+
+ /* If $this->ogroup is set add the new system to the requested ogroup */
+ if ($this->ogroup) {
+ $og = new ogroup($this->config, $this->ogroup);
+ $og->AddDelMembership($this->dn);
+ $og->save();
+ }
}
function set_everything_to_inherited()
{
+ /* Find out what is set in the object group as XDriver */
+ $inherit_xdriver = 0;
+ if ($this->dn != 'new' || $this->ogroup) {
+ $ldap = $this->config->get_ldap_link();
+ $entry = NULL;
+ /* If initialized with an object group we need to use this instead of
+ * an object group we'll become a member in */
+ if ($this->ogroup) {
+ $entry = $ldap->cat($this->ogroup, array("gotoXDriver"));
+ }else {
+ $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("gotoXDriver"));
+ if ($ldap->count() == 1) {
+ $entry = $ldap->fetch();
+ }
+ }
+ if ($entry) {
+ /* Get list of valid XDrivers */
+ $xdrivers = $this->parent->by_object['workservice']->getListOfXDrivers();
+ /* Only inherit if driver in object group is set to something in the list of
+ * valid XDrivers */
+ if (in_array($entry['gotoXDriver'][0], $xdrivers)) {
+ $inherit_xdriver = 1;
+ }
+ }
+ }
+
$this->gotoSyslogServer = "default";
$this->inheritTimeServer = TRUE;
/* Set workstation service attributes to inherited */
if($this->member_of_ogroup && isset($this->parent->by_object['workservice'])){
- foreach(array("gotoXKbLayout","gotoXKbModel","gotoXKbVariant",
- "gotoXResolution","gotoXColordepth","gotoXMouseType","gotoXMouseport") as $name){
- if($this->parent->by_object['workservice']->acl_is_writeable($name)){
- $this->parent->by_object['workservice']->$name = "default";
- }
+ foreach(array("gotoXKbLayout","gotoXKbModel","gotoXKbVariant", "gotoXDriver",
+ "gotoXResolution","gotoXColordepth","gotoXMouseType","gotoXMouseport") as $name){
+ if(!(($name == 'gotoXDriver') && ($inherit_xdriver == 0))) {
+ if($this->parent->by_object['workservice']->acl_is_writeable($name)){
+ $this->parent->by_object['workservice']->$name = "default";
+ }
+ }
}
}