Skip to content

Commit 649953a

Browse files
author
Marius Burkard
committed
Merge branch 'stable-3.1'
2 parents fcfb3bb + cb52d1b commit 649953a

File tree

5 files changed

+51
-27
lines changed

5 files changed

+51
-27
lines changed

interface/lib/classes/db_mysql.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ class db_result {
10291029
*
10301030
* @access private
10311031
*/
1032-
public function db_result($iResId, $iConnection) {
1032+
public function __construct($iResId, $iConnection) {
10331033
$this->_iResId = $iResId;
10341034
$this->_iConnection = $iConnection;
10351035
}
@@ -1155,7 +1155,7 @@ class fakedb_result {
11551155
*
11561156
* @access private
11571157
*/
1158-
public function fakedb_result($aData) {
1158+
public function __construct($aData) {
11591159
$this->aResultData = $aData;
11601160
$this->aLimitedData = $aData;
11611161
reset($this->aLimitedData);

interface/lib/classes/remote.d/admin.inc.php

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -106,31 +106,55 @@ public function update_record_permissions($tablename, $index_field, $index_value
106106
/**
107107
Set a value in the system configuration
108108
@param int session id
109-
@param int server id
110-
@param string section of the config field in the server table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
109+
@param string section of the config field in the table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
111110
@param string key of the option that you want to set
112111
@param string option value that you want to set
113112
*/
114-
115-
116113
public function system_config_set($session_id, $section, $key, $value) {
117-
global $app;
118-
if(!$this->checkPerm($session_id, 'system_config_set')) {
119-
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
120-
return false;
121-
}
122-
if ($section != '' && $key != '') {
123-
$app->uses('remoting_lib,getconf,ini_parser');
124-
$system_config_array = $app->getconf->get_global_config();
125-
$system_config_array[$section][$key] = $value;
126-
$system_config_str = $app->ini_parser->get_ini_string($system_config_array);
127-
$app->db->datalogUpdate('sys_ini', array("config" => $system_config_str), 'sysini_id', 1);
128-
} else {
129-
throw new SoapFault('invalid_function_parameter', 'Invalid function parameter.');
130-
return false;
131-
}
114+
global $app;
115+
if(!$this->checkPerm($session_id, 'system_config_set')) {
116+
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
117+
return false;
118+
}
119+
if ($section != '' && $key != '') {
120+
$app->uses('remoting_lib,getconf,ini_parser');
121+
$system_config_array = $app->getconf->get_global_config();
122+
$system_config_array[$section][$key] = $value;
123+
$system_config_str = $app->ini_parser->get_ini_string($system_config_array);
124+
return $app->db->datalogUpdate('sys_ini', array("config" => $system_config_str), 'sysini_id', 1);
125+
} else {
126+
throw new SoapFault('invalid_function_parameter', 'Invalid function parameter.');
127+
return false;
128+
}
132129
}
133130

131+
/**
132+
Get the values of the system configuration
133+
@param int session id
134+
@param string section of the config field in the table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
135+
@param string key of the option that you want to set
136+
@param string option value that you want to set
137+
*/
138+
public function system_config_get($session_id, $section, $key) {
139+
global $app;
140+
if(!$this->checkPerm($session_id, 'system_config_get')) {
141+
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
142+
return false;
143+
}
144+
if ($section != '') {
145+
$app->uses('remoting_lib,getconf,ini_parser');
146+
$system_config_array = $app->getconf->get_global_config();
147+
if($key != '') {
148+
if(isset($system_config_array[$section][$key])) return $system_config_array[$section][$key];
149+
else return false;
150+
} else {
151+
if(isset($system_config_array[$section])) return $system_config_array[$section];
152+
else return false;
153+
} else {
154+
throw new SoapFault('invalid_function_parameter', 'Invalid function parameter.');
155+
return false;
156+
}
157+
}
134158

135159
}
136160

interface/lib/classes/remote.d/server.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public function server_get_serverid_by_name($session_id, $server_name)
207207
}
208208
if (!empty($session_id) && !empty($server_name)) {
209209
$sql = "SELECT server_id FROM server WHERE server_name = ? LIMIT 1";
210-
$all = $app->db->queryAllRecords($sql, $server_name);
210+
$all = $app->db->queryOneRecord($sql, $server_name);
211211
return $all;
212212
} else {
213213
return false;
@@ -228,8 +228,8 @@ public function server_get_functions($session_id, $server_id)
228228
return false;
229229
}
230230
if (!empty($session_id) && !empty($server_id)) {
231-
$sql = "SELECT mail_server, web_server, dns_server, file_server, db_server, vserver_server, proxy_server, firewall_server FROM server WHERE server_id = ? LIMIT 1 ";
232-
$all = $app->db->queryAllRecords($sql, $server_id);
231+
$sql = "SELECT mail_server, web_server, dns_server, file_server, db_server, vserver_server, proxy_server, firewall_server, mirror_server_id FROM server WHERE server_id = ? LIMIT 1 ";
232+
$all = $app->db->queryOneRecord($sql, $server_id);
233233
return $all;
234234
} else {
235235
return false;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
$function_list['server_get,server_config_set,get_function_list,client_templates_get_all,server_get_serverid_by_ip,server_ip_get,server_ip_add,server_ip_update,server_ip_delete,system_config_set'] = 'Server functions';
3+
$function_list['server_get,server_config_set,get_function_list,client_templates_get_all,server_get_serverid_by_ip,server_ip_get,server_ip_add,server_ip_update,server_ip_delete,system_config_set,system_config_get'] = 'Server functions';
44
$function_list['admin_record_permissions'] = 'Record permission changes';
55

66
?>

server/lib/classes/db_mysql.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ class db_result {
981981
*
982982
* @access private
983983
*/
984-
public function db_result($iResId, $iConnection) {
984+
public function __construct($iResId, $iConnection) {
985985
$this->_iResId = $iResId;
986986
$this->_iConnection = $iConnection;
987987
}
@@ -1107,7 +1107,7 @@ class fakedb_result {
11071107
*
11081108
* @access private
11091109
*/
1110-
public function fakedb_result($aData) {
1110+
public function __construct($aData) {
11111111
$this->aResultData = $aData;
11121112
$this->aLimitedData = $aData;
11131113
reset($this->aLimitedData);

0 commit comments

Comments
 (0)