Skip to content

Commit c8f2030

Browse files
committed
Fixed bug in remoting lib when clients were created and a bug in openvz actions.
1 parent c161eac commit c8f2030

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

interface/lib/classes/remoting.inc.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,23 +2132,28 @@ protected function klientadd($formdef_file, $reseller_id, $params)
21322132

21332133
//* Get the SQL query
21342134
$sql = $app->remoting_lib->getSQL($params,'INSERT',0);
2135+
$app->db->query($sql);
2136+
21352137
if($app->remoting_lib->errorMessage != '') {
21362138
$this->server->fault('data_processing_error', $app->remoting_lib->errorMessage);
21372139
return false;
21382140
}
21392141

2140-
$app->db->query($sql);
2142+
$insert_id = $app->db->insertID();
2143+
2144+
$this->id = $insert_id;
2145+
$this->dataRecord = $params;
21412146

21422147
$app->plugin->raiseEvent('client:client:on_after_insert',$this);
21432148

2149+
/*
21442150
if($app->db->errorMessage != '') {
21452151
$this->server->fault('database_error', $app->db->errorMessage . ' '.$sql);
21462152
return false;
21472153
}
2154+
*/
21482155

2149-
2150-
2151-
$insert_id = $app->db->insertID();
2156+
21522157
//$app->uses('tform');
21532158
//* Save changes to Datalog
21542159
if($app->remoting_lib->formDef["db_history"] == 'yes') {

server/mods-available/remoteaction_core_module.inc.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,21 @@ private function _execActions() {
131131
if($veid > 0) {
132132
exec("vzctl start $veid");
133133
}
134+
$this->_actionDone($action['action_id'], 'ok');
134135
}
135136
if ($action['action_type'] == 'openvz_stop_vm') {
136137
$veid = intval($action['action_param']);
137138
if($veid > 0) {
138139
exec("vzctl stop $veid");
139140
}
141+
$this->_actionDone($action['action_id'], 'ok');
140142
}
141143
if ($action['action_type'] == 'openvz_restart_vm') {
142144
$veid = intval($action['action_param']);
143145
if($veid > 0) {
144146
exec("vzctl restart $veid");
145147
}
148+
$this->_actionDone($action['action_id'], 'ok');
146149
}
147150
if ($action['action_type'] == 'openvz_create_ostpl') {
148151
$parts = explode(':',$action['action_param']);
@@ -155,6 +158,7 @@ private function _execActions() {
155158
exec("mv ".$template_cache_dir."vzdump-openvz-".$veid."*.tgz ".$template_cache_dir.$template_name.".tar.gz");
156159
exec("rm -f ".$template_cache_dir."vzdump-openvz-".$veid."*.log");
157160
}
161+
$this->_actionDone($action['action_id'], 'ok');
158162
/* this action takes so much time,
159163
* we stop executing the actions not to waste more time */
160164
return;

0 commit comments

Comments
 (0)