Commit b8cf6504 authored by Benoit Mortier's avatar Benoit Mortier
Browse files

Fixes: #1615 BootKernelAttribute should not be in faiStartup

parent b06ed3b2
<div class="plugin_section">
<span class="legend">
{t 1=$group_cn}Inherited informations from object group %1{/t}
</span>
<div>
<table>
<tr><td>{t}Port{/t}</td><td>{$group_argonautClientPort}</td></tr>
<tr><td>{t}WakeOnLan interface{/t}</td><td>{$group_argonautClientWakeOnLanInterface}</td></tr>
<tr><td>{t}Task id file{/t}</td><td>{$group_argonautTaskIdFile}</td></tr>
<tr><td>{t}Log directory{/t}</td><td>{$group_argonautClientLogDir}</td></tr>
</table>
</div>
</div>
......@@ -105,7 +105,7 @@ class argonautClient extends simplePlugin
var $objectclasses = array("argonautClient");
var $displayHeader = TRUE;
var $inheritance = array("gotoWorkstationTemplate" => "member");
var $inheritance = array("gosaGroupOfNames" => "member");
// The main function : information about attributes
static function getAttributesInfo ()
......
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2012 FusionDirectory
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
class BootKernelAttribute extends SelectAttribute
{
private $cache = array();
function setRelease($release)
{
if ($this->update_kernel_cache($release)) {
$this->setChoices($this->cache[$release]);
$this->setDisabled(FALSE);
} else {
$this->setChoices(array());
$this->setValue($this->getInitialValue());
$this->setDisabled(TRUE);
}
}
function update_kernel_cache($release)
{
/* Get list of available kernel for this release
*/
if (!isset($this->cache)) {
$this->cache = array();
}
if (!isset($this->cache[$release])) {
$s_daemon = new supportDaemon();
if (!$s_daemon->is_available()) {
return FALSE;
}
$tmp = $s_daemon->FAI_get_kernels($release);
if ($s_daemon->is_error()) {
return FALSE;
}
$this->cache[$release] = $tmp;
ksort($this->cache[$release]);
}
return TRUE;
}
}
?>
......@@ -48,46 +48,6 @@ class FAIreleaseAttribute extends SelectAttribute
}
}
class BootKernelAttribute extends SelectAttribute
{
private $cache = array();
function setRelease($release)
{
if ($this->update_kernel_cache($release)) {
$this->setChoices($this->cache[$release]);
$this->setDisabled(FALSE);
} else {
$this->setChoices(array());
$this->setValue($this->getInitialValue());
$this->setDisabled(TRUE);
}
}
function update_kernel_cache($release)
{
/* Get list of available kernel for this release
*/
if (!isset($this->cache)) {
$this->cache = array();
}
if (!isset($this->cache[$release])) {
$s_daemon = new supportDaemon();
if (!$s_daemon->is_available()) {
return FALSE;
}
$tmp = $s_daemon->FAI_get_kernels($release);
if ($s_daemon->is_error()) {
return FALSE;
}
$this->cache[$release] = $tmp;
ksort($this->cache[$release]);
}
return TRUE;
}
}
class faiStartup extends simplePlugin
{
var $displayHeader = TRUE;
......@@ -95,7 +55,7 @@ class faiStartup extends simplePlugin
/* attribute list for save action */
var $objectclasses = array("FAIobject");
var $inheritance = array("gotoWorkstationTemplate" => "member");
var $inheritance = array("gosaGroupOfNames" => "member");
var $sdaemon_available;
/*!
......
......@@ -20,6 +20,32 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
class TerminalReleaseAttribute extends SelectAttribute
{
function __construct ($label, $description, $ldapName, $required, $choices = array())
{
parent::__construct($label, $description, $ldapName, $required, $choices);
$this->setSubmitForm(TRUE);
}
function setValue ($value)
{
if (!in_array($value, $this->choices)) {
return;
}
parent::setValue($value);
if (isset($this->plugin)) {
$this->plugin->attributesInfo['main']['attrs']['gotoBootKernel']->setRelease($value);
}
}
function setParent (&$plugin)
{
parent::setParent($plugin);
$this->setValue('squeeze');
}
}
class terminalStartup extends simplePlugin
{
/* attribute list for save action */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment