summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 50de2f3)
raw | patch | inline | side by side (parent: 50de2f3)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 18 Jul 2007 12:03:54 +0000 (12:03 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 18 Jul 2007 12:03:54 +0000 (12:03 +0000) |
Only display inherit options if system is part of an object group collection.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6908 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6908 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc
index 797186de2f41404593392d196c1d570f967cd3a5..ec31c831f4db43b114485a9adcceed55111d48ea 100644 (file)
$this->gotoNtpServer=array();
}
+ /* You can't inherit the NTP service, if we are not member in an object group */
+ if(!$this->member_of_ogroup){
+ $this->inheritTimeServer = FALSE;
+ }
+
/* Create available ntp options */
$this->gotoNtpServers = $this->config->data['SERVERS']['NTP'];
foreach($this->gotoNtpServers as $key => $server){
$tmp = $this->config->data['SERVERS']['SYSLOG'];
foreach($tmp as $server){
$visible = $server;
- if($server == "default") {
+ if($server == "default" && $this->member_of_ogroup) {
$visible = "["._("inherited")."]";
}
$this->gotoSyslogServers[$server] = $visible;
if($server != "default"){
$tmp2[$server]= $server;
}else{
- $tmp2[$server]="["._("inherited")."]";
+ if($this->member_of_ogroup){
+ $tmp2[$server]="["._("inherited")."]";
+ }
}
}
}
if(isset($_POST['termgeneric_posted'])){
- if(isset($_POST["inheritTimeServer"])){
+ if(isset($_POST["inheritTimeServer"]) && $this->member_of_ogroup){
$this->inheritTimeServer = true;
}else{
$this->inheritTimeServer = false;
diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc
index a6984a55897608e31398e03f31cdb92e56a259a9..e3900e931c2e1b098d02dd8be6be11886fd7e4c1 100644 (file)
$this->gotoNtpServer=array();
}
+ /* You can't inherit the NTP service, if we are not member in an object group */
+ if(!$this->member_of_ogroup){
+ $this->inheritTimeServer = FALSE;
+ }
+
/* Create available ntp options */
$tmp = $this->config->data['SERVERS']['NTP'];
$this->gotoNtpServers = array();
$tmp = $this->config->data['SERVERS']['SYSLOG'];
foreach($tmp as $server){
$visible = $server;
- if($server == "default") {
+ if($server == "default" && $this->member_of_ogroup) {
$visible = "["._("inherited")."]";
}
$this->gotoSyslogServers[$server] = $visible;
/* Set inherit mode */
if((isset($_POST['workgeneric_posted'])) && ($this->acl_is_writeable("gotoNtpServer"))){
- if(isset($_POST["inheritTimeServer"])){
+ if(isset($_POST["inheritTimeServer"]) && $this->member_of_ogroup){
$this->inheritTimeServer = true;
}else{
$this->inheritTimeServer = false;
diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc
index 567fd2f15551ed5b4aaec9467632c95a519c7332..0f7f3d37cde59dad074c0a1d37c5a322ea7cc0a0 100644 (file)
var $fai_activated = FALSE;
+ var $member_of_ogroup = FALSE;
+
function workstartup ($config, $dn= NULL, $parent= NULL)
{
/* Check if FAI is active */
plugin::plugin ($config, $dn, $parent);
+ if(!isset($this->parent->by_object['ogroup'])){
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd ($this->config->current['BASE']);
+ $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))",array("cn"));
+ $this->member_of_ogroup = $ldap->count() >= 1;
+ }
+
/* Creating a list of valid Mirrors
* none will not be saved to ldap.
*/
$this->gotoBootKernels= array("default-inherited" => '['._("inherited").']');
/* Load hardware list */
- $ldap= $this->config->get_ldap_link();
- $ldap->cd($this->config->current['BASE']);
- $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))");
- if ($ldap->count() == 1){
+ if ($this->member_of_ogroup){
+
+ if(count($this->FAIclass)==0 && $this->FAIrelease == ""){
+ $this->FAIdebianMirror = "inherited";
+ }
if($this->fai_activated){
$map= array("gotoLdapServer","FAIclass","FAIdebianMirror");
}
}
- if(count($this->FAIclass)==0 && $this->FAIrelease == ""){
- $this->FAIdebianMirror = "inherited";
- }
-
/* Turn to default, if we've nothing to inherit */
if (!isset($this->gotoBootKernels['default-inherited']) && $this->gotoBootKernel == "default-inherited"){
$this->gotoBootKernel= "default";
function getFAIdebianMirrors()
{
$ret = array();
- $ret['inherited']="["._("inherited")."]";
+
+ /* Only add inherit option, if we are part in an object group
+ */
+ if($this->member_of_ogroup) {
+ $ret['inherited']="["._("inherited")."]";
+ }
+
$ret['auto']=_("automatic");
$secs = array();
index a943fc86c2b5ad0f7be5a182f3dfcdb4d405a7e6..dc088f867a36d5aaaf6eba4d25474b4a45a83174 100644 (file)
<table width="100%">
<tr>
<td colspan="2">
+{if $member_of_ogroup}
{render acl=$gotoNtpServerACL}
<input type="checkbox" value="1" name="inheritTimeServer"
{if $inheritTimeServer } checked {/if}
changeState('addNtpServer');
changeState('delNtpServer');">{t}Inherit time server attributes{/t}
{/render}
+{else}
+ <input disabled type='checkbox' name='option_disabled'>{t}Inherit time server attributes{/t}
+{/if}
</td>
</tr>
<tr>
index 9caee6e777ee563c6d77a3b6b693f4f6379cea24..ba8489947ed877f0854782d536e2a750019ffdf0 100644 (file)
<table width="100%">
<tr>
<td colspan="2">
+{if $member_of_ogroup}
{render acl=$gotoNtpServerACL}
<input type="checkbox" value="1" name="inheritTimeServer"
{if $inheritTimeServer } checked {/if}
changeState('addNtpServer');
changeState('delNtpServer');">{t}Inherit time server attributes{/t}
{/render}
+{else}
+ <input disabled type='checkbox' name='option_disabled'>{t}Inherit time server attributes{/t}
+{/if}
</td>
</tr>
<tr>