summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 17bbab0)
raw | patch | inline | side by side (parent: 17bbab0)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Dec 2006 06:12:54 +0000 (06:12 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Dec 2006 06:12:54 +0000 (06:12 +0000) |
Only set action (FAIstate) if fai is enabled,
and the edited entry already exists in ldap
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5344 594d385d-05f5-0310-b6e9-bd551577e9d8
and the edited entry already exists in ldap
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5344 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc
index af9812c9e9f0e6af26e599b5e64a235cc43b3c33..30ee0acac002cc04f680634225435dbd86b402ee 100644 (file)
"memcheck" => "memcheck",
"sysinfo" => "sysinfo");
+ var $fai_activated = FALSE;
+
function servgeneric ($config, $dn= NULL, $parent= NULL)
{
plugin::plugin ($config, $dn, $parent);
+ /* Check if FAI is activated */
+ $tmp = search_config($config->data,"faiManagement","CLASS");
+ if(!empty($tmp)){
+ $this->fai_activated = TRUE;
+ }
+
$this->modes["active"]= _("Activated");
$this->modes["locked"]= _("Locked");
$this->didAction= TRUE;
/* Set FAIstate */
- $ldap = $this->config->get_ldap_link();
- $ldap->cd($this->config->current['BASE']);
- $ldap->cat($this->dn,array("objectClass"));
- $res = $ldap->fetch();
-
- $attrs = array();
- $attrs['FAIstate'] = "";
- if(isset($this->mapActions[$_POST['saction']])){
- $attrs['FAIstate'] = $this->mapActions[$_POST ['saction']];
- }
- for($i = 0; $i < $res['objectClass']['count'] ; $i ++){
- $attrs['objectClass'][] = $res['objectClass'][$i];
- }
+ if($this->fai_activated && $this->dn != "new"){
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->cat($this->dn,array("objectClass"));
+ $res = $ldap->fetch();
- if(($attrs['FAIstate'] != "") && (!in_array("FAIobject",$attrs['objectClass']))){
- $attrs['objectClass'][] = "FAIobject";
- }
+ $attrs = array();
+ $attrs['FAIstate'] = "";
+ if(isset($this->mapActions[$_POST['saction']])){
+ $attrs['FAIstate'] = $this->mapActions[$_POST ['saction']];
+ }
+
+ for($i = 0; $i < $res['objectClass']['count'] ; $i ++){
+ $attrs['objectClass'][] = $res['objectClass'][$i];
+ }
+
+ if(($attrs['FAIstate'] != "") && (!in_array("FAIobject",$attrs['objectClass']))){
+ $attrs['objectClass'][] = "FAIobject";
+ }
+
+ if($attrs['FAIstate'] == ""){
+#FIXME we should check if FAIobject is used anymore
+ $attrs['FAIstate'] = array();
+ }
- if($attrs['FAIstate'] == ""){
- #FIXME we should check if FAIobject is used anymore
- $attrs['FAIstate'] = array();
+ $ldap->cd($this->dn);
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
}
-
- $ldap->cd($this->dn);
- $ldap->modify($attrs);
- show_ldap_error($ldap->get_error());
}
}
}
/* Show main page */
$this->netConfigDNS->cn= $this->cn;
$smarty->assign("netconfig", $this->netConfigDNS->execute());
+ $smarty->assign("fai_activated",$this->fai_activated);
$smarty->assign("modes", $this->modes);
return($smarty->fetch (get_template_path('server.tpl', TRUE)));
diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc
index 88bbce350f83baa121c3c2c556088fb3aa7d924a..7a12d4ef91850ea358a49027ec11c368992167cc 100644 (file)
"memcheck" => "memcheck",
"sysinfo" => "sysinfo");
+ var $fai_activated = FALSE;
function termgeneric ($config, $dn= NULL, $parent= NULL)
{
+ /* Check if FAI is activated */
+ $tmp = search_config($config->data,"faiManagement","CLASS");
+ if(!empty($tmp)){
+ $this->fai_activated = TRUE;
+ }
+
plugin::plugin ($config, $dn, $parent);
$this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
/* Read arrays */
if (isset($_POST['action'])){
- /* Set FAIstate */
- $ldap = $this->config->get_ldap_link();
- $ldap->cd($this->config->current['BASE']);
- $ldap->cat($this->dn,array("objectClass"));
- $res = $ldap->fetch();
- $attrs = array();
- $attrs['FAIstate'] = "";
- if(isset($this->mapActions[$_POST['saction']])){
- $attrs['FAIstate'] = $this->mapActions[$_POST ['saction']];
- }
+ if($this->fai_activated && $this->dn != "new"){
+ /* Set FAIstate */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->cat($this->dn,array("objectClass"));
+ $res = $ldap->fetch();
- for($i = 0; $i < $res['objectClass']['count'] ; $i ++){
- $attrs['objectClass'][] = $res['objectClass'][$i];
- }
+ $attrs = array();
+ $attrs['FAIstate'] = "";
+ if(isset($this->mapActions[$_POST['saction']])){
+ $attrs['FAIstate'] = $this->mapActions[$_POST ['saction']];
+ }
- if(($attrs['FAIstate'] != "") && (!in_array("FAIobject",$attrs['objectClass']))){
- $attrs['objectClass'][] = "FAIobject";
- }
+ for($i = 0; $i < $res['objectClass']['count'] ; $i ++){
+ $attrs['objectClass'][] = $res['objectClass'][$i];
+ }
- if($attrs['FAIstate'] == ""){
- #FIXME we should check if FAIobject is used anymore
- $attrs['FAIstate'] = array();
- }
+ if(($attrs['FAIstate'] != "") && (!in_array("FAIobject",$attrs['objectClass']))){
+ $attrs['objectClass'][] = "FAIobject";
+ }
- $ldap->cd($this->dn);
- $ldap->modify($attrs);
- show_ldap_error($ldap->get_error());
+ if($attrs['FAIstate'] == ""){
+#FIXME we should check if FAIobject is used anymore
+ $attrs['FAIstate'] = array();
+ }
+
+ $ldap->cd($this->dn);
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
+ }
switch($_POST['saction']){
case 'wake':
/* Show main page */
$this->netConfigDNS->cn= $this->cn;
$smarty->assign("netconfig", $this->netConfigDNS->execute());
+ $smarty->assign("fai_activated",$this->fai_activated);
$smarty->assign("actionACL", chkacl($this->acl, 'action'));
return($smarty->fetch (get_template_path('terminal.tpl', TRUE)));
}
diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc
index 3ba74d927d0f606eca2cb1d45650edfea80a66b9..577ed196c8322c4b9606977e3c082a896d5d7dcf 100644 (file)
"sysinfo" => "sysinfo");
+ var $fai_activated = FALSE;
function workgeneric ($config, $dn= NULL, $parent= NULL)
{
+ /* Check if FAI is activated */
+ $tmp = search_config($config->data,"faiManagement","CLASS");
+ if(!empty($tmp)){
+ $this->fai_activated = TRUE;
+ }
+
plugin::plugin ($config, $dn, $parent);
$this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
print_red(sprintf(_("Execution of '%s' failed!"), $cmd));
} elseif ($_POST['saction'] != "wake") {
- /* Set FAIstate */
- $ldap = $this->config->get_ldap_link();
- $ldap->cd($this->config->current['BASE']);
- $ldap->cat($this->dn,array("objectClass"));
- $res = $ldap->fetch();
+ if($this->fai_activated && $this->dn != "new"){
+ /* Set FAIstate */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->cat($this->dn,array("objectClass"));
+ $res = $ldap->fetch();
+
+ $attrs = array();
+ $attrs['FAIstate'] = "";
+ if(isset($this->mapActions[$_POST['saction']])){
+ $attrs['FAIstate'] = $this->mapActions[$_POST ['saction']];
+ }
- $attrs = array();
- $attrs['FAIstate'] = "";
- if(isset($this->mapActions[$_POST['saction']])){
- $attrs['FAIstate'] = $this->mapActions[$_POST ['saction']];
- }
+ for($i = 0; $i < $res['objectClass']['count'] ; $i ++){
+ $attrs['objectClass'][] = $res['objectClass'][$i];
+ }
- for($i = 0; $i < $res['objectClass']['count'] ; $i ++){
- $attrs['objectClass'][] = $res['objectClass'][$i];
- }
+ if(($attrs['FAIstate'] != "") && (!in_array("FAIobject",$attrs['objectClass']))){
+ $attrs['objectClass'][] = "FAIobject";
+ }
- if(($attrs['FAIstate'] != "") && (!in_array("FAIobject",$attrs['objectClass']))){
- $attrs['objectClass'][] = "FAIobject";
- }
+ if($attrs['FAIstate'] == ""){
+#FIXME we should check if FAIobject is used anymore
+ $attrs['FAIstate'] = array();
+ }
- if($attrs['FAIstate'] == ""){
- #FIXME we should check if FAIobject is used anymore
- $attrs['FAIstate'] = array();
- }
+ $ldap->cd($this->dn);
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
- $ldap->cd($this->dn);
- $ldap->modify($attrs);
- show_ldap_error($ldap->get_error());
-
- $this->didAction= TRUE;
+ $this->didAction= TRUE;
+ }
}
}
}
/* Show main page */
$this->netConfigDNS->cn= $this->cn;
$smarty->assign("netconfig", $this->netConfigDNS->execute());
+ $smarty->assign("fai_activated",$this->fai_activated);
return($smarty->fetch (get_template_path('workstation.tpl', TRUE)));
}
index f33a589dae5c15815ec6fca3ff177fe8c1aa68ec..4c9067d4d19a3d496f5927e9be623e9c2944ab44 100644 (file)
{$netconfig}
+{if $fai_activated}
<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
<h2><img class="center" alt="" align="middle" src="images/rocket.png"> {t}Action{/t}</h2>
</td>
</tr>
</table>
-
+{/if}
<!-- Place cursor -->
<script language="JavaScript" type="text/javascript">
index 5913ba2b8ba799f224b90c69826108b0ddfb5948..4de4cc904ebb447675641465a256ae8709ef6cf6 100644 (file)
{$netconfig}
{/if}
+{if $fai_activated}
<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
<h2><img class="center" alt="" align="middle" src="images/rocket.png"> {t}Action{/t}</h2>
<table summary="">
</td>
</tr>
</table>
+{/if}
<input type="hidden" name="termgeneric_posted" value="1">
<!-- Place cursor -->
index 9d7786509d4d4b22593cdf8a97686e4d9b731b36..128da389cb138044f872bd56e210b2b2436043cd 100644 (file)
{$netconfig}
{/if}
+
+{if $fai_activated}
<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
<h2><img class="center" alt="" align="middle" src="images/rocket.png"> {t}Action{/t}</h2>
<table summary="">
</td>
</tr>
</table>
+{/if}
<input type="hidden" name="workgeneric_posted" value="1">
{if $cn eq 'wdefault'}
<!-- Place cursor -->