summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3d2ec2a)
raw | patch | inline | side by side (parent: 3d2ec2a)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 3 Jul 2006 04:01:54 +0000 (04:01 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 3 Jul 2006 04:01:54 +0000 (04:01 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4013 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/ogroups/class_termgroup.inc | patch | blob | history |
index 7a218d62430f1f311329ab81b7ad2dafa7b93c76..6f9b053ab1368a8eb0040aaaf4f8516af3322c9c 100644 (file)
var $modes = array();
var $inheritTimeServer = true;
var $acl ;
- var $is_account = true;
- var $orig_dn = "";
- var $didAction = FALSE;
+ var $is_account = true;
+ var $orig_dn = "";
+ var $didAction = FALSE;
+ var $mapActions = array("reboot" => "",
+ "instant_update" => "softupdate",
+ "update" => "sceduledupdate",
+ "reinstall" => "install",
+ "rescan" => "",
+ "memcheck" => "memcheck",
+ "sysinfo" => "sysinfo");
function termgroup ($config, $dn= NULL)
$this->modes["active"]= _("Activated");
$this->modes["locked"]= _("Locked");
- $this->modes["memcheck"]= _("Memory test");
- $this->modes["sysinfo"]= _("System analysis");
+// $this->modes["memcheck"]= _("Memory test");
+// $this->modes["sysinfo"]= _("System analysis");
$this->orig_dn = $this->dn;
if (isset($_POST['action'])){
$cmd= search_config($this->config->data['TABS'], "workgeneric", "ACTIONCMD");
+
if ($cmd == ""){
print_red(_("No ACTIONCMD definition found in your gosa.conf"));
} else {
print_red(sprintf(_("Execution of '%s' failed!"), $cmd));
} else {
$this->didAction= TRUE;
+
+ /* Get dns from member objects. Create ldap object */
+ $member = $this->parent->by_object['ogroup']->member;
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+
+ /* walk trough members and add FAIstate */
+ foreach($member as $dn => $object){
+
+ /* Get object */
+ $ldap->cat($dn,array("objectClass"));
+ $res = $ldap->fetch();
+ $attrs = array();
+
+ /* Add FAI state */
+ $attrs['FAIstate'] = "";
+ if(isset($this->mapActions[$_POST['saction']])){
+ $attrs['FAIstate'] = $this->mapActions[$_POST ['saction']];
+ }
+
+ /* Fix objectClass index */
+ for($i = 0; $i < $res['objectClass']['count'] ; $i ++){
+ $attrs['objectClass'][] = $res['objectClass'][$i];
+ }
+
+ /* Check if we must add the objectClass */
+ if(($attrs['FAIstate'] != "") && (!in_array("FAIobject",$attrs['objectClass']))){
+ $attrs['objectClass'][] = "FAIobject";
+ }
+
+ if($attrs['FAIstate'] == ""){
+ $attrs['FAIstate'] = array();
+ }
+
+ $ldap->cd($dn);
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error(), sprintf(_("Saving of system workstation/generic (FAIstate) with dn '%s' failed."),$dn));
+ }
+ $this->didAction= TRUE;
}
}
}
$smarty->assign($val."ACL", chkacl($this->acl, $val));
}
- /* Check if workstation is online */
- $smarty->assign("actions", array(
- "halt" => _("Switch off"),
- "reboot" => _("Reboot"),
- "instant_update" => _("Instant update"),
- "update" => _("Scheduled update"),
- "reinstall" => _("Reinstall"),
- "rescan" => _("Rescan hardware")));
+ $smarty->assign("actions", array("halt" => _("Switch off"), "reboot" => _("Reboot"),
+ "instant_update" => _("Instant update"),
+ "update" => _("Scheduled update"),
+ "reinstall" => _("Reinstall"),
+ "rescan" => _("Rescan hardware"),
+ "memcheck" => _("Memory test"),
+ "sysinfo" => _("System analysis")));
$smarty->assign("inheritTimeServer",$this->inheritTimeServer);
$smarty->assign("modes", $this->modes);
- $smarty->assign("actions", array("wake" => _("Wake up"), "halt" => _("Switch off"), "reboot" => _("Reboot")));
$smarty->assign("actionACL", chkacl($this->acl, 'action'));
$tmp = array();