Subversion-Projekte lars-tiefland.openvz_admin

Revision

Revision 74 | Revision 140 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
3 lars 1
<?php
9 lars 2
	//$Id: control.php 109 2008-05-09 22:19:52Z lars $
109 lars 3
	/**
4
	 * 	@package	openvz_admin
5
	 * 	@author		Lars Tiefland <ltiefland@gmail.com>
6
	 **/
3 lars 7
	require("include/common.php");
8
	$smarty->assign("title","openVZ Administration");
4 lars 9
	$smarty->assign("h1","vServer kontrollieren");
10
	$mode=(isset($_POST["mode"]))?$_POST["mode"]:"";
11
	$act=(isset($_POST["action"]))?$_POST["action"]:"";
12
	$v_id=(isset($_POST["v_id"]))?$_POST["v_id"]:0;
17 lars 13
	$hn_id=(isset($_POST["hn_id"]))?$_POST["hn_id"]:1;
4 lars 14
	switch($mode)
3 lars 15
	{
4 lars 16
		case "ask":
17
			switch($act)
18
			{
68 lars 19
				case "destroy":
74 lars 20
					$action="l&ouml;schen";
68 lars 21
					break;
4 lars 22
				case "stop":
23
					$action="stoppen";
24
					break;
25
				case "start":
26
					$action="starten";
27
					break;
28
				case "restart":
29
					$action="neu starten";
30
					break;
31
			}
32
			$smarty->assign("action",$action);
33
			$smarty->assign("name",$v_id);
34
			$smarty->assign("id",$v_id);
17 lars 35
			$smarty->assign("hn_id",$hn_id);
4 lars 36
			$smarty->assign("art","vServer");
37
			$smarty->assign("mode",$act);
38
			$smarty->display("confirm.tpl");
39
			break;
68 lars 40
		case "destroy":
4 lars 41
		case "start":
42
		case "stop":
43
		case "restart":
17 lars 44
			$vs=new vServer($v_id, $hn_id);
15 lars 45
			$ret=$vs->control($mode);
17 lars 46
			$smarty->assign("hn_id",$hn_id);
16 lars 47
			$smarty->assign("db_meld",$ret["status"]);
48
			$smarty->assign("error",$ret["error"]);
4 lars 49
			$smarty->display("meld.tpl");
50
			break;
3 lars 51
	}
52
?>