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
isp
ISPConfig 3
Commits
3db18204
Commit
3db18204
authored
17 years ago
by
pedro_morgan
Browse files
Options
Downloads
Patches
Plain Diff
Minor tidy
parent
8951334b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
interface/lib/classes/remoting.inc.php
+26
-30
26 additions, 30 deletions
interface/lib/classes/remoting.inc.php
with
26 additions
and
30 deletions
interface/lib/classes/remoting.inc.php
+
26
−
30
View file @
3db18204
...
...
@@ -6,16 +6,17 @@ class remoting {
private
$session_timeout
=
600
;
//* remote login function
public
function
login
(
$username
,
$password
)
{
global
$app
,
$conf
,
$server
;
public
function
login
(
$username
,
$password
)
{
global
$app
,
$conf
,
$server
;
if
(
empty
(
$username
))
{
$server
->
fault
(
'login_username_empty'
,
'The login username is empty'
);
$server
->
fault
(
'login_username_empty'
,
'The login username is empty'
);
return
false
;
}
if
(
empty
(
$password
))
{
$server
->
fault
(
'login_password_empty'
,
'The login password is empty'
);
$server
->
fault
(
'login_password_empty'
,
'The login password is empty'
);
return
false
;
}
...
...
@@ -35,7 +36,7 @@ class remoting {
$app
->
db
->
query
(
$sql
);
return
$remote_session
;
}
else
{
$server
->
fault
(
'login_failed'
,
'The login failed. Username or password wrong.'
);
$server
->
fault
(
'login_failed'
,
'The login failed. Username or password wrong.'
);
return
false
;
}
...
...
@@ -43,11 +44,12 @@ class remoting {
//* remote logout function
public
function
logout
(
$session_id
)
{
global
$app
,
$conf
,
$server
;
public
function
logout
(
$session_id
)
{
global
$app
,
$conf
,
$server
;
if
(
empty
(
$session_id
))
{
$server
->
fault
(
'session_id_empty'
,
'The SessionID is empty.'
);
$server
->
fault
(
'session_id_empty'
,
'The SessionID is empty.'
);
return
false
;
}
...
...
@@ -62,10 +64,11 @@ class remoting {
}
}
public
function
mail_domain_add
(
$session_id
,
$params
)
{
global
$app
,
$conf
,
$server
;
public
function
mail_domain_add
(
$session_id
,
$params
)
{
global
$app
,
$conf
,
$server
;
if
(
!
$this
->
checkPerm
(
$session_id
,
'mail_domain_add'
))
{
if
(
!
$this
->
checkPerm
(
$session_id
,
'mail_domain_add'
))
{
$server
->
fault
(
'permission_denied'
,
'You do not have the permissions to access this function.'
);
return
false
;
}
...
...
@@ -83,31 +86,27 @@ class remoting {
//* private functions -----------------------------------------------------------------------------------
//*
*
private functions -----------------------------------------------------------------------------------
private
function
updateQuery
(
$formdef
,
$params
)
{
private
function
updateQuery
(
$formdef
,
$params
)
{
}
private
function
checkPerm
(
$session_id
,
$function_name
)
{
private
function
checkPerm
(
$session_id
,
$function_name
)
{
$session
=
$this
->
getSession
(
$session_id
);
if
(
$session
)
{
$remote_functions
=
explode
(
','
,
$session
[
'remote_functions'
]);
if
(
in_array
(
$function_name
,
$remote_functions
))
{
return
true
;
}
else
{
return
false
;
}
}
else
{
return
false
;
}
if
(
!
$session
){
return
false
;
}
return
in_array
(
$function_name
,
explode
(
','
,
$session
[
'remote_functions'
])
);
}
private
function
getSession
(
$session_id
)
{
global
$app
,
$conf
,
$server
;
private
function
getSession
(
$session_id
)
{
global
$app
,
$conf
,
$server
;
if
(
empty
(
$session_id
))
{
$server
->
fault
(
'session_id_empty'
,
'The SessionID is empty.'
);
...
...
@@ -125,10 +124,7 @@ class remoting {
$server
->
fault
(
'session_does_not_exist'
,
'The Session is expired or does not exist.'
);
return
false
;
}
}
}
?>
\ No newline at end of file
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