Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ISPConfig 3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Helmo
ISPConfig 3
Commits
0494b461
Commit
0494b461
authored
7 years ago
by
Marius Burkard
Browse files
Options
Downloads
Patches
Plain Diff
- added remote function for getting system config
parent
4733cfe7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
interface/lib/classes/remote.d/admin.inc.php
+43
-19
43 additions, 19 deletions
interface/lib/classes/remote.d/admin.inc.php
interface/web/admin/lib/remote.conf.php
+1
-1
1 addition, 1 deletion
interface/web/admin/lib/remote.conf.php
with
44 additions
and
20 deletions
interface/lib/classes/remote.d/admin.inc.php
+
43
−
19
View file @
0494b461
...
...
@@ -106,31 +106,55 @@ class remoting_admin extends remoting {
/**
Set a value in the system configuration
@param int session id
@param int server id
@param string section of the config field in the server table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
@param string section of the config field in the table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
@param string key of the option that you want to set
@param string option value that you want to set
*/
public
function
system_config_set
(
$session_id
,
$section
,
$key
,
$value
)
{
global
$app
;
if
(
!
$this
->
checkPerm
(
$session_id
,
'system_config_set'
))
{
throw
new
SoapFault
(
'permission_denied'
,
'You do not have the permissions to access this function.'
);
return
false
;
}
if
(
$section
!=
''
&&
$key
!=
''
)
{
$app
->
uses
(
'remoting_lib,getconf,ini_parser'
);
$system_config_array
=
$app
->
getconf
->
get_global_config
();
$system_config_array
[
$section
][
$key
]
=
$value
;
$system_config_str
=
$app
->
ini_parser
->
get_ini_string
(
$system_config_array
);
$app
->
db
->
datalogUpdate
(
'sys_ini'
,
array
(
"config"
=>
$system_config_str
),
'sysini_id'
,
1
);
}
else
{
throw
new
SoapFault
(
'invalid_function_parameter'
,
'Invalid function parameter.'
);
return
false
;
}
global
$app
;
if
(
!
$this
->
checkPerm
(
$session_id
,
'system_config_set'
))
{
throw
new
SoapFault
(
'permission_denied'
,
'You do not have the permissions to access this function.'
);
return
false
;
}
if
(
$section
!=
''
&&
$key
!=
''
)
{
$app
->
uses
(
'remoting_lib,getconf,ini_parser'
);
$system_config_array
=
$app
->
getconf
->
get_global_config
();
$system_config_array
[
$section
][
$key
]
=
$value
;
$system_config_str
=
$app
->
ini_parser
->
get_ini_string
(
$system_config_array
);
$app
->
db
->
datalogUpdate
(
'sys_ini'
,
array
(
"config"
=>
$system_config_str
),
'sysini_id'
,
1
);
}
else
{
throw
new
SoapFault
(
'invalid_function_parameter'
,
'Invalid function parameter.'
);
return
false
;
}
}
/**
Get the values of the system configuration
@param int session id
@param string section of the config field in the table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
@param string key of the option that you want to set
@param string option value that you want to set
*/
public
function
system_config_get
(
$session_id
,
$section
,
$key
)
{
global
$app
;
if
(
!
$this
->
checkPerm
(
$session_id
,
'system_config_get'
))
{
throw
new
SoapFault
(
'permission_denied'
,
'You do not have the permissions to access this function.'
);
return
false
;
}
if
(
$section
!=
''
)
{
$app
->
uses
(
'remoting_lib,getconf,ini_parser'
);
$system_config_array
=
$app
->
getconf
->
get_global_config
();
if
(
$key
!=
''
)
{
if
(
isset
(
$system_config_array
[
$section
][
$key
]))
return
$system_config_array
[
$section
][
$key
];
else
return
false
;
}
else
{
if
(
isset
(
$system_config_array
[
$section
]))
return
$system_config_array
[
$section
];
else
return
false
;
}
else
{
throw
new
SoapFault
(
'invalid_function_parameter'
,
'Invalid function parameter.'
);
return
false
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
interface/web/admin/lib/remote.conf.php
+
1
−
1
View file @
0494b461
<?php
$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'
;
$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'
;
$function_list
[
'admin_record_permissions'
]
=
'Record permission changes'
;
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment