FOSSology
3.2.0rc1
Open Source License Compliance by Open Source Software
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
Auth.php
Go to the documentation of this file.
1
<?php
2
/*
3
Copyright (C) 2014-2015, Siemens AG
4
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU General Public License
7
version 2 as published by the Free Software Foundation.
8
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
14
You should have received a copy of the GNU General Public License along
15
with this program; if not, write to the Free Software Foundation, Inc.,
16
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
*/
18
23
namespace
Fossology\Lib\Auth
;
24
34
class
Auth
35
{
38
const
USER_NAME
=
'User'
;
41
const
USER_ID
=
'UserId'
;
44
const
GROUP_ID
=
'GroupId'
;
47
const
USER_LEVEL
=
'UserLevel'
;
48
51
const
PERM_NONE
= 0;
54
const
PERM_READ
= 1;
57
const
PERM_WRITE
= 3;
60
const
PERM_CADMIN=5;
63
const
PERM_ADMIN
=10;
64
69
public
static
function
getUserId
()
70
{
71
return
$GLOBALS[
'SysConf'
][
'auth'
][self::USER_ID];
72
}
73
78
public
static
function
getGroupId
()
79
{
80
return
$GLOBALS[
'SysConf'
][
'auth'
][self::GROUP_ID];
81
}
82
87
public
static
function
isAdmin
()
88
{
89
return
$_SESSION[self::USER_LEVEL]==
self::PERM_ADMIN
;
90
}
91
96
public
static
function
isClearingAdmin
()
97
{
98
return
$_SESSION[self::USER_LEVEL]>=self::PERM_CADMIN;
99
}
100
}
Fossology\Lib\Auth\Auth\PERM_WRITE
const PERM_WRITE
Definition:
Auth.php:57
Fossology\Lib\Auth\Auth\getUserId
static getUserId()
Get the current user's id.
Definition:
Auth.php:69
Fossology\Lib\Auth\Auth\PERM_NONE
const PERM_NONE
Definition:
Auth.php:51
Fossology\Lib\Auth\Auth\isAdmin
static isAdmin()
Check if user is admin.
Definition:
Auth.php:87
Fossology\Lib\Auth\Auth\isClearingAdmin
static isClearingAdmin()
Check if user is clearing admin.
Definition:
Auth.php:96
Fossology\Lib\Auth\Auth\USER_NAME
const USER_NAME
Definition:
Auth.php:38
Fossology\Lib\Auth\Auth\USER_ID
const USER_ID
Definition:
Auth.php:41
Fossology\Lib\Auth\Auth\PERM_ADMIN
const PERM_ADMIN
Definition:
Auth.php:63
Fossology\Lib\Auth\Auth\USER_LEVEL
const USER_LEVEL
Definition:
Auth.php:47
Fossology\Lib\Auth\Auth\PERM_READ
const PERM_READ
Definition:
Auth.php:54
Fossology\Lib\Auth\Auth
Contains the constants and helpers for authentication of user.
Definition:
Auth.php:34
Fossology\Lib\Auth\Auth\getGroupId
static getGroupId()
Get the current user's group id.
Definition:
Auth.php:78
Fossology\Lib\Auth
Fossology\Lib\Auth\Auth\GROUP_ID
const GROUP_ID
Definition:
Auth.php:44
PERM_ADMIN
#define PERM_ADMIN
Administrator.
Definition:
libfossology.h:46
src
lib
php
Auth
Auth.php
Generated on Mon Jun 29 2020 12:03:42 for FOSSology by
1.8.11