| 165 |
lars |
1 |
<?php
|
|
|
2 |
// $Id: change.php 165 2011-07-10 19:03:44Z lars $
|
|
|
3 |
/**
|
|
|
4 |
* @package openvz_admin
|
|
|
5 |
* @author Lars Tiefland <ltiefland@gmail.com>
|
|
|
6 |
**/
|
|
|
7 |
require ( "include/common.php" );
|
|
|
8 |
$mode = ( isset( $_POST["mode"] ) ) ? $_POST["mode"] : "";
|
|
|
9 |
$v_id = ( isset( $_POST["v_id"] ) ) ? $_POST["v_id"] : 0;
|
|
|
10 |
$v_name = ( isset( $_POST["v_name"] ) ) ? $_POST["v_name"] : "";
|
|
|
11 |
$dist_id = ( isset( $_POST["d_id"] ) ) ? $_POST["d_id"] : 1;
|
|
|
12 |
$root_pw = ( isset( $_POST["v_r_pw"] ) ) ? $_POST["v_r_w"] : "";
|
|
|
13 |
$hn_id = ( isset( $_POST["hn_id"] ) ) ? $_POST["hn_id"] : 1;
|
|
|
14 |
$ip = ( isset( $_POST["ip_id"] ) ) ? $_POST["ip_id"] : -1;
|
|
|
15 |
$ips = IP::getIPs( $hn_id );
|
|
|
16 |
$dists = Dist::getDists();
|
|
|
17 |
switch ( $mode )
|
|
|
18 |
{
|
|
|
19 |
case "new_v":
|
|
|
20 |
$title = "neuen vServer anlegen";
|
|
|
21 |
$tpl_file = "new_vserver.tpl";
|
|
|
22 |
break;
|
|
|
23 |
case "edit_conf":
|
|
|
24 |
$title = "Konfigruration von vServer $v_id ändern";
|
|
|
25 |
$tpl_file = "change.tpl";
|
|
|
26 |
break;
|
|
|
27 |
case "create_v":
|
|
|
28 |
$vs = new vServer( $v_id, $hn_id );
|
|
|
29 |
$vs->save( $v_name, $dist_id, $ip, $root_pw );
|
|
|
30 |
$tpl_file = "meld.tpl";
|
|
|
31 |
break;
|
|
|
32 |
case "save_conf":
|
|
|
33 |
$tpl_file = "meld.tpl";
|
|
|
34 |
break;
|
|
|
35 |
}
|
|
|
36 |
$smarty->assign( "title", "openVZ Administration" );
|
|
|
37 |
$smarty->assign( "h1", $title );
|
|
|
38 |
$smarty->assign( "ips", $ips );
|
|
|
39 |
$smarty->assign( "dists", $dists );
|
|
|
40 |
$smarty->assign( "cur_ip", $ip );
|
|
|
41 |
$smarty->assign( "cur_dist", $dist_id );
|
|
|
42 |
$smarty->assign( "hn_id", $hn_id );
|
|
|
43 |
$smarty->display( $tpl_file );
|
|
|
44 |
?>
|