Skip to content

Commit 3ba5648

Browse files
author
Till Brehm
committed
Implemented: FS#2837 - New functions for the API
1 parent 37fccba commit 3ba5648

File tree

2 files changed

+54
-8
lines changed

2 files changed

+54
-8
lines changed

interface/lib/classes/remoting.inc.php

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,61 @@ public function server_get($session_id, $server_id, $section ='') {
156156
}
157157

158158
/**
159-
Gets the ISPconfig version of the server
160-
@param int session_id
161-
@author Sascha Bay <info@space2place.de> TheCry 2013
162-
*/
163-
public function server_get_app_version($session_id) {
164-
global $app;
159+
Gets the server_id by server_name
160+
@param int session_id
161+
@param int server_name
162+
@author Sascha Bay <info@space2place.de> TheCry 2013
163+
*/
164+
public function server_get_serverid_by_name($session_id, $server_name)
165+
{
166+
global $app;
165167
if(!$this->checkPerm($session_id, 'server_get')) {
166-
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
168+
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
169+
return false;
170+
}
171+
if (!empty($session_id) && !empty($server_name)) {
172+
$sql = "SELECT server_id FROM server WHERE server_name = '$server_name' LIMIT 1 ";
173+
$all = $app->db->queryAllRecords($sql);
174+
return $all;
175+
} else {
176+
return false;
177+
}
178+
}
179+
180+
/**
181+
Gets the functions of a server by server_id
182+
@param int session_id
183+
@param int server_id
184+
@author Sascha Bay <info@space2place.de> TheCry 2013
185+
*/
186+
public function server_get_functions($session_id, $server_id)
187+
{
188+
global $app;
189+
if(!$this->checkPerm($session_id, 'server_get')) {
190+
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
191+
return false;
192+
}
193+
if (!empty($session_id) && !empty($server_id)) {
194+
$sql = "SELECT mail_server, web_server, dns_server, file_server, db_server, vserver_server, proxy_server, firewall_server FROM server WHERE server_id = '$server_id' LIMIT 1 ";
195+
$all = $app->db->queryAllRecords($sql);
196+
return $all;
197+
} else {
167198
return false;
168199
}
200+
}
201+
202+
/**
203+
Gets the ISPconfig version of the server
204+
@param int session_id
205+
@author Sascha Bay <info@space2place.de> TheCry 2013
206+
*/
207+
public function server_get_app_version($session_id)
208+
{
209+
global $app;
210+
if(!$this->checkPerm($session_id, 'server_get')) {
211+
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
212+
return false;
213+
}
169214
if (!empty($session_id)) {
170215
$ispc_app_version = array('ispc_app_version' => ISPC_APP_VERSION);
171216
return $ispc_app_version;

interface/web/tools/lib/menu.d/import.menu.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
43
// Menu
54

65
if($app->auth->is_admin()) {
@@ -28,4 +27,6 @@
2827
unset($items);
2928
}
3029

30+
31+
3132
?>

0 commit comments

Comments
 (0)