Subversion-Projekte lars-tiefland.openvz_admin

Revision

Revision 16 | Revision 74 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

<?php
        //$Id: control.php 17 2007-09-30 16:23:20Z lars $
        require("include/common.php");
        $smarty->assign("title","openVZ Administration");
        $smarty->assign("h1","vServer kontrollieren");
        $mode=(isset($_POST["mode"]))?$_POST["mode"]:"";
        $act=(isset($_POST["action"]))?$_POST["action"]:"";
        $v_id=(isset($_POST["v_id"]))?$_POST["v_id"]:0;
        $hn_id=(isset($_POST["hn_id"]))?$_POST["hn_id"]:1;
        switch($mode)
        {
                case "ask":
                        switch($act)
                        {
                                case "stop":
                                        $action="stoppen";
                                        break;
                                case "start":
                                        $action="starten";
                                        break;
                                case "restart":
                                        $action="neu starten";
                                        break;
                        }
                        $smarty->assign("action",$action);
                        $smarty->assign("name",$v_id);
                        $smarty->assign("id",$v_id);
                        $smarty->assign("hn_id",$hn_id);
                        $smarty->assign("art","vServer");
                        $smarty->assign("mode",$act);
                        $smarty->display("confirm.tpl");
                        break;
                case "start":
                case "stop":
                case "restart":
                        $vs=new vServer($v_id, $hn_id);
                        $ret=$vs->control($mode);
                        $smarty->assign("hn_id",$hn_id);
                        $smarty->assign("db_meld",$ret["status"]);
                        $smarty->assign("error",$ret["error"]);
                        $smarty->display("meld.tpl");
                        break;
        }
?>