|
|
@ -629,11 +629,22 @@ class Container extends CPHPDatabaseRecordClass
|
|
|
|
|
|
|
|
|
|
|
|
public function SetRootPassword($password)
|
|
|
|
public function SetRootPassword($password)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$sPassword = escapeshellarg($password);
|
|
|
|
if($this->sStatus == CVM_STATUS_SUSPENDED)
|
|
|
|
|
|
|
|
{
|
|
|
|
$this->SetOptions(array(
|
|
|
|
throw new ContainerSuspendedException("The root password cannot be changed, because the container is suspended.", 1, $this->sInternalId);
|
|
|
|
'userpasswd' => "root:{$sPassword}"
|
|
|
|
}
|
|
|
|
));
|
|
|
|
elseif($this->sStatus == CVM_STATUS_TERMINATED)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new ContainerTerminatedException("The root password cannot be changed, because the container is terminated.", 1, $this->sInternalId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$sPassword = escapeshellarg($password);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->SetOptions(array(
|
|
|
|
|
|
|
|
'userpasswd' => "root:{$sPassword}"
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function EnableTunTap()
|
|
|
|
public function EnableTunTap()
|
|
|
|