Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dirk Dankhoff
ISPConfig 3
Commits
c161eacd
Commit
c161eacd
authored
Aug 23, 2011
by
tbrehm
Browse files
- Fixed a bug in lng() function.
- Added a function to the remote api to get all virtual machines of a client.
parent
320e4e84
Changes
2
Hide whitespace changes
Inline
Side-by-side
interface/lib/app.inc.php
View file @
c161eacd
...
...
@@ -162,6 +162,7 @@ class app {
/** Translates strings in current language */
public
function
lng
(
$text
)
{
global
$conf
;
if
(
$this
->
_language_inc
!=
1
)
{
$language
=
(
isset
(
$_SESSION
[
's'
][
'language'
]))
?
$_SESSION
[
's'
][
'language'
]
:
$conf
[
'language'
];
//* loading global Wordbook
...
...
interface/lib/classes/remoting.inc.php
View file @
c161eacd
...
...
@@ -2127,7 +2127,7 @@ class remoting {
if
(
isset
(
$params
[
'template_master'
])
and
$params
[
'template_master'
]
>
0
)
{
$template
=
$app
->
db
->
queryOneRecord
(
"SELECT * FROM client_template WHERE template_id="
.
intval
(
$params
[
'template_master'
]));
$params
=
array_merge
(
$params
,
$template
);
if
(
is_array
(
$template
))
$params
=
array_merge
(
$params
,
$template
);
}
//* Get the SQL query
...
...
@@ -2793,6 +2793,26 @@ class remoting {
return
$app
->
remoting_lib
->
getDataRecord
(
$vm_id
);
}
//* Get OpenVZ list
public
function
openvz_vm_get_by_client
(
$session_id
,
$client_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
;
}
if
(
!
empty
(
$client_id
))
{
$client_id
=
intval
(
$client_id
);
$tmp
=
$app
->
db
->
queryOneRecord
(
"SELECT groupid FROM sys_group WHERE client_id =
$client_id
"
);
$sql
=
"SELECT * FROM openvz_vm WHERE sys_groupid = "
.
intval
(
$tmp
[
'groupid'
]);
$result
=
$app
->
db
->
queryAllRecords
(
$sql
);
return
$result
;
}
return
false
;
}
//* Add a openvz vm record
public
function
openvz_vm_add
(
$session_id
,
$client_id
,
$params
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment