Commit 18c7b534 authored by tbrehm's avatar tbrehm
Browse files

- Updated french language files.

- Added functions to start / stop / restart virtual machines to the remote api.
parent 51ee2e92
......@@ -2954,8 +2954,152 @@ class remoting {
return $affected_rows;
}
//* Start VM
public function openvz_vm_start($session_id, $vm_id)
{
global $app;
if(!$this->checkPerm($session_id, 'vm_openvz')) {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$app->uses('remoting_lib');
$app->remoting_lib->loadFormDef('../vm/form/openvz_vm.tform.php');
$vm = $app->remoting_lib->getDataRecord($vm_id);
if(!is_array($vm)) {
$this->server->fault('action_pending', 'No VM with this ID available.');
return false;
}
if($vm['active'] == 'n') {
$this->server->fault('action_pending', 'VM is not in active state.');
return false;
}
$action = 'openvz_start_vm';
$tmp = $app->db->queryOneRecord("SELECT count(action_id) as actions FROM sys_remoteaction
WHERE server_id = '".$vm['server_id']."'
AND action_type = '$action'
AND action_param = '".$vm['veid']."'
AND action_state = 'pending'");
if($tmp['actions'] > 0) {
$this->server->fault('action_pending', 'There is already a action pending for this VM.');
return false;
} else {
$sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " .
"VALUES (".
(int)$vm['server_id'] . ", ".
time() . ", ".
"'".$action."', ".
$vm['veid'].", ".
"'pending', ".
"''".
")";
$app->db->query($sql);
}
}
//* Stop VM
public function openvz_vm_stop($session_id, $vm_id)
{
global $app;
if(!$this->checkPerm($session_id, 'vm_openvz')) {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$app->uses('remoting_lib');
$app->remoting_lib->loadFormDef('../vm/form/openvz_vm.tform.php');
$vm = $app->remoting_lib->getDataRecord($vm_id);
if(!is_array($vm)) {
$this->server->fault('action_pending', 'No VM with this ID available.');
return false;
}
if($vm['active'] == 'n') {
$this->server->fault('action_pending', 'VM is not in active state.');
return false;
}
$action = 'openvz_stop_vm';
$tmp = $app->db->queryOneRecord("SELECT count(action_id) as actions FROM sys_remoteaction
WHERE server_id = '".$vm['server_id']."'
AND action_type = '$action'
AND action_param = '".$vm['veid']."'
AND action_state = 'pending'");
if($tmp['actions'] > 0) {
$this->server->fault('action_pending', 'There is already a action pending for this VM.');
return false;
} else {
$sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " .
"VALUES (".
(int)$vm['server_id'] . ", ".
time() . ", ".
"'".$action."', ".
$vm['veid'].", ".
"'pending', ".
"''".
")";
$app->db->query($sql);
}
}
//* Restart VM
public function openvz_vm_restart($session_id, $vm_id)
{
global $app;
if(!$this->checkPerm($session_id, 'vm_openvz')) {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$app->uses('remoting_lib');
$app->remoting_lib->loadFormDef('../vm/form/openvz_vm.tform.php');
$vm = $app->remoting_lib->getDataRecord($vm_id);
if(!is_array($vm)) {
$this->server->fault('action_pending', 'No VM with this ID available.');
return false;
}
if($vm['active'] == 'n') {
$this->server->fault('action_pending', 'VM is not in active state.');
return false;
}
$action = 'openvz_restart_vm';
$tmp = $app->db->queryOneRecord("SELECT count(action_id) as actions FROM sys_remoteaction
WHERE server_id = '".$vm['server_id']."'
AND action_type = '$action'
AND action_param = '".$vm['veid']."'
AND action_state = 'pending'");
if($tmp['actions'] > 0) {
$this->server->fault('action_pending', 'There is already a action pending for this VM.');
return false;
} else {
$sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " .
"VALUES (".
(int)$vm['server_id'] . ", ".
time() . ", ".
"'".$action."', ".
$vm['veid'].", ".
"'pending', ".
"''".
")";
$app->db->query($sql);
}
}
......
......@@ -42,3 +42,4 @@ $wb['Do OS-Update'] = 'Mise à jour de l\'OS';
$wb['Do ISPConfig-Update'] = 'Mise à jour ISPConfig';
?>
......@@ -10,3 +10,4 @@ $wb['tcp_ports_error_regex'] = 'Caractère non autorisé dans la définition du
$wb['udp_ports_error_regex'] = 'Caractère non autorisé dans la définition du port UDP. Les caractères autorisés sont les nombres, : et ,.';
?>
......@@ -7,3 +7,4 @@ $wb['udp_port_txt'] = 'Ouvrir des ports UDP';
$wb['add_new_record_txt'] = 'Ajouter un enregistrement au pare-feu';
?>
......@@ -4,3 +4,4 @@ $wb['name_txt'] = 'Groupe';
$wb['name_err'] = 'Le groupe doit avoir entre 1 et 30 caractères.';
?>
......@@ -6,3 +6,4 @@ $wb['add_new_record_txt'] = 'Ajouter un nouveau groupe';
$wb['warning_txt'] = '<b>ATTENTION:</b> Ne pas éditer ou modifier de paramètre utilisateur ici. Utilisez les paramètres Client et Revendeur dans le module Client à la place. Modifier ou changer les informations ici peut conduire à la perte de données';
?>
......@@ -12,3 +12,4 @@ $wb['active_txt'] = 'Active';
$wb['iptables_error_unique'] = 'There is already a firewall record for this server.';
?>
......@@ -14,3 +14,4 @@ $wb['active_txt'] = 'Active';
$wb['iptables_error_unique'] = 'There is already a firewall record for this server.';
?>
......@@ -7,3 +7,4 @@ $wb['btn_cancel_txt'] = 'Précédent';
$wb['language_new_hint_txt'] = 'Code langage à 2 caractères ISO 639-1 (Voir http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)';
?>
......@@ -6,3 +6,4 @@ $wb['btn_cancel_txt'] = 'Précédent';
$wb['list_desc_txt'] = 'Fusionne le langage sélectionné avec le langage principal anglais. <br />Ceci ajoute les élements manquants en anglais au fichier sélectionné.';
?>
......@@ -7,3 +7,4 @@ $wb['btn_save_txt'] = 'Enregistrer';
$wb['btn_cancel_txt'] = 'Précédent';
?>
......@@ -5,3 +5,4 @@ $wb['btn_save_txt'] = 'Exporte la langue sélectionnée dans un fichier';
$wb['btn_cancel_txt'] = 'Précédent';
?>
......@@ -7,3 +7,4 @@ $wb['btn_cancel_txt'] = 'Précédent';
$wb['ignore_version_txt'] = 'Ignorer le test de version ISPConfig';
?>
......@@ -6,3 +6,4 @@ $wb['lang_file_txt'] = 'Fichier de langue';
$wb['lang_file_date_txt'] = 'Dernière modification';
?>
......@@ -6,3 +6,4 @@ $wb['repo_password_txt'] = 'Mot de passe (optionnel)';
$wb['active_txt'] = 'Actif';
?>
......@@ -9,3 +9,4 @@ $wb['action_scheduled'] = 'Laction est marquée pour exécution';
$wb['select_all_server'] = 'Tout serveur';
?>
......@@ -42,3 +42,4 @@ $wb['DNS txt functions'] = 'Fonctions TXT DNS';
$wb['Mail mailing list functions'] = 'Fonctions Mailinglist Mail';
?>
......@@ -6,3 +6,4 @@ $wb['parent_remote_userid_txt'] = 'ID';
$wb['username_txt'] = 'Identifiant';
?>
......@@ -14,3 +14,4 @@ $wb['proxy_server_txt'] = 'Proxy-Server';
$wb['firewall_server_txt'] = 'Firewall-Server';
?>
......@@ -151,3 +151,4 @@ $wb['enable_sni_txt'] = 'Enable SNI';
$wb['do_not_try_rescue_httpd_txt'] = 'Disable HTTPD monitoring';
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment