Subversion-Projekte lars-tiefland.openvz_admin

Revision

Revision 132 | Revision 138 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 132 Revision 136
Zeile 1... Zeile 1...
1
<?php
1
<?php
2
	//$Id: load.php 132 2008-05-22 15:37:07Z lars $
2
	//$Id: load.php 136 2008-07-15 11:22:09Z lars $
3
	/**
3
	/**
4
	 * 	@package	openvz_admin
4
	 * 	@package	openvz_admin
5
	 * 	@author		Lars Tiefland <ltiefland@gmail.com> 
5
	 * 	@author		Lars Tiefland <ltiefland@gmail.com> 
6
	 **/
6
	 **/
7
	require ("include/common.php");
7
	require ("include/common.php");
8
	$hns = HN::getHNs();
8
	/*$hns = HN::getHNs();
9
	unset($hns[-1]);
9
	unset($hns[-1]);*/
-
 
10
	$hns[1]="mainframe.starfleethq.de";
10
	foreach ($hns as $hn_id => $hn_name)
11
	foreach ($hns as $hn_id => $hn_name)
11
	{
12
	{
12
		$configs = load_configs($hn_id, $hn_name);
13
		$configs = load_configs($hn_id, $hn_name);
13
		foreach ($configs as $conf_id => $config)
14
		foreach ($configs as $conf_id => $config)
14
		{
15
		{
Zeile 68... Zeile 69...
68
				{
69
				{
69
					if ($res->numRows())
70
					if ($res->numRows())
70
					{
71
					{
71
						$row = $res->fetchRow();
72
						$row = $res->fetchRow();
72
						$dist_id = $row["dist_id"];
73
						$dist_id = $row["dist_id"];
-
 
74
						$sql_v="SELECT v_dist, dist_name FROM distributions, vservers WHERE dist_id=v_dist AND v_id=".$config["v_id"];
-
 
75
						$res_v=$db->query($sql_v);
-
 
76
						if(PEAR::isError($res_v))
-
 
77
						{
-
 
78
							die($res_v->getUserInfo());
-
 
79
						}
-
 
80
						$row_v=$res_v->fetchRow();
-
 
81
						$dist_name = $row_v["dist_name"];
-
 
82
						if ($dist_name != $config["DISTRIBUTION"])
-
 
83
						{
-
 
84
							$sql="UPDATE vservers SET v_dist=$dist_id WHERE v_id=".$config["v_id"];
-
 
85
							$res=$db->query($sql);
-
 
86
							if(PEAR::isError($res))
-
 
87
							{
-
 
88
								die($res->getUserInfo());
-
 
89
							}
-
 
90
						}
73
					}
91
					}
74
					else
92
					else
75
					{
93
					{
76
						$sql = "INSERT INTO distributions (dist_name, dist_template) VALUES('" . $config["DISTRIBUTION"] .
94
						$sql = "INSERT INTO distributions (dist_name, dist_template) VALUES('" . $config["DISTRIBUTION"] .
77
							"', '" . $config["OSTEMPLATE"] . "')";
95
							"', '" . $config["OSTEMPLATE"] . "')";
Zeile 130... Zeile 148...
130
					echo $res->getUserInfo();
148
					echo $res->getUserInfo();
131
				}
149
				}
132
			}
150
			}
133
		}
151
		}
134
	}
152
	}
135
?>
-
 
136
153
?>
-
 
154