summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 658dbd4)
raw | patch | inline | side by side (parent: 658dbd4)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 11 Jan 2010 09:44:17 +0000 (09:44 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 11 Jan 2010 09:44:17 +0000 (09:44 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15135 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/systems/admin/systems/class_systemManagement.inc | patch | blob | history | |
gosa-plugins/systems/admin/systems/system-list.xml | patch | blob | history |
diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc
index aecf4289d509dd112f4f52575a83097d7ebbfa20..240d811d5af3d2911299a8637553970c4728164f 100644 (file)
$this->registerAction("DaemonEvent_activate","handleEvent");
}
$this->registerAction("saveEvent","saveEventDialog");
+ $this->registerAction("createISO","createISO");
+ $this->registerAction("initiateISOcreation","initiateISOcreation");
+ $this->registerAction("performIsoCreation","performIsoCreation");
// Add copy&paste and snapshot handler.
if ($this->config->boolValueIsTrue("main", "copyPaste")){
}
+ function createISO($action,$target)
+ {
+ if(count($target) == 1){
+ $smarty = get_smarty();
+ $this->dn= array_pop($target);
+ set_object_info($this->dn);
+ return ($smarty->fetch(get_template_path('goto/gencd.tpl', TRUE)));
+
+ }
+ }
+
+ function initiateISOcreation()
+ {
+ $smarty = get_smarty();
+ $smarty->assign("src", "?plug=".$_GET['plug']."&PerformIsoCreation");
+ return ($smarty->fetch(get_template_path('goto/gencd_frame.tpl', TRUE)));
+ }
+
+
+ function performIsoCreation()
+ {
+ $return_button = "<form method='get' action='main.php' target='_parent'>
+ <input type='submit' value='"._("Back")."'>
+ <input type='hidden' name='plug' value='".$_GET['plug']."'/>
+ </form>";
+
+ $dsc = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w"));
+
+ /* Get and check command */
+ $command= $this->config->search("workgeneric", "SYSTEMISOHOOK",array('tabs'));
+ if (check_command($command)){
+ @DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__, $command, "Execute");
+
+ /* Print out html introduction */
+ echo ' <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+ <html>
+ <head>
+ <title></title>
+ <style type="text/css">@import url("themes/default/style.css");</style>
+ <script language="javascript" src="include/focus.js" type="text/javascript"></script>
+ </head>
+ <body style="background: none; margin:4px;" id="body" >
+ <pre>';
+
+ /* Open process handle and check if it is a valid process */
+ $process= proc_open($command." '".$this->dn."'", $dsc, $pipes);
+ if (is_resource($process)) {
+ fclose($pipes[0]);
+
+ /* Print out returned lines && write JS to scroll down each line */
+ while (!feof($pipes[1])){
+ $cur_dat = fgets($pipes[1], 1024);
+ echo $cur_dat;
+ echo '<script language="javascript" type="text/javascript">scrollDown2();</script>' ;
+ flush();
+ }
+ }
+
+ /* Get error string && close streams */
+ $buffer= stream_get_contents($pipes[2]);
+
+ fclose($pipes[1]);
+ fclose($pipes[2]);
+ echo "</pre>";
+
+ /* Check return code */
+ $ret= proc_close($process);
+ if ($ret != 0){
+ echo "<h1 style='color:red'>"._("Creating the image failed. Please see the report below.")."</h1>";
+ echo "<pre style='color:red'>$buffer</pre>";
+ }
+ echo $return_button."<br>";
+ } else {
+ $tmp= "<h1 style='color:red'>".sprintf(_("Command '%s', specified for ISO creation doesn't seem to exist."), $command)."</h1>";
+ echo $tmp;
+ echo $return_button."<br>";
+ }
+
+ /* Scroll down completly */
+ echo '<script language="javascript" type="text/javascript">scrollDown2();</script>' ;
+ echo '</body></html>';
+ flush();
+ exit;
+ }
+
+
/*! \brief Handle GOsa-si events
* All events are handled here.
*/
$action= management::detectPostActions();
if(isset($_POST['abort_event_dialog'])) $action['action'] = "cancel";
if(isset($_POST['save_event_dialog'])) $action['action'] = "saveEvent";
+ if(isset($_POST['cd_create'])) $action['action'] = "initiateISOcreation";
+ if(isset($_GET['PerformIsoCreation'])) $action['action'] = "performIsoCreation";
return($action);
}
diff --git a/gosa-plugins/systems/admin/systems/system-list.xml b/gosa-plugins/systems/admin/systems/system-list.xml
index 20044b55e324135e21c3d58880ec6e5997345466..31405ca096aaa6a21afe87c26fbc92abaa02dbdd 100644 (file)
<actiontriggers snapshot="true" copypaste="true">
+ <action>
+ <name>createISO</name>
+ <type>entry</type>
+ <objectclass>gotoWorkstation</objectclass>
+ <image>plugins/systems/images/cdrom.png</image>
+ <acl>workstation/workgeneric[createFAICD:w]</acl>
+ <label>Create ISO</label>
+ </action>
+
<action>
<name>cp</name>
<type>copypaste</type>