diff --git a/frontend/classes/class.node.php b/frontend/classes/class.node.php index 54d847e..624bd63 100644 --- a/frontend/classes/class.node.php +++ b/frontend/classes/class.node.php @@ -15,6 +15,25 @@ if(!isset($_CVM)) { die("Unauthorized."); } class Node extends CPHPDatabaseRecordClass { + public $table_name = "nodes"; + public $fill_query = "SELECT * FROM {$table_name} WHERE `Id` = '%d'"; + public $verify_query = "SELECT * FROM {$table_name} WHERE `Id` = '%d'"; + + public $prototype = array( + 'string' => array( + 'Name' => "Name", + 'Hostname' => "Hostname", + 'PrivateKey' => "CustomPrivateKey", + 'PublicKey' => "CustomPublicKey" + ), + 'numeric' => array( + 'Port' => "Port" + ), + 'boolean' => array( + 'HasCustomKey' => "HasCustomKey" + ) + ); + public $ssh = null; } diff --git a/frontend/classes/class.sshconnector.php b/frontend/classes/class.sshconnector.php index bc72b48..8d587bc 100644 --- a/frontend/classes/class.sshconnector.php +++ b/frontend/classes/class.sshconnector.php @@ -41,8 +41,7 @@ class SshConnector extends CPHPBaseClass } catch (SshCommandException $e) { - $error = $e->getMessage(); - throw new SshCommandException($error); + throw new SshCommandException($e->getMessage()); } catch (SshConnectException $e) { @@ -51,8 +50,7 @@ class SshConnector extends CPHPBaseClass } catch (SshExitException $e) { - $error = $e->getMessage(); - throw new SshExitException($error); + throw new SshExitException($e->getMessage(), $e->getCode()); } }