Main SSO class
Can by used by client application
| package | sso\lib |
|---|
auth(boolean $authOnly= FALSE, string $fromURL= NULL) : \sso\AuthUser
Redirect user to login page if not.
booleanTRUE for do not check credentials
stringURL application to redirect after login
\sso\AuthUserreturn current user if logged, redirect to sso otherwiseclientError(integer $code, string $message, string $file, integer $line)
integererror code
stringerror message
stringfile name
integerline number
clientException(\sso\Exception $ex)
\sso\Exceptionthe exception
displayFullMenuAfterBody()
CSS will be added by javascript during page load
displayMenu(boolean $hidden = FALSE)
booleanTRUE for do not display menu
displayMenuCssHeader(boolean $hidden = FALSE)
booleanTRUE for do not display menu
getInstance(string $path = NULL) : \sso\SsoClient
stringweb path of SSO. Needed for retrieve SSO from client application
\sso\SsoClientcurrent instancegetLogin() : string
stringlogin user namegetLogoutReason(integer $reason) : string
integerself::AUTHKO*
stringlogout reasongetUser() : \sso\AuthUser
\sso\AuthUserthe AuthUser returned by an auth methodgetUserName() : string
stringuser name for displayisLogged() : boolean
booleanTRUE if user is logged and enabledisSsoAdmin() : boolean
booleanTRUE if logged user is an SSO adminisSubPath(string $fullPath, string $basePath) : TRUE
Examples :
/a/b/c is a subpath of /a/b
/a/b is a subpath of /a/b
/a/bc is NOT a subpath of /a/b
stringfull path to check
stringthe base path the full path have to begin with
TRUEif $fullPath start with $basePath and match exactly for last path element.pagesList() : array<mixed,string>
array<mixed,string>key => textregisterGlobals(array<mixed,mixed> $variables)
Variables will be restored at each page in global variables
array<mixed,mixed>variableName => variableValue
checkCredentials(string $appli) : boolean
currentApplication became $appli if user have access
stringapplication path
booleanTRUE if user can access to this application, FALSE otherwisegetClientHandler(string $appli = NULL) : \sso\Handler
stringapplication path, or NULL for use current application
\sso\Handlerthe Handler instance for this application. Can be NULLloadClientHandler(string $handler, string $appli) : \sso\Handler
stringhandler class name
stringapplication path
\sso\Handlerinstance__construct(string $path = NULL)
stringweb path of SSO
checkUserAuth() : integer
integerstatus of session : self::AUTH_*getMenuId(boolean $hidden = FALSE) : string
booleanTRUE for do not display menu
stringan ID prefixed by destination : application=IDinitApplication()
\sso\Exception |
if something go wrong during init |
|---|
isSsoPage() : boolean
booleanTRUE if it's an SSO page$session : \sso\Session
$currentApplication : string
NULL$instance : \sso\SsoClient
NULL$logoutReasons : array<mixed,string>
array(self::AUTH_KO_AGENT => \sso\L::logout_reason_invalid, self::AUTH_KO_IP => \sso\L::logout_reason_invalid, self::AUTH_KO_NO_SESSION => \sso\L::logout_reason_not_exists, self::AUTH_KO_TIMEOUT => \sso\L::logout_reason_expire, self::AUTH_KO_UNKNOWN => \sso\L::logout_reason_unknown, self::AUTH_KO_INIT_APP => \sso\L::logout_reason_auth)AUTH_KO_AGENT = 21
AUTH_KO_INIT_APP = 40
AUTH_KO_IP = 20
AUTH_KO_NO_SESSION = 11
AUTH_KO_TIMEOUT = 30
AUTH_KO_UNKNOWN = 99
AUTH_OK = 10