diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc
index d0649fc577e77f5bcb304e2fd0a6add267ea71e4..4db156af858d7e14cdddb9189beb1a08fbbe2d22 100644 (file)
var $XKbLayouts =array();
var $XKbVariants =array();
var $XKbLayouts =array();
var $XKbVariants =array();
- function workservice ($config, $dn= NULL)
+ function workservice ($config, $dn= NULL, $parent= NULL)
{
{
- plugin::plugin ($config, $dn);
+ plugin::plugin ($config, $dn, $parent);
$this->XResolutions= array(
"640x480" => "640x480",
$this->XResolutions= array(
"640x480" => "640x480",
}
$this->MouseTypes= array("ImPS/2" => "ImPS/2", "PS/2" => "PS/2", "Microsoft" => "Microsoft",
}
$this->MouseTypes= array("ImPS/2" => "ImPS/2", "PS/2" => "PS/2", "Microsoft" => "Microsoft",
- "Logitech" => "Microsoft");
+ "Logitech" => "Logitech");
$this->MousePorts= array("/dev/ttyS0" =>"/dev/ttyS0",
"/dev/ttyS1" => "/dev/ttyS1", "/dev/psaux" =>"/dev/psaux",
"/dev/input/mice" => "/dev/input/mice");
$this->MousePorts= array("/dev/ttyS0" =>"/dev/ttyS0",
"/dev/ttyS1" => "/dev/ttyS1", "/dev/psaux" =>"/dev/psaux",
"/dev/input/mice" => "/dev/input/mice");
- /* Additional values will be extracted from /etc/gosa/keyboardLayouts */
+ /* Additional values will be extracted from CONFIG_DIR/gosa/keyboardLayouts */
$this->XKbLayouts= array ("de"=> "de","intl" =>"intl","us" =>"us");
$this->XKbVariants= array ("nodeadkeys"=>"nodeadkeys", "basic"=>"basic");
$this->XKbLayouts= array ("de"=> "de","intl" =>"intl","us" =>"us");
$this->XKbVariants= array ("nodeadkeys"=>"nodeadkeys", "basic"=>"basic");
$ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))");
if ($ldap->count() == 1){
$map= array("gotoXResolution", "gotoXColordepth", "gotoXKbModel", "gotoXKbLayout",
$ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))");
if ($ldap->count() == 1){
$map= array("gotoXResolution", "gotoXColordepth", "gotoXKbModel", "gotoXKbLayout",
- "gotoXKbVariant", "gotoMouseType", "gotoMousePort");
+ "gotoXKbVariant", "gotoXMouseType", "gotoXMouseport");
$attrs= $ldap->fetch();
foreach ($map as $name){
$attrs= $ldap->fetch();
foreach ($map as $name){
switch ($name){
case 'gotoXResolution':
switch ($name){
case 'gotoXResolution':
- $this->XResolutions= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].']' ), $this->XResolutions);
+ $this->XResolutions= array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XResolutions;
break;
case 'gotoXColordepth':
break;
case 'gotoXColordepth':
- $this->XColordepths= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].' '._('Bit').']'), $this->XColordepths);
+ $this->XColordepths= array('default' => _("inherited").' ['.$attrs[$name][0].' '._('Bit').']') + $this->XColordepths;
break;
case 'gotoXKbModel':
break;
case 'gotoXKbModel':
- $this->XKbModels= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].']'), $this->XKbModels);
+ $this->XKbModels= array('default' => _("inherited").' ['.$attrs[$name][0].']') + $this->XKbModels;
break;
case 'gotoXKbLayout':
break;
case 'gotoXKbLayout':
- $this->XKbLayouts= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].']' ), $this->XKbLayouts);
+ $this->XKbLayouts= array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XKbLayouts;
break;
case 'gotoXKbVariant':
break;
case 'gotoXKbVariant':
- $this->XKBvariants= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].']' ), $this->XKbVariants);
+ $this->XKbVariants= array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XKbVariants;
break;
break;
- case 'gotoMouseType':
- $this->XMouseTypes= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].']' ), $this->XMouseTypes);
+ case 'gotoXMouseType':
+ $this->MouseTypes= array('AUTO' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->MouseTypes;
break;
break;
- case 'gotoMousePort':
- $this->XMousePorts= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].']' ), $this->XMousePorts);
+ case 'gotoXMouseport':
+ $this->MousePorts= array('AUTO' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->MousePorts;
break;
}
}
}
break;
}
}
}
+
+ /* Workaround to fill in inherited values if we've specified an objectclass */
+ if (isset($_SESSION['SelectedSystemType']['ogroup']) && $_SESSION['SelectedSystemType']['ogroup'] != 'none'){
+ $this->XResolutions= array('default' => _("inherited"));
+ $this->XColordepths= array('default' => _("inherited"));
+ $this->XKbModels= array('default' => _("inherited"));
+ $this->XKbLayouts= array('default' => _("inherited"));
+ $this->XKbVariants= array('default' => _("inherited"));
+ $this->MouseTypes= array('AUTO' => _("inherited"));
+ $this->MousePorts= array('AUTO' => _("inherited"));
+ }
}
function execute()
}
function execute()
if($this->AutoSync){
$smarty->assign("AutoSyncCHK"," checked ");
if($this->AutoSync){
$smarty->assign("AutoSyncCHK"," checked ");
+ $smarty->assign("hiddenState"," disabled ");
}else{
$smarty->assign("AutoSyncCHK"," ");
}else{
$smarty->assign("AutoSyncCHK"," ");
+ $smarty->assign("hiddenState","");
}
/* Show main page */
}
/* Show main page */
{
plugin::save_object();
{
plugin::save_object();
- if(isset($_POST['gotoXHsync'])){
+ if(isset($_POST['gotoXDriver'])){
if(isset($_POST['AutoSync'])){
$this->AutoSync = true;
}else{
if(isset($_POST['AutoSync'])){
$this->AutoSync = true;
}else{
/* Default entries can use blank hsync/vsync entries */
if ($this->dn != "" && $this->cn != "default" && $this->cn != "wdefault"){
/* Default entries can use blank hsync/vsync entries */
if ($this->dn != "" && $this->cn != "default" && $this->cn != "wdefault"){
- /* Check vsync for correct usage */
- $val= preg_replace ("/\s/", "", $this->gotoXVsync);
- if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val)
- && chkacl ($this->acl, "gotoXVsync") == ""){
-
- $message[]= _("Please specify a valid VSync range.");
- } elseif (chkacl ($this->acl, "gotoXVsync") == ""){
- list($v1,$v2)= preg_split ("/[-+]/", $val);
- if ($v2 != ""){
- if ($v1 > $v2){
- $message[]= _("Please specify a valid VSync range.");
+ /* But only if no auto sync is enabled... */
+ if (!$this->AutoSync){
+
+ /* Check vsync for correct usage */
+ $val= preg_replace ("/\s/", "", $this->gotoXVsync);
+ if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val)
+ && chkacl ($this->acl, "gotoXVsync") == ""){
+
+ $message[]= _("Please specify a valid VSync range.");
+ } elseif (chkacl ($this->acl, "gotoXVsync") == ""){
+ list($v1,$v2)= preg_split ("/[-+]/", $val);
+ if ($v2 != ""){
+ if ($v1 > $v2){
+ $message[]= _("Please specify a valid VSync range.");
+ }
}
}
}
}
- }
- /* Check hsync for correct usage */
- $val= preg_replace ("/\s/", "", $this->gotoXHsync);
- if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val)
- && chkacl ($this->acl, "gotoXHsync") == ""){
-
- $message[]= _("Please specify a valid HSync range.");
- } elseif (chkacl ($this->acl, "gotoXHsync") == ""){
- list($v1,$v2)= preg_split ("/[-+]/", $val);
- if ($v2 != ""){
- if ($v1 > $v2){
- $message[]= _("Please specify a valid HSync range.");
+ /* Check hsync for correct usage */
+ $val= preg_replace ("/\s/", "", $this->gotoXHsync);
+ if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val)
+ && chkacl ($this->acl, "gotoXHsync") == ""){
+
+ $message[]= _("Please specify a valid HSync range.");
+ } elseif (chkacl ($this->acl, "gotoXHsync") == ""){
+ list($v1,$v2)= preg_split ("/[-+]/", $val);
+ if ($v2 != ""){
+ if ($v1 > $v2){
+ $message[]= _("Please specify a valid HSync range.");
+ }
}
}
}
}
}
}
}
}
+
return ($message);
}
return ($message);
}
}
if($this->AutoSync){
}
if($this->AutoSync){
- $this->attrs['gotoXHsync'] = preg_replace("/-/","+",$this->attrs['gotoXHsync']) ;
- $this->attrs['gotoXVsync'] = preg_replace("/-/","+",$this->attrs['gotoXVsync']) ;
+ $this->attrs['gotoXHsync'] = "30+55";
+ $this->attrs['gotoXVsync'] = "50+70";
}
/* Write back to ldap */
}
/* Write back to ldap */