Subversion-Projekte lars-tiefland.openvz_admin

Revision

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

Revision 102 Revision 103
Zeile 1... Zeile 1...
1
<?php
1
<?php
2
	//$Id: vServer.class.php 102 2008-02-23 20:10:11Z lars $
2
	//$Id: vServer.class.php 103 2008-03-16 12:52:02Z lars $
3
	class vServer
3
	class vServer
4
	{
4
	{
5
	 	protected $status;
5
	 	protected $status;
6
	 	protected $name;
6
	 	protected $name;
7
	 	protected $hn_id;
7
	 	protected $hn_id;
Zeile 165... Zeile 165...
165
			$sql="INSERT into vservers (v_id, hn_id, v_name, v_dist) VALUES ($this->v_id, $this->hn_id, '$this->name', $this->dist_id)";
165
			$sql="INSERT into vservers (v_id, hn_id, v_name, v_dist) VALUES ($this->v_id, $this->hn_id, '$this->name', $this->dist_id)";
166
			$res=$db->query($sql);
166
			$res=$db->query($sql);
167
			if(!PEAR::isError($res))
167
			if(!PEAR::isError($res))
168
			{
168
			{
169
				$v_id=$res->insert_id;
169
				$v_id=$res->insert_id;
170
				$sql="UPDATE ips SET used=1 WHERE ip='".$ip["ip"]."'";
170
				$sql="SELECT ip FROM ips WHERE ip='".$ip["ip"]."'";
171
				$res=$db->query($sql);
171
				$res=$db->query($sql);
172
				if(!PEAR::isError($res))
172
				if(!PEAR::isError($res))
173
				{
173
				{
174
					$ip_id=$db->lastinsertid();
174
					$row=$res->fetch_row();
-
 
175
					$ip_id=$row["ip"];
175
					$sql="INSERT INTO host_2_ip (ve_id, ip) VALUES (".$v_id.",'".$ip_id."')";
176
					$sql="INSERT INTO host_2_ip (ve_id, ip) VALUES (".$v_id.",'".$ip_id."')";
176
					$res=$db->query($sql);
177
					$res=$db->query($sql);
177
					if(!PEAR::isError($res))
178
					if(!PEAR::isError($res))
178
					{
179
					{
179
						$cmd="ssh root@mainframe vzctl create $this->v_id --hostname $v_name --ostemplate $d_template --config vps.$d_name --ipadd ".$ip["ip"];
180
						$cmd="ssh root@mainframe vzctl create $this->v_id --hostname $v_name --ostemplate $d_template --config vps.$d_name --ipadd ".$ip["ip"];