Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Guilherme Filippo
ISPConfig 3
Commits
19b5e01d
Commit
19b5e01d
authored
Aug 13, 2014
by
Till Brehm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added function "is_superadmin" in auth library and improved other functions.
parent
3ee67a99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
interface/lib/classes/auth.inc.php
interface/lib/classes/auth.inc.php
+11
-1
No files found.
interface/lib/classes/auth.inc.php
View file @
19b5e01d
...
...
@@ -44,6 +44,14 @@ class auth {
return
false
;
}
}
public
function
is_superadmin
()
{
if
(
$_SESSION
[
's'
][
'user'
][
'typ'
]
==
'admin'
&&
$_SESSION
[
's'
][
'user'
][
'userid'
]
===
1
)
{
return
true
;
}
else
{
return
false
;
}
}
public
function
has_clients
(
$userid
)
{
global
$app
,
$conf
;
...
...
@@ -83,6 +91,7 @@ class auth {
global
$app
;
$userid
=
$app
->
functions
->
intval
(
$userid
);
if
(
!
preg_match
(
'/^[a-zA-Z0-9\-\_]{1,64}$/'
,
$limitname
))
$app
->
error
(
'Invalid limit name '
.
$limitname
);
// simple query cache
if
(
$this
->
client_limits
===
null
)
...
...
@@ -120,7 +129,8 @@ class auth {
public
function
check_module_permissions
(
$module
)
{
// Check if the current user has the permissions to access this module
if
(
!
stristr
(
$_SESSION
[
"s"
][
"user"
][
"modules"
],
$module
))
{
$user_modules
=
explode
(
','
,
$_SESSION
[
"s"
][
"user"
][
"modules"
]);
if
(
!
in_array
(
$module
,
$user_modules
))
{
// echo "LOGIN_REDIRECT:/index.php";
header
(
"Location: /index.php"
);
exit
;
...
...
Write
Preview
Markdown
is supported
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