Subversion-Projekte lars-tiefland.openvz_admin

Revision

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

<?php
    // $Id: change.php 162 2010-03-12 23:25:46Z lars $
    /**
     *  @package        openvz_admin
     *  @author         Lars Tiefland <ltiefland@gmail.com> 
     **/
    require ( "include/common.php" );
    $mode = ( isset( $_POST["mode"] ) ) ? $_POST["mode"] : "";
    $v_id = ( isset( $_POST["v_id"] ) ) ? $_POST["v_id"] : 0;
    $v_name = ( isset( $_POST["v_name"] ) ) ? $_POST["v_name"] : "";
    $dist_id = ( isset( $_POST["d_id"] ) ) ? $_POST["d_id"] : 1;
    $root_pw = ( isset( $_POST["v_r_pw"] ) ) ? $_POST["v_r_w"] : "";
    $hn_id = ( isset( $_POST["hn_id"] ) ) ? $_POST["hn_id"] : 1;
    $ip = ( isset( $_POST["ip_id"] ) ) ? $_POST["ip_id"] : -1;
    $ips = IP::getIPs( $hn_id );
    $dists = Dist::getDists();
    switch ( $mode )
    {
        case "new_v":
            $title = "neuen vServer anlegen";
            $tpl_file = "new_vserver.tpl";
            break;
        case "edit_conf":
            $title = "Konfigruration von vServer $v_id &auml;ndern";
            $tpl_file = "change.tpl";
            break;
        case "create_v":
            $vs = new vServer( $v_id, $hn_id );
            $vs->save( $v_name, $dist_id, $ip, $root_pw );
            $tpl_file = "meld.tpl";
            break;
        case "save_conf":
            $tpl_file = "meld.tpl";
            break;
    }
    $smarty->assign( "title", "openVZ Administration" );
    $smarty->assign( "h1", $title );
    $smarty->assign( "ips", $ips );
    $smarty->assign( "dists", $dists );
    $smarty->assign( "cur_ip", $ip );
    $smarty->assign( "cur_dist", $dist_id );
    $smarty->assign( "hn_id", $hn_id );
    $smarty->display( $tpl_file );
?>